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 100% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md 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..34ddfd9ef2 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ If a package was never on DefinitelyTyped, it does not need to be added to `notN To lint a package, just add a `tslint.json` to that package containing `{ "extends": "../tslint.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", "rules": { @@ -255,6 +255,10 @@ transitively `react-router-bootstrap` (which depends on `react-router`) also add Also, `/// ` will not work with path mapping, so dependencies must use `import`. +#### 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/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/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/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/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/bunyan/index.d.ts b/bunyan/index.d.ts deleted file mode 100644 index 787a0225f1..0000000000 --- a/bunyan/index.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -// 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; - - trace(error: Error, format?: any, ...params: any[]): void; - trace(buffer: Buffer, format?: any, ...params: any[]): void; - trace(obj: Object, format?: any, ...params: any[]): void; - trace(format: string, ...params: any[]): void; - debug(error: Error, format?: any, ...params: any[]): void; - debug(buffer: Buffer, format?: any, ...params: any[]): void; - debug(obj: Object, format?: any, ...params: any[]): void; - debug(format: string, ...params: any[]): void; - info(error: Error, format?: any, ...params: any[]): void; - info(buffer: Buffer, format?: any, ...params: any[]): void; - info(obj: Object, format?: any, ...params: any[]): void; - info(format: string, ...params: any[]): void; - warn(error: Error, format?: any, ...params: any[]): void; - warn(buffer: Buffer, format?: any, ...params: any[]): void; - warn(obj: Object, format?: any, ...params: any[]): void; - warn(format: string, ...params: any[]): void; - error(error: Error, format?: any, ...params: any[]): void; - error(buffer: Buffer, format?: any, ...params: any[]): void; - error(obj: Object, format?: any, ...params: any[]): void; - error(format: string, ...params: any[]): void; - fatal(error: Error, format?: any, ...params: any[]): void; - fatal(buffer: Buffer, format?: any, ...params: any[]): void; - fatal(obj: Object, format?: any, ...params: any[]): void; - fatal(format: string, ...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/chokidar/chokidar-tests.ts b/chokidar/chokidar-tests.ts deleted file mode 100644 index a67638e927..0000000000 --- a/chokidar/chokidar-tests.ts +++ /dev/null @@ -1,47 +0,0 @@ - - -import fs = require('fs'); -import chokidar = require('chokidar'); - -var watcher = chokidar.watch('file, dir, or glob', { - ignored: /[\/\\]\./, persistent: true -}); - -var log = console.log.bind(console); - -let str: string; -let any: any; -let stats: fs.Stats; - -watcher - .on('add', path => { str = path; }) - .on('addDir', path => { str = path; }) - .on('change', path => { str = path; }) - .on('unlink', path => { str = path; }) - .on('unlinkDir', path => { str = path; }) - .on('error', (error) => { any = error; }) - .on('ready', () => { }) - .on('raw', (event, path, details) => { str = event; str = path; any = 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, _stats) => { - str = path; - stats = _stats; -}); - -// 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, path) => { - str = event; - str = path; -}); \ No newline at end of file diff --git a/chokidar/index.d.ts b/chokidar/index.d.ts deleted file mode 100644 index ab37a73948..0000000000 --- a/chokidar/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for chokidar 1.4.3 -// Project: https://github.com/paulmillr/chokidar -// Definitions by: Stefan Steinhart -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare module "chokidar" -{ - export class FSWatcher - { - constructor(options?: WatchOptions); - add(fileDirOrGlob:string):void; - add(filesDirsOrGlobs:Array):void; - unwatch(fileDirOrGlob:string):void; - unwatch(filesDirsOrGlobs:Array):void; - getWatched():any; - on(event: 'add', fn: (path: string, stats?: fs.Stats) => void): this; - on(event: 'change', fn: (path: string, stats?: fs.Stats) => void): this; - on(event: 'unlink', fn: (path: string) => void): this; - on(event: 'raw', fn: (event: string, path:string, details:any) => void): this; - on(event: 'all', fn: (event: string, path: string) => void): this; - on(event: string, fn: (path: string) => void): this; - close(): this; - } - - interface WatchOptions - { - persistent?:boolean; - ignored?:any; - ignoreInitial?:boolean; - followSymlinks?:boolean; - cwd?:string; - usePolling?:boolean; - useFsEvents?:boolean; - alwaysStat?:boolean; - depth?:number; - interval?:number; - binaryInterval?:number; - ignorePermissionErrors?:boolean; - atomic?:boolean; - awaitWriteFinish?:any; - } - - import fs = require("fs"); - - export function watch(fileDirOrGlob:string, options?:WatchOptions):FSWatcher; - export function watch(filesDirsOrGlobs:Array, options?:WatchOptions):FSWatcher; -} 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/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/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-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/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/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/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/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/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/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/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/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.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/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/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/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/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/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/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/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.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.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/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/kii-cloud-sdk/kii-cloud-sdk-tests.ts b/kii-cloud-sdk/kii-cloud-sdk-tests.ts deleted file mode 100644 index 97f4d40512..0000000000 --- a/kii-cloud-sdk/kii-cloud-sdk-tests.ts +++ /dev/null @@ -1,99 +0,0 @@ - - -function main() { - Kii.initializeWithSite("abc", "def", KiiSite.JP); - - var user = KiiUser.userWithUsername("name", "password"); - - user.register({ - success(user: KiiUser) { - }, - failure(user: KiiUser, message: string) { - } - }); - - user.register({ - success: (user: KiiUser) => 123, - failure: (user: KiiUser, message: string) => 456 - }); - - user.register() - .then(function (user: KiiUser) { - }); - - user.pushInstallation().getMqttEndpoint("") - .then(function (endpoint: KiiCloud.KiiMqttEndpoint) { - endpoint.installationID; - }); - - user.setLocale("en"); - var locale: string = user.getLocale(); - - var anotherUser: KiiUser = KiiUserBuilder - .builderWithIdentifier("id", "password") - .setEmailAddress("mail@example.org") - .build(); - - var bucket = Kii.bucketWithName("foo"); - var clause1 = KiiClause.lessThan("x", 1); - var clause2 = KiiClause.greaterThan("y", 1); - var clause3 = KiiClause.and(clause1, clause2); - var query = KiiQuery.queryWithClause(clause3); - - bucket.executeQuery(query, { - success: function (query: KiiQuery, - results: KiiObject[], - nextQuery: KiiQuery) { - }, - failure: function (bucket: KiiBucket, message: string) { - } - }); - - bucket.executeQuery(query) - .then(function (params: [KiiQuery, KiiObject[], KiiQuery]) { - var [query, results, nextQuery] = params; - }); - - var object = bucket.createObject(); - - object.set("foo", 1); - - object.save(); - - KiiGroup.registerGroupWithID("Group ID", "Group Name", [user], { - success: function(theSavedGroup: KiiGroup) { - theSavedGroup.saveWithOwner("user ID"); - }, - failure: function(theGroup: KiiGroup, - anErrorString: String, - addMembersArray: KiiUser[], - removeMembersArray: KiiUser[]) { - } - }); - - Kii.authenticateAsThing("thing id", "password", { - success: function (thingAuthContext: KiiThingContext) { - thingAuthContext.bucketWithName(""); - }, - failure: function (error) { - } - }) - .then(function (thingAuthContext: KiiThingContext) { - }); - - Kii.authenticateAsThingWithToken("thing id", "token", { - success: function (thingAuthContext: KiiThingContext) { - thingAuthContext.bucketWithName(""); - }, - failure: function (error) { - } - }) - .then(function (thingAuthContext: KiiThingContext) { - }); - - KiiThing.loadWithVendorThingID("thing ID") - .then(function (thing) { - var isOnline: boolean = thing.isOnline(); - var onlineStatusModifiedAt: Date = thing.getOnlineStatusModifiedAt(); - }); -} diff --git a/knockout.kogrid/knockout.kogrid-tests.ts b/knockout.kogrid/knockout.kogrid-tests.ts deleted file mode 100644 index 8abe83d36d..0000000000 --- a/knockout.kogrid/knockout.kogrid-tests.ts +++ /dev/null @@ -1,33 +0,0 @@ -/// - - -namespace KoGridTests -{ - export interface IGridItem { - name: string; - } - - export class Tests { - public items: KnockoutObservableArray; - public selectedItems: KnockoutObservableArray; - public gridOptionsAlarms: kg.GridOptions; - - constructor() { - this.items = ko.observableArray(); - this.selectedItems = ko.observableArray(); - this.gridOptionsAlarms = this.createDefaultGridOptions(this.items, this.selectedItems); - } - - public createDefaultGridOptions(dataArray: KnockoutObservableArray, selectedItems: KnockoutObservableArray): kg.GridOptions { - return { - data: dataArray, - displaySelectionCheckbox: false, - footerVisible: false, - multiSelect: false, - showColumnMenu: false, - plugins: null, - selectedItems: selectedItems - }; - } - } -} diff --git a/koa-compose/koa-compose-tests.ts b/koa-compose/koa-compose-tests.ts deleted file mode 100644 index 2b2a65038e..0000000000 --- a/koa-compose/koa-compose-tests.ts +++ /dev/null @@ -1,17 +0,0 @@ - -import compose = require('koa-compose'); - -var fn1: compose.Middleware = function(context: any, next: () => Promise): Promise { - return Promise - .resolve(console.log('in fn1')) - .then(() => next()); -}; - -var fn2: compose.Middleware = function(context: any, next: () => Promise): Promise { - return Promise - .resolve(console.log('in fn2')) - .then(() => next()); -}; - - -var fn = compose([fn1, fn2]); \ No newline at end of file diff --git a/leaflet-imageoverlay-rotated/index.d.ts b/leaflet-imageoverlay-rotated/index.d.ts deleted file mode 100644 index acb4d7f172..0000000000 --- a/leaflet-imageoverlay-rotated/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Type definitions for leaflet-imageoverlay-rotated 0.1 -// Project: https://github.com/IvanSanchez/Leaflet.ImageOverlay.Rotated -// Definitions by: Thomas Kleinke -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace L { - - namespace ImageOverlay { - - export interface Rotated extends L.ImageOverlay { - reposition(topleft: L.LatLngExpression, - topright: L.LatLngExpression, - bottomleft: L.LatLngExpression): void; - } - } - - namespace imageOverlay { - - export function rotated(imgSrc: string | HTMLImageElement | HTMLCanvasElement, - topleft: L.LatLngExpression, - topright: L.LatLngExpression, - bottomleft: L.LatLngExpression, - options?: L.ImageOverlayOptions): L.ImageOverlay.Rotated; - } -} diff --git a/leaflet-imageoverlay-rotated/leaflet-imageoverlay-rotated-tests.ts b/leaflet-imageoverlay-rotated/leaflet-imageoverlay-rotated-tests.ts deleted file mode 100644 index 1b2ffd6c20..0000000000 --- a/leaflet-imageoverlay-rotated/leaflet-imageoverlay-rotated-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -var topleft = L.latLng(40.52256691873593, -3.7743186950683594); -var topright = L.latLng(40.5210255066156, -3.7734764814376835); -var bottomleft = L.latLng(40.52180437272552, -3.7768453359603886); - -var overlay = L.imageOverlay.rotated("image.jpg", topleft, topright, bottomleft, { - opacity: 0.5, - interactive: true -}); - -overlay.reposition(topleft, topright, bottomleft); diff --git a/localforage/index.d.ts b/localforage/index.d.ts deleted file mode 100644 index d0194ec60f..0000000000 --- a/localforage/index.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -// Type definitions for Mozilla's localForage -// Project: https://github.com/mozilla/localforage -// Definitions by: yuichi david pichsenmeister -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface LocalForageOptions { - driver?: string | LocalForageDriver | LocalForageDriver[]; - - name?: string; - - size?: number; - - storeName?: string; - - version?: number; - - description?: string; -} - -interface LocalForageDbMethods { - getItem(key: string): Promise; - getItem(key: string, callback: (err: any, value: T) => void): void; - - setItem(key: string, value: T): Promise; - setItem(key: string, value: T, callback: (err: any, value: T) => void): void; - - removeItem(key: string): Promise; - removeItem(key: string, callback: (err: any) => void): void; - - clear(): Promise; - clear(callback: (err: any) => void): void; - - length(): Promise; - length(callback: (err: any, numberOfKeys: number) => void): void; - - key(keyIndex: number): Promise; - key(keyIndex: number, callback: (err: any, key: string) => void): void; - - keys(): Promise; - keys(callback: (err: any, keys: string[]) => void): void; - - iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise; - iterate(iteratee: (value: any, key: string, iterationNumber: number) => any, - callback: (err: any, result: any) => void): void; -} - -interface LocalForageDriverSupportFunc { - (): Promise; -} - -interface LocalForageDriver extends LocalForageDbMethods { - _driver: string; - - _initStorage(options: LocalForageOptions): void; - - _support?: boolean | LocalForageDriverSupportFunc; -} - -interface LocalForageSerializer { - serialize(value: T | ArrayBuffer | Blob, callback: (value: string, error: any) => void): void; - - deserialize(value: string): T | ArrayBuffer | Blob; - - stringToBuffer(serializedString: string): ArrayBuffer; - - bufferToString(buffer: ArrayBuffer): string; -} - -interface LocalForage extends LocalForageDbMethods { - LOCALSTORAGE: string; - WEBSQL: string; - INDEXEDDB: string; - - /** - * Set and persist localForage options. This must be called before any other calls to localForage are made, but can be called after localForage is loaded. - * If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver() - * @param {LocalForageOptions} options? - */ - config(options: LocalForageOptions): boolean; - - /** - * Create a new instance of localForage to point to a different store. - * All the configuration options used by config are supported. - * @param {LocalForageOptions} options - */ - createInstance(options: LocalForageOptions): LocalForage; - - driver(): string; - /** - * Force usage of a particular driver or drivers, if available. - * @param {string} driver - */ - setDriver(driver: string | string[]): Promise; - setDriver(driver: string | string[], callback: () => void, errorCallback: (error: any) => void): void; - defineDriver(driver: LocalForageDriver): Promise; - defineDriver(driver: LocalForageDriver, callback: () => void, errorCallback: (error: any) => void): void; - /** - * Return a particular driver - * @param {string} driver - */ - getDriver(driver: string): Promise; - - getSerializer(): Promise; - getSerializer(callback: (serializer: LocalForageSerializer) => void): void; - - supports(driverName: string): boolean; - - ready(callback: () => void): void; - ready(): Promise; -} - -declare module "localforage" { - let localforage: LocalForage; - export = localforage; -} diff --git a/localforage/localforage-tests.ts b/localforage/localforage-tests.ts deleted file mode 100644 index e3edeba2d0..0000000000 --- a/localforage/localforage-tests.ts +++ /dev/null @@ -1,117 +0,0 @@ - - -declare let localForage: LocalForage; - -namespace LocalForageTest { - localForage.clear((err: any) => { - let newError: any = err; - }); - - localForage.iterate((str: string, key: string, num: number) => { - let newStr: string = str; - let newKey: string = key; - let newNum: number = num; - }); - - localForage.length((err: any, num: number) => { - let newError: any = err; - let newNumber: number = num; - }); - - localForage.length().then((num: number) => { - var newNumber: number = num; - }); - - localForage.key(0, (err: any, value: string) => { - let newError: any = err; - let newValue: string = value; - }); - - localForage.keys((err: any, keys: Array) => { - let newError: any = err; - let newArray: Array = keys; - }); - - localForage.keys().then((keys: Array) => { - var newArray: Array = keys; - }); - - localForage.getItem("key",(err: any, str: string) => { - let newError: any = err; - let newStr: string = str - }); - - localForage.getItem("key").then((str: string) => { - let newStr: string = str; - }); - - localForage.setItem("key", "value",(err: any, str: string) => { - let newError: any = err; - let newStr: string = str - }); - - localForage.setItem("key", "value").then((str: string) => { - let newStr: string = str; - }); - - localForage.removeItem("key",(err: any) => { - let newError: any = err; - }); - - localForage.removeItem("key").then(() => { - }); - - localForage.getDriver("CustomDriver").then((result: LocalForageDriver) => { - var driver: LocalForageDriver = result; - // we need to use a variable for proper type guards before TS 2.0 - var _support = driver._support; - if (typeof _support === "function") { - // _support = _support.bind(driver); - _support().then((result: boolean) => { - let doesSupport: boolean = result; - }); - } else if (typeof _support === "boolean") { - let doesSupport: boolean = _support; - } - }); - - { - let config: boolean; - - config = localForage.config({ - name: "testyo", - driver: localForage.LOCALSTORAGE - }); - } - - { - let store: LocalForage; - - store = localForage.createInstance({ - name: "da instance", - driver: localForage.LOCALSTORAGE - }); - } - - { - let testSerializer: LocalForageSerializer; - - localForage.getSerializer() - .then((serializer: LocalForageSerializer) => { - testSerializer = serializer; - }); - - localForage.getSerializer((serializer: LocalForageSerializer) => { - testSerializer = serializer; - }); - } - - { - let store: LocalForage; - - store.ready() - .then(() => {}); - - store.ready(() => {}); - } -} \ No newline at end of file diff --git a/maskedinput/maskedinput-tests.ts b/maskedinput/maskedinput-tests.ts deleted file mode 100644 index 6d620ce1b9..0000000000 --- a/maskedinput/maskedinput-tests.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for Masked Input plugin for jQuery -// Project: http://digitalbush.com/projects/masked-input-plugin -// Definitions by: Lokesh Peta -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -$("#test").mask("9:000"); -$("#test").mask("9:000", { numeric: true }); - -var alies = $.mask.defaults.aliases; diff --git a/microsoft-sdk-soap/index.d.ts b/microsoft-sdk-soap/index.d.ts deleted file mode 100644 index 9effce35ad..0000000000 --- a/microsoft-sdk-soap/index.d.ts +++ /dev/null @@ -1,2970 +0,0 @@ -// Type definitions for Sdk.Soap.js -// Project: https://code.msdn.microsoft.com/SdkSoapjs-9b51b99a -// Definitions by: Markus Mauch -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace Sdk -{ - interface IEntityView - { - attributes: AttributeCollection; - entityState: EntityState; - id: string; - logicalName: string; - relatedEntities: RelatedEntityCollection; - } - - interface IEntityCollectionView - { - entityName: string; - entities: Array; - minActiveRowVersion: string; - moreRecords: boolean; - pagingCookie: string; - totalRecordCount: number; - totalRecordCountLimitExceeded: boolean; - } - - interface IEntityReferenceView - { - Id: string; - Type: string; - Name: string; - } - - interface IEntityReferenceCollectionView extends Array - { - } - - class Q - { - /** - * Creates a link between records. - * @param entityName The logical name of the entity that is specified in the entityId parameter. - * @param entityId The ID of the record to which the related records are associated. - * @param relationship The name of the relationship to be used to create the link. - * @param relatedEntities A collection of Sdk.EntityReference objects to be associated. - */ - static associate( entityName: string, entityId: string, relationship: string, relatedEntities: Sdk.Collection ): Q.Promise; - /** - * Creates an entity record and returns a string representation of the GUID value that is the Id of the created entity. - * @param entity An entity instance. - */ - static create( entity: Sdk.Entity ): Q.Promise; - - /** - * Deletes an entity record - * @param entityName The LogicalName of the entity to delete. - * @param id An ID of the record to delete. - */ - static del( entityName: string, id: string ): Q.Promise; - - /** - * Removes a link between records. - * @param entityName The logical name of the entity that is specified in the entityId parameter. - * @param entityId The ID of the record to which the related records are disassociated. - * @param relationship The name of the relationship to be used to remove the link. - * @param relatedEntities A collection of Sdk.EntityReference objects to be disassociated. - */ - static disassociate( entityName: string, entityId: string, relationship: string, relatedEntities: Sdk.Collection ): Q.Promise; - - /** - * Executes a SOAP Request using the SOAPAction Execute. - * @param request A request object. - */ - static execute( request: Sdk.OrganizationRequest ): Q.Promise; - - /** - * Retrieves an entity instance. - * @param entityName The logical name of the entity to retrieve. - * @param id The id of the entity to retrieve. - * @param columnSet The columns of the entities to retrieve. - */ - static retrieve( entityName: string, id: string, columnSet: Sdk.ColumnSet ): Q.Promise; - - /** - * Retrieves the results of a query - * @param query An Sdk.Query.QueryByAttribute query. - */ - static retrieveMultiple( query: Sdk.Query.QueryByAttribute ): Q.Promise; - - /** - * Retrieves the results of a query - * @param query An Sdk.Query.QueryExpression query. - */ - static retrieveMultiple( query: Sdk.Query.QueryExpression ): Q.Promise; - - /** - * Retrieves the results of a query - * @param query An Sdk.Query.FetchExpression query. - */ - static retrieveMultiple( query: Sdk.Query.FetchExpression ): Q.Promise; - - /** - * Updates an entity instance. - * @param entity An entity instance to update. - */ - static update( entity: Entity ): Q.Promise; - } - - class ColumnSet - { - /** - * Specifies the attributes for which non- null values are returned from a query. - * @param columns Comma separated string values for attribute logical names. - */ - constructor( ...columns: string[] ); - - /** - * Specifies the attributes for which non- null values are returned from a query. - * @param columns An array of string values. - */ - constructor( columns: string[] ); - - /** - * Specifies the attributes for which non- null values are returned from a query. - * @param allColumns If Boolean true value is passed as the first parameter all columns will be included. (Not recommended for production code). - */ - constructor( allColumns: boolean ); - - /** - * Gets the collection of column names. - * @returns The collection of column names. - */ - getColumns(): Sdk.Collection; - - /** - * Adds a column to the collection. - * @param column The logical name of the attribute to add. - */ - addColumn( column: string ): void; - - /** - * Adds a string array of column names. - * @param columns A string array of column names. - */ - addColumns( columns: Array ): void; - - /** - * Sets the AllColumns property. - * @params allColumns A boolean value. - */ - setAllColumns( allColumns: boolean ): void; - - /** - * Whether all columns will be returned. - */ - getAllColumns(): boolean; - - /** - * Gets the number of columns. - */ - getCount(): number; - - - /// prototype methods - - /** - * Removes a column from the ColumnSet. - * @param columnName The logical name of an attribute to be removed from the ColumnSet. - * @param errorIfNotFound Whether to throw an error when the column to remove is not found. The default is false - */ - removeColumn( columnName: string, errorIfNotFound?: boolean ): void; - - /** - * The XML node with "" as the root element. - */ - toXml(): string; - - /** - * XML nodes for columnSet properties. - */ - toValueXml(): string; - } - - class ValueType - { - } - - class Collection - { - /** - * A Collection for a specified type. - * @param type The function that specifies the type. - * @param items An array of items to add to the collection. - */ - constructor( type: T, items?: Array ); - - /** - * Gets the type defined for the collection. - */ - getType(): T; - - /** - * Adds an item to the collection. - * @param item An item to add to the collection. - */ - add( item: T ): void; - - /** - * Adds an array of objects to the collection. - * @param items An array of items to add to the collection. - */ - addRange( items: any[] ): void; - - /** - * Removes all items from the collection. - */ - clear(): void; - - /** - * Returns whether an object exists within the collection. - * @param item The item to search in the collection. - */ - contains( item: T ): boolean; - - /** - * Returns whether an object exists within the collection. - * @param predicate A comparer function which is invoked for each item of the collection. - */ - contains( predicate: ( item: T ) => boolean ): boolean; - - /** - * Returns an Sdk.Collection that contains all the items of this collection that satisfy the specified predicate function. - * @param predicate A predicate function that takes a collection item as argument and returns a boolean. - */ - select( predicate: ( item: T ) => boolean ): Collection; - - /** - * Applies the action contained within a delegate function. - * @param fn Delegate function with parameters for item and index. - */ - forEach( fn: ( item: T, index: number ) => any ): void; - - /** - * Gets the item in the collection at the specified index. - * @param index The index of the item to return. - */ - getByIndex( index: number ): T; - - /** - * Removes an item from the collection. - * @param item A reference to the item to be removed. - */ - remove( item: T ): void; - - /** - * Gets a copy of the array of items in the collection. - */ - toArray(): Array; - - /** - * Returns the number of items in the collection. - */ - getCount(): number; - } - - class EntityCollection - { - /** - * Contains a collection of entity instances. - * @param entities Initializes a new instance of the EntityCollection class setting the Sdk.Collection of Sdk.Entity objects. - */ - constructor( entities: Sdk.Collection ); - - /** - * Adds an entity to the collection. - * @param entity - */ - addEntity( entity: Sdk.Entity ): void; - - /** - * Gets the collection of entities. - */ - getEntities(): Sdk.Collection; - - /** - * Gets an entity in the collection. - * @param index The index of the entity in the collection. - */ - getEntity( index: number ): Sdk.Entity; - - /** - * Gets an entity in the collection. - * @param id The id of the entity in the collection. - */ - getEntity( id: Sdk.Guid ): Sdk.Entity; - - /** - * Sets an item in the collection. - * @param index The index of the entity in the collection. - * @param value The Sdk.Entity value to set. - */ - setEntity( index: number, value: Sdk.Entity ): void; - - /** - * Sets an item in the collection. - * @param id The Sdk.Guid id of the entity in the collection. - * @param value The Sdk.Entity value to set. - */ - setEntity( id: Sdk.Guid, value: Sdk.Entity ): void; - - /** - * Gets the logical name of the entity. - */ - getEntityName(): string; - - /** - * Sets the logical name of the entity. - * @param name The logical name of the entity. - */ - setEntityName( name: string ): void; - - /** - * Gets the lowest active row version value. - */ - getMinActiveRowVersion(): string; - - /** - * Sets the lowest active row version value. - * @param minActiveRowVersion The lowest active row version value. - */ - setMinActiveRowVersion( minActiveRowVersion: string ): void; - - /** - * Gets whether there are more records available. - */ - getMoreRecords(): boolean; - - /** - * Sets whether there are more records available. - * @param moreRecords Whether there are more records available. - */ - setMoreRecords( moreRecords: boolean ): void; - - /** - * Gets the current paging information. - */ - getPagingCookie(): string; - - /** - * Sets the current paging information. - * @param pagingCookie The current paging information. - */ - setPagingCookie( pagingCookie: string ): void; - - /** - * Gets the total number of records in the collection if ReturnTotalRecordCount was true when the query was executed. - */ - getTotalRecordCount(): number; - - /** - * Sets the total number of records in the collection if ReturnTotalRecordCount was true when the query was executed. - * @param totalRecordCount The total number of records in the collection if ReturnTotalRecordCount was true when the query was executed. - */ - setTotalRecordCount( totalRecordCount: number ): void; - - /** - * Gets whether the results of the query exceeds the total record count. - */ - getTotalRecordCountLimitExceeded(): boolean; - - /** - * Sets whether the results of the query exceeds the total record count. - * @param totalRecordCountLimitExceeded Whether the results of the query exceeds the total record count. - */ - setTotalRecordCountLimitExceeded( totalRecordCountLimitExceeded: boolean ): void; - - /** - * XML definition of an the child nodes of an entity. - */ - toValueXml(): string; - - /** - * Returns a view of the entity collection - */ - view(): IEntityCollectionView; - } - - class EntityReferenceCollection - { - /** - * Contains a collection of EntityReference instances. - * @param entityReferences Initializes a new instance of the EntityReferenceCollection class setting the Sdk.Collection of Sdk.EntityReference objects. - */ - constructor( entityReferences?: Sdk.Collection ); - - /** - * Gets the collection of entity references. - */ - getEntityReferences(): Sdk.Collection; - - /** - * Sets the collection of entity references. - * @param entityReferences The entity references - */ - setEntityReferences( entityReferences: Sdk.Collection ): void; - - - /// prototype methods - - /** - * Removes an entity reference to the collection. - * @param entityReference The entity reference to remove. - */ - remove( entityReference: Sdk.EntityReference ): void; - - /** - * Returns a view of the data in an entity reference collection instance. - */ - view(): IEntityReferenceCollectionView; - - /** - * Returns the values of serialized entity reference collection as XML nodes. - */ - toValueXml(): string; - } - - class RelatedEntityCollection extends EntityCollection - { - } - - class AttributeCollection extends Collection - { - constructor(); - - /** - * Adds an attribute to the Attribute Collection. - * @param attribute The attribute to add. - * @param isChanged Override the the attribute IsChanged value. - */ - add( attribute: AttributeBase, isChanged?: boolean ): void; - - /** - * Gets the attributes in the collection. - */ - getAttributes(): Collection; - - - /// prototype methods - - /** - * Allows for a delegate function to be applied to each attribute in the collection. - * @param fm The function to be applied. Function should have parameters for the attribute and the iterator i.e.: '(att,i)' - */ - forEach( fn: ( attribute: AttributeBase, index: number ) => any ): void; - - /** - * Returns all attributes in the collection. - */ - get(): Sdk.Collection; - - /** - * Returns the attribute with matching name. - * @param attribuetName - */ - get( attribuetName: string ): AttributeBase; - - /** - * Returns the attribute with matching index. - * @param attribuetName - */ - get( index: number ): AttributeBase; - - /** - * Gets an attribute at a given index. - * @param index The index. - */ - getAttributeByIndex( index: number ): AttributeBase; - - /** - * Gets an attribute with a given name. - * @param name The Logical name of the attribute. - */ - getAttributeByName( name: string ): AttributeBase; - - /** - * Gets an array of the names of attributes in a collection. - */ - getNames(): Array; - /** - * The XML for an attribute collection. - */ - toXml( action: string ): string; - } - - class FormattedValueCollection - { - } - - class RelatedEntitiesCollection - { - } - - class AttributeBase - { - /** - * Gets whether the value of the attribute has changed. - */ - getIsChanged(): boolean; - - /** - * Gets the logical name of the attribute. - */ - getName(): string; - - /** - * Gets the value type of the attribute. - */ - getType(): Sdk.ValueType; - - /** - * Gets the value of the attribute. - * The type of value depends on the type of attribute. - */ - getValue(): any; - - /** - * Whether the value of the attribute is set. - */ - isValueSet(): boolean; - - /** - * Sets whether the value of the attribute has changed. - * @param isChanged Whether the value of the attribute has changed. - */ - setIsChanged( isChanged: boolean ): void; - - /** - * Sets the name of the attribute - * @param name The name of the attribute. - */ - setName( name: string ): void; - - /** - * For internal use only. - * @param type The type of the attribute. - */ - setType( type: Sdk.ValueType ): void; - - /** - * Sets the general value of the attribute - * @param name The value of the attribute. - */ - setValue( value: any ): void; - - /// prototype methods - /** - * XML node for Attribute. - */ - toXml( action: string ): string; - } - - class Boolean extends AttributeBase - { - /** - * A Boolean Attribute. - * @param name The logical name of the attribute . - * @param value The value of the managed property. - */ - constructor( name: string, value?: boolean ) - - /** - * Gets the value of a Boolean attribute. - */ - getValue(): boolean; - - /** - * Sets the value of a Boolean attribute. - * @param value - */ - setValue( value: boolean ): void; - } - - class DateTime extends AttributeBase - { - /** - * A DateTime Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: Date ); - - /** - * Gets the value of a DateTime attribute. - */ - getValue(): Date; - - /** - * Sets the value of a DateTime attribute. - * @param value The value to set. - */ - setValue( value: Date ): void; - } - - class Decimal extends AttributeBase - { - /** - * A Decimal Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: number ); - - /** - * Gets the value of a Decimal attribute. - */ - getValue(): number; - - /** - * Sets the value of a Decimal attribute. - * @param value The value to set. - */ - setValue( value: number ): void; - } - - class Double - { - /** - * A Double Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: number ); - - /** - * Gets the value of a Double attribute. - */ - getValue(): number; - - /** - * Sets the value of a Double attribute. - * @param value The value to set. - */ - setValue( value: number ): void; - } - - class Guid extends AttributeBase - { - /** - * A Guid Attribute. - * @param name The logical name of the attribute. - * @param value" The value of the attribute - */ - constructor( name: string, value?: string ); - - /** - * Gets the value of a Guid attribute. - */ - getValue(): string; - - /** - * Sets the value of a Guid attribute. - * @param value The value to set. - */ - setValue( value: string ): void; - } - - class Int extends AttributeBase - { - /** - * An Integer Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: number ); - - /** - * Gets the value of an Integer attribute. - */ - getValue(): number; - - /** - * Sets the value of an Integer attribute. - * @param value The value to set. - */ - setValue( value: number ): void; - } - - class Long extends AttributeBase - { - /** - * A Long Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: number ); - - /** - * Gets the value of a Long attribute. - */ - getValue(): number; - - /** - * Sets the value of a Long attribute. - * @param value The value to set. - */ - setValue( value: number ): void; - } - - class Lookup extends AttributeBase - { - /** - * A Lookup Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: EntityReference ); - - /** - * Gets the value of a Lookup attribute. - */ - getValue(): EntityReference; - - /** - * Sets the value of a Lookup attribute. - * @param value The value to set. - */ - setValue( value: EntityReference ): void; - } - - class Money extends AttributeBase - { - /** - * A Money Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: number ); - - /** - * Gets the value of a Money attribute. - */ - getValue(): number; - - /** - * Sets the value of a Money attribute. - * @param value The value to set. - */ - setValue( value: number ): void; - } - - class OptionSet extends AttributeBase - { - /** - * An OptionSet Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: number ); - - /** - * Gets the value of a OptionSet attribute. - */ - getValue(): number; - - /** - * Sets the value of an OptionSet attribute. - * @param value The value to set. - */ - setValue( value: number ): void; - } - - class PartyList extends AttributeBase - { - /** - * A PartyList Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: EntityCollection ); - - /** - * Gets the value of a PartyList attribute. - */ - getValue(): EntityCollection; - - /** - * Sets the value of a PartyList attribute. - * @param value The value to set. - */ - setValue( value: EntityCollection ): void; - } - - class String extends AttributeBase - { - /** - * A String Attribute. - * @param name The logical name of the attribute. - * @param value The value of the attribute. - */ - constructor( name: string, value?: string ); - - /** - * Gets the value of a String attribute. - */ - getValue(): string; - - /** - * Sets the value of a String attribute. - * @param value The value to set. - */ - setValue( value: string ): void; - } - - class EntityState - { - } - - class Entity - { - /** - * Represents an instance of an entity (a record). - * @param type The logical name of the entity. - */ - constructor( type: string ); - - /** - * Gets the collection of attributes for the entity. - */ - getAttributes(): Sdk.AttributeCollection; - - /** - * Gets the collection of attributes for the entity. - * @param attributeName The attribute with matching name is returned. - */ - getAttributes( attributeName: string ): Sdk.AttributeBase; - - /** - * Gets the collection of attributes for the entity. - * @param index The attribute with matching index is returned. - */ - getAttributes( index: number ): Sdk.AttributeBase; - - /** - * Checks whether the entity has an attribute that satisfies the specified predicate. - * @param A comparer function that takes an Sdk.AttributeBase as argument and returns a boolean. - */ - containsAttribute( predicate: ( attribute: Sdk.AttributeBase ) => boolean ): boolean; - - /** - * Checks whether the entity has an attribute with the specified name. - * @param The name of the attribute. - */ - containsAttribute( name: string ): boolean; - - /** - * Sets the collection of attributes for the entity. - * @param attributes The collection of attributes for the entity. - */ - setAttributes( attributes: Sdk.AttributeCollection ): void; - - /** - * Gets the state of the entity. - */ - getEntityState(): Sdk.EntityState; - - /** - * Sets the state of the entity. - * @param state The state of the entity. - */ - setEntityState( state: Sdk.EntityState ): void; - - /** - * Gets the collection of formatted values for the entity attributes. - */ - getFormattedValues(): Sdk.FormattedValueCollection; - - /** - * Sets the collection of formatted values for the entity attributes. - * @param values" The collection of formatted values for the entity attributes. - */ - setFormattedValues( values: Sdk.FormattedValueCollection ): void; - - /** - * Gets the Id of the record represented by this entity instance. - */ - getId(): string; - - /** - * Sets the Id of the record represented by this entity instance. - * @param id The Id of the record represented by this entity instance. - * @param override Allow setting the Id property, for example when creating a new record from an existing one. - */ - setId( id: string, override?: boolean ): void; - - /** - * Gets the logical name of the entity. - */ - getType(): string; - - /** - * Sets the logical name of the entity. - * @param type The logical name of the entity. - */ - setType( type: string ): void; - - /** - * Gets a collection of related entities. - */ - getRelatedEntities(): Sdk.RelatedEntitiesCollection; - - /** - * Sets a collection of related entities. - * @param relatedEntities A collection of related entities. - */ - setRelatedEntities( relatedEntities: Sdk.RelatedEntitiesCollection ): void; - - /** - * Adds an attribute with an optional value to a newly instantiated Sdk.Entity - * @param attribute The attribute to add - * @param isChanged Whether the attribute should be considered changed, the default is true. - */ - addAttribute( attribute: Sdk.AttributeBase, isChanged?: boolean ): void; - - /** - * Adds an entity to the related entities. - * @param relationshipSchemaName The relationship SchemaName. - * @param entity The entity to add. - */ - addRelatedEntity( relationshipSchemaName: string, entity: Sdk.Entity ): void; - - /** - * Gets the value to indicate whether data for the entity has changed. - */ - getIsChanged(): boolean; - - /** - * Sets the value to indicate whether data for the entity has changed. - * @param isChanged The value to indicate whether data for the entity has changed. - */ - setIsChanged( isChanged: boolean ): void; - - /** - * Gets the value of the specified attribute. - * @param logicalName The logical name of the attribute. - */ - getValue( logicalName: string ): any; - - /** - * Generates properties for the entity based on metadata. - */ - initializeSubClass( metadata: Sdk.Mdq.IEntityMetadata ): void; - - /** - * Sets the value of the specified attribute. - * @param logicalName The logical name of the attribute. - * @param value The value for the attribute. Simple JavaScript types may be used for most attribute types. Sdk.EntityReference, Sdk.EntityCollection, and Sdk.BooleanManagedPropertyValue cannot use simple JavaScript types. - */ - setValue( logicalName: string, value: Object ): void; - - /** - * Generates an entity reference. - */ - toEntityReference(): Sdk.EntityReference; - - /** - * Overrides the default toString method. - */ - toString(): string; - - /** - * XML definition of an the child nodes of an entity. - * @param action - */ - toValueXml( action: string ): string; - - /** - * XML definition of an entity where the root node is . - */ - toXml( action: string ): string; - - /** - * Returns a view of the data in an entity instance - */ - view(): IEntityView; - } - - class EntityReference - { - /** - * Identifies a record. - * @param logicalName The logical name of the entity. - * @param id The id of the record. - * @param name The value of the primary attribute of the entity instance. This property can contain a value or null. This property is not automatically populated unless the EntityReference object has been retrieved from the server. - */ - constructor( logicalName: string, id: string, name?: string ); - - /** - * Gets the logicalName representing the type of referenced entity. - */ - getType(): string; - - /** - * Gets the Id value of the referenced entity. - */ - getId(): string; - - /** - * Gets the primary attribute value of the referenced entity. - */ - getName(): string; - - /** - * Sets the logicalName representing the type of referenced entity. - * @param type The logicalName representing the type of referenced entity. - */ - setType( type: string ): void; - - /** - * Sets the Id value of the entity. - * @param id The Id value of the entity. - */ - setId( id: string ): void; - - /** - * Sets the primary attribute value of the referenced entity. - * @param name The primary attribute value of the referenced entity. - */ - setName( name: string ): void; - - - /// prototype methods - - /** - * Returns a serialized entity reference where the root element is . - */ - toXml(): string; - - /** - * Returns the values of serialized entity reference as XML nodes. - */ - toValueXml(): string; - - /** - * Returns a view of the data in an EntityReference - */ - view(): IEntityReferenceView; - } - - class OrganizationRequest - { - /** - * Sets the request XML. - * @param xml The request XML. - */ - setRequestXml( xml: string ): void; - - /** - * Gets the request XML. - */ - getRequestXml(): string; - - /** - * Sets the response type. - * @param type A class that inherits from Sdk.OrganizationResponse. - */ - setResponseType( type: OrganizationResponse ): void; - - /** - * Gets the response type. - */ - getResponseType(): OrganizationResponse; - } - - class OrganizationResponse - { - } - - /** - * Contains the data that is needed to convert a query in FetchXML to a QueryExpression. - * @param fetchXml Sets the query to convert. - */ - class FetchXmlToQueryExpressionRequest extends Sdk.OrganizationRequest - { - constructor( fetchXml: string ); - - /** - * Sets the query to convert. - * @param The query to convert. - */ - setFetchXml( value: string ): void; - } - - /** - * Response to FetchXmlToQueryExpressionRequest. - * @param responseXml The response XML to the FetchXmlToQueryExpressionRequest. - */ - class FetchXmlToQueryExpressionResponse extends Sdk.OrganizationResponse - { - constructor( responseXml: string ); - - /** - * Gets the results of the query conversion. - */ - public getQuery(): Query.QueryExpression; - } - - /** - * Contains the data that is needed to convert a query, which is represented as a QueryExpression class, to its equivalent query, which is represented as FetchXML. - * @param query The query. - */ - class QueryExpressionToFetchXmlRequest extends Sdk.OrganizationRequest - { - constructor( query: Sdk.Query.QueryBase ); - - /** - * Sets the query to convert. - * @param query The query. - * @param query - */ - public setQuery( query: Sdk.Query.QueryBase ): void; - } - - /** - * Response to QueryExpressionToFetchXmlRequest. - */ - class QueryExpressionToFetchXmlResponse extends Sdk.OrganizationResponse - { - constructor( responseXml: string ); - - /** - * Gets the results of the query conversion. - */ - public getFetchXml(): string; - } - - /** - * Request to retrieve metadata and metadata changes. - * @param query The Sdk.Mdq.EntityQueryExpression that defines the query. - * @param clientVersionStamp The Sdk.Mdq.RetrieveMetadataChangesResponse.ServerVersionStamp value from a previous request. When included only the metadata changes since the previous request will be returned. - * @param deletedMetadataFilters An Sdk.Mdq.DeletedMetadataFilters enumeration value. When included the deleted metadata changes will be limited to the types defined by the enumeration. - */ - class RetrieveMetadataChangesRequest extends Sdk.OrganizationRequest - { - constructor( query: Sdk.Mdq.EntityQueryExpression, clientVersionStamp?: string, deletedMetadataFilters?: Sdk.Mdq.DeletedMetadataFilters ); - getEntityMetadata(): Sdk.Mdq.IEntityMetadata[]; - getServerVersionStamp(): string; - getDeletedMetadata(): Object; - } - - /** - * Response to RetrieveMetadataChangesRequest. - * @param resopnseXml The response XML. - */ - class RetrieveMetadataChangesResponse - { - constructor( responseXml: string ); - - /*** - * - */ - public getEntityMetadata(): Array; - - /*** - * - */ - public getServerVersionStamp(): string; - - /*** - * - */ - public getDeletedMetadata(): any; - } - - - /** - * Contains the data that is needed to set the state of an entity record. - * @param entityMoniker Sets the entity. - * @param state Sets the state of the entity record. - * @param status Sets the status that corresponds to the State property. - */ - class SetStateRequest extends Sdk.OrganizationRequest - { - constructor( entityMoniker: EntityReference, state: number, status: number ); - - /** - * Sets the entity. - * @param value The entity. - */ - public setEntityMoniker( value: EntityReference ): void; - - /** - * Sets the state of the entity record. - * @param value The state of the entity record. - */ - setState( value: number ): void; - - /** - * Sets the status that corresponds to the State property. - * @param value The status that corresponds to the State property. - */ - setStatus( value: number ): void; - } - - /** - * Response to SetStateRequest. - */ - class SetStateResponse - { - constructor( responseXml: string ); - } -} - -declare namespace Sdk.Query -{ - class QueryBase - { - /** - * Internal Use Only. - * @param type An Abstract class for different query classes to inherit from. - */ - constructor( type: string ); - - /** - * Gets the columns to include. - */ - getColumnSet(): Sdk.ColumnSet; - - /** - * Sets the columns to include. - * @param columns An Sdk.ColumnSet instance. - */ - setColumnSet( columns: Sdk.ColumnSet ): void; - - /** - * Sets the columns to include. - * @param columns An array of attribute logical names for the columns to return. - */ - setColumnSet( columns: Array ): void; - - /** - * Sets the columns to include. - * @param columns Pass each attribute logical name as an argument. - */ - setColumnSet( ...columns: string[] ): void; - - /** - * - */ - getQueryType(): string; - - /** - * Gets the logical name of the entity. - */ - getEntityName(): string; - - /** - * Sets the logical name of the entity. - * @param name The logical name of the entity. - */ - setEntityName( name: string ): void; - - /** - * Gets the number of pages and the number of entity instances per page returned from the query. - */ - getPageInfo(): Sdk.Query.PagingInfo; - - /** - * Sets the number of pages and the number of entity instances per page returned from the query. - * @param pageInfo The number of pages and the number of entity instances per page returned from the query. - */ - setPageInfo( pageInfo: Sdk.Query.PagingInfo ): void; - - /** - * Adds the specified column to the column set. - * @param columnName The logical name of the column to add. - */ - addColumn( columnName: string ): void; - - /** - * Removes a column from the ColumnSet used by the query. - * @param columnName The logical name of an attribute to be removed from the ColumnSet. - * @param errorIfNotFound Whether to throw an error when the column to remove is not found. The default is false. - */ - removeColumn( columnName: string, errorIfNotFound?: boolean ): void; - - /** - * Gets an Sdk.Collection of Sdk.Query.OrderExpression instances that define the order in which the entity instances are returned from the query. - */ - getOrders(): Sdk.Collection; - - /** - * Gets the number of rows to be returned. - */ - getTopCount(): number; - - /** - * Sets the number of rows to be returned. - * @param count The number of rows to be returned. - */ - setTopCount( count: number ): void; - - /** - * Gets the serialized QueryExpression. - */ - toXml(): string; - - /** - * Gets the serialized QueryExpression values. - */ - toValueXml(): string; - } - - class QueryByAttribute extends QueryBase - { - /** - * Initializes a new instance of the QueryByAttribute class setting the entity name. - * @param entityName The logical name of the entity. - * - */ - constructor( entityName: string ); - - /** - * Gets An Sdk.Collection of Sdk.AttributeBase attributes. - */ - getAttributeValues(): Sdk.Collection; - - /** - * Sets an Sdk.Collection of Sdk.Query.OrderExpression instances that define the order in which the entity instances are returned from the query. - * @param orders An Sdk.Collection of Sdk.Query.OrderExpression instances that define the order in which the entity instances are returned from the query. - */ - setOrders( orders: Sdk.Collection ): void; - - /// prototype methods - - /** - * Adds the attribute with values to include in the query. - * @param attributeValue One of the classes that inherit from Sdk.AttributeBase including the value to use as criteria. - */ - addAttributeValue( attributeValue: Sdk.AttributeBase ): void; - - /** - * Adds an order to apply to the results of the query. - * @param order An order expression. - */ - addOrder( order: Sdk.Query.OrderExpression ): void; - - /** - * Removes an attribute with values to include in the query. - * @param attributeValue One of the classes that inherit from Sdk.AttributeBase including the value to use as criteria. - * @param errorIfNotFound Whether to throw an error when the attribute to remove is not found. The default is false. - */ - removeAttributeValue( attributeValue: Sdk.AttributeBase, errorIfNotFound?: boolean ): void; - } - - class QueryExpression extends QueryBase - { - /** - * Initializes a new instance of the QueryExpression class setting the entity name. - * @param entityName The name of the entity. - */ - constructor( entityName: string ); - - /** - * Gets the complex condition and logical filter expressions that filter the results of the query. - */ - getCriteria(): FilterExpression; - - /** - * Sets the complex condition and logical filter expressions that filter the results of the query. - * @param criteria The query condition and filter criteria. - */ - setCriteria( criteria: FilterExpression ): void; - - /** - * Gets whether the results of the query contain duplicate entity instances. - */ - getDistinct(): boolean; - - /** - * Sets whether the results of the query contain duplicate entity instances. - */ - setDistinct( isDistinct: boolean ): void; - - /** - * Gets an Sdk.Collection of Sdk.Query.LinkEntity instances. - */ - getLinkEntities(): Sdk.Collection; - - /** - * Gets a value that indicates that no shared locks are issued against the data that would prohibit other transactions from modifying the data in the records returned from the query. - */ - getNoLock(): boolean; - - /** - * Sets a value that indicates that no shared locks are issued against the data that would prohibit other transactions from modifying the data in the records returned from the query. - * @param isNoLock True if there are no shared locks are issued against the data that would prohibit other transactions from modifying the data in the records returned from the query; otherwise, false. - */ - setNoLock( isNoLock: boolean ): void; - - /// prototype methods - - /** - * Contains a condition expression used to filter the results of the query. - * @param entityName The logical name of the entity in the condition expression. - * @param attributeName The logical name of the attribute in the condition expression. - * @param operator The condition operator. - * @param values The value(s) to compare. Use one of the following classes that inherit from Sdk.Query.ValueBase: - * Sdk.Query.Booleans - * Sdk.Query.BooleanManagedProperties - * Sdk.Query.Dates - * Sdk.Query.Decimals - * Sdk.Query.Doubles - * Sdk.Query.EntityReferences - * Sdk.Query.Guids - * Sdk.Query.Ints - * Sdk.Query.Longs - * Sdk.Query.Money - * Sdk.Query.OptionSets - * Sdk.Query.Strings - */ - addCondition( entityName: string, attributeName: string, conditionOperator: Sdk.Query.ConditionOperator, values: Sdk.Query.ValueBase ): void; - - /** - * Adds the specified link to the query expression setting the entity name to link to, the attribute name to link from and the attribute name to link to. - * @param firstParam An Sdk.Query.LinkEntity instance. - */ - addLink( firstParam: Sdk.Query.LinkEntity ): void; - - /** - * Adds the specified link to the query expression setting the entity name to link to, the attribute name to link from and the attribute name to link to. - * @param firstParam The name of entity to link from. - * @param linkFromAttributeName The name of the attribute to link from. - * @param linkToAttributeName The name of the attribute to link to. - * @param joinOperator The join operator. The default value is Inner - */ - addLink( firstParam: string, linkFromAttributeName: string, linkToAttributeName: string, joinOperator: Sdk.Query.JoinOperator ): void; - - /** - * Adds the specified order expression to the query expression. - * @param attributeName The name of the attribute. - * @param orderType The order, ascending or descending. Ascending is the default if not specified. - */ - addOrder( attributeName: string, orderType: Sdk.Query.OrderType ): void; - } - - class OrderExpression - { - } - - class ConditionExpression - { - /** - * Contains a condition expression used to filter the results of the query. - * @param name entityName The logical name of the entity in the condition expression. - * @param name attributeName The logical name of the attribute in the condition expression. - * @param name operator The condition operator. - * @param name values The value(s) to compare. - * Use one of the following classes that inherit from Sdk.Query.ValueBase: - * - Sdk.Query.Booleans - * - Sdk.Query.BooleanManagedProperties - * - Sdk.Query.Dates - * - Sdk.Query.Decimals - * - Sdk.Query.Doubles - * - Sdk.Query.EntityReferences - * - Sdk.Query.Guids - * - Sdk.Query.Ints - * - Sdk.Query.Longs - * - Sdk.Query.Money - * - Sdk.Query.OptionSets - * - Sdk.Query.Strings - */ - constructor( entityName: string, attributeName: string, operator: ConditionOperator, values?: ValueBase ); - - /** - * Returns the logical name of the entity in the condition expression. - */ - getEntityName(): string; - - /** - * Sets the logical name of the entity in the condition expression. - * @param name The logical name of the entity in the condition expression. - */ - setEntityName( name: string ): void; - - /** - * Returns the logical name of the attribute in the condition expression. - */ - getAttributeName(): string; - - /** - * Sets the logical name of the attribute in the condition expression. - * @param name The logical name of the attribute in the condition expression. - */ - setAttributeName( name: string ): void; - - /** - * Returns the condition operator. - */ - getOperator(): ConditionOperator; - - /** - * Sets the condition operator. - * @param operator The condition operator. - */ - setOperator( operator: ConditionOperator ): void; - - /** - * Returns the values for the attribute. - */ - getValues(): ValueBase; - - /** - * Sets the values for the attribute. - * @param The value(s) to compare - * Use one of the following classes that inherit from Sdk.Query.ValueBase: - * - Sdk.Query.Booleans - * - Sdk.Query.BooleanManagedProperties - * - Sdk.Query.Dates - * - Sdk.Query.Decimals - * - Sdk.Query.Doubles - * - Sdk.Query.EntityReferences - * - Sdk.Query.Guids - * - Sdk.Query.Ints - * - Sdk.Query.Longs - * - Sdk.Query.Money - * - Sdk.Query.OptionSets - * - Sdk.Query.Strings - */ - setValues( values: ValueBase ): void; - } - - /** - * Specifies complex condition and logical filter expressions used for filtering the results of the query. - * @param logicalOperator The filter operator. - */ - class FilterExpression - { - constructor( logicalOperator: LogicalOperator ); - - /** - * Adds a condition to the filter expression setting the attribute name, condition operator, and values. - * @param conditionExpression The expression that will set the condition. - */ - public addCondition( firstParam: ConditionExpression ): void; - - /** - * Adds a condition to the filter expression setting the attribute name, condition operator, and values. - * @param entityName The entityName of the new ConditionExpression that will be instantiated using the other parameters. - * @param attributeName The attribute name to use in the condition expression. - * @param conditionOperator The condition operator if the first parameter is a string. - * @param values The value(s) to compare. - * Use one of the following classes that - * - Sdk.Query.Booleans - * - Sdk.Query.BooleanManagedProperties - * - Sdk.Query.Dates - * - Sdk.Query.Decimals - * - Sdk.Query.Doubles - * - Sdk.Query.EntityReferences - * - Sdk.Query.Guids - * - Sdk.Query.Ints - * - Sdk.Query.Longs - * - Sdk.Query.Money - * - Sdk.Query.OptionSets - * - Sdk.Query.Strings - */ - public addCondition( entityName: string, attributeName: string, conditionOperator: ConditionOperator, values?: ValueBase ): void; - - /** - * Adds a child filter to the filter expression. - * @param filterExpression The filter to add. - */ - addFilter( filterExpression: FilterExpression ): void; - - /** - * Adds a child filter to the filter expression. - * @param logicalOperator Creates new FilterExpression with the specified logical operator and adds it. - */ - addFilter( logicalOperator: LogicalOperator ): void; - - /** - * Returns a collection of Sdk.Query.ConditionExpression values. - */ - getConditions(): Sdk.Collection; - - /** - * Gets the logical AND/OR filter operator. - */ - getFilterOperator(): LogicalOperator - - /** - * Returns an Sdk.Collection of Sdk.Query.FilterExpression. - */ - getFilters(): Sdk.Collection; - - /** - * Gets whether the expression is part of a quick find query. - */ - getIsQuickFindFilter(): boolean; - - /** - * Sets the filter operator. - * @param filterOperator The filter operator. - */ - setFilterOperator( filterOperator: LogicalOperator ): void; - - /** - * Sets whether the expression is part of a quick find query. - * @param isQuickFind True if the filter is part of a quick find query; otherwise, false. - */ - setIsQuickFindFilter( isQuickFind: boolean ): void; - } - - class FetchExpression - { - /** - * @param fetchXml The FetchXml to be used in a query. - */ - constructor( fetchXml: string ); - - /** - * Gets the FetchXml to be used in a query. - */ - public getFetchXml(): string; - - /** - * Sets the FetchXml to be used in a query. - * @param fetchXml The FetchXml to be used in a query. - */ - public setFetchXml( fetchXml: string ): void; - } - - class LinkEntity - { - /** - * Initializes a new instance of the Sdk.Query.LinkEntity class setting the required properties. - * @param linkFromEntityName The logical name of the entity to link from. - * @param linkToEntityName The logical name of the entity to link to. - * @param linkFromAttributeName The name of the attribute to link from. - * @param linkToAttributeName The name of the attribute to link to. - * @param joinOperator The join operator. - * @param entityAlias The string representing an alias for the linkToEntityName. - */ - constructor( - linkFromEntityName: string, - linkToEntityName: string, - linkFromAttributeName: string, - linkToAttributeName: string, - joinOperator: Sdk.Query.JoinOperator, - entityAlias: string ); - - /** - * Adds a linked entity. - * @param linkEntity An Sdk.Query.LinkEntity to add. - */ - public addLink( linkEntity: Sdk.Query.LinkEntity ): void; - - /** - * Gets the column set. - */ - public getColumns(): Sdk.ColumnSet; - - /** - * Sets the columns to include. - * @param columns An Sdk.ColumnSet instance. - */ - public setColumns( columns: Sdk.ColumnSet ): void; - - /** - * Sets the columns to include. - * @param columns An Array of attribute logical names for the columns to return. - */ - public setColumns( columns: string[] ): void; - - /** - * Sets the columns to include. - * @param columns Pass each attribute logical name as an argument. - */ - public setColumns( ...columns: string[] ): void; - - /** - * Gets the alias for the entity. - */ - public getEntityAlias(): string; - - /** - * Sets the alias for the entity. - * @param alias The alias for the entity. - */ - public setEntityAlias( alias: string ): void; - - /** - * Gets the join operator. - */ - public getJoinOperator(): Sdk.Query.JoinOperator; - - /** - * Sets the join operator. - * @param operator The join operator. - */ - public setJoinOperator( operator: Sdk.Query.JoinOperator ): void; - - /** - * Gets the complex condition and logical filter expressions that filter the results of the query. - */ - public getLinkCriteria(): Sdk.Query.FilterExpression; - - /** - * Sets the complex condition and logical filter expressions that filter the results of the query. - * @param criteria The complex condition and logical filter expressions that filter the results of the query. - */ - public setLinkCriteria( criteria: Sdk.Query.FilterExpression ): void; - - /** - * Gets the collection of Sdk.Query.LinkEntity that define links between multiple entity types. - */ - public getLinkEntities(): Sdk.Collection; - - /** - * Gets the logical name of the attribute of the entity that you are linking from. - */ - public getLinkFromAttributeName(): string; - - /** - * Sets the logical name of the attribute of the entity that you are linking from. - * @param name The logical name of the attribute of the entity that you are linking from. - */ - public setLinkFromAttributeName( name: string ): void; - - /** - * Gets the logical name of the entity that you are linking from. - */ - public getLinkFromEntityName(): string; - - /** - * Sets the logical name of the entity that you are linking from. - * @param name The logical name of the entity that you are linking from. - */ - public setLinkFromEntityName( name: string ): void; - - /** - * Gets the logical name of the attribute of the entity that you are linking to - */ - public getLinkToAttributeName(): string; - - /** - * Sets the logical name of the attribute of the entity that you are linking to. - * @param name The logical name of the attribute of the entity that you are linking to. - */ - public setLinkToAttributeName( name: string ): void; - - /** - * Gets the logical name of the entity that you are linking to. - */ - public getLinkToEntityName(): string; - - /** - * Sets the logical name of the entity that you are linking to. - * @param name The logical name of the entity that you are linking to. - */ - public setLinkToEntityName( name: string ): void; - - /** - * Gets the serialized link entity. - */ - public toXml(): string; - - /** - * Gets the serialized link entity values. - */ - public toValueXml(): string; - } - - class PagingInfo - { - /** - * Gets the number of entity instances returned per page. - */ - getCount(): number; - - /** - * Sets the number of entity instances returned per page. - * @param The number of entity instances returned per page - */ - setCount( count: number ): void; - - /** - * Gets the number of pages returned from the query. - */ - getPageNumber(): number; - - /** - * Sets the number of pages returned from the query. - * @param The number of pages returned from the query. - */ - setPageNumber( pages: number ): void; - - /** - * Gets the info used to page large result sets. - */ - getPagingCookie(): string; - - /** - * Sets the info used to page large result sets. - */ - setPagingCookie( cookie: string ): void; - - /** - * Gets whether the total number of records should be returned from the query. - */ - getReturnTotalRecordCount(): boolean; - - /** - * Sets whether the total number of records should be returned from the query. - * @param Specifies whether the TotalRecordCount should be set when the query is executed. - */ - setReturnTotalRecordCount( returnTotalRecordsCount: boolean ): void; - - - /// prototype methods - - /** - * Gets the serialized paging info. - * - toXml():string; - - /** - * Gets the serialized paging info values. - */ - toValueXml(): string; - } - - export enum ConditionOperator - { - Equal, - NotEqual, - GreaterThan, - LessThan, - GreaterEqual, - LessEqual, - Like, - NotLike, - In, - NotIn, - Between, - NotBetween, - Null, - NotNull, - Yesterday, - Today, - Tomorrow, - Last7Days, - Next7Days, - LastWeek, - ThisWeek, - NextWeek, - LastMonth, - ThisMonth, - NextMonth, - On, - OnOrBefore, - OnOrAfter, - LastYear, - ThisYear, - NextYear, - LastXHours, - NextXHours, - LastXDays, - NextXDays, - LastXWeeks, - NextXWeeks, - LastXMonths, - NextXMonths, - LastXYears, - NextXYears, - EqualUserId, - NotEqualUserId, - EqualBusinessId, - NotEqualBusinessId, - Mask, - NotMask, - Contains, - DoesNotContain, - EqualUserLanguage, - NotOn, - OlderThanXMonths, - BeginsWith, - DoesNotBeginWith, - EndsWith, - DoesNotEndWith, - ThisFiscalYear, - ThisFiscalPeriod, - NextFiscalYear, - NextFiscalPeriod, - LastFiscalYear, - LastFiscalPeriod, - LastXFiscalYears, - LastXFiscalPeriods, - NextXFiscalYears, - NextXFiscalPeriods, - InFiscalYear, - InFiscalPeriod, - InFiscalPeriodAndYear, - InOrBeforeFiscalPeriodAndYear, - InOrAfterFiscalPeriodAndYear, - EqualUserOrUserTeams, - EqualUserTeams, - } - - export enum JoinOperator - { - Inner, - LeftOuter, - Natural, - } - - export enum OrderType - { - Ascending, - Descending, - } - - export class ValueBase - { } - - /** - * Specifies Boolean values to be compared in the query. - * @param args An array of Boolean values. - */ - class Booleans extends ValueBase - { - constructor( args: boolean[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of boolean values. - */ - public getValues(): Sdk.Collection; - - - /** - * Specifies a Boolean value to be compared in the query. - * @param setValueArgs An array of boolean values. - */ - public setValues( setValueArgs: boolean[] ): void; - } - - /** - * Specifies the Date values to be compared in the query. - * @param args An array of Date values. - */ - class Dates extends ValueBase - { - constructor( args: Date[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of Date values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Date values to be compared in the query. - * @param setValueArgs An array of Date values. - */ - public setValues( setValueArgs: Date[] ): void; - } - - /** - * Specifies the Decimal values to be compared in the query. - * @param args An array of Decimal values. - */ - class Decimals extends ValueBase - { - constructor( args: number[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of number values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Decimal values to be compared in the query. - * @param setValueArgs An array of number values. - */ - public setValues( setValueArgs: number[] ): void; - } - - /** - * Specifies the Double values to be compared in the query. - * @param args An array of Double values. - */ - class Doubles extends ValueBase - { - constructor( args: number[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of number values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Double values to be compared in the query. - * @param setValueArgs An array of number values. - */ - public setValues( setValueArgs: number[] ): void; - } - - /** - * Specifies the Int values to be compared in the query. - * @param args An array of Int values. - */ - class Ints extends ValueBase - { - constructor( args: number[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of number values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Int values to be compared in the query - * @param setValueArgs An array of number values. - */ - public setValues( setValueArgs: number[] ): void; - } - - /** - * Specifies the Long values to be compared in the query. - * @param args An array of Long values. - */ - class Longs extends ValueBase - { - constructor( args: number[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of number values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Long values to be compared in the query. - * @param setValueArgs An array of number values. - */ - public setValues( setValueArgs: number[] ): void; - } - - /** - * Specifies the Sdk.EntityReference values to be compared in the query. - * @param args An array of Sdk.EntityReference values. - */ - class EntityReferences extends ValueBase - { - constructor( args: Sdk.EntityReference[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of Sdk.EntityReference values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Long values to be compared in the query. - * @param setValueArgs An array of Sdk.EntityReference values. - */ - public setValues( setValueArgs: Sdk.EntityReference[] ): void; - } - - /** - * Specifies the Sdk.Query.Guids values to be compared in the query. - * @param args An array of GUID string values. - */ - class Guids extends ValueBase - { - constructor( args: string[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of GUID string values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Long values to be compared in the query. - * @param setValueArgs An array of GUID string values. - */ - public setValues( setValueArgs: string[] ): void; - } - - /** - * Specifies the Money values to be compared in the query. - * @param args An array of number values. - */ - class Money extends ValueBase - { - constructor( args: number[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of number values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the Money values to be compared in the query. - * @param setValueArgs An array of number values. - */ - public setValues( setValueArgs: number[] ): void; - } - - /** - * Specifies the OptionSet values to be compared in the query. - * @param args An array of number values. - */ - class OptionSets extends ValueBase - { - constructor( args: number[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of number values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the OptionSet values to be compared in the query. - * @param setValueArgs An array of number values. - */ - public setValues( setValueArgs: number[] ): void; - } - - /** - * Specifies the String values to be compared in the query. - * @param args An array of String values. - */ - class Strings extends ValueBase - { - constructor( args: string[] ); - - /** - * Returns the type of value with namespace prefix. - */ - public getType(): string; - - /** - * Returns an Sdk.Collection of String values. - */ - public getValues(): Sdk.Collection; - - /** - * Specifies the String values to be compared in the query. - * @param setValueArgs An array of String values. - */ - public setValues( setValueArgs: string[] ): void - } - - export enum LogicalOperator - { - Or, - And, - } -} - -declare namespace Sdk.Util -{ - /** - * Verifies the parameter is a string formatted as a GUID. - * @param value The value to check. - */ - function isGuid( value: string ): boolean; - - /** - * Verifies the parameter is a string formatted as a GUID or null. - * @param value The value to check. - */ - function isGuidOrNull( value: string ): boolean; - - /** - * Verifies the parameter is a valid enum value. - * @param enumeration The enumeration. - * @param value The value to check. - */ - - /** - * Returns an empty GUID. - */ - function getEmptyGuid(): string; - - /** - * Formats a string with the arguments from an array. - * @param string The string containing placeholders for items in the array. - * @param args An array of strings to replace the placeholders. - */ - function format( string: string, args: string[] ): string; - - /** - * - */ - function getError( resp: any ): string; - - /** - * Returns the clinent URL. - */ - function getClientUrl(): string; - - /** - * Provides a way to override the client Url when a client-side context is not available. - * @param url The client URL to use instead of the default. - */ - function setClientUrl( url: string ): void; - - /** - * - */ - function getXMLHttpRequest( action: string, async: boolean ): any; - - /** - * Creates an entity from XML. - * @param The serialized entity returned from the SOAP service as XML. - */ - function createEntityFromNode( node: string ): void; -} - -declare namespace Sdk.Xml -{ -} - -declare namespace Sdk.Mdq -{ - /** - * Defines a complex query to retrieve entity metadata. - * @param criteria The filter criteria for the metadata query. - * @param properties The properties to be returned by the query. - * @param attributeQuery A query expression for the entity attribute metadata to return. - * @param relationshipQuery A query expression for the entity relationship metadata to return. - * @param labelQuery A query expression for the labels to return. - */ - export class EntityQueryExpression - { - constructor( - criteria: Sdk.Mdq.MetadataFilterExpression, - properties: Sdk.Mdq.MetadataPropertiesExpression, - attributeQuery?: Sdk.Mdq.AttributeQueryExpression, - relationshipQuery?: Sdk.Mdq.RelationshipQueryExpression, - labelQuery?: Sdk.Mdq.LabelQueryExpression ); - } - - /** - * An enumeration that specifies the type of deleted metadata to retrieve. - */ - export enum DeletedMetadataFilters - { - All, // All deleted metadata - Attribute, // Deleted Attribute metadata - Default, // The value used if not set. Equals Entity - Entity, //Deleted Entity metadata - Label, //Deleted Label metadata - OptionSet, // Deleted OptionSet metadata - Relationship, //Deleted Relationship metadata - } - - /** - * Specifies complex condition and logical filter expressions used for filtering the results of a metadata query. - * @param filterOperator The logical AND/OR filter operator. - */ - - export class MetadataFilterExpression - { - constructor( filterOperator: Sdk.Mdq.LogicalOperator ); - - /** - * Adds a condition. This method accepts either the properties to create a new Sdk.Mdq.MetadataConditionExpression or a Sdk.Mdq.MetadataConditionExpression as the first argument. - * @param propertyName The metadata property to evaluate. - * @param conditionOperator The condition operator. - * @param value The metadata value to evaluate. - */ - public addCondition( - propertyName: SearchableEntityMetadataProperties|SearchableAttributeMetadataProperties|SearchableRelationshipMetadataProperties, - conditionOperator: MetadataConditionOperator, - value: Object ): void; - public addCondition( - propertyName: SearchableAttributeMetadataProperties, conditionOperator: MetadataConditionOperator, value: any): void; - public addCondition( - propertyName: SearchableEntityMetadataProperties|SearchableAttributeMetadataProperties|SearchableRelationshipMetadataProperties, - conditionOperator: MetadataConditionOperator, - value: Object ): void; - addCondition(propertyName: SearchableAttributeMetadataProperties, conditionOperator: MetadataConditionOperator): void; - public addCondition( - propertyName: SearchableEntityMetadataProperties|SearchableAttributeMetadataProperties|SearchableRelationshipMetadataProperties, - conditionOperator: MetadataConditionOperator, - value: Object): void; - } - - /** - * Defines a complex query to retrieve attribute metadata for entities retrieved using an Sdk.Mdq.EntityQueryExpression. - * @param criteria The filter criteria for the metadata query. - * @param properties The properties to be returned by the query. - */ - export class AttributeQueryExpression - { - constructor( criteria: MetadataFilterExpression, properties: Sdk.Mdq.MetadataPropertiesExpression ); - } - - /** - * Defines a complex query to retrieve entity relationship metadata for entities retrieved using an EntityQueryExpression. - * @param criteria The filter criteria for the metadata query. - * @param properties The properties to be returned by the query. - */ - export class RelationshipQueryExpression - { - constructor( criteria: MetadataFilterExpression, properties: Mdq.MetadataPropertiesExpression ); - } - - /** - * Defines the languages for the labels to be retrieved for metadata items that have labels. - * @param languages An array of LCID number values. - */ - export class LabelQueryExpression - { - constructor( languages: Array ); - } - - /** - * Logical operator. - */ - export enum LogicalOperator - { - And, - Or, - } - - /** - * Specifies the properties for which non-null values are returned from a query. - * @param allProperties Whether to retrieve all the properties of a metadata object. - * @param propertyNames: >An array of strings representing the metadata properties to retrieve. - */ - export class MetadataPropertiesExpression - { - constructor( allProperties: boolean, propertyNames?: Array ); - } - - export enum RelationshipMetadataProperties - { - AssociatedMenuConfiguration, - CascadeConfiguration, - HasChanged, - Entity1AssociatedMenuConfiguration, - Entity1IntersectAttribute, - Entity1LogicalName, - Entity2AssociatedMenuConfiguration, - Entity2IntersectAttribute, - Entity2LogicalName, - IntersectEntityName, - IsCustomizable, - IntroducedVersion, - IsCustomRelationship, - IsManaged, - IsValidForAdvancedFind, - MetadataId, - ReferencedAttribute, - ReferencedEntity, - ReferencingAttribute, - ReferencingEntity, - RelationshipType, - SchemaName, - SecurityTypes, - } - - export enum AttributeMetadataProperties - { - AttributeOf, - AttributeType, - AttributeTypeName, - CalculationOf, - CanBeSecuredForCreate, - CanBeSecuredForRead, - CanBeSecuredForUpdate, - CanModifyAdditionalSettings, - ColumnNumber, - DefaultFormValue, - DefaultValue, - DeprecatedVersion, - Description, - DisplayName, - EntityLogicalName, - Format, - FormatName, - ImeMode, - IntroducedVersion, - IsAuditEnabled, - IsCustomAttribute, - IsCustomizable, - IsManaged, - IsPrimaryId, - IsPrimaryName, - IsRenameable, - IsSecured, - IsValidForAdvancedFind, - IsValidForCreate, - IsValidForRead, - IsValidForUpdate, - LinkedAttributeId, - LogicalName, - MaxLength, - MaxValue, - MetadataId, - MinValue, - OptionSet, - Precision, - PrecisionSource, - RequiredLevel, - SchemaName, - Targets, - YomiOf, - } - - export enum EntityMetadataProperties - { - ActivityTypeMask, - Attributes, - AutoCreateAccessTeams, - AutoRouteToOwnerQueue, - CanBeInManyToMany, - CanBePrimaryEntityInRelationship, - CanBeRelatedEntityInRelationship, - CanCreateAttributes, - CanCreateCharts, - CanCreateForms, - CanCreateViews, - CanModifyAdditionalSettings, - CanTriggerWorkflow, - Description, - DisplayCollectionName, - DisplayName, - IconLargeName, - IconMediumName, - IconSmallName, - IntroducedVersion, - IsActivity, - IsActivityParty, - IsAIRUpdated, - IsAuditEnabled, - IsAvailableOffline, - IsBusinessProcessEnabled, - IsChildEntity, - IsConnectionsEnabled, - IsCustomEntity, - IsCustomizable, - IsDocumentManagementEnabled, - IsDuplicateDetectionEnabled, - IsEnabledForCharts, - IsImportable, - IsIntersect, - IsMailMergeEnabled, - IsManaged, - IsMappable, - IsQuickCreateEnabled, - IsReadingPaneEnabled, - IsRenameable, - IsValidForAdvancedFind, - IsValidForQueue, - IsVisibleInMobile, - IsVisibleInMobileClient, - LogicalName, - ManyToManyRelationships, - ManyToOneRelationships, - MetadataId, - ObjectTypeCode, - OneToManyRelationships, - OwnershipType, - PrimaryIdAttribute, - PrimaryImageAttribute, - PrimaryNameAttribute, - Privileges, - RecurrenceBaseEntityLogicalName, - ReportViewName, - SchemaName, - } - - export enum SearchableEntityMetadataProperties - { - ActivityTypeMask, - AutoCreateAccessTeams, - AutoRouteToOwnerQueue, - CanBeInManyToMany, - CanBePrimaryEntityInRelationship, - CanBeRelatedEntityInRelationship, - CanCreateAttributes, - CanCreateCharts, - CanCreateForms, - CanCreateViews, - CanModifyAdditionalSettings, - CanTriggerWorkflow, - IconLargeName, - IconMediumName, - IconSmallName, - IntroducedVersion, - IsActivity, - IsActivityParty, - IsAIRUpdated, - IsAuditEnabled, - IsAvailableOffline, - IsBusinessProcessEnabled, - IsChildEntity, - IsConnectionsEnabled, - IsCustomEntity, - IsCustomizable, - IsDocumentManagementEnabled, - IsDuplicateDetectionEnabled, - IsEnabledForCharts, - IsImportable, - IsIntersect, - IsMailMergeEnabled, - IsManaged, - IsMappable, - IsQuickCreateEnabled, - IsReadingPaneEnabled, - IsRenameable, - IsValidForAdvancedFind, - IsValidForQueue, - IsVisibleInMobile, - IsVisibleInMobileClient, - LogicalName, - MetadataId, - ObjectTypeCode, - OwnershipType, - PrimaryIdAttribute, - PrimaryImageAttribute, - PrimaryNameAttribute, - RecurrenceBaseEntityLogicalName, - ReportViewName, - SchemaName, - } - - export enum SearchableAttributeMetadataProperties - { - AttributeOf, - AttributeType, - CalculationOf, - CanBeSecuredForCreate, - CanBeSecuredForRead, - CanBeSecuredForUpdate, - CanModifyAdditionalSettings, - ColumnNumber, - DefaultFormValue, - DefaultValue, - DeprecatedVersion, - EntityLogicalName, - Format, - FormatName, - ImeMode, - IntroducedVersion, - IsAuditEnabled, - IsCustomAttribute, - IsCustomizable, - IsManaged, - IsPrimaryId, - IsPrimaryName, - IsRenameable, - IsSecured, - IsValidForAdvancedFind, - IsValidForCreate, - IsValidForRead, - IsValidForUpdate, - LinkedAttributeId, - LogicalName, - MaxLength, - MaxValue, - MetadataId, - MinValue, - Precision, - PrecisionSource, - RequiredLevel, - SchemaName, - YomiOf, - } - - export enum SearchableRelationshipMetadataProperties - { - HasChanged, - Entity1IntersectAttribute, - Entity1LogicalName, - Entity2IntersectAttribute, - Entity2LogicalName, - IntersectEntityName, - IsCustomizable, - IntroducedVersion, - IsCustomRelationship, - IsManaged, - IsValidForAdvancedFind, - MetadataId, - ReferencedAttribute, - ReferencedEntity, - ReferencingAttribute, - ReferencingEntity, - RelationshipType, - SchemaName, - SecurityTypes, - } - - export enum MetadataConditionOperator - { - Equals, - NotEquals, - In, - NotIn, - GreaterThan, - LessThan, - } - - export interface IEntityMetadata - { - ActivityTypeMask: number; - Attributes: IAttributeMetadata[]; - AutoCreateAccessTeams: any; - AutoRouteToOwnerQueue: boolean; - CanBeInManyToMany: ManagedProperty; - CanBePrimaryEntityInRelationship: ManagedProperty; - CanBeRelatedEntityInRelationship: ManagedProperty; - CanCreateAttributes: ManagedProperty; - CanCreateCharts: ManagedProperty; - CanCreateForms: ManagedProperty; - CanCreateViews: ManagedProperty; - CanModifyAdditionalSettings: ManagedProperty; - CanTriggerWorkflow: boolean; - Description: Label; - DisplayCollectionName: Label; - DisplayName: Label; - IconLargeName: string; - IconMediumName: string; - IconSmallName: string; - IntroducedVersion: any; - IsActivity: boolean; - IsActivityParty: boolean; - IsAIRUpdated: boolean; - IsAuditEnabled: ManagedProperty; - IsAvailableOffline: boolean; - IsBusinessProcessEnabled: boolean; - IsChildEntity: boolean; - IsConnectionsEnabled: ManagedProperty; - IsCustomEntity: boolean; - IsCustomizable: ManagedProperty; - IsDocumentManagementEnabled: boolean; - IsDuplicateDetectionEnabled: ManagedProperty; - IsEnabledForCharts: boolean; - IsImportable: boolean; - IsIntersect: boolean; - IsMailMergeEnabled: ManagedProperty; - IsManaged: boolean; - IsMappable: ManagedProperty; - IsQuickCreateEnabled: boolean; - IsReadingPaneEnabled: boolean; - IsRenameable: boolean; - IsValidForAdvancedFind: boolean; - IsValidForQueue: ManagedProperty; - IsVisibleInMobile: ManagedProperty; - IsVisibleInMobileClient: boolean; - LogicalName: string; - ManyToManyRelationships: ManyToManyRelationshipMetadata; - ManyToOneRelationships: OneToManyRelationshipMetadata; - MetadataId: string; - ObjectTypeCode: number; - OneToManyRelationships: OneToManyRelationshipMetadata; - OwnershipType: "BusinessOwned" | "BusinessParented" | "None OrganizationOwned" | "TeamOwned UserOwned"; - PrimaryIdAttribute: string; - PrimaryImageAttribute: string; - PrimaryNameAttribute: string; - Privileges: SecurityPrivilegeMetadata[]; - RecurrenceBaseEntityLogicalName: string; - ReportViewName: string; - SchemaName: string; - } - - export interface SecurityPrivilegeMetadata - { - CanBeBasic: boolean; - CanBeDeep: boolean; - CanBeEntityReference: boolean; - CanBeGlobal: boolean; - CanBeLocal: boolean; - CanBeParentEntityReference: boolean; - ExtensionData: boolean; - Name: string; - PrivilegeId: string; - PrivilegeType: "Append" | "AppendTo" | "Assign" | "Create" | "Delete" | "None" | "Read" | "Share" | "Write"; - } - - export interface OneToManyRelationshipMetadata - { - AssociatedMenuConfiguration: AssociatedMenuConfiguration; - CascadeConfiguration: CascadeConfiguration; - HasChanged: any; - IntroducedVersion: any; - IsCustomizable: ManagedProperty; - IsCustomRelationship: boolean; - IsHierarchical: any; - IsManaged: boolean; - IsValidForAdvancedFind: boolean; - MetadataId: string; - ReferencedAttribute: string; - ReferencedEntity: string; - ReferencingAttribute: string; - ReferencingEntity: string; - RelationshipType: string; - SchemaName: string; - SecurityTypes: any; - } - - export interface CascadeConfiguration - { - Assign: CascadeType; - Delete: CascadeType; - ExtensionData: CascadeType; - Merge: CascadeType; - Reparent: CascadeType; - Share: CascadeType; - Unshare: CascadeType; - } - - export type CascadeType = "Active" | "Cascade" | "NoCascade" | "UserOwned"; - - export interface ManyToManyRelationshipMetadata - { - Entity1AssociatedMenuConfiguration: AssociatedMenuConfiguration; - Entity1IntersectAttribute: string; - Entity1LogicalName: string; - Entity2AssociatedMenuConfiguration: AssociatedMenuConfiguration; - Entity2IntersectAttribute: string; - Entity2LogicalName: string; - HasChanged: boolean; - IntersectEntityName: string; - IntroducedVersion: any; - IsCustomizable: ManagedProperty; - IsCustomRelationship: boolean; - IsManaged: boolean; - IsValidForAdvancedFind: boolean; - MetadataId: string; - RelationshipType: RelationshipType; - SchemaName: string; - SecurityTypes: SecurityType; - } - - export interface AssociatedMenuConfiguration - { - Behavior: AssociatedMenuBehavior; - Group: AssociatedMenuGroup; - Label: Label; - Order: number; - } - - export type AssociatedMenuBehavior = "DoNotDisplay" | "UseCollectionName" | "UseLabel"; - - export type AssociatedMenuGroup = "Details" | "Marketing" | "Sales" | "Service"; - - export type RelationshipType = "Default" | "ManyToManyRelationship" | "OneToManyRelationship"; - - export type SecurityType = "Append" | "Inheritance" | "None" | "ParentChild" | "Pointer"; - - export interface IAttributeMetadata - { - AttributeOf: string; - AttributeType: "Customer" | "DateTime" | "Decimal" | "Double" | "EntityName" | "Integer" | "Lookup" | "ManagedProperty" | "Memo" | "Money" | "Owner" | "PartyList" | "Picklist" | "State" | "Status" | "Uniqueidentifier" | "Virtual" - AttributeTypeName: "BigIntType" | "BooleanType" | "CalendarRulesType" | "CustomerType" | "DateTimeType" | "DecimalType" | "DoubleType" | "EntityNameType" | "ImageType" | "IntegerType" | "LookupType" | "ManagedPropertyType" | "MemoType" | "MoneyType" | "OwnerType" | "PartyListType" | "PicklistType" | "StateType StatusType" | "StringType" | "UniqueidentifierType" | "VirtualType"; - CalculationOf: any; - CanBeSecuredForCreate: boolean; - CanBeSecuredForRead: boolean; - CanBeSecuredForUpdate: boolean; - CanModifyAdditionalSettings: ManagedProperty; - ColumnNumber: number; - DefaultFormValue: any; - DefaultValue: any; - DeprecatedVersion: any; - Description: Label; - DisplayName: Label; - EntityLogicalName: string; - Format: any; - FormatName: string; - ImeMode: any; - IntroducedVersion: any; - IsAuditEnabled: boolean; - IsCustomAttribute: boolean; - IsCustomizable: ManagedProperty; - IsManaged: boolean; - IsPrimaryId: boolean; - IsPrimaryName: boolean; - IsRenameable: ManagedProperty; - IsSecured: boolean; - IsValidForAdvancedFind: ManagedProperty; - IsValidForCreate: boolean; - IsValidForRead: boolean; - IsValidForUpdate: boolean; - LinkedAttributeId: string; - LogicalName: string; - MaxLength: number; - MaxValue: any; - MetadataId: string; - MinValue: number; - OptionSet: any; - Precision: any; - PrecisionSource: any; - RequiredLevel: ManagedProperty; - SchemaName: string; - Targets: string[]; - YomiOf: any; - } - - export interface ManagedProperty - { - CanBeChanged: boolean; - ManagedPropertyLogicalName: string; - Value: T; - } - - export interface Label - { - LocalizedLabels: LocalizedLabel[]; - UserLocalizedLabel: LocalizedLabel; - } - - export interface LocalizedLabel - { - Label: string; - LangaugeCode: number; - MetadataId: string; - HasChanged: boolean; - IsManaged: boolean; - } - - namespace ValueEnums - { - export enum OwnershipType - { - None, - OrganizationOwned, - TeamOwned, - UserOwned, - } - - export enum AttributeTypeCode - { - BigInt, - Boolean, - CalendarRules, - Customer, - DateTime, - Decimal, - Double, - EntityName, - Integer, - Lookup, - ManagedProperty, - Memo, - Money, - Owner, - PartyList, - Picklist, - State, - Status, - String, - Uniqueidentifier, - Virtual, - } - - - export enum AttributeRequiredLevel - { - ApplicationRequired, - None, - Recommended, - SystemRequired, - } - - - export enum DateTimeFormat - { - DateAndTime, - DateOnly, - } - - export enum ImeMode - { - Active, - Auto, - Disabled, - Inactive, - } - - - - export enum IntegerFormat - { - Duration, - Language, - Locale, - None, - TimeZone, - } - - - export enum SecurityTypes - { - Append, - Inheritance, - None, - ParentChild, - Pointer, - } - - export enum StringFormat - { - Email, - PhoneticGuide, - Text, - TextArea, - TickerSymbol, - Url, - VersionNumber, - } - } -} - -declare namespace Sdk.Mdq.ValueEnums -{ } diff --git a/mobservable/index.d.ts b/mobservable/index.d.ts deleted file mode 100644 index 719eddaf31..0000000000 --- a/mobservable/index.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -// Type definitions for mobservable 0.6 -// Project: https://mweststrate.github.io/mobservable -// Definitions by: Michel Weststrate -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Mobservable { - interface Static extends MakeReactive { - /** - * Turns an object, array or function into a reactive structure. - * @param value the value which should become observable. - */ - makeReactive: MakeReactive; - - /** - * Extends an object with reactive capabilities. - * @param target the object to which reactive properties should be added - * @param properties the properties that should be added and made reactive - * @returns targer - */ - extendReactive(target: Object, properties: Object): Object; - - /** - * Returns true if the provided value is reactive. - * @param value object, function or array - * @param propertyName if propertyName is specified, checkes whether value.propertyName is reactive. - */ - isReactive(value: any, propertyName?: string): boolean; - - /** - * Can be used in combination with makeReactive / extendReactive. - * Enforces that a reference to 'value' is stored as property, - * but that 'value' itself is not turned into something reactive. - * Future assignments to the same property will inherit this behavior. - * @param value initial value of the reactive property that is being defined. - */ - asReference(value: any): {value: T}; - - /** - * ES6 / Typescript decorator which can to make class properties and getter functions reactive. - */ - observable(target: Object, key: string): any; // decorator / annotation - - /** - * Creates a reactive view and keeps it alive, so that the view is always - * updated if one of the dependencies changes, even when the view is not further used by something else. - * @param func The reactive view - * @param scope (optional) - * @returns disposer function, which can be used to stop the view from being updated in the future. - */ - observe(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * Deprecated, use mobservable.observe instead. - */ - sideEffect(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * Similar to 'observer', observes the given predicate until it returns true. - * Once it returns true, the 'effect' function is invoked an the observation is cancelled. - * @param predicate - * @param effect - * @param scope (optional) - * @returns disposer function to prematurely end the observer. - */ - observeUntil(predicate: () => boolean, effect: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * During a transaction no views are updated until the end of the transaction. - * The transaction will be run synchronously nonetheless. - * @param action a function that updates some reactive state - * @returns any value that was returned by the 'action' parameter. - */ - transaction(action: () => T): T; - - /** - * Converts a reactive structure into a non-reactive structure. - * Basically a deep-clone. - */ - toJSON(value: T): T; - - /** - * Sets the reporting level Defaults to 1. Use 0 for production or 2 for increased verbosity. - */ - logLevel: number; // 0 = production, 1 = development, 2 = debugging - - extras: { - getDependencyTree(thing: any, property?: string): Mobservable.DependencyTree; - - getObserverTree(thing: any, property?: string): Mobservable.ObserverTree; - - trackTransitions(extensive?: boolean, onReport?: (lines: Mobservable.TransitionEvent) => void): Mobservable.Lambda; - }; - } - - interface MakeReactive { - (value: T[], opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableArray; - (value: () => T, opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableValue; - (value: T, opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableValue; - (value: Object, opts?: Mobservable.MakeReactiveOptions): T; - } - - interface MakeReactiveOptions { - as?: string; /* "auto" | "reference" | TODO: see #8 "structure" */ - scope?: Object; - context?: Object; - recurse?: boolean; - name?: string; - // protected: boolean TODO: see #9 - } - - type ContextInfo = { object: Object; name: string } | string; - - interface Lambda { - (): void; - name?: string; - } - - interface Observable { - observe(callback: (...args: any[]) => void, fireImmediately?: boolean): Lambda; - } - - interface ObservableValue extends Observable { - (): T; - (value: T): void; - observe(callback: (newValue: T, oldValue: T) => void, fireImmediately?: boolean): Lambda; - } - - interface ObservableArray extends Observable, Array { - spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]; - observe(listener: (changeData: ArrayChange|ArraySplice) => void, fireImmediately?: boolean): Lambda; - clear(): T[]; - replace(newItems: T[]): T[]; - find(predicate: (item: T, index: number, array: ObservableArray) => boolean, thisArg?: any, fromIndex?: number): T; - remove(value: T): boolean; - } - - interface ArrayChange { - type: string; // Always: 'update' - object: ObservableArray; - index: number; - oldValue: T; - } - - interface ArraySplice { - type: string; // Always: 'splice' - object: ObservableArray; - index: number; - removed: T[]; - addedCount: number; - } - - interface DependencyTree { - id: number; - name: string; - context: any; - dependencies?: DependencyTree[]; - } - - interface ObserverTree { - id: number; - name: string; - context: any; - observers?: ObserverTree[]; - listeners?: number; // amount of functions manually attached using an .observe method - } - - interface TransitionEvent { - id: number; - name: string; - context: Object; - state: string; - changed: boolean; - newValue: string; - } -} - -declare const Mobservable: Mobservable.Static; -export = Mobservable; diff --git a/mobservable/mobservable-tests.ts b/mobservable/mobservable-tests.ts deleted file mode 100644 index 060f0d14b3..0000000000 --- a/mobservable/mobservable-tests.ts +++ /dev/null @@ -1,56 +0,0 @@ -import mobservable = require('mobservable'); -import {observable} from "mobservable"; - -var v = mobservable(3); -v.observe(() => {}); - -var a = mobservable([1, 2, 3]); - -class Order { - @observable price: number = 3; - @observable amount: number = 2; - @observable orders: string[] = []; - - @observable get total() { - return this.amount * this.price * (1 + this.orders.length); - } -} - -export function testObservable() { - var a = mobservable(3); - var b = mobservable(() => a() * 2); -} - -export function testAnnotations() { - var order1totals: number[] = []; - var order1 = new Order(); - var order2 = new Order(); - - var disposer = mobservable.observe(() => { - order1totals.push(order1.total); - }); - - order2.price = 4; - order1.amount = 1; - - order2.orders.push('bla'); - - order1.orders.splice(0, 0, 'boe', 'hoi'); - - disposer(); - order1.orders.pop(); -}; - -export function testTyping() { - var ar: mobservable.ObservableArray = mobservable.makeReactive([1, 2]); - ar.observe((d: mobservable.ArrayChange | mobservable.ArraySplice) => { - console.log(d.type); - }); - - var ar2: mobservable.ObservableArray = mobservable([1, 2]); - ar2.observe((d: mobservable.ArrayChange | mobservable.ArraySplice) => { - console.log(d.type); - }); - - var x: mobservable.ObservableValue = mobservable(3); -} \ No newline at end of file diff --git a/mobservable/tsconfig.json b/mobservable/tsconfig.json deleted file mode 100644 index cee6db4b01..0000000000 --- a/mobservable/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "experimentalDecorators": true, - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "mobservable-tests.ts" - ] -} \ No newline at end of file diff --git a/mssql/index.d.ts b/mssql/index.d.ts deleted file mode 100644 index 8aaca045e2..0000000000 --- a/mssql/index.d.ts +++ /dev/null @@ -1,278 +0,0 @@ -// Type definitions for mssql 3.3 -// Project: https://www.npmjs.com/package/mssql -// Definitions by: COLSA Corporation , Ben Farr , Vitor Buzinaro , Matt Richardson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - -import events = require('events'); - -type sqlTypeWithNoParams = { type: sqlTypeFactoryWithNoParams } -type sqlTypeWithLength = { type: sqlTypeFactoryWithLength, length: number } -type sqlTypeWithScale = { type: sqlTypeFactoryWithScale, scale: number } -type sqlTypeWithPrecisionScale = { type: sqlTypeFactoryWithPrecisionScale, precision: number, scale: number } -type sqlTypeWithTvpType = { type: sqlTypeFactoryWithTvpType, tvpType: any } - -type sqlTypeFactoryWithNoParams = () => sqlTypeWithNoParams; -type sqlTypeFactoryWithLength = (length?: number) => sqlTypeWithLength; -type sqlTypeFactoryWithScale = (scale?: number) => sqlTypeWithScale; -type sqlTypeFactoryWithPrecisionScale = (precision?: number, scale?: number) => sqlTypeWithPrecisionScale; -type sqlTypeFactoryWithTvpType = (tvpType: any) => sqlTypeWithTvpType; - -export declare var VarChar: sqlTypeFactoryWithLength; -export declare var NVarChar: sqlTypeFactoryWithLength; -export declare var Text: sqlTypeFactoryWithNoParams; -export declare var Int: sqlTypeFactoryWithNoParams; -export declare var BigInt: sqlTypeFactoryWithNoParams; -export declare var TinyInt: sqlTypeFactoryWithNoParams; -export declare var SmallInt: sqlTypeFactoryWithNoParams; -export declare var Bit: sqlTypeFactoryWithNoParams; -export declare var Float: sqlTypeFactoryWithNoParams; -export declare var Numeric: sqlTypeFactoryWithPrecisionScale; -export declare var Decimal: sqlTypeFactoryWithPrecisionScale; -export declare var Real: sqlTypeFactoryWithNoParams; -export declare var Date: sqlTypeFactoryWithNoParams; -export declare var DateTime: sqlTypeFactoryWithNoParams; -export declare var DateTime2: sqlTypeFactoryWithScale; -export declare var DateTimeOffset: sqlTypeFactoryWithScale; -export declare var SmallDateTime: sqlTypeFactoryWithNoParams; -export declare var Time: sqlTypeFactoryWithScale; -export declare var UniqueIdentifier: sqlTypeFactoryWithNoParams; -export declare var SmallMoney: sqlTypeFactoryWithNoParams; -export declare var Money: sqlTypeFactoryWithNoParams; -export declare var Binary: sqlTypeFactoryWithNoParams; -export declare var VarBinary: sqlTypeFactoryWithLength; -export declare var Image: sqlTypeFactoryWithNoParams; -export declare var Xml: sqlTypeFactoryWithNoParams; -export declare var Char: sqlTypeFactoryWithLength; -export declare var NChar: sqlTypeFactoryWithLength; -export declare var NText: sqlTypeFactoryWithNoParams; -export declare var TVP: sqlTypeFactoryWithTvpType; -export declare var UDT: sqlTypeFactoryWithNoParams; -export declare var Geography: sqlTypeFactoryWithNoParams; -export declare var Geometry: sqlTypeFactoryWithNoParams; - -export declare var TYPES: { - VarChar: sqlTypeFactoryWithLength; - NVarChar: sqlTypeFactoryWithLength; - Text: sqlTypeFactoryWithNoParams; - Int: sqlTypeFactoryWithNoParams; - BigInt: sqlTypeFactoryWithNoParams; - TinyInt: sqlTypeFactoryWithNoParams; - SmallInt: sqlTypeFactoryWithNoParams; - Bit: sqlTypeFactoryWithNoParams; - Float: sqlTypeFactoryWithNoParams; - Numeric: sqlTypeFactoryWithPrecisionScale; - Decimal: sqlTypeFactoryWithPrecisionScale; - Real: sqlTypeFactoryWithNoParams; - Date: sqlTypeFactoryWithNoParams; - DateTime: sqlTypeFactoryWithNoParams; - DateTime2: sqlTypeFactoryWithScale; - DateTimeOffset: sqlTypeFactoryWithScale; - SmallDateTime: sqlTypeFactoryWithNoParams; - Time: sqlTypeFactoryWithScale; - UniqueIdentifier: sqlTypeFactoryWithNoParams; - SmallMoney: sqlTypeFactoryWithNoParams; - Money: sqlTypeFactoryWithNoParams; - Binary: sqlTypeFactoryWithNoParams; - VarBinary: sqlTypeFactoryWithLength; - Image: sqlTypeFactoryWithNoParams; - Xml: sqlTypeFactoryWithNoParams; - Char: sqlTypeFactoryWithLength; - NChar: sqlTypeFactoryWithLength; - NText: sqlTypeFactoryWithNoParams; - TVP: sqlTypeFactoryWithTvpType; - UDT: sqlTypeFactoryWithNoParams; - Geography: sqlTypeFactoryWithNoParams; - Geometry: sqlTypeFactoryWithNoParams; -}; - -export declare var MAX: number; -export declare var fix: boolean; -export declare var Promise: any; - - -interface IMap extends Array<{ js: any, sql: any }> { - register(jstype: any, sql: any): void; -} - -export declare var map: IMap; - -export declare var DRIVERS: string[]; - -type recordSet = any; -type IIsolationLevel = number; - -export declare var ISOLATION_LEVEL: { - READ_UNCOMMITTED: IIsolationLevel - READ_COMMITTED: IIsolationLevel - REPEATABLE_READ: IIsolationLevel - SERIALIZABLE: IIsolationLevel - SNAPSHOT: IIsolationLevel -} - -export interface IOptions { - encrypt?: boolean; - instanceName?: string; - useUTC?: boolean; - tdsVersion?: string; - appName?: string; - abortTransactionOnError?: boolean; - trustedConnection?: boolean; -} - - -export interface IPool { - min: number; - max: number; - idleTimeoutMillis: number; -} - -export declare var pool: IPool; - -export interface config { - driver?: string; - user?: string; - password?: string; - server: string; - port?: number; - domain?: string; - database: string; - connectionTimeout?: number; - requestTimeout?: number; - stream?: boolean; - options?: IOptions; - pool?: IPool; -} - -export declare class Connection extends events.EventEmitter { - public connected: boolean; - public connecting: boolean; - public driver: string; - public constructor(config: config, callback?: (err?: any) => void); - public connect(): Promise; - public connect(callback: (err: any) => void): void; - public close(): Promise; - public close(callback: (err: any) => void): void; -} - -export declare class ConnectionError implements Error { - constructor(message: string, code?: any) - public name: string; - public message: string; - public code: string; -} - -declare class columns { - public add(name: string, type: any, options: any): void; -} - -declare class rows { - public add(...row: any[]): void; -} - -export declare class Table { - public create: boolean; - public columns: columns; - public rows: rows; - public constructor(tableName: string); -} - -interface IRequestParameters { - [name: string]: { - name: string; - type: any; - io: number; - value: any; - length: number; - scale: number; - precision: number; - tvpType: any; - } -} - -export declare class Request extends events.EventEmitter { - public connection: Connection; - public transaction: Transaction; - public pstatement: PreparedStatement; - public parameters: IRequestParameters; - public verbose: boolean; - public multiple: boolean; - public canceled: boolean; - public stream: any; - public constructor(connection?: Connection); - public constructor(transaction: Transaction); - public constructor(preparedStatement: PreparedStatement); - public execute(procedure: string): Promise; - public execute(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any, rowsAffected?: number) => void): void; - public input(name: string, value: any): void; - public input(name: string, type: any, value: any): void; - public output(name: string, type: any, value?: any): void; - public pipe(stream: NodeJS.WritableStream): void; - public query(command: string): Promise; - public query(command: string): Promise; - public query(command: string, callback: (err?: any, recordset?: any, rowsAffected?: number) => void): void; - public query(command: string, callback: (err?: any, recordset?: Entity[]) => void): void; - public batch(batch: string): Promise; - public batch(batch: string): Promise; - public batch(batch: string, callback: (err?: any, recordset?: any) => void): void; - public batch(batch: string, callback: (err?: any, recordset?: Entity[]) => void): void; - public bulk(table: Table): Promise; - public bulk(table: Table, callback: (err: any, rowCount: any) => void): void; - public cancel(): void; -} - -export declare class RequestError implements Error { - constructor(message: string, code?: any) - public name: string; - public message: string; - public code: string; -} - -export declare class Transaction extends events.EventEmitter { - public connection: Connection; - public isolationLevel: IIsolationLevel; - public constructor(connection?: Connection); - public begin(isolationLevel?: IIsolationLevel): Promise; - public begin(isolationLevel?: IIsolationLevel, callback?: (err?: any) => void): void; - public commit(): Promise; - public commit(callback: (err?: any) => void): void; - public rollback(): Promise; - public rollback(callback: (err?: any) => void): void; -} - -export declare class TransactionError implements Error { - constructor(message: string, code?: any) - public name: string; - public message: string; - public code: string; -} - -export declare class PreparedStatement extends events.EventEmitter { - public connection: Connection; - public transaction: Transaction; - public prepared: boolean; - public statement: string; - public parameters: IRequestParameters; - public multiple: boolean; - public stream: any; - public constructor(connection?: Connection); - public input(name: string, type: any): void; - public output(name: string, type: any): void; - public prepare(statement?: string): Promise; - public prepare(statement?: string, callback?: (err?: any) => void): void; - public execute(values: Object): Promise; - public execute(values: Object): Promise; - public execute(values: Object, callback: (err: any, recordSet: recordSet, rowsAffected: number) => void): void; - public execute(values: Object, callback: (err: any, recordSet: Entity[]) => void): void; - public unprepare(): Promise; - public unprepare(callback: (err?: any) => void): void; -} - -export declare class PreparedStatementError implements Error { - constructor(message: string, code?: any) - public name: string; - public message: string; - public code: string; -} diff --git a/navigation/index.d.ts b/navigation/index.d.ts deleted file mode 100644 index 953255f8eb..0000000000 --- a/navigation/index.d.ts +++ /dev/null @@ -1,603 +0,0 @@ -// Type definitions for Navigation 2.0.0 -// Project: http://grahammendick.github.io/navigation/ -// Definitions by: Graham Mendick -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export = Navigation; - -declare namespace Navigation { - /** - * Defines a contract a class must implement in order to configure a State - */ - interface StateInfo { - /** - * Gets the unique key - */ - key: string; - /** - * Gets the default NavigationData for this State - */ - defaults?: any; - /** - * Gets the default NavigationData Types for this State - */ - defaultTypes?: any; - /** - * Gets the textual description of the state - */ - title?: string; - /** - * Gets the route Url patterns - */ - route?: string | string[]; - /** - * Gets a value that indicates whether to maintain the crumb trail - */ - trackCrumbTrail?: boolean | string; - /** - * Gets a value that indicates whether NavigationData Types are - * preserved when navigating - */ - trackTypes?: boolean; - /** - * Gets the additional state attributes - */ - [extras: string]: any; - } - - /** - * Represents a view and is the destination of a navigation - */ - class State implements StateInfo { - /** - * Gets the unique key - */ - key: string; - /** - * Gets the default NavigationData for this State - */ - defaults: any; - /** - * Gets the default NavigationData Types for this State - */ - defaultTypes: any; - /** - * Gets the formatted default NavigationData for this State - */ - formattedDefaults: any; - /** - * Gets the formatted default array NavigationData for this State - */ - formattedArrayDefaults: { [index: string]: string[]; }; - /** - * Gets the textual description of the state - */ - title: string; - /** - * Gets the route Url patterns - */ - route: string | string[]; - /** - * Gets a value that indicates whether to maintain the crumb trail - */ - trackCrumbTrail: boolean; - /** - * Gets the crumb trail key - */ - crumbTrailKey: string; - /** - * Gets a value that indicates whether NavigationData Types are - * preserved when navigating - */ - trackTypes: boolean; - /** - * Gets the additional state attributes - */ - [extras: string]: any; - /** - * Called on the old State before navigating to a different State - * @param state The new State - * @param data The new NavigationData - * @param url The new target location - * @param unload The function to call to continue to navigate - * @param history A value indicating whether browser history was used - */ - unloading: (state: State, data: any, url: string, unload: () => void, history?: boolean) => void; - /** - * Called on the old State after navigating to a different State - */ - dispose: () => void; - /** - * Called on the current State after navigating to it - * @param data The current NavigationData - * @param asyncData The data passed asynchronously while navigating - */ - navigated: (data: any, asyncData: any) => void; - /** - * Called on the new State before navigating to it - * @param data The new NavigationData - * @param url The new target location - * @param navigate The function to call to continue to navigate - * @param history A value indicating whether browser history was used - */ - navigating: (data: any, url: string, navigate: (asyncData?: any) => void, history: boolean) => void; - /** - * Encodes the Url value - * @param state The State navigated to - * @param key The key of the navigation data item - * @param val The Url value of the navigation data item - * @param queryString A value indicating the Url value's location - */ - urlEncode(state: State, key: string, val: string, queryString: boolean): string; - /** - * Decodes the Url value - * @param state The State navigated to - * @param key The key of the navigation data item - * @param val The Url value of the navigation data item - * @param queryString A value indicating the Url value's location - */ - urlDecode(state: State, key: string, val: string, queryString: boolean): string; - /** - * Validates the NavigationData before navigating to the new State - * @param data The new NavigationData - * @returns Validation success indicator - */ - validate(data: any): boolean; - /** - * Truncates the crumb trail whenever a repeated or initial State is - * encountered - * @param The State navigated to - * @param The Crumb collection representing the crumb trail - * @returns Truncated crumb trail - */ - truncateCrumbTrail(state: State, crumbs: Crumb[]): Crumb[]; - } - - /** - * Defines a contract a class must implement in order to manage the browser - * Url - */ - interface HistoryManager { - /** - * Gets or sets a value indicating whether to disable browser history - */ - disabled: boolean; - /** - * Registers browser history event listeners - * @param navigateHistory The history navigation event handler - */ - init(navigateHistory: () => void): void; - /** - * Adds browser history - * @param url The current url - * @param replace A value indicating whether to replace the current - * browser history entry - */ - addHistory(url: string, replace: boolean): void; - /** - * Gets the current location - */ - getCurrentUrl(): string; - /** - * Gets an Href from the url - */ - getHref(url: string): string; - /** - * Gets a Url from the anchor or location - */ - getUrl(hrefElement: HTMLAnchorElement | Location): string; - /** - * Removes browser history event listeners - */ - stop(): void; - } - - /** - * Manages history using the browser Url's hash. If used in a browser - * without the hashchange event or outside of a browser environment, then - * history is disabled - */ - class HashHistoryManager implements HistoryManager { - /** - * Gets or sets a value indicating whether to disable browser history. - * Set to true if used in a browser without the hashchange event or - * outside of a browser environment - */ - disabled: boolean; - /** - * Initializes a new instance of the HashHistoryManager class - */ - constructor(); - /** - * Initializes a new instance of the HashHistoryManager class - * @param replaceQueryIdentifier a value indicating whether to use '#' - * in place of '?'. Set to true for Internet explorer 6 and 7 support - */ - constructor(replaceQueryIdentifier: boolean); - /** - * Registers a listener for the hashchange event - * @param navigateHistory The history navigation event handler - */ - init(navigateHistory: any): void; - /** - * Sets the browser Url's hash to the url - * @param url The current url - * @param replace A value indicating whether to replace the current - * browser history entry - */ - addHistory(url: string, replace: boolean): void; - /** - * Gets the current location - */ - getCurrentUrl(): string; - /** - * Gets an Href from the url - */ - getHref(url: string): string; - /** - * Gets a Url from the anchor or location - */ - getUrl(hrefElement: HTMLAnchorElement | Location): string; - /** - * Removes a listener for the hashchange event - */ - stop(): void; - } - - /** - * Manages history using the HTML5 history api. If used in a browser - * without the HTML5 history api or outside of a browser environment, then - * history is disabled - */ - class HTML5HistoryManager implements HistoryManager { - /** - * Gets or sets a value indicating whether to disable browser history. - * Set to true if used in a browser without the HTML5 history api or - * outside of a browser environment - */ - disabled: boolean; - /** - * Initializes a new instance of the HTML5HistoryManager class - */ - constructor(); - /** - * Initializes a new instance of the HTML5HistoryManager class - * @param applicationPath The application path - */ - constructor(applicationPath: string); - /** - * Registers a listener for the popstate event - * @param navigateHistory The history navigation event handler - */ - init(navigateHistory: () => void): void; - /** - * Sets the browser Url to the url using pushState - * @param url The current url - * @param replace A value indicating whether to replace the current - * browser history entry - */ - addHistory(url: string, replace: boolean): void; - /** - * Gets the current location - */ - getCurrentUrl(): string; - /** - * Gets an Href from the url - */ - getHref(url: string): string; - /** - * Gets a Url from the anchor or location - */ - getUrl(hrefElement: HTMLAnchorElement | Location): string; - /** - * Removes a listener for the popstate event - */ - stop(): void; - } - - /** - * Represents one piece of the crumb trail and holds the information need - * to return to and recreate the State as previously visited - */ - class Crumb { - /** - * Gets the Context Data held at the time of navigating away from this - * State - */ - data: any; - /** - * Gets the configuration information associated with this navigation - */ - state: State; - /** - * Gets a value indicating whether the Crumb is the last in the crumb - * trail - */ - last: boolean; - /** - * Gets the State Title - */ - title: string; - /** - * Gets the link navigation to return to the State and pass the - * associated Data - */ - url: string; - /** - * Gets the link navigation without crumb trail to return to the State - * and pass the associated Data - */ - crumblessUrl: string; - /** - * Initializes a new instance of the Crumb class - * @param data The Context Data held at the time of navigating away - * from this State - * @param state The configuration information associated with this - * navigation - * @param link The link navigation to return to the State and pass the - * associated Data - * @param crumblessLink The link navigation without crumb trail to - * return to the State and pass the associated Data - * @param last A value indicating whether the Crumb is the last in the - * crumb trail - */ - constructor(data: any, state: State, link: string, crumblessLink: string, last: boolean); - } - - /** - * Provides properties for accessing context sensitive navigation - * information. Holds the current State and NavigationData - */ - class StateContext { - /** - * Gets the last State displayed before the current State - */ - oldState: State; - /** - * Gets the NavigationData for the last displayed State - */ - oldData: any; - /** - * Gets the State of the last Crumb in the crumb trail - */ - previousState: State; - /** - * Gets the NavigationData of the last Crumb in the crumb trail - */ - previousData: any; - /** - * Gets the current State - */ - state: State; - /** - * Gets the NavigationData for the current State - */ - data: any; - /** - * Gets the current Url - */ - url: string; - /** - * Gets or sets the current title - */ - title: string; - /** - * Gets a Crumb collection representing the crumb trail, ordered oldest - * Crumb first - */ - crumbs: Crumb[]; - /** - * Gets the next crumb - */ - nextCrumb: Crumb; - /** - * Clears the Context Data - */ - clear(): void; - /** - * Combines the data with all the current NavigationData - * @param The data to add to the current NavigationData - * @returns The combined data - */ - includeCurrentData(data: any): any; - /** - * Combines the data with a subset of the current NavigationData - * @param The data to add to the current NavigationData - * @returns The combined data - */ - includeCurrentData(data: any, keys: string[]): any; - } - - /** - * Manages all navigation. These can be forward, backward or refreshing the - * current State - */ - class StateNavigator { - /** - * Provides access to context sensitive navigation information - */ - stateContext: StateContext; - /** - * Gets the browser Url manager - */ - historyManager: HistoryManager; - /** - * Gets a list of States - */ - states: { [index: string]: State; }; - /** - * Initializes a new instance of the StateNavigator class - */ - constructor(); - /** - * Initializes a new instance of the StateNavigator class - * @param states A collection of States - */ - constructor(states: StateInfo[]); - /** - * Initializes a new instance of the StateNavigator class - * @param states A collection of States - * @param historyManager The manager of the browser Url - */ - constructor(states: StateInfo[], historyManager: HistoryManager); - /** - * Configures the StateNavigator - * @param stateInfos A collection of State Infos - */ - configure(stateInfos: StateInfo[]): void; - /** - * Configures the StateNavigator - * @param stateInfos A collection of State Infos - * @param historyManager The manager of the browser Url - */ - configure(stateInfos: StateInfo[], historyManager: HistoryManager): void; - /** - * Registers a navigate event listener - * @param handler The navigate event listener - */ - onNavigate(handler: (oldState: State, state: State, data: any, asyncData: any) => void): void; - /** - * Unregisters a navigate event listener - * @param handler The navigate event listener - */ - offNavigate(handler: (oldState: State, state: State, data: any, asyncData: any) => void): void; - /** - * Navigates to a State - * @param stateKey The key of a State - * @throws state does not match the key of a State or there is - * NavigationData that cannot be converted to a String - * @throws A mandatory route parameter has not been supplied a value - */ - navigate(stateKey: string): void; - /** - * Navigates to a State - * @param stateKey The key of a State - * @param navigationData The NavigationData to be passed to the next - * State and stored in the StateContext - * @throws state does not match the key of a State or there is - * NavigationData that cannot be converted to a String - * @throws A mandatory route parameter has not been supplied a value - */ - navigate(stateKey: string, navigationData: any): void; - /** - * Navigates to a State - * @param stateKey The key of a State - * @param navigationData The NavigationData to be passed to the next - * State and stored in the StateContext - * @param A value determining the effect on browser history - * @throws state does not match the key of a State or there is - * NavigationData that cannot be converted to a String - * @throws A mandatory route parameter has not been supplied a value - */ - navigate(stateKey: string, navigationData: any, historyAction: 'add' | 'replace' | 'none'): void; - /** - * Gets a Url to navigate to a State - * @param stateKey The key of a State - * @returns Url that will navigate to State specified in the action - * @throws state does not match the key of a State or there is - * NavigationData that cannot be converted to a String - */ - getNavigationLink(stateKey: string): string; - /** - * Gets a Url to navigate to a State - * @param stateKey The key of a State - * @param navigationData The NavigationData to be passed to the next - * State and stored in the StateContext - * @returns Url that will navigate to State specified in the action - * @throws state does not match the key of a State or there is - * NavigationData that cannot be converted to a String - */ - getNavigationLink(stateKey: string, navigationData: any): string; - /** - * Determines if the distance specified is within the bounds of the - * crumb trail represented by the Crumbs collection - */ - canNavigateBack(distance: number): boolean; - /** - * Navigates back along the crumb trail - * @param distance Starting at 1, the number of Crumb steps to go back - * @throws canNavigateBack returns false for this distance - * @throws A mandatory route parameter has not been supplied a value - */ - navigateBack(distance: number): void; - /** - * Navigates back along the crumb trail - * @param distance Starting at 1, the number of Crumb steps to go back - * @param A value determining the effect on browser history - * @throws canNavigateBack returns false for this distance - * @throws A mandatory route parameter has not been supplied a value - */ - navigateBack(distance: number, historyAction: 'add' | 'replace' | 'none'): void; - /** - * Gets a Url to navigate back along the crumb trail - * @param distance Starting at 1, the number of Crumb steps to go back - * @throws canNavigateBack returns false for this distance - */ - getNavigationBackLink(distance: number): string; - /** - * Navigates to the current State passing no NavigationData - * @throws A mandatory route parameter has not been supplied a value - */ - refresh(): void; - /** - * Navigates to the current State - * @param navigationData The NavigationData to be passed to the current - * State and stored in the StateContext - * @throws There is NavigationData that cannot be converted to a String - * @throws A mandatory route parameter has not been supplied a value - */ - refresh(navigationData: any): void; - /** - * Navigates to the current State - * @param navigationData The NavigationData to be passed to the current - * State and stored in the StateContext - * @param A value determining the effect on browser history - * @throws There is NavigationData that cannot be converted to a String - * @throws A mandatory route parameter has not been supplied a value - */ - refresh(navigationData: any, historyAction: 'add' | 'replace' | 'none'): void; - /** - * Gets a Url to navigate to the current State - */ - getRefreshLink(): string; - /** - * Gets a Url to navigate to the current State - * @param navigationData The NavigationData to be passed to the current - * State and stored in the StateContext - * @returns Url that will navigate to the current State - * @throws There is NavigationData that cannot be converted to a String - */ - getRefreshLink(navigationData: any): string; - /** - * Navigates to the url - * @param url The target location - */ - navigateLink(url: string): void; - /** - * Navigates to the url - * @param url The target location - * @param A value determining the effect on browser history - */ - navigateLink(url: string, historyAction: 'add' | 'replace' | 'none'): void; - /** - * Navigates to the url - * @param url The target location - * @param A value determining the effect on browser history - * @param history A value indicating whether browser history was used - */ - navigateLink(url: string, historyAction: 'add' | 'replace' | 'none', history: boolean): void; - /** - * Parses the url out into State and Navigation Data - * @param url The url to parse - */ - parseLink(url: string): { state: State; data: any; }; - /** - * Navigates to the current location - */ - start(): void; - /** - * Navigates to the passed in url - * @param url The url to navigate to - */ - start(url: string): void; - } -} diff --git a/navigation/navigation-tests.ts b/navigation/navigation-tests.ts deleted file mode 100644 index bec19b7f62..0000000000 --- a/navigation/navigation-tests.ts +++ /dev/null @@ -1,91 +0,0 @@ -import Navigation = require("navigation"); - - -namespace NavigationTests { - // History Manager - class LogHistoryManager extends Navigation.HashHistoryManager { - addHistory(url: string) { - console.log('add history'); - super.addHistory(url, false); - } - } - - // Configuration - var config = [ - { key: 'people', route: ['people/{page}', 'people/{page}/sort/{sort}'], defaults: { page: 1 }, help: 'people.htm' }, - { key: 'person', route: 'person/{id}', trackTypes: false, defaultTypes: { id: 'number' }, trackCrumbTrail: true } - ]; - var stateNavigator = new Navigation.StateNavigator(config); - stateNavigator.configure(config, new LogHistoryManager()); - - // States - var states = stateNavigator.states; - var people = states['people']; - var person = states['person']; - var help = people['help']; - var pageDefault = people.defaults.page; - var idDefaultType = person.defaultTypes.id; - - // State Controller - people.dispose = () => {}; - people.navigating = (data, url, navigate) => { - navigate([]); - }; - people.navigated = (data, asyncData) => {}; - person.navigating = (data, url, navigate) => { - navigate(); - }; - person.navigated = (data) => {}; - person.urlEncode = function urlEncode(state: Navigation.State, key: string, val: string, queryString: boolean): string { - return queryString ? val.replace(/\s/g, '+') : encodeURIComponent(val); - }; - person.urlDecode = function urlDecode(state: Navigation.State, key: string, val: string, queryString: boolean): string { - return queryString ? val.replace(/\+/g, ' ') : decodeURIComponent(val); - }; - person.validate = (data: any) => data.id > 0; - - // Navigation Event - var navigationListener = (oldState: Navigation.State, state: Navigation.State, data: any, asyncData: any) => { - stateNavigator.offNavigate(navigationListener); - }; - stateNavigator.onNavigate(navigationListener); - - // Navigation - stateNavigator.navigate('people'); - stateNavigator.navigate('people', null, 'add'); - stateNavigator.refresh(); - stateNavigator.refresh({ page: 3 }); - stateNavigator.refresh({ page: 2 }, 'replace'); - stateNavigator.navigate('person', { id: 10 }); - var canGoBack: boolean = stateNavigator.canNavigateBack(1); - stateNavigator.navigateBack(1); - stateNavigator.stateContext.clear(); - - // Navigation Link - var link = stateNavigator.getNavigationLink('people'); - link = stateNavigator.getRefreshLink(); - link = stateNavigator.getRefreshLink({ page: 2 }); - stateNavigator.navigateLink(link); - link = stateNavigator.getNavigationLink('person', { id: 10 }); - stateNavigator.navigateLink(link, 'replace'); - link = stateNavigator.getNavigationBackLink(1); - var crumb = stateNavigator.stateContext.crumbs[0]; - link = crumb.url; - stateNavigator.navigateLink(link, 'none', true); - - // State Context - var state: Navigation.State = stateNavigator.stateContext.state; - var url: string = stateNavigator.stateContext.url; - var title: string = stateNavigator.stateContext.title; - var page: number = stateNavigator.stateContext.data.page; - state = stateNavigator.stateContext.oldState; - page = stateNavigator.stateContext.oldData.page; - state = stateNavigator.stateContext.previousState; - page = stateNavigator.stateContext.previousData.page; - - // Navigation Data - var data = stateNavigator.stateContext.includeCurrentData({ sort: 'name' }, ['page']); - stateNavigator.refresh(data); - var data = stateNavigator.stateContext.includeCurrentData({ pageSize: 10 }); - stateNavigator.refresh(data); -} diff --git a/nedb/index.d.ts b/nedb/index.d.ts deleted file mode 100644 index 23519d3579..0000000000 --- a/nedb/index.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -// Type definitions for NeDB -// Project: https://github.com/louischatriot/nedb -// Definitions by: Stefan Steinhart -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = NeDBDataStore; -export as namespace Nedb; - -declare namespace NeDBDataStore { } -declare class NeDBDataStore { - constructor(); - constructor(path:string); - constructor(options:NeDB.DataStoreOptions); - - persistence:NeDB.Persistence; - - /** - * Load the database from the datafile, and trigger the execution of buffered commands if any - */ - loadDatabase(cb?:(err:Error)=>void):void; - - /** - * Get an array of all the data in the database - */ - getAllData():Array; - - - /** - * Reset all currently defined indexes - */ - resetIndexes(newData:any):void; - - /** - * Ensure an index is kept for this field. Same parameters as lib/indexes - * For now this function is synchronous, we need to test how much time it takes - * We use an async API for consistency with the rest of the code - * @param {String} options.fieldName - * @param {Boolean} options.unique - * @param {Boolean} options.sparse - * @param {Function} cb Optional callback, signature: err - */ - ensureIndex(options:NeDB.EnsureIndexOptions, cb?:(err:Error)=>void):void; - - /** - * Remove an index - * @param {String} fieldName - * @param {Function} cb Optional callback, signature: err - */ - removeIndex(fieldName:string, cb?:(err:Error)=>void):void; - - /** - * Add one or several document(s) to all indexes - */ - addToIndexes(doc:T):void; - addToIndexes(doc:Array):void; - - /** - * Remove one or several document(s) from all indexes - */ - removeFromIndexes(doc:T):void; - removeFromIndexes(doc:Array):void; - - /** - * Update one or several documents in all indexes - * To update multiple documents, oldDoc must be an array of { oldDoc, newDoc } pairs - * If one update violates a constraint, all changes are rolled back - */ - updateIndexes(oldDoc:T, newDoc:T):void; - updateIndexes(updates:Array<{oldDoc:T; newDoc:T;}>):void; - - /** - * Return the list of candidates for a given query - * Crude implementation for now, we return the candidates given by the first usable index if any - * We try the following query types, in this order: basic match, $in match, comparison match - * One way to make it better would be to enable the use of multiple indexes if the first usable index - * returns too much data. I may do it in the future. - * - * TODO: needs to be moved to the Cursor module - */ - getCandidates(query:any):void; - - /** - * Insert a new document - * @param {Function} cb Optional callback, signature: err, insertedDoc - */ - insert(newDoc:T, cb?:(err:Error, document:T)=>void):void; - - /** - * Count all documents matching the query - * @param {any} query MongoDB-style query - */ - count(query:any, callback:(err:Error, n:number)=>void):void; - count(query:any):NeDB.CursorCount; - - /** - * Find all documents matching the query - * If no callback is passed, we return the cursor so that user can limit, skip and finally exec - * @param {any} query MongoDB-style query - * @param {any} projection MongoDB-style projection - */ - find(query:any, projection:T, callback:(err:Error, documents:Array)=>void):void; - find(query:any, projection:T):NeDB.Cursor; - - /** - * Find all documents matching the query - * If no callback is passed, we return the cursor so that user can limit, skip and finally exec - * * @param {any} query MongoDB-style query - */ - find(query:any, callback:(err:Error, documents:Array)=>void):void; - find(query:any):NeDB.Cursor; - - /** - * Find one document matching the query - * @param {any} query MongoDB-style query - * @param {any} projection MongoDB-style projection - */ - findOne(query:any, projection:T, callback:(err:Error, document:T)=>void):void; - - /** - * Find one document matching the query - * @param {any} query MongoDB-style query - */ - findOne(query:any, callback:(err:Error, document:T)=>void):void; - - /** - * Update all docs matching query v1.7.4 and prior signature. - * For now, very naive implementation (recalculating the whole database) - * @param {any} query - * @param {any} updateQuery - * @param {Object} options Optional options - * options.multi If true, can update multiple documents (defaults to false) - * options.upsert If true, document is inserted if the query doesn't match anything - * @param {Function} cb Optional callback, signature: err, - * numReplaced, - * upsert (set to true if the update was in fact an upsert) - * - * @api private Use Datastore.update which has the same signature - */ - update(query:any, updateQuery:any, options?:NeDB.UpdateOptions, cb?:(err:Error, numberOfUpdated:number, upsert:boolean)=>void):void; - /** - * Update all docs matching query v1.8 signature. - * For now, very naive implementation (recalculating the whole database) - * @param {any} query - * @param {any} updateQuery - * @param {Object} options Optional options - * options.multi If true, can update multiple documents (defaults to false) - * options.upsert If true, document is inserted if the query doesn't match anything - * @param {Function} cb Optional callback, signature: err, - * numAffected, - * affectedDocuments (when returnUpdatedDocs is set to true), obj or array - * upsert (set to true if the update was in fact an upsert) - * - * @api private Use Datastore.update which has the same signature - */ - update(query:any, updateQuery:any, options?:NeDB.UpdateOptions, cb?:(err:Error, numberOfUpdated:number, affectedDocuments:any, upsert:boolean)=>void):void; - - /** - * Remove all docs matching the query - * For now very naive implementation (similar to update) - * @param {Object} query - * @param {Object} options Optional options - * options.multi If true, can update multiple documents (defaults to false) - * @param {Function} cb Optional callback, signature: err, numRemoved - * - * @api private Use Datastore.remove which has the same signature - */ - remove(query:any, options:NeDB.RemoveOptions, cb?:(err:Error, n:number)=>void):void; - remove(query:any, cb?:(err:Error, n:number)=>void):void; -} - -declare namespace NeDB { - interface Cursor { - sort(query:any):Cursor; - skip(n:number):Cursor; - limit(n:number):Cursor; - projection(query:any):Cursor; - exec(callback:(err:Error, documents:Array)=>void):void; - } - - interface CursorCount { - exec(callback:(err:Error, count:number)=>void):void; - } - - interface DataStoreOptions { - filename?:string // Optional, datastore will be in-memory only if not provided - inMemoryOnly?:boolean // Optional, default to false - nodeWebkitAppName?:boolean // Optional, specify the name of your NW app if you want options.filename to be relative to the directory where - autoload?:boolean // Optional, defaults to false - onload?:(error:Error)=>any // Optional, if autoload is used this will be called after the load database with the error object as parameter. If you don't pass it the error will be thrown - afterSerialization?:(line:string)=>string; // (optional): hook you can use to transform data after it was serialized and before it is written to disk. Can be used for example to encrypt data before writing database to disk. This function takes a string as parameter (one line of an NeDB data file) and outputs the transformed string, which must absolutely not contain a \n character (or data will be lost) - beforeDeserialization?:(line:string)=>string; // (optional): reverse of afterSerialization. Make sure to include both and not just one or you risk data loss. For the same reason, make sure both functions are inverses of one another. Some failsafe mechanisms are in place to prevent data loss if you misuse the serialization hooks: NeDB checks that never one is declared without the other, and checks that they are reverse of one another by testing on random strings of various lengths. In addition, if too much data is detected as corrupt, NeDB will refuse to start as it could mean you're not using the deserialization hook corresponding to the serialization hook used before (see below) - corruptAlertThreshold?:number; // (optional): between 0 and 1, defaults to 10%. NeDB will refuse to start if more than this percentage of the datafile is corrupt. 0 means you don't tolerate any corruption, 1 means you don't care - } - - /** - * multi (defaults to false) which allows the modification of several documents if set to true - * upsert (defaults to false) if you want to insert a new document corresponding to the update rules if your query doesn't match anything - */ - interface UpdateOptions { - multi?: boolean; - upsert?: boolean; - returnUpdatedDocs?: boolean - } - - /** - * options only one option for now: multi which allows the removal of multiple documents if set to true. Default is false - */ - interface RemoveOptions { - multi?:boolean - } - - interface EnsureIndexOptions { - fieldName:string; - unique?:boolean; - sparse?:boolean; - } - - interface Persistence { - compactDatafile():void; - setAutocompactionInterval(interval:number):void; - stopAutocompaction():void; - } -} diff --git a/node-form/index.d.ts b/node-form/index.d.ts deleted file mode 100644 index 41781ee154..0000000000 --- a/node-form/index.d.ts +++ /dev/null @@ -1,711 +0,0 @@ -// Type definitions for node-form v1.0.13 -// Project: https://github.com/rsamec/form -// Definitions by: Roman Samec -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as Q from "q"; - -export as namespace Validation; - -export = Validation; - -declare namespace Validation { - /** - * Custom message functions. - */ - interface IErrorCustomMessage { - (config: any, args: any): string; - } - /** - * It represents a property validator for atomic object. - */ - interface IPropertyValidator { - isAcceptable(s: any): boolean; - customMessage?: IErrorCustomMessage; - tagName?: string; - } - /** - * It represents a property validator for simple string value. - */ - interface IStringValidator extends IPropertyValidator { - isAcceptable(s: string): boolean; - } - /** - * It represents an async property validator for atomic object. - */ - interface IAsyncPropertyValidator { - isAcceptable(s: any): Q.Promise; - customMessage?: IErrorCustomMessage; - isAsync: boolean; - tagName?: string; - } - /** - * It represents an async property validator for simple string value. - */ - interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator { - isAcceptable(s: string): Q.Promise; - } - /** - * It defines compare operators. - */ - enum CompareOperator { - LessThan = 0, - LessThanEqual = 1, - Equal = 2, - NotEqual = 3, - GreaterThanEqual = 4, - GreaterThan = 5, - } - class StringFce { - static format(s: string, args: any): string; - } - class NumberFce { - static GetNegDigits(value: string): number; - } - class LettersOnlyValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class ZipCodeValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class EmailValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class UrlValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class RequiredValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class DateValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class DateISOValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class NumberValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class DigitValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class SignedDigitValidator implements IStringValidator { - public isAcceptable(s: string): boolean; - public tagName: string; - } - class MinLengthValidator implements IStringValidator { - public MinLength: number; - constructor(MinLength?: number); - public isAcceptable(s: string): boolean; - public tagName: string; - } - class MaxLengthValidator implements IStringValidator { - public MaxLength: number; - constructor(MaxLength?: number); - public isAcceptable(s: string): boolean; - public tagName: string; - } - class RangeLengthValidator implements IStringValidator { - public RangeLength: number[]; - constructor(RangeLength?: number[]); - public isAcceptable(s: string): boolean; - public MinLength : number; - public MaxLength : number; - public tagName: string; - } - class MinValidator implements IPropertyValidator { - public Min: number; - constructor(Min?: number); - public isAcceptable(s: any): boolean; - public tagName: string; - } - class MaxValidator implements IPropertyValidator { - public Max: number; - constructor(Max?: number); - public isAcceptable(s: any): boolean; - public tagName: string; - } - class RangeValidator implements IPropertyValidator { - public Range: number[]; - constructor(Range?: number[]); - public isAcceptable(s: any): boolean; - public Min : number; - public Max : number; - public tagName: string; - } - class StepValidator implements IPropertyValidator { - public Step: string; - constructor(Step?: string); - public isAcceptable(s: any): boolean; - public tagName: string; - } - class PatternValidator implements IStringValidator { - public Pattern: string; - constructor(Pattern?: string); - public isAcceptable(s: string): boolean; - public tagName: string; - } - class ContainsValidator implements IAsyncPropertyValidator { - public Options: Q.Promise; - constructor(Options: Q.Promise); - public isAcceptable(s: string): Q.Promise; - public isAsync: boolean; - public tagName: string; - } -} -declare namespace Validation { - /** - * basic error structure - */ - interface IError { - HasError: boolean; - ErrorMessage: string; - TranslateArgs?: IErrorTranslateArgs; - } - /** - * support for localization of error messages - */ - interface IErrorTranslateArgs { - TranslateId: string; - MessageArgs: any; - CustomMessage?: IErrorCustomMessage; - } - /** - * It defines conditional function. - */ - interface IOptional { - (): boolean; - } - /** - * It represents the validation result. - */ - interface IValidationFailure extends IError { - IsAsync: boolean; - Error: IError; - } - /** - * This class provides unit of information about error. - * Implements composite design pattern to enable nesting of error information. - */ - interface IValidationResult { - /** - * The name of error collection. - */ - Name: string; - /** - * Add error information to child collection of errors. - * @param validationResult - error information to be added. - */ - Add(validationResult: IValidationResult): void; - /** - * Remove error information from child collection of errors. - * @param index - index of error information to be removed. - */ - Remove(index: number): void; - /** - * Return collections of child errors information. - */ - Children: IValidationResult[]; - /** - * Return true if there is any error. - */ - HasErrors: boolean; - /** - * Return true if there is any error and hasw dirty state. - */ - HasErrorsDirty: boolean; - /** - * Return error message, if there is no error, return empty string. - */ - ErrorMessage: string; - /** - * Return number of errors. - */ - ErrorCount: number; - /** - * It enables to have errors optional. - */ - Optional?: IOptional; - /** - * It enables support for localization of error messages. - */ - TranslateArgs?: IErrorTranslateArgs[]; - } - /** - * - * @ngdoc object - * @name Error - * @module Validation - * - * - * @description - * It represents basic error structure. - */ - class Error implements IError { - public HasError: boolean; - public ErrorMessage: string; - constructor(); - } - /** - * - * @ngdoc object - * @name ValidationFailure - * @module Validation - * - * - * @description - * It represents validation failure. - */ - class ValidationFailure implements IError { - public Error: IError; - public IsAsync: boolean; - constructor(Error: IError, IsAsync: boolean); - public HasError : boolean; - public ErrorMessage : string; - public TranslateArgs : IErrorTranslateArgs; - } - /** - * - * @ngdoc object - * @name ValidationResult - * @module Validation - * - * - * @description - * It represents simple abstract error object. - */ - 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; - } - /** - * - * @ngdoc object - * @name CompositeValidationResult - * @module Validation - * - * - * @description - * It represents composite error object. - */ - 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); - } -} -declare namespace Validation { - /** - * @ngdoc module - * @name Validation - * - * - * @description - * # Validation (core module) - * The module itself contains the essential components for an validation engine to function. The table below - * lists a high level breakdown of each of the components (object, functions) available within this core module. - * - *

- */ - /** - * It defines validation function. - */ - interface IValidate { - (args: IError): void; - } - /** - * It defines async validation function. - */ - interface IAsyncValidate { - (args: IError): Q.Promise; - } - /** - * It represents named validation function. - */ - interface IValidatorFce { - Name: string; - ValidationFce?: IValidate; - AsyncValidationFce?: IAsyncValidate; - } - /** - * This class represents custom validator. - */ - interface IValidator { - Validate(context: any): IValidationFailure; - ValidateAsync(context: any): Q.Promise; - Error: IError; - } - /** - * It represents abstract validator for type of . - */ - interface IAbstractValidator { - RuleFor(prop: string, validator: IPropertyValidator): any; - ValidationFor(prop: string, validator: IValidatorFce): any; - ValidatorFor(prop: string, validator: IAbstractValidator): any; - /** - * It creates new concrete validation rule and assigned data context to this rule. - * @param name of the rule - * @constructor - */ - CreateRule(name: string): IAbstractValidationRule; - CreateAbstractRule(name: string): IAbstractValidationRule; - CreateAbstractListRule(name: string): IAbstractValidationRule; - /** - * return true if this validation rule is intended for list of items, otherwise true - */ - ForList: boolean; - } - /** - * It represents concrete validation rule for type of . - */ - interface IAbstractValidationRule { - /** - * Performs validation using a validation context and returns a collection of Validation Failures. - */ - Validate(context: T): IValidationResult; - /** - * Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy. - */ - ValidateAsync(context: T): Q.Promise; - /** - * Performs validation and async validation using a validation context. - */ - ValidateAll(context: T): void; - /** - * Performs validation and async validation using a validation context for a passed field. - */ - ValidateField(context: T, propName: string): void; - /** - * Return validation results. - */ - ValidationResult: IValidationResult; - Rules: { - [name: string]: IPropertyValidationRule; - }; - Validators: { - [name: string]: IValidator; - }; - Children: { - [name: string]: AbstractValidationRule; - }; - } - /** - * It represents property validation rule for type of . - */ - interface IPropertyValidationRule { - /** - *The validators that are grouped under this rule. - */ - Validators: { - [name: string]: any; - }; - /** - * Performs validation using a validation context and returns a collection of Validation Failures. - */ - Validate(context: IValidationContext): IValidationFailure[]; - /** - * Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy. - */ - ValidateAsync(context: IValidationContext): Q.Promise; - } - /** - * It represents a data context for validation rule. - */ - interface IValidationContext { - /** - * Return current value. - */ - Value: string; - /** - * Return property name for current data context. - */ - Key: string; - /** - * Data context for validation rule. - */ - Data: T; - } - /** - * - * @ngdoc object - * @name AbstractValidator - * @module Validation - * - * - * @description - * It enables to create custom validator for your own abstract object (class) and to assign validation rules to its properties. - * You can assigned these rules - * - * + property validation rules - use _RuleFor_ property - * + property async validation rules - use _RuleFor_ property - * + shared validation rules - use _ValidationFor_ property - * + custom object validator - use _ValidatorFor_ property - enables composition of child custom validators - */ - 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 ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void; - public CreateAbstractRule(name: string): AbstractValidationRule; - public CreateAbstractListRule(name: string): AbstractListValidationRule; - public CreateRule(name: string): AbstractValidationRule; - /** - * Return true if this validation rule is intended for list of items, otherwise true. - */ - public ForList: boolean; - } - /** - * - * @ngdoc object - * @name AbstractValidationRule - * @module Validation - * - * - * @description - * It represents concreate validator for custom object. It enables to assign validation rules to custom object properties. - */ - class AbstractValidationRule implements IAbstractValidationRule { - public Name: string; - public validator: AbstractValidator; - public ValidationResult: IValidationResult; - public Rules: { - [name: string]: IPropertyValidationRule; - }; - public Validators: { - [name: string]: IValidator; - }; - public Children: { - [name: string]: AbstractValidationRule; - }; - /** - * Return true if this validation rule is intended for list of items, otherwise true. - */ - public ForList: boolean; - constructor(Name: string, validator: AbstractValidator, forList?: boolean); - public addChildren(): void; - public SetOptional(fce: IOptional): void; - private createRuleFor(prop); - /** - * Performs validation using a validation context and returns a collection of Validation Failures. - */ - public Validate(context: T): IValidationResult; - /** - * Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy. - */ - public ValidateAsync(context: T): Q.Promise; - public ValidateAll(context: T): void; - public ValidateField(context: T, propName: string): void; - } - /** - * - * @ngdoc object - * @name AbstractListValidationRule - * @module Validation - * - * - * @description - * It represents an validator for custom object. It enables to assign rules to custom object properties. - */ - class AbstractListValidationRule extends AbstractValidationRule { - public Name: string; - public validator: AbstractValidator; - constructor(Name: string, validator: AbstractValidator); - /** - * Performs validation using a validation context and returns a collection of Validation Failures. - */ - public Validate(context: any): IValidationResult; - /** - * Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy. - */ - public ValidateAsync(context: any): Q.Promise; - private getValidationRule(i); - private getIndexedKey(i); - public NotifyListChanged(list: any[]): void; - } - /** - * - * @ngdoc object - * @name ValidationContext - * @module Validation - * - * - * @description - * It represents a data context for validation rule. - */ - class ValidationContext implements IValidationContext { - public Key: string; - public Data: T; - constructor(Key: string, Data: T); - public Value : any; - } - 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; - } - /** - * - * @ngdoc object - * @name PropertyValidationRule - * @module Validation - * - * - * @description - * It represents a property validation rule. The property has assigned collection of property validators. - */ - class PropertyValidationRule extends ValidationResult implements IPropertyValidationRule { - public Name: string; - public Validators: { - [name: string]: any; - }; - public ValidationFailures: { - [name: string]: IValidationFailure; - }; - constructor(Name: string, validatorsToAdd?: IPropertyValidator[]); - public AddValidator(validator: any): void; - public Errors : { - [name: string]: IValidationFailure; - }; - public HasErrors : boolean; - public ErrorCount : number; - public ErrorMessage : string; - public TranslateArgs : IErrorTranslateArgs[]; - /** - * Performs validation using a validation context and returns a collection of Validation Failures. - */ - public Validate(context: IValidationContext): IValidationFailure[]; - public ValidateEx(value: any): IValidationFailure[]; - /** - * Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy. - */ - public ValidateAsync(context: IValidationContext): Q.Promise; - /** - * Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy. - */ - public ValidateAsyncEx(value: string): Q.Promise; - } - /** - * - * @ngdoc object - * @name Validator - * @module Validation - * - * - * @description - * It represents a custom validator. It enables to define your own shared validation rules - */ - class Validator extends ValidationResult implements IValidator { - public Name: string; - private ValidateFce; - private AsyncValidationFce; - public Error: IError; - public ValidationFailures: { - [name: string]: IValidationFailure; - }; - constructor(Name: string, ValidateFce?: IValidate, AsyncValidationFce?: IAsyncValidate); - public Optional: IOptional; - public Validate(context: any): IValidationFailure; - public ValidateAsync(context: any): Q.Promise; - public HasError : boolean; - public Errors : { - [name: string]: IValidationFailure; - }; - public HasErrors : boolean; - public ErrorCount : number; - public ErrorMessage : string; - public TranslateArgs : IErrorTranslateArgs[]; - } -} diff --git a/node-form/node-form-tests.ts b/node-form/node-form-tests.ts deleted file mode 100644 index 75d98f6b13..0000000000 --- a/node-form/node-form-tests.ts +++ /dev/null @@ -1,25 +0,0 @@ -interface IPerson{ - Checked:boolean; - FirstName:string; - LastName:string; - Email:string; -} - -//create custom composite validator -var personValidator = new Validation.AbstractValidator(); - -//create field validators -var required = new Validation.RequiredValidator(); -var email = new Validation.EmailValidator(); -var maxLength = new Validation.MaxLengthValidator(); -maxLength.MaxLength = 15; - - -personValidator.RuleFor("FirstName", required); -personValidator.RuleFor("FirstName", maxLength); - -personValidator.RuleFor("LastName", required); -personValidator.RuleFor("LastName", maxLength); - -personValidator.RuleFor("Email", required); -personValidator.RuleFor("Email", email); diff --git a/node-form/tsconfig.json b/node-form/tsconfig.json deleted file mode 100644 index 1bb627df73..0000000000 --- a/node-form/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", - "node-form-tests.ts" - ] -} \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index c8b59ea072..90a63f066e 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1,94 +1,28 @@ { "packages": [ { - "libraryName": "Moment", - "typingsPackageName": "moment", - "sourceRepoURL": "https://github.com/moment/moment", - "asOfVersion": "2.13.0" - }, - { - "libraryName": "ng-table", - "typingsPackageName": "ng-table", - "sourceRepoURL": "https://github.com/esvit/ng-table", - "asOfVersion": "2.0.1" - }, - { - "libraryName": "spotify-web-api-js", - "typingsPackageName": "spotify-web-api-js", - "sourceRepoURL": "https://github.com/JMPerez/spotify-web-api-js", - "asOfVersion": "0.21.0" - }, - { - "libraryName": "Linq.JS", - "typingsPackageName": "linq", - "sourceRepoURL": "https://linqjs.codeplex.com/", - "asOfVersion": "2.2.33" - }, - { - "libraryName": "Protractor", - "typingsPackageName": "protractor", - "sourceRepoURL": "https://github.com/angular/protractor", - "asOfVersion": "4.0.0" - }, - { - "libraryName": "Dexie.js", - "typingsPackageName": "dexie", - "sourceRepoURL": "https://github.com/dfahlander/Dexie.js", - "asOfVersion": "1.3.1" - }, - { - "libraryName": "LinqSharp", - "typingsPackageName": "linqsharp", - "sourceRepoURL": "https://github.com/brunolm/LinqSharp", + "libraryName": "ajv", + "typingsPackageName": "ajv", + "sourceRepoURL": "https://github.com/epoberezkin/ajv", "asOfVersion": "1.0.0" }, { - "libraryName": "TypeScript", - "typingsPackageName": "typescript", - "sourceRepoURL": "https://github.com/Microsoft/TypeScript", - "asOfVersion": "2.0.0" - }, - { - "libraryName": "TypeScript", - "typingsPackageName": "typescript-services", - "sourceRepoURL": "https://github.com/Microsoft/TypeScript", - "asOfVersion": "2.0.0" - }, - { - "libraryName": "Prando", - "typingsPackageName": "prando", - "sourceRepoURL": "https://github.com/zeh/prando", + "libraryName": "antd", + "typingsPackageName": "antd", + "sourceRepoURL": "https://github.com/ant-design/ant-design", "asOfVersion": "1.0.0" }, { - "libraryName": "Shopify Prime", - "typingsPackageName": "shopify-prime", - "sourceRepoURL": "https://github.com/nozzlegear/shopify-prime", - "asOfVersion": "2.0.0" + "libraryName": "Argon2", + "typingsPackageName": "argon2", + "sourceRepoURL": "https://github.com/ranisalt/node-argon2", + "asOfVersion": "0.15.0" }, { - "libraryName": "SimpleSignal", - "typingsPackageName": "simplesignal", - "sourceRepoURL": "https://github.com/zeh/simplesignal", - "asOfVersion": "1.0.0" - }, - { - "libraryName": "Redux", - "typingsPackageName": "redux", - "sourceRepoURL": "https://github.com/reactjs/redux", - "asOfVersion": "3.6.0" - }, - { - "libraryName": "Redux Thunk", - "typingsPackageName": "redux-thunk", - "sourceRepoURL": "https://github.com/gaearon/redux-thunk", - "asOfVersion": "2.1.0" - }, - { - "libraryName": "Normalizr", - "typingsPackageName": "normalizr", - "sourceRepoURL": "https://github.com/paularmstrong/normalizr", - "asOfVersion": "2.0.18" + "libraryName": "axios", + "typingsPackageName": "axios", + "sourceRepoURL": "https://github.com/mzabriskie/axios", + "asOfVersion": "0.14.0" }, { "libraryName": "camel-case", @@ -108,12 +42,90 @@ "sourceRepoURL": "https://github.com/blakeembrey/constant-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "date-fns", + "typingsPackageName": "date-fns", + "sourceRepoURL": "https://github.com/date-fns/date-fns", + "asOfVersion": "2.6.0" + }, + { + "libraryName": "Dexie.js", + "typingsPackageName": "dexie", + "sourceRepoURL": "https://github.com/dfahlander/Dexie.js", + "asOfVersion": "1.3.1" + }, { "libraryName": "dot-case", "typingsPackageName": "dot-case", "sourceRepoURL": "https://github.com/blakeembrey/dot-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "dva", + "typingsPackageName": "dva", + "sourceRepoURL": "https://github.com/dvajs/dva", + "asOfVersion": "1.1.0" + }, + { + "libraryName": "ecmarkup", + "typingsPackageName": "ecmarkup", + "sourceRepoURL": "https://github.com/bterlson/ecmarkup", + "asOfVersion": "3.4.0" + }, + { + "libraryName": "FineUploader", + "typingsPackageName": "fine-uploader", + "sourceRepoURL": "http://fineuploader.com/", + "asOfVersion": "5.14.0" + }, + { + "libraryName": "gaea-model", + "typingsPackageName": "gaea-model", + "sourceRepoURL": "https://github.com/ascoders/gaea-model", + "asOfVersion": "0.0.0" + }, + { + "libraryName": "Facebook's Immutable", + "typingsPackageName": "immutable", + "sourceRepoURL": "https://github.com/facebook/immutable-js", + "asOfVersion": "3.8.7" + }, + { + "libraryName": "inversify", + "typingsPackageName": "inversify", + "sourceRepoURL": "http://inversify.io", + "asOfVersion": "2.0.33" + }, + { + "libraryName": "inversify-binding-decorators", + "typingsPackageName": "inversify-binding-decorators", + "sourceRepoURL": "https://github.com/inversify/inversify-binding-decorators", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "inversify-express-utils", + "typingsPackageName": "inversify-express-utils", + "sourceRepoURL": "https://github.com/inversify/inversify-express-utils", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "inversify-inject-decorators", + "typingsPackageName": "inversify-inject-decorators", + "sourceRepoURL": "https://github.com/inversify/inversify-inject-decorators", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "inversify-logger-middleware", + "typingsPackageName": "inversify-logger-middleware", + "sourceRepoURL": "https://github.com/inversify/inversify-logger-middleware", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "inversify-restify-utils", + "typingsPackageName": "inversify-restify-utils", + "sourceRepoURL": "https://github.com/inversify/inversify-restify-utils", + "asOfVersion": "2.0.0" + }, { "libraryName": "is-lower-case", "typingsPackageName": "is-lower-case", @@ -126,6 +138,30 @@ "sourceRepoURL": "https://github.com/blakeembrey/is-upper-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "jsonschema", + "typingsPackageName": "jsonschema", + "sourceRepoURL": "https://github.com/tdegrunt/jsonschema", + "asOfVersion": "1.1.1" + }, + { + "libraryName": "Linq.JS", + "typingsPackageName": "linq", + "sourceRepoURL": "https://linqjs.codeplex.com/", + "asOfVersion": "2.2.33" + }, + { + "libraryName": "LinqSharp", + "typingsPackageName": "linqsharp", + "sourceRepoURL": "https://github.com/brunolm/LinqSharp", + "asOfVersion": "1.0.0" + }, + { + "libraryName": "localforage", + "typingsPackageName": "localforage", + "sourceRepoURL": "https://github.com/localForage/localForage", + "asOfVersion": "0.0.34" + }, { "libraryName": "lower-case", "typingsPackageName": "lower-case", @@ -138,6 +174,36 @@ "sourceRepoURL": "https://github.com/blakeembrey/lower-case-first", "asOfVersion": "1.0.1" }, + { + "libraryName": "mobservable", + "typingsPackageName": "mobservable", + "sourceRepoURL": "github.com/mweststrate/mobservable", + "asOfVersion": "1.2.5" + }, + { + "libraryName": "Moment", + "typingsPackageName": "moment", + "sourceRepoURL": "https://github.com/moment/moment", + "asOfVersion": "2.13.0" + }, + { + "libraryName": "ng-table", + "typingsPackageName": "ng-table", + "sourceRepoURL": "https://github.com/esvit/ng-table", + "asOfVersion": "2.0.1" + }, + { + "libraryName": "Normalizr", + "typingsPackageName": "normalizr", + "sourceRepoURL": "https://github.com/paularmstrong/normalizr", + "asOfVersion": "2.0.18" + }, + { + "libraryName": "Numbro", + "typingsPackageName": "numbro", + "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", + "asOfVersion": "1.9.3" + }, { "libraryName": "param-case", "typingsPackageName": "param-case", @@ -156,18 +222,108 @@ "sourceRepoURL": "https://github.com/blakeembrey/path-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "pixi-spine", + "typingsPackageName": "pixi-spine", + "sourceRepoURL": "https://github.com/pixijs/pixi-spine", + "asOfVersion": "1.4.2" + }, + { + "libraryName": "poly2tri.js", + "typingsPackageName": "poly2tri", + "sourceRepoURL": "https://github.com/r3mi/poly2tri.js", + "asOfVersion": "1.4.0" + }, + { + "libraryName": "Prando", + "typingsPackageName": "prando", + "sourceRepoURL": "https://github.com/zeh/prando", + "asOfVersion": "1.0.0" + }, + { + "libraryName": "Protractor", + "typingsPackageName": "protractor", + "sourceRepoURL": "https://github.com/angular/protractor", + "asOfVersion": "4.0.0" + }, + { + "libraryName": "Raven JS", + "typingsPackageName": "raven-js", + "sourceRepoURL": "https://github.com/getsentry/raven-js", + "asOfVersion": "3.10.0" + }, + { + "libraryName": "Redux", + "typingsPackageName": "redux", + "sourceRepoURL": "https://github.com/reactjs/redux", + "asOfVersion": "3.6.0" + }, + { + "libraryName": "redux-persist", + "typingsPackageName": "redux-persist", + "sourceRepoURL": "https://github.com/rt2zz/redux-persist", + "asOfVersion": "4.3.1" + }, + { + "libraryName": "redux-persist-transform-compress", + "typingsPackageName": "redux-persist-transform-compress", + "sourceRepoURL": "https://github.com/rt2zz/redux-persist-transform-compress", + "asOfVersion": "4.2.0" + }, + { + "libraryName": "redux-saga", + "typingsPackageName": "redux-saga", + "sourceRepoURL": "https://github.com/redux-saga/redux-saga", + "asOfVersion": "0.10.5" + }, + { + "libraryName": "Redux Thunk", + "typingsPackageName": "redux-thunk", + "sourceRepoURL": "https://github.com/gaearon/redux-thunk", + "asOfVersion": "2.1.0" + }, + { + "libraryName": "node-scanf", + "typingsPackageName": "scanf", + "sourceRepoURL": "https://github.com/Lellansin/node-scanf", + "asOfVersion": "0.7.3" + }, { "libraryName": "sentence-case", "typingsPackageName": "sentence-case", "sourceRepoURL": "https://github.com/blakeembrey/sentence-case", "asOfVersion": "1.1.3" }, + { + "libraryName": "Shopify Prime", + "typingsPackageName": "shopify-prime", + "sourceRepoURL": "https://github.com/nozzlegear/shopify-prime", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "SimpleSignal", + "typingsPackageName": "simplesignal", + "sourceRepoURL": "https://github.com/zeh/simplesignal", + "asOfVersion": "1.0.0" + }, { "libraryName": "snake-case", "typingsPackageName": "snake-case", "sourceRepoURL": "https://github.com/blakeembrey/snake-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "spotify-web-api-js", + "typingsPackageName": "spotify-web-api-js", + "sourceRepoURL": "https://github.com/JMPerez/spotify-web-api-js", + "asOfVersion": "0.21.0" + }, + { + "libraryName": "Sugar", + "typingsPackageName": "sugar", + "sourceRepoURL": "https://github.com/andrewplummer/Sugar", + "asOfVersion": "2.0.2" + }, { "libraryName": "swap-case", "typingsPackageName": "swap-case", @@ -180,6 +336,18 @@ "sourceRepoURL": "https://github.com/blakeembrey/title-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "TypeScript", + "typingsPackageName": "typescript", + "sourceRepoURL": "https://github.com/Microsoft/TypeScript", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "TypeScript", + "typingsPackageName": "typescript-services", + "sourceRepoURL": "https://github.com/Microsoft/TypeScript", + "asOfVersion": "2.0.0" + }, { "libraryName": "upper-case", "typingsPackageName": "upper-case", @@ -192,90 +360,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/upper-case-first", "asOfVersion": "1.1.2" }, - { - "libraryName": "Sugar", - "typingsPackageName": "sugar", - "sourceRepoURL": "https://github.com/andrewplummer/Sugar", - "asOfVersion": "2.0.2" - }, - { - "libraryName": "ajv", - "typingsPackageName": "ajv", - "sourceRepoURL": "https://github.com/epoberezkin/ajv", - "asOfVersion": "1.0.0" - }, - { - "libraryName": "date-fns", - "typingsPackageName": "date-fns", - "sourceRepoURL": "https://github.com/date-fns/date-fns", - "asOfVersion": "2.6.0" - }, { "libraryName": "vuejs", "typingsPackageName": "vue", "sourceRepoURL": "https://github.com/vuejs/vue", "asOfVersion": "2.0.0" }, - { - "libraryName": "Facebook's Immutable", - "typingsPackageName": "immutable", - "sourceRepoURL": "https://github.com/facebook/immutable-js", - "asOfVersion": "3.8.7" - }, - { - "libraryName": "dva", - "typingsPackageName": "dva", - "sourceRepoURL": "https://github.com/dvajs/dva", - "asOfVersion": "1.1.0" - }, - { - "libraryName": "inversify", - "typingsPackageName": "inversify", - "sourceRepoURL": "http://inversify.io", - "asOfVersion": "2.0.33" - }, - { - "libraryName": "inversify-express-utils", - "typingsPackageName": "inversify-express-utils", - "sourceRepoURL": "https://github.com/inversify/inversify-express-utils", - "asOfVersion": "2.0.0" - }, - { - "libraryName": "inversify-binding-decorators", - "typingsPackageName": "inversify-binding-decorators", - "sourceRepoURL": "https://github.com/inversify/inversify-binding-decorators", - "asOfVersion": "2.0.0" - }, - { - "libraryName": "inversify-logger-middleware", - "typingsPackageName": "inversify-logger-middleware", - "sourceRepoURL": "https://github.com/inversify/inversify-logger-middleware", - "asOfVersion": "2.0.0" - }, - { - "libraryName": "inversify-inject-decorators", - "typingsPackageName": "inversify-inject-decorators", - "sourceRepoURL": "https://github.com/inversify/inversify-inject-decorators", - "asOfVersion": "2.0.0" - }, - { - "libraryName": "inversify-restify-utils", - "typingsPackageName": "inversify-restify-utils", - "sourceRepoURL": "https://github.com/inversify/inversify-restify-utils", - "asOfVersion": "2.0.0" - }, - { - "libraryName": "Argon2", - "typingsPackageName": "argon2", - "sourceRepoURL": "https://github.com/ranisalt/node-argon2", - "asOfVersion": "0.15.0" - }, - { - "libraryName": "node-scanf", - "typingsPackageName": "scanf", - "sourceRepoURL": "https://github.com/Lellansin/node-scanf", - "asOfVersion": "0.7.3" - }, { "libraryName": "vue-router", "typingsPackageName": "vue-router", @@ -283,46 +373,16 @@ "asOfVersion": "2.0.0" }, { - "libraryName": "ecmarkup", - "typingsPackageName": "ecmarkup", - "sourceRepoURL": "https://github.com/bterlson/ecmarkup", - "asOfVersion": "3.4.0" + "libraryName": "x2js", + "typingsPackageName": "x2js", + "sourceRepoURL": "https://code.google.com/p/x2js/", + "asOfVersion": "3.1.0" }, { - "libraryName": "redux-saga", - "typingsPackageName": "redux-saga", - "sourceRepoURL": "https://github.com/redux-saga/redux-saga", - "asOfVersion": "0.10.5" - }, - { - "libraryName": "axios", - "typingsPackageName": "axios", - "sourceRepoURL": "https://github.com/mzabriskie/axios", - "asOfVersion": "0.14.0" - }, - { - "libraryName": "gaea-model", - "typingsPackageName": "gaea-model", - "sourceRepoURL": "https://github.com/ascoders/gaea-model", - "asOfVersion": "0.0.0" - }, - { - "libraryName": "jsonschema", - "typingsPackageName": "jsonschema", - "sourceRepoURL": "https://github.com/tdegrunt/jsonschema", - "asOfVersion": "1.1.1" - }, - { - "libraryName": "Raven JS", - "typingsPackageName": "raven-js", - "sourceRepoURL": "https://github.com/getsentry/raven-js", - "asOfVersion": "3.10.0" - }, - { - "libraryName": "antd", - "typingsPackageName": "antd", - "sourceRepoURL": "https://github.com/ant-design/ant-design", - "asOfVersion": "1.0.0" + "libraryName": "@xmpp/jid", + "typingsPackageName": "xmpp-jid", + "sourceRepoURL": "github.com/node-xmpp/node-xmpp/", + "asOfVersion": "1.2.0" } ] -} \ No newline at end of file +} diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json deleted file mode 100644 index efbf716a77..0000000000 --- a/npm-shrinkwrap.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "name": "definitely-typed", - "version": "0.0.1", - "dependencies": { - "assertion-error": { - "version": "1.0.1", - "from": "assertion-error@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.1.tgz" - }, - "balanced-match": { - "version": "0.3.0", - "from": "balanced-match@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" - }, - "bluebird": { - "version": "3.3.4", - "from": "bluebird@>=3.3.1 <4.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.3.4.tgz" - }, - "brace-expansion": { - "version": "1.1.3", - "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" - }, - "concat-map": { - "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "core-util-is": { - "version": "1.0.2", - "from": "core-util-is@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - }, - "findup-sync": { - "version": "0.3.0", - "from": "findup-sync@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "dependencies": { - "glob": { - "version": "5.0.15", - "from": "glob@>=5.0.0 <5.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz" - } - } - }, - "git-wrapper": { - "version": "0.1.1", - "from": "git-wrapper@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz" - }, - "glob": { - "version": "7.0.3", - "from": "glob@>=7.0.0 <8.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz" - }, - "hoek": { - "version": "3.0.4", - "from": "hoek@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-3.0.4.tgz" - }, - "inflight": { - "version": "1.0.4", - "from": "inflight@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz" - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "isarray": { - "version": "0.0.1", - "from": "isarray@0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "isemail": { - "version": "2.1.0", - "from": "isemail@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.1.0.tgz" - }, - "joi": { - "version": "8.0.4", - "from": "joi@>=8.0.4 <9.0.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-8.0.4.tgz" - }, - "joi-assert": { - "version": "0.0.3", - "from": "joi-assert@>=0.0.3 <0.0.4", - "resolved": "https://registry.npmjs.org/joi-assert/-/joi-assert-0.0.3.tgz" - }, - "jsonparse": { - "version": "0.0.5", - "from": "jsonparse@0.0.5", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" - }, - "JSONStream": { - "version": "0.8.4", - "from": "JSONStream@>=0.8.4 <0.9.0", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz" - }, - "lazy.js": { - "version": "0.4.2", - "from": "lazy.js@>=0.4.2 <0.5.0", - "resolved": "https://registry.npmjs.org/lazy.js/-/lazy.js-0.4.2.tgz" - }, - "manticore": { - "version": "0.2.4", - "from": "manticore@>=0.2.4 <0.3.0", - "resolved": "https://registry.npmjs.org/manticore/-/manticore-0.2.4.tgz", - "dependencies": { - "bluebird": { - "version": "1.2.4", - "from": "bluebird@>=1.2.4 <2.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz" - } - } - }, - "minimatch": { - "version": "3.0.0", - "from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" - }, - "minimist": { - "version": "0.0.10", - "from": "minimist@>=0.0.1 <0.1.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" - }, - "moment": { - "version": "2.12.0", - "from": "moment@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.12.0.tgz" - }, - "once": { - "version": "1.3.3", - "from": "once@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" - }, - "optimist": { - "version": "0.6.1", - "from": "optimist@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" - }, - "parsimmon": { - "version": "0.7.0", - "from": "parsimmon@>=0.7.0 <0.8.0", - "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.7.0.tgz" - }, - "path-is-absolute": { - "version": "1.0.0", - "from": "path-is-absolute@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - }, - "pjs": { - "version": "5.1.1", - "from": "pjs@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/pjs/-/pjs-5.1.1.tgz" - }, - "readable-stream": { - "version": "1.0.33", - "from": "readable-stream@>=1.0.17 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz" - }, - "string_decoder": { - "version": "0.10.31", - "from": "string_decoder@>=0.10.0 <0.11.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "through": { - "version": "2.3.8", - "from": "through@>=2.2.7 <3.0.0", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" - }, - "through2": { - "version": "0.5.1", - "from": "through2@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz" - }, - "topo": { - "version": "2.0.0", - "from": "topo@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/topo/-/topo-2.0.0.tgz" - }, - "type-detect": { - "version": "0.1.2", - "from": "type-detect@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz" - }, - "wordwrap": { - "version": "0.0.3", - "from": "wordwrap@>=0.0.2 <0.1.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - }, - "wrappy": { - "version": "1.0.1", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - }, - "xregexp": { - "version": "3.1.0", - "from": "xregexp@>=3.0.0 <4.0.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-3.1.0.tgz" - }, - "xtend": { - "version": "3.0.0", - "from": "xtend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" - } - } -} diff --git a/numbro/index.d.ts b/numbro/index.d.ts deleted file mode 100644 index ccb0892a0d..0000000000 --- a/numbro/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for Numbro.js -// Project: https://github.com/foretagsplatsen/numbro -// Definitions by: Vincent Bortone -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface NumbroLanguage { - delimiters: { - thousands: string; - decimal: string; - }; - abbreviations: { - thousand: string; - million: string; - billion: string; - trillion: string; - }; - ordinal(num: number): string; - currency: { - symbol: string; - }; -} - -interface Numbro { - (value?: any): Numbro; - version: string; - isNumbro: boolean; - language(key: string, values?: NumbroLanguage): Numbro; - zeroFormat(format: string): string; - clone(): Numbro; - format(inputString?: string): string; - formatCurrency(inputString?: string): string; - unformat(inputString: string): number; - value(): number; - valueOf(): number; - set (value: any): Numbro; - add(value: any): Numbro; - subtract(value: any): Numbro; - multiply(value: any): Numbro; - divide(value: any): Numbro; - difference(value: any): number; -} - -declare var numbro: Numbro; - -declare module "numbro" { - - export = numbro; - -} diff --git a/numbro/numbro-tests.ts b/numbro/numbro-tests.ts deleted file mode 100644 index 5b5b762353..0000000000 --- a/numbro/numbro-tests.ts +++ /dev/null @@ -1,43 +0,0 @@ - - -var valueFormat: string = numbro(1000).format('0,0'); -// '1,000' - -var valueUnformat: number = numbro().unformat('($10,000.00)'); -// '-10000' - -var value3: Numbro = numbro(1000); -var added: Numbro = value3.add(10); -// 1010 - -var value4: Numbro = numbro(1000); -var formatValue4a: string = value4.format('0,0'); -// '1,000' -var formatValue4b: number = value4.value(); -// 1000 - -var value5: Numbro = numbro(); -value5.set(1000); -var value5Num: number = value5.value(); -// 1000 - -var value6: Numbro = numbro(1000); -var value: number = 100; -var difference = value6.difference(value); -// 900 - -var value7: Numbro = numbro(0); -numbro.zeroFormat('N/A'); -var zeroString: string = value7.format('0.0'); -// 'N/A' - -var a: Numbro = numbro(1000); -var b: Numbro = numbro(a); -var c: Numbro = a.clone(); - -var aVal: number = a.set(2000).value(); -// 2000 -var bVal: number = b.value(); -// 1000 -var cVal: number = c.add(10).value(); -// 1010 diff --git a/numbro/tsconfig.json b/numbro/tsconfig.json deleted file mode 100644 index 4a55ffe0ab..0000000000 --- a/numbro/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", - "numbro-tests.ts" - ] -} \ No newline at end of file diff --git a/paymentrequest/index.d.ts b/paymentrequest/index.d.ts deleted file mode 100644 index 5231f53bc3..0000000000 --- a/paymentrequest/index.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -// Type definitions for PaymentRequest -// Project: https://www.w3.org/TR/payment-request/ -// Definitions by: Adam Cmiel , Eiji Kitamura -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface PaymentRequest extends EventTarget { - new (methodData: PaymentMethodData[], details: PaymentDetails, options?: PaymentOptions): PaymentRequest; - show(): PromiseLike; - abort(): PromiseLike; - canMakePayment(): Promise; - readonly paymentRequestID: string; - readonly shippingAddress?: PaymentAddress; - readonly shippingOption?: string; - readonly shippingType?: string; - onshippingaddresschange: PaymentUpdateEventListener; - onshippingoptionchange: PaymentUpdateEventListener; -} - -interface PaymentMethodData { - supportedMethods: string[]; - data?: { - supportedNetworks: string[]; - supportedTypes: string[]; - }; -} - -interface PaymentCurrencyAmount { - currency: string; - value: string; - currencySystem?:string; -} - -interface PaymentDetails { - total: PaymentItem; - displayItems?: PaymentItem[]; - shippingOptions?: PaymentShippingOption[]; - modifiers?: PaymentDetailsModifier[]; - error?: string; -} - -interface PaymentDetailsModifier { - supportedMethods: string[]; - total?: PaymentItem; - additionalDisplayItems?: PaymentItem[]; - data?: Object; -} - -interface PaymentOptions { - requestShipping?: boolean; - requestPayerEmail?: boolean; - requestPayerPhone?: boolean; - requestPayerName?: boolean; - shippingType?: 'shipping' | 'delivery' | 'pickup'; -} - -interface PaymentItem { - label: string; - amount: PaymentCurrencyAmount; - pending?: boolean; -} - -interface PaymentAddress { - readonly country: string; - readonly addressLine: string[]; - readonly region: string; - readonly city: string; - readonly dependentLocality: string; - readonly postalCode: string; - readonly sortingCode: string; - readonly languageCode: string; - readonly organization: string; - readonly recipient: string; - readonly phone: string; -} - -interface PaymentShippingOption { - id: string; - label: string; - amount: PaymentCurrencyAmount; - selected?: boolean; -} - -interface PaymentResponse { - readonly paymentRequestID: string; - readonly methodName: string; - readonly details: Object; - readonly shippingAddress?: PaymentAddress; - readonly shippingOption?: string; - readonly payerEmail?: string; - readonly payerPhone?: string; - readonly payerName?: string; - - complete(result?: '' | 'success' | 'fail'): PromiseLike; - toJSON(): Object; -} - -interface PaymentUpdateEventListener extends EventListener { - (evt: PaymentRequestUpdateEvent): void; -} - -interface PaymentRequestUpdateEvent extends Event { - updateWith(d: PromiseLike): void; -} - -interface Window { - PaymentRequest?: PaymentRequest; -} - diff --git a/paymentrequest/paymentrequest-tests.ts b/paymentrequest/paymentrequest-tests.ts deleted file mode 100644 index 62c2721bfb..0000000000 --- a/paymentrequest/paymentrequest-tests.ts +++ /dev/null @@ -1,118 +0,0 @@ -/// - -/// Code examples derived from -/// https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/ - -async function makeRequest() { - if (!window.PaymentRequest) { - return Promise.reject(new Error("PaymentRequest not available")) - } - - const methodData = [ - { - supportedMethods: ["visa", "mastercard"] - } - ] - - const details: PaymentDetails = { - displayItems: [ - { - label: "Original donation amount", - amount: { currency: "USD", value : "65.00" }, // US$65.00 - }, - { - label: "Friends and family discount", - amount: { currency: "USD", value : "-10.00" }, // -US$10.00 - } - ], - total: { - label: "Total", - amount: { currency: "USD", value : "55.00" }, // US$55.00 - } - } - - const options: PaymentOptions = { - requestShipping: true, - requestPayerEmail: true, - requestPayerPhone: true, - requestPayerName: true, - shippingType: 'delivery' - } - - const request = new window.PaymentRequest(methodData, details, options) - request.addEventListener("shippingaddresschange", (e: any) => { - e.updateWith(((details, addr) => { - if (addr.country === 'US') { - var shippingOption = { - id: '', - label: '', - amount: {currency: 'USD', value: '0.00'}, - selected: true - }; - if (addr.region === 'US') { - shippingOption.id = 'us'; - shippingOption.label = 'Standard shipping in US'; - shippingOption.amount.value = '0.00'; - details.total.amount.value = '55.00'; - } else { - shippingOption.id = 'others'; - shippingOption.label = 'International shipping'; - shippingOption.amount.value = '10.00'; - details.total.amount.value = '65.00'; - } - if (details.displayItems.length === 2) { - details.displayItems.splice(1, 0, shippingOption); - } else { - details.displayItems.splice(1, 1, shippingOption); - } - - details.shippingOptions = [shippingOption]; - } else { - details.shippingOptions = []; - } - return Promise.resolve(details); - })(details, request.shippingAddress)); - }) - - let canMakePayment = await request.canMakePayment() - if (canMakePayment) { - return request.show() - } else { - throw 'can not make payment on this environment.' - } -} - -async function processPayment(): Promise { - let paymentResponse: PaymentResponse; - try { - paymentResponse = await makeRequest() - } catch (error) { - location.href = '/checkout'; - return; - } - - var paymentData = { - // payment method string - method: paymentResponse.methodName, - // payment details as you requested - details: paymentResponse.details, - // shipping address information - address: paymentResponse.shippingAddress, - // shipping option - shippingOption: paymentResponse.shippingOption - } - - // make call to backend to process payment data - const ok = await Promise.resolve(true) - - if (ok) { - paymentResponse.complete("success") - } else { - paymentResponse.complete("fail") - } -} - -function onShippingAddressChange(e: any) { -} - -document.querySelector("#pay").addEventListener("click", processPayment) diff --git a/paymentrequest/tsconfig.json b/paymentrequest/tsconfig.json deleted file mode 100644 index e5754a139a..0000000000 --- a/paymentrequest/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "target": "es6", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "paymentrequest-tests.ts" - ] -} \ No newline at end of file diff --git a/pixi-spine/index.d.ts b/pixi-spine/index.d.ts deleted file mode 100644 index deb614c749..0000000000 --- a/pixi-spine/index.d.ts +++ /dev/null @@ -1,1042 +0,0 @@ -// Type definitions for Pixi-spine 1.3 -// Project: https://github.com/pixijs/pixi-spine/tree/master -// Definitions by: Ivan Popelyshev -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as PPP from "pixi.js"; - -declare module "pixi.js" { - namespace spine.core { - class Animation { - name: string; - timelines: Timeline[]; - duration: number; - constructor(name: string, timelines: Timeline[], duration: number); - apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - static binarySearch(values: ArrayLike, target: number, step?: number): number; - static linearSearch(values: ArrayLike, target: number, step: number): number; - } - interface Timeline { - apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - getPropertyId(): number; - } - enum TimelineType { - rotate = 0, - translate = 1, - scale = 2, - shear = 3, - attachment = 4, - color = 5, - deform = 6, - event = 7, - drawOrder = 8, - ikConstraint = 9, - transformConstraint = 10, - pathConstraintPosition = 11, - pathConstraintSpacing = 12, - pathConstraintMix = 13, - } - abstract class CurveTimeline implements Timeline { - static LINEAR: number; - static STEPPED: number; - static BEZIER: number; - static BEZIER_SIZE: number; - private curves; - abstract getPropertyId(): number; - constructor(frameCount: number); - getFrameCount(): number; - setLinear(frameIndex: number): void; - setStepped(frameIndex: number): void; - getCurveType(frameIndex: number): number; - setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void; - getCurvePercent(frameIndex: number, percent: number): number; - abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class RotateTimeline extends CurveTimeline { - static ENTRIES: number; - static PREV_TIME: number; - static PREV_ROTATION: number; - static ROTATION: number; - boneIndex: number; - frames: ArrayLike; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, degrees: number): void; - apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class TranslateTimeline extends CurveTimeline { - static ENTRIES: number; - static PREV_TIME: number; - static PREV_X: number; - static PREV_Y: number; - static X: number; - static Y: number; - boneIndex: number; - frames: ArrayLike; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, x: number, y: number): void; - apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class ScaleTimeline extends TranslateTimeline { - constructor(frameCount: number); - getPropertyId(): number; - apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class ShearTimeline extends TranslateTimeline { - constructor(frameCount: number); - getPropertyId(): number; - apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class ColorTimeline extends CurveTimeline { - static ENTRIES: number; - static PREV_TIME: number; - static PREV_R: number; - static PREV_G: number; - static PREV_B: number; - static PREV_A: number; - static R: number; - static G: number; - static B: number; - static A: number; - slotIndex: number; - frames: ArrayLike; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void; - apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class AttachmentTimeline implements Timeline { - slotIndex: number; - frames: ArrayLike; - attachmentNames: string[]; - constructor(frameCount: number); - getPropertyId(): number; - getFrameCount(): number; - setFrame(frameIndex: number, time: number, attachmentName: string): void; - apply(skeleton: Skeleton, lastTime: number, time: number, events: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class DeformTimeline extends CurveTimeline { - slotIndex: number; - attachment: VertexAttachment; - frames: ArrayLike; - frameVertices: Array>; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, vertices: ArrayLike): void; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class EventTimeline implements Timeline { - frames: ArrayLike; - events: Event[]; - constructor(frameCount: number); - getPropertyId(): number; - getFrameCount(): number; - setFrame(frameIndex: number, event: Event): void; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class DrawOrderTimeline implements Timeline { - frames: ArrayLike; - drawOrders: number[][]; - constructor(frameCount: number); - getPropertyId(): number; - getFrameCount(): number; - setFrame(frameIndex: number, time: number, drawOrder: number[]): void; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class IkConstraintTimeline extends CurveTimeline { - static ENTRIES: number; - static PREV_TIME: number; - static PREV_MIX: number; - static PREV_BEND_DIRECTION: number; - static MIX: number; - static BEND_DIRECTION: number; - ikConstraintIndex: number; - frames: ArrayLike; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, mix: number, bendDirection: number): void; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class TransformConstraintTimeline extends CurveTimeline { - static ENTRIES: number; - static PREV_TIME: number; - static PREV_ROTATE: number; - static PREV_TRANSLATE: number; - static PREV_SCALE: number; - static PREV_SHEAR: number; - static ROTATE: number; - static TRANSLATE: number; - static SCALE: number; - static SHEAR: number; - transformConstraintIndex: number; - frames: ArrayLike; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class PathConstraintPositionTimeline extends CurveTimeline { - static ENTRIES: number; - static PREV_TIME: number; - static PREV_VALUE: number; - static VALUE: number; - pathConstraintIndex: number; - frames: ArrayLike; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, value: number): void; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline { - constructor(frameCount: number); - getPropertyId(): number; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - class PathConstraintMixTimeline extends CurveTimeline { - static ENTRIES: number; - static PREV_TIME: number; - static PREV_ROTATE: number; - static PREV_TRANSLATE: number; - static ROTATE: number; - static TRANSLATE: number; - pathConstraintIndex: number; - frames: ArrayLike; - constructor(frameCount: number); - getPropertyId(): number; - setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void; - apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Event[], alpha: number, setupPose: boolean, mixingOut: boolean): void; - } - } - namespace spine.core { - class AnimationState { - static emptyAnimation: Animation; - data: AnimationStateData; - tracks: TrackEntry[]; - events: Event[]; - listeners: AnimationStateListener2[]; - queue: EventQueue; - propertyIDs: IntSet; - animationsChanged: boolean; - timeScale: number; - trackEntryPool: Pool; - constructor(data: AnimationStateData); - update(delta: number): void; - updateMixingFrom(entry: TrackEntry, delta: number, canEnd: boolean): void; - apply(skeleton: Skeleton): void; - applyMixingFrom(entry: TrackEntry, skeleton: Skeleton): number; - applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: number[], i: number, firstFrame: boolean): void; - queueEvents(entry: TrackEntry, animationTime: number): void; - clearTracks(): void; - clearTrack(trackIndex: number): void; - setCurrent(index: number, current: TrackEntry): void; - setAnimation(trackIndex: number, animationName: string, loop: boolean): TrackEntry; - setAnimationWith(trackIndex: number, animation: Animation, loop: boolean): TrackEntry; - addAnimation(trackIndex: number, animationName: string, loop: boolean, delay: number): TrackEntry; - addAnimationWith(trackIndex: number, animation: Animation, loop: boolean, delay: number): TrackEntry; - setEmptyAnimation(trackIndex: number, mixDuration: number): TrackEntry; - addEmptyAnimation(trackIndex: number, mixDuration: number, delay: number): TrackEntry; - setEmptyAnimations(mixDuration: number): void; - expandToIndex(index: number): TrackEntry; - trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry): TrackEntry; - disposeNext(entry: TrackEntry): void; - _animationsChanged(): void; - setTimelinesFirst(entry: TrackEntry): void; - checkTimelinesFirst(entry: TrackEntry): void; - checkTimelinesUsage(entry: TrackEntry, usageArray: boolean[]): void; - getCurrent(trackIndex: number): TrackEntry; - addListener(listener: AnimationStateListener2): void; - removeListener(listener: AnimationStateListener2): void; - clearListeners(): void; - clearListenerNotifications(): void; - onComplete: (trackIndex: number, loopCount: number) => any; - onEvent: (trackIndex: number, event: Event) => any; - onStart: (trackIndex: number) => any; - onEnd: (trackIndex: number) => any; - private static deprecatedWarning1; - setAnimationByName(trackIndex: number, animationName: string, loop: boolean): void; - private static deprecatedWarning2; - addAnimationByName(trackIndex: number, animationName: string, loop: boolean, delay: number): void; - private static deprecatedWarning3; - hasAnimationByName(animationName: string): boolean; - } - class TrackEntry { - animation: Animation; - next: TrackEntry; - mixingFrom: TrackEntry; - listener: AnimationStateListener2; - trackIndex: number; - loop: boolean; - eventThreshold: number; - attachmentThreshold: number; - drawOrderThreshold: number; - animationStart: number; - animationEnd: number; - animationLast: number; - nextAnimationLast: number; - delay: number; - trackTime: number; - trackLast: number; - nextTrackLast: number; - trackEnd: number; - timeScale: number; - alpha: number; - mixTime: number; - mixDuration: number; - mixAlpha: number; - timelinesFirst: boolean[]; - timelinesRotation: number[]; - reset(): void; - getAnimationTime(): number; - setAnimationLast(animationLast: number): void; - isComplete(): boolean; - resetRotationDirections(): void; - onComplete: (trackIndex: number, loopCount: number) => any; - onEvent: (trackIndex: number, event: Event) => any; - onStart: (trackIndex: number) => any; - onEnd: (trackIndex: number) => any; - private static deprecatedWarning1; - private static deprecatedWarning2; - time: number; - endTime: number; - loopsCount(): number; - } - class EventQueue { - objects: any[]; - drainDisabled: boolean; - animState: AnimationState; - constructor(animState: AnimationState); - start(entry: TrackEntry): void; - interrupt(entry: TrackEntry): void; - end(entry: TrackEntry): void; - dispose(entry: TrackEntry): void; - complete(entry: TrackEntry): void; - event(entry: TrackEntry, event: Event): void; - private static deprecatedWarning1; - deprecateStuff(): boolean; - drain(): void; - clear(): void; - } - enum EventType { - start = 0, - interrupt = 1, - end = 2, - dispose = 3, - complete = 4, - event = 5, - } - interface AnimationStateListener2 { - start(entry: TrackEntry): void; - interrupt(entry: TrackEntry): void; - end(entry: TrackEntry): void; - dispose(entry: TrackEntry): void; - complete(entry: TrackEntry): void; - event(entry: TrackEntry, event: Event): void; - } - abstract class AnimationStateAdapter2 implements AnimationStateListener2 { - start(entry: TrackEntry): void; - interrupt(entry: TrackEntry): void; - end(entry: TrackEntry): void; - dispose(entry: TrackEntry): void; - complete(entry: TrackEntry): void; - event(entry: TrackEntry, event: Event): void; - } - } - namespace spine.core { - class AnimationStateData { - skeletonData: SkeletonData; - animationToMixTime: Map; - defaultMix: number; - constructor(skeletonData: SkeletonData); - setMix(fromName: string, toName: string, duration: number): void; - private static deprecatedWarning1; - setMixByName(fromName: string, toName: string, duration: number): void; - setMixWith(from: Animation, to: Animation, duration: number): void; - getMix(from: Animation, to: Animation): number; - } - } - namespace spine.core { - class AtlasAttachmentLoader implements AttachmentLoader { - atlas: TextureAtlas; - constructor(atlas: TextureAtlas); - newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; - newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; - newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; - newPathAttachment(skin: Skin, name: string): PathAttachment; - } - } - namespace spine.core { - abstract class Attachment { - name: string; - constructor(name: string); - } - abstract class VertexAttachment extends Attachment { - bones: number[]; - vertices: ArrayLike; - worldVerticesLength: number; - constructor(name: string); - computeWorldVertices(slot: Slot, worldVertices: ArrayLike): void; - computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number): void; - applyDeform(sourceAttachment: VertexAttachment): boolean; - } - } - namespace spine.core { - interface AttachmentLoader { - newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment; - newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment; - newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment; - newPathAttachment(skin: Skin, name: string): PathAttachment; - } - } - namespace spine.core { - enum AttachmentType { - Region = 0, - BoundingBox = 1, - Mesh = 2, - LinkedMesh = 3, - Path = 4, - } - } - namespace spine.core { - class BoundingBoxAttachment extends VertexAttachment { - color: Color; - constructor(name: string); - } - } - namespace spine.core { - class MeshAttachment extends VertexAttachment { - region: TextureRegion; - path: string; - regionUVs: ArrayLike; - triangles: number[]; - color: Color; - hullLength: number; - private parentMesh; - inheritDeform: boolean; - tempColor: Color; - constructor(name: string); - updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike; - updateUVs(region: TextureRegion, uvs: ArrayLike): ArrayLike; - applyDeform(sourceAttachment: VertexAttachment): boolean; - getParentMesh(): MeshAttachment; - setParentMesh(parentMesh: MeshAttachment): void; - } - } - namespace spine.core { - class PathAttachment extends VertexAttachment { - lengths: number[]; - closed: boolean; - constantSpeed: boolean; - color: Color; - constructor(name: string); - } - } - namespace spine.core { - class RegionAttachment extends Attachment { - x: number; - y: number; - scaleX: number; - scaleY: number; - rotation: number; - width: number; - height: number; - color: Color; - path: string; - region: TextureRegion; - constructor(name: string); - updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike; - } - } - namespace spine.core { - enum BlendMode { - Normal = 0, - Additive = 1, - Multiply = 2, - Screen = 3, - } - } - namespace spine.core { - class Bone implements Updatable { - static yDown: boolean; - matrix: Matrix; - readonly worldX: number; - readonly worldY: number; - data: BoneData; - skeleton: Skeleton; - parent: Bone; - children: Bone[]; - x: number; - y: number; - rotation: number; - scaleX: number; - scaleY: number; - shearX: number; - shearY: number; - ax: number; - ay: number; - arotation: number; - ascaleX: number; - ascaleY: number; - ashearX: number; - ashearY: number; - appliedValid: boolean; - sorted: boolean; - constructor(data: BoneData, skeleton: Skeleton, parent: Bone); - update(): void; - updateWorldTransform(): void; - updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void; - setToSetupPose(): void; - getWorldRotationX(): number; - getWorldRotationY(): number; - getWorldScaleX(): number; - getWorldScaleY(): number; - worldToLocalRotationX(): number; - worldToLocalRotationY(): number; - rotateWorld(degrees: number): void; - updateAppliedTransform(): void; - worldToLocal(world: Vector2): Vector2; - localToWorld(local: Vector2): Vector2; - } - } - namespace spine.core { - class BoneData { - index: number; - name: string; - parent: BoneData; - length: number; - x: number; - y: number; - rotation: number; - scaleX: number; - scaleY: number; - shearX: number; - shearY: number; - transformMode: TransformMode; - constructor(index: number, name: string, parent: BoneData); - } - enum TransformMode { - Normal = 0, - OnlyTranslation = 1, - NoRotationOrReflection = 2, - NoScale = 3, - NoScaleOrReflection = 4, - } - } - namespace spine.core { - interface Constraint extends Updatable { - getOrder(): number; - } - } - namespace spine.core { - class Event { - data: EventData; - intValue: number; - floatValue: number; - stringValue: string; - time: number; - constructor(time: number, data: EventData); - } - } - namespace spine.core { - class EventData { - name: string; - intValue: number; - floatValue: number; - stringValue: string; - constructor(name: string); - } - } - namespace spine.core { - class IkConstraint implements Constraint { - data: IkConstraintData; - bones: Bone[]; - target: Bone; - mix: number; - bendDirection: number; - level: number; - constructor(data: IkConstraintData, skeleton: Skeleton); - getOrder(): number; - apply(): void; - update(): void; - apply1(bone: Bone, targetX: number, targetY: number, alpha: number): void; - apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, alpha: number): void; - } - } - namespace spine.core { - class IkConstraintData { - name: string; - order: number; - bones: BoneData[]; - target: BoneData; - bendDirection: number; - mix: number; - constructor(name: string); - } - } - namespace spine.core { - class PathConstraint implements Constraint { - static NONE: number; - static BEFORE: number; - static AFTER: number; - data: PathConstraintData; - bones: Bone[]; - target: Slot; - position: number; - spacing: number; - rotateMix: number; - translateMix: number; - spaces: number[]; - positions: number[]; - world: number[]; - curves: number[]; - lengths: number[]; - segments: number[]; - constructor(data: PathConstraintData, skeleton: Skeleton); - apply(): void; - update(): void; - computeWorldPositions(path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): number[]; - addBeforePosition(p: number, temp: number[], i: number, out: number[], o: number): void; - addAfterPosition(p: number, temp: number[], i: number, out: number[], o: number): void; - addCurvePosition(p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, out: number[], o: number, tangents: boolean): void; - getOrder(): number; - } - } - namespace spine.core { - class PathConstraintData { - name: string; - order: number; - bones: BoneData[]; - target: SlotData; - positionMode: PositionMode; - spacingMode: SpacingMode; - rotateMode: RotateMode; - offsetRotation: number; - position: number; - spacing: number; - rotateMix: number; - translateMix: number; - constructor(name: string); - } - enum PositionMode { - Fixed = 0, - Percent = 1, - } - enum SpacingMode { - Length = 0, - Fixed = 1, - Percent = 2, - } - enum RotateMode { - Tangent = 0, - Chain = 1, - ChainScale = 2, - } - } - namespace spine.core { - class Skeleton { - data: SkeletonData; - bones: Bone[]; - slots: Slot[]; - drawOrder: Slot[]; - ikConstraints: IkConstraint[]; - transformConstraints: TransformConstraint[]; - pathConstraints: PathConstraint[]; - _updateCache: Updatable[]; - updateCacheReset: Updatable[]; - skin: Skin; - color: Color; - time: number; - flipX: boolean; - flipY: boolean; - x: number; - y: number; - constructor(data: SkeletonData); - updateCache(): void; - sortIkConstraint(constraint: IkConstraint): void; - sortPathConstraint(constraint: PathConstraint): void; - sortTransformConstraint(constraint: TransformConstraint): void; - sortPathConstraintAttachment(skin: Skin, slotIndex: number, slotBone: Bone): void; - sortPathConstraintAttachmentWith(attachment: Attachment, slotBone: Bone): void; - sortBone(bone: Bone): void; - sortReset(bones: Bone[]): void; - updateWorldTransform(): void; - setToSetupPose(): void; - setBonesToSetupPose(): void; - setSlotsToSetupPose(): void; - getRootBone(): Bone; - findBone(boneName: string): Bone; - findBoneIndex(boneName: string): number; - findSlot(slotName: string): Slot; - findSlotIndex(slotName: string): number; - setSkinByName(skinName: string): void; - setSkin(newSkin: Skin): void; - getAttachmentByName(slotName: string, attachmentName: string): Attachment; - getAttachment(slotIndex: number, attachmentName: string): Attachment; - setAttachment(slotName: string, attachmentName: string): void; - findIkConstraint(constraintName: string): IkConstraint; - findTransformConstraint(constraintName: string): TransformConstraint; - findPathConstraint(constraintName: string): PathConstraint; - getBounds(offset: Vector2, size: Vector2): void; - update(delta: number): void; - } - } - namespace spine.core { - class SkeletonBounds { - minX: number; - minY: number; - maxX: number; - maxY: number; - boundingBoxes: BoundingBoxAttachment[]; - polygons: Array>; - private polygonPool; - update(skeleton: Skeleton, updateAabb: boolean): void; - aabbCompute(): void; - aabbContainsPoint(x: number, y: number): boolean; - aabbIntersectsSegment(x1: number, y1: number, x2: number, y2: number): boolean; - aabbIntersectsSkeleton(bounds: SkeletonBounds): boolean; - containsPoint(x: number, y: number): BoundingBoxAttachment; - containsPointPolygon(polygon: ArrayLike, x: number, y: number): boolean; - intersectsSegment(x1: number, y1: number, x2: number, y2: number): BoundingBoxAttachment; - intersectsSegmentPolygon(polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number): boolean; - getPolygon(boundingBox: BoundingBoxAttachment): ArrayLike; - getWidth(): number; - getHeight(): number; - } - } - namespace spine.core { - class SkeletonData { - name: string; - bones: BoneData[]; - slots: SlotData[]; - skins: Skin[]; - defaultSkin: Skin; - events: EventData[]; - animations: Animation[]; - ikConstraints: IkConstraintData[]; - transformConstraints: TransformConstraintData[]; - pathConstraints: PathConstraintData[]; - width: number; - height: number; - version: string; - hash: string; - fps: number; - imagesPath: string; - findBone(boneName: string): BoneData; - findBoneIndex(boneName: string): number; - findSlot(slotName: string): SlotData; - findSlotIndex(slotName: string): number; - findSkin(skinName: string): Skin; - findEvent(eventDataName: string): EventData; - findAnimation(animationName: string): Animation; - findIkConstraint(constraintName: string): IkConstraintData; - findTransformConstraint(constraintName: string): TransformConstraintData; - findPathConstraint(constraintName: string): PathConstraintData; - findPathConstraintIndex(pathConstraintName: string): number; - } - } - namespace spine.core { - class SkeletonJson { - attachmentLoader: AttachmentLoader; - scale: number; - private linkedMeshes; - constructor(attachmentLoader: AttachmentLoader); - readSkeletonData(json: string | any): SkeletonData; - readAttachment(map: any, skin: Skin, slotIndex: number, name: string): Attachment; - readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void; - readAnimation(map: any, name: string, skeletonData: SkeletonData): void; - readCurve(map: any, timeline: CurveTimeline, frameIndex: number): void; - getValue(map: any, prop: string, defaultValue: any): any; - static blendModeFromString(str: string): number; - static positionModeFromString(str: string): PositionMode; - static spacingModeFromString(str: string): SpacingMode; - static rotateModeFromString(str: string): RotateMode; - static transformModeFromString(str: string): TransformMode; - static transformModeLegacy(inheritRotation: boolean, inheritScale: boolean): TransformMode; - } - } - namespace spine.core { - class Skin { - name: string; - attachments: Array>; - constructor(name: string); - addAttachment(slotIndex: number, name: string, attachment: Attachment): void; - getAttachment(slotIndex: number, name: string): Attachment; - attachAll(skeleton: Skeleton, oldSkin: Skin): void; - } - } - namespace spine.core { - class Slot { - currentMesh: any; - currentSprite: any; - meshes: any; - currentMeshName: string; - sprites: any; - currentSpriteName: string; - blendMode: number; - tempRegion: TextureRegion; - tempAttachment: Attachment; - data: SlotData; - bone: Bone; - color: Color; - attachment: Attachment; - private attachmentTime; - attachmentVertices: number[]; - constructor(data: SlotData, bone: Bone); - getAttachment(): Attachment; - setAttachment(attachment: Attachment): void; - setAttachmentTime(time: number): void; - getAttachmentTime(): number; - setToSetupPose(): void; - } - } - namespace spine.core { - class SlotData { - index: number; - name: string; - boneData: BoneData; - color: Color; - attachmentName: string; - blendMode: number; - constructor(index: number, name: string, boneData: BoneData); - } - } - namespace spine.core { - abstract class Texture { - protected _image: HTMLImageElement; - constructor(image: HTMLImageElement); - getImage(): HTMLImageElement; - abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; - abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; - abstract dispose(): void; - static filterFromString(text: string): TextureFilter; - static wrapFromString(text: string): TextureWrap; - } - enum TextureFilter { - Nearest = 9728, - Linear = 9729, - MipMap = 9987, - MipMapNearestNearest = 9984, - MipMapLinearNearest = 9985, - MipMapNearestLinear = 9986, - MipMapLinearLinear = 9987, - } - enum TextureWrap { - MirroredRepeat = 33648, - ClampToEdge = 33071, - Repeat = 10497, - } - class TextureRegion { - texture: Texture; - size: Rectangle; - readonly width: number; - readonly height: number; - readonly u: number; - readonly v: number; - readonly u2: number; - readonly v2: number; - readonly offsetX: number; - readonly offsetY: number; - readonly pixiOffsetY: number; - readonly spineOffsetY: number; - readonly originalWidth: number; - readonly originalHeight: number; - readonly x: number; - readonly y: number; - readonly rotate: boolean; - } - } - namespace spine.core { - class TextureAtlas implements Disposable { - pages: TextureAtlasPage[]; - regions: TextureAtlasRegion[]; - constructor(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any); - addTexture(name: string, texture: Texture): TextureAtlasRegion; - addTextureHash(textures: Map, stripExtension: boolean): void; - addSpineAtlas(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any): void; - private load(atlasText, textureLoader, callback); - findRegion(name: string): TextureAtlasRegion; - dispose(): void; - } - class TextureAtlasPage { - name: string; - minFilter: TextureFilter; - magFilter: TextureFilter; - uWrap: TextureWrap; - vWrap: TextureWrap; - baseTexture: BaseTexture; - width: number; - height: number; - setFilters(): void; - } - class TextureAtlasRegion extends TextureRegion { - page: TextureAtlasPage; - name: string; - index: number; - } - } - namespace spine.core { - class TransformConstraint implements Constraint { - data: TransformConstraintData; - bones: Bone[]; - target: Bone; - rotateMix: number; - translateMix: number; - scaleMix: number; - shearMix: number; - temp: Vector2; - constructor(data: TransformConstraintData, skeleton: Skeleton); - apply(): void; - update(): void; - getOrder(): number; - } - } - namespace spine.core { - class TransformConstraintData { - name: string; - order: number; - bones: BoneData[]; - target: BoneData; - rotateMix: number; - translateMix: number; - scaleMix: number; - shearMix: number; - offsetRotation: number; - offsetX: number; - offsetY: number; - offsetScaleX: number; - offsetScaleY: number; - offsetShearY: number; - constructor(name: string); - } - } - namespace spine.core { - interface Updatable { - update(): void; - } - } - namespace spine.core { - interface Map { - [key: string]: T; - } - class IntSet { - array: number[]; - add(value: number): boolean; - contains(value: number): boolean; - remove(value: number): void; - clear(): void; - } - interface Disposable { - dispose(): void; - } - class Color { - r: number; - g: number; - b: number; - a: number; - static WHITE: Color; - static RED: Color; - static GREEN: Color; - static BLUE: Color; - static MAGENTA: Color; - constructor(r?: number, g?: number, b?: number, a?: number); - set(r: number, g: number, b: number, a: number): this; - setFromColor(c: Color): this; - setFromString(hex: string): this; - add(r: number, g: number, b: number, a: number): this; - clamp(): this; - } - class MathUtils { - static PI: number; - static PI2: number; - static radiansToDegrees: number; - static radDeg: number; - static degreesToRadians: number; - static degRad: number; - static clamp(value: number, min: number, max: number): number; - static cosDeg(degrees: number): number; - static sinDeg(degrees: number): number; - static signum(value: number): number; - static toInt(x: number): number; - static cbrt(x: number): number; - } - class Utils { - static SUPPORTS_TYPED_ARRAYS: boolean; - static arrayCopy(source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number): void; - static setArraySize(array: T[], size: number, value?: any): T[]; - static ensureArrayCapacity(array: T[], size: number, value?: any): T[]; - static newArray(size: number, defaultValue: T): T[]; - static newFloatArray(size: number): ArrayLike; - static toFloatArray(array: number[]): number[] | Float32Array; - } - class DebugUtils { - static logBones(skeleton: Skeleton): void; - } - class Pool { - private items; - private instantiator; - constructor(instantiator: () => T); - obtain(): T; - free(item: T): void; - freeAll(items: ArrayLike): void; - clear(): void; - } - class Vector2 { - x: number; - y: number; - constructor(x?: number, y?: number); - set(x: number, y: number): Vector2; - length(): number; - normalize(): this; - } - class TimeKeeper { - maxDelta: number; - framesPerSecond: number; - delta: number; - totalTime: number; - private lastTime; - private frameCount; - private frameTime; - update(): void; - } - interface ArrayLike { - length: number; - [n: number]: T; - } - } - namespace spine { - function atlasParser(): (resource: loaders.Resource, next: () => any) => any; - function imageLoaderAdapter(loader: any, namePrefix: any, baseUrl: any, imageOptions: any): (line: string, callback: (baseTexture: BaseTexture) => any) => void; - function syncImageLoaderAdapter(baseUrl: any, crossOrigin: any): (line: any, callback: any) => void; - } - namespace spine { - class SpineSprite extends Sprite { - region: core.TextureRegion; - constructor(tex: Texture); - } - class SpineMesh extends mesh.Mesh { - region: core.TextureRegion; - constructor(texture: Texture, vertices?: Float32Array, uvs?: Float32Array, indices?: Uint16Array, drawMode?: number); - } - class Spine extends Container { - static globalAutoUpdate: boolean; - tintRgb: ArrayLike; - spineData: core.SkeletonData; - skeleton: core.Skeleton; - stateData: core.AnimationStateData; - state: core.AnimationState; - slotContainers: Container[]; - constructor(spineData: core.SkeletonData); - autoUpdate: boolean; - tint: number; - update(dt: number): void; - private setSpriteRegion(attachment, sprite, region); - private setMeshRegion(attachment, mesh, region); - protected lastTime: number; - autoUpdateTransform(): void; - createSprite(slot: core.Slot, attachment: core.RegionAttachment, defName: string): SpineSprite; - createMesh(slot: core.Slot, attachment: core.MeshAttachment): SpineMesh; - hackTextureBySlotIndex(slotIndex: number, texture?: Texture, size?: Rectangle): boolean; - hackTextureBySlotName: (slotName: string, texture?: Texture, size?: Rectangle) => any; - } - } -} diff --git a/pixi-spine/pixi-spine-tests.ts b/pixi-spine/pixi-spine-tests.ts deleted file mode 100644 index 51e4c7806f..0000000000 --- a/pixi-spine/pixi-spine-tests.ts +++ /dev/null @@ -1,311 +0,0 @@ -import * as PIXI from "pixi.js"; - -namespace Spine { - - export class Dragon { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private dragon: PIXI.spine.Spine; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - PIXI.loader.add('dragon', '../../_assets/spine/dragon.json').load(this.onAssetsLoaded); - - } - - private onAssetsLoaded = (loader: PIXI.loaders.Loader, res: any): void => { - - // initiate the spine animation - this.dragon = new PIXI.spine.Spine(res.dragon.spineData); - this.dragon.skeleton.setToSetupPose(); - this.dragon.update(0); - this.dragon.autoUpdate = false; - - // create a container for the spin animation and add the animation to it - var dragonCage: PIXI.Container = new PIXI.Container(); - dragonCage.addChild(this.dragon); - - // measure the spine animation and position it inside its container to align it to the origin - var localRect: PIXI.Rectangle = this.dragon.getLocalBounds(); - this.dragon.position.set(-localRect.x, -localRect.y); - - // now we can scale, position and rotate the container as any other display object - var scale = Math.min((this.renderer.width * 0.7) / dragonCage.width, (this.renderer.height * 0.7) / dragonCage.height); - dragonCage.scale.set(scale, scale); - dragonCage.position.set((this.renderer.width - dragonCage.width) * 0.5, (this.renderer.height - dragonCage.height) * 0.5); - - // add the container to the stage - this.stage.addChild(dragonCage); - - // once position and scaled, set the animation to play - this.dragon.state.setAnimation(0, 'flying', true); - - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - // update the spine animation, only needed if dragon.autoupdate is set to false - this.dragon.update(0.01666666666667); // HARDCODED FRAMERATE! - - this.renderer.render(this.stage); - - } - - } - -} - -namespace Spine { - - export class Goblin { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private goblin: PIXI.spine.Spine; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - PIXI.loader.add('goblins', '../../_assets/spine/goblins.json').load(this.onAssetsLoaded); - - } - - private onAssetsLoaded = (loader: PIXI.loaders.Loader, res: any): void => { - - // initiate the spine animation - this.goblin = new PIXI.spine.Spine(res.goblins.spineData); - this.goblin.skeleton.setSkinByName('goblin'); - this.goblin.skeleton.setSlotsToSetupPose(); - - this.goblin.position.x = 400; - this.goblin.position.y = 600; - this.goblin.scale.set(1.5); - - this.goblin.state.setAnimationByName(0, 'walk', true); - - this.stage.addChild(this.goblin); - - this.stage.on('click', () => { - - // change current skin - var currentSkinName = this.goblin.skeleton.skin.name; - var newSkinName = (currentSkinName === 'goblin' ? 'goblingirl' : 'goblin'); - this.goblin.skeleton.setSkinByName(newSkinName); - this.goblin.skeleton.setSlotsToSetupPose(); - - }); - - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace Spine { - - export class Pixie { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private pixie: PIXI.spine.Spine; - - private position: number; - private background: PIXI.Sprite; - private background2: PIXI.Sprite; - private foreground: PIXI.Sprite; - private foreground2: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - PIXI.loader.add('pixie', '../../_assets/spine/pixie.json').load(this.onAssetsLoaded); - - } - - private onAssetsLoaded = (loader: PIXI.loaders.Loader, res: any): void => { - - this.background = PIXI.Sprite.fromImage('../../_assets/spine/iP4_BGtile.jpg'); - this.background2 = PIXI.Sprite.fromImage('../../_assets/spine/iP4_BGtile.jpg'); - this.stage.addChild(this.background); - this.stage.addChild(this.background2); - - this.foreground = PIXI.Sprite.fromImage('../../_assets/spine/iP4_ground.png'); - this.foreground2 = PIXI.Sprite.fromImage('../../_assets/spine/iP4_ground.png'); - this.stage.addChild(this.foreground); - this.stage.addChild(this.foreground2); - this.foreground.position.y = this.foreground2.position.y = 640 - this.foreground2.height; - - this.pixie = new PIXI.spine.Spine(res.pixie.spineData); - - var scale = 0.3; - - this.pixie.position.x = 1024 / 3; - this.pixie.position.y = 500; - - this.pixie.scale.x = this.pixie.scale.y = scale; - - this.stage.addChild(this.pixie); - - this.pixie.stateData.setMix('running', 'jump', 0.2); - this.pixie.stateData.setMix('jump', 'running', 0.4); - - this.pixie.state.setAnimation(0, 'running', true); - - this.stage.on('mousedown', this.onTouchStart); - this.stage.on('touchstart', this.onTouchStart); - - this.animate(); - - } - - private onTouchStart = (): void => { - - this.pixie.state.setAnimation(0, 'jump', false); - this.pixie.state.addAnimation(0, 'running', true, 0); - - } - - private animate = (): void => { - - this.position += 10; - - this.background.position.x = -(this.position * 0.6); - this.background.position.x %= 1286 * 2; - if (this.background.position.x < 0) { - this.background.position.x += 1286 * 2; - } - this.background.position.x -= 1286; - - this.background2.position.x = -(this.position * 0.6) + 1286; - this.background2.position.x %= 1286 * 2; - if (this.background2.position.x < 0) { - this.background2.position.x += 1286 * 2; - } - this.background2.position.x -= 1286; - - this.foreground.position.x = -this.position; - this.foreground.position.x %= 1286 * 2; - if (this.foreground.position.x < 0) { - this.foreground.position.x += 1286 * 2; - } - this.foreground.position.x -= 1286; - - this.foreground2.position.x = -this.position + 1286; - this.foreground2.position.x %= 1286 * 2; - if (this.foreground2.position.x < 0) { - this.foreground2.position.x += 1286 * 2; - } - this.foreground2.position.x -= 1286; - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - - namespace Spine { - - export class SpineBoy { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private spineboy: PIXI.spine.Spine; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - PIXI.loader.add('spineboy', '../../_assets/spine/spineboy.json').load(this.onAssetsLoaded); - - } - - private onAssetsLoaded = (loader: PIXI.loaders.Loader, res: any): void => { - - // initiate the spine animation - this.spineboy = new PIXI.spine.Spine(res.spineboy.spineData); - this.spineboy.position.x = this.renderer.width / 2; - this.spineboy.position.y = this.renderer.height; - this.spineboy.scale.set(1.5); - - // set up the mixes! - this.spineboy.stateData.setMix('walk', 'jump', 0.2); - this.spineboy.stateData.setMix('jump', 'walk', 0.4); - - // play animation - this.spineboy.state.setAnimation(0, 'walk', true); - - this.stage.addChild(this.spineboy); - - - this.stage.on('click', () => { - - this.spineboy.state.setAnimation(0, 'jump', false); - this.spineboy.state.addAnimation(0, 'walk', true, 0); - - }); - - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - - } - -} diff --git a/pixi-spine/tsconfig.json b/pixi-spine/tsconfig.json deleted file mode 100644 index 8351a9fd60..0000000000 --- a/pixi-spine/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", - "pixi-spine-tests.ts" - ] -} \ No newline at end of file diff --git a/pixi-spine/tslint.json b/pixi-spine/tslint.json deleted file mode 100644 index c21d1d3fb1..0000000000 --- a/pixi-spine/tslint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": {} -} diff --git a/pixi.js/index.d.ts b/pixi.js/index.d.ts deleted file mode 100644 index bacdfd23aa..0000000000 --- a/pixi.js/index.d.ts +++ /dev/null @@ -1,2891 +0,0 @@ -// Type definitions for Pixi.js 4.3 -// Project: https://github.com/pixijs/pixi.js/ -// Definitions by: Clark Stevenson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// from CONST -export var VERSION: typeof CONST.VERSION; -export var PI_2: typeof CONST.PI_2; -export var RAD_TO_DEG: typeof CONST.RAD_TO_DEG; -export var DEG_TO_RAD: typeof CONST.DEG_TO_RAD; -export var RENDERER_TYPE: typeof CONST.RENDERER_TYPE; -export var BLEND_MODES: typeof CONST.BLEND_MODES; -export var DRAW_MODES: typeof CONST.DRAW_MODES; -export var SCALE_MODES: typeof CONST.SCALE_MODES; -export var WRAP_MODES: typeof CONST.WRAP_MODES; -export var TRANSFORM_MODE: typeof CONST.TRANSFORM_MODE; -export var PRECISION: typeof CONST.PRECISION; -export var TEXT_STYLE_CHANGED: typeof CONST.TEXT_STYLE_CHANGED; -export var GC_MODES: typeof CONST.GC_MODES; -export var SHAPES: typeof CONST.SHAPES; -export var TEXT_GRADIENT: typeof CONST.TEXT_GRADIENT; - -export function autoDetectRenderer(width: number, height: number, options?: PIXI.IRendererOptions, noWebGL?: boolean): PIXI.WebGLRenderer | PIXI.CanvasRenderer; -export var loader: PIXI.loaders.Loader; - -////////////////////////////////////////////////////////////////////////////// -///////////////////////////////SETTINGS/////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace settings { - export var TARGET_FPMS: number; - export var MIPMAP_TEXTURES: boolean; - export var RESOLUTION: number; - export var FILTER_RESOLUTION: number; - export var SPRITE_MAX_TEXTURES: number; - export var SPRITE_BATCH_SIZE: number; - export var RETINA_PREFIX: RegExp; - export var RENDER_OPTIONS: { - view: HTMLCanvasElement, - antialias: boolean, - forceFXAA: boolean, - autoResize: boolean, - transparent: boolean, - backgroundColor: number, - clearBeforeRender: boolean, - preserveDrawingBuffer: boolean, - roundPixels: boolean - }; - export var TRANSFORM_MODE: number; - export var GC_MODE: number; - export var GC_MAX_IDLE: number; - export var GC_MAX_CHECK_COUNT: number; - export var WRAP_MODE: number; - export var SCALE_MODE: number; - export var PRECISION: string; - export var UPLOADS_PER_FRAME: number; - export var CAN_UPLOAD_SAME_BUFFER: boolean; -} - -////////////////////////////////////////////////////////////////////////////// -/////////////////////////////ACCESSIBILITY//////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace accessibility { - - // accessibility - export class AccessibilityManager { - - constructor(renderer: CanvasRenderer | WebGLRenderer); - - protected div: HTMLElement; - protected pool: HTMLElement[]; - protected renderId: number; - debug: boolean; - renderer: SystemRenderer; - protected children: IAccessibleTarget[]; - protected isActive: boolean; - - protected activate(): void; - protected deactivate(): void; - protected updateAccessibleObjects(displayObject: DisplayObject): void; - protected update(): void; - protected capHitArea(hitArea: IHitArea): void; - protected addChild(displayObject: DisplayObject): void; - protected _onClick(e: interaction.InteractionEvent): void; - protected _onFocus(e: interaction.InteractionEvent): void; - protected _onFocusOut(e: interaction.InteractionEvent): void; - protected _onKeyDown(e: interaction.InteractionEvent): void; - protected _onMouseMove(): void; - - destroy(): void; - - } - export interface IAccessibleTarget { - - accessible: boolean; - accessibleTitle: string; - accessibleHint: string; - tabIndex: number; - - } - -} - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////CORE////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -// const - -export namespace CONST { - export var VERSION: string; - export var PI_2: number; - export var RAD_TO_DEG: number; - export var DEG_TO_RAD: number; - export var TARGET_FPMS: number; - export var RENDERER_TYPE: { - UNKNOWN: number; - WEBGL: number; - CANVAS: number; - }; - export var BLEND_MODES: { - NORMAL: number; - ADD: number; - MULTIPLY: number; - SCREEN: number; - OVERLAY: number; - DARKEN: number; - LIGHTEN: number; - COLOR_DODGE: number; - COLOR_BURN: number; - HARD_LIGHT: number; - SOFT_LIGHT: number; - DIFFERENCE: number; - EXCLUSION: number; - HUE: number; - SATURATION: number; - COLOR: number; - LUMINOSITY: number; - }; - export var DRAW_MODES: { - POINTS: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - TRIANGLES: number; - TRIANGLE_STRIP: number; - TRIANGLE_FAN: number; - }; - export var SCALE_MODES: { - LINEAR: number, - NEAREST: number - }; - export var GC_MODES: { - AUTO: number; - MANUAL: number; - }; - export var WRAP_MODES: { - CLAMP: number; - MIRRORED_REPEAT: number; - REPEAT: number; - }; - export var TRANSFORM_MODE: { - DEFAULT: number; - DYNAMIC: number; - STATIC: number; - }; - export var URL_FILE_EXTENSION: RegExp | string; - export var DATA_URI: RegExp | string; - export var SVG_SIZE: RegExp | string; - export var SHAPES: { - POLY: number; - RECT: number; - CIRC: number; - ELIP: number; - RREC: number; - }; - export var PRECISION: { - LOW: string; - MEDIUM: string; - HIGH: string; - }; - export var TEXT_GRADIENT: { - LINEAR_VERTICAL: number; - LINEAR_HORIZONTAL: number; - }; - export var TEXT_STYLE_CHANGED: string; - -} - -// display - -export interface IDestroyOptions { - children?: boolean; - texture?: boolean; - baseTexture?: boolean; -} -export class Bounds { - - minX: number; - minY: number; - maxX: number; - maxY: number; - rect: Rectangle; - - isEmpty(): boolean; - clear(): void; - - getRectangle(rect?: Rectangle): Rectangle; - addPoint(point: Point): void; - addQuad(vertices: number[]): Bounds; - addFrame(transform: Transform, x0: number, y0: number, x1: number, y1: number): void; - addVertices(transform: Transform, vertices: number[], beginOffset: number, endOffset: number): void; - addBounds(bounds: Bounds): void; - addBoundsMask(bounds: Bounds, mask: Bounds): void; - addBoundsArea(bounds: Bounds, area: Rectangle): void; - -} -export class Container extends DisplayObject { - - // begin extras.getChildByName - getChildByName(name: string): DisplayObject; - // end extras.getChildByName - - children: DisplayObject[]; - width: number; - height: number; - - protected onChildrenChange: (...args: any[]) => void; - addChild(child: T, ...additionalChildren: DisplayObject[]): T; - addChildAt(child: T, index: number): T; - swapChildren(child: DisplayObject, child2: DisplayObject): void; - getChildIndex(child: DisplayObject): number; - setChildIndex(child: DisplayObject, index: number): void; - getChildAt(index: number): DisplayObject; - removeChild(child: DisplayObject): DisplayObject; - removeChildAt(index: number): DisplayObject; - removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; - updateTransform(): void; - calculateBounds(): void; - protected _calculateBounds(): void; - protected containerUpdateTransform(): void; - renderWebGL(renderer: WebGLRenderer): void; - renderAdvancedWebGL(renderer: WebGLRenderer): void; - protected _renderWebGL(renderer: WebGLRenderer): void; - protected _renderCanvas(renderer: CanvasRenderer): void; - renderCanvas(renderer: CanvasRenderer): void; - destroy(options?: IDestroyOptions | boolean): void; - - once(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): utils.EventEmitter; - once(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - on(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): utils.EventEmitter; - on(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): utils.EventEmitter; - on(event: string, fn: Function, context?: any): utils.EventEmitter; - off(event: string, fn: Function, context?: any): utils.EventEmitter; - -} -export class DisplayObject extends utils.EventEmitter implements interaction.InteractiveTarget { - - // begin extras.cacheAsBitmap - protected _cacheAsBitmap: boolean; - protected _cacheData: boolean; - cacheAsBitmap: boolean; - protected _renderCachedWebGL(renderer: WebGLRenderer): void; - protected _initCachedDisplayObject(renderer: WebGLRenderer): void; - protected _renderCachedCanvas(renderer: CanvasRenderer): void; - protected _initCachedDisplayObjectCanvas(renderer: CanvasRenderer): void; - protected _calculateCachedBounds(): Rectangle; - protected _getCachedLocalBounds(): Rectangle; - protected _destroyCachedDisplayObject(): void; - protected _cacheAsBitmapDestroy(): void; - // end extras.cacheAsBitmap - - // begin extras.getChildByName - name: string; - // end extras.getChildByName - - // begin extras.getGlobalPosition - getGlobalPosition(point?: Point, skipUpdate?: boolean): Point; - // end extras.getGlobalPosition - - // begin accessible target - accessible: boolean; - accessibleTitle: string; - accessibleHint: string; - tabIndex: number; - // end accessible target - - // begin interactive target - interactive: boolean; - buttonMode: boolean; - hitArea: IHitArea; - interactiveChildren: boolean; - defaultCursor: string; - _isRightDown: boolean; - _isLeftDown: boolean; - // end interactive target - - transform: TransformBase; - alpha: number; - visible: boolean; - renderable: boolean; - parent: Container; - worldAlpha: number; - filterArea: Rectangle; - protected _filters: Filter[]; - protected _enabledFilters: Filter[]; - protected _bounds: Bounds; - protected _boundsID: number; - protected _lastBoundsID: number; - protected _boundsRect: Rectangle; - protected _localBoundsRect: Rectangle; - protected _mask: Rectangle; - x: number; - y: number; - worldTransform: Matrix; - localTransform: Matrix; - position: Point; - scale: Point; - pivot: Point; - skew: Point; - rotation: number; - worldVisible: boolean; - mask: PIXI.Graphics | PIXI.Sprite; - filters: Filter[]; - - updateTransform(): void; - protected displayObjectUpdateTransform(): void; - protected _recursivePostUpdateTransform(): void; - getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle; - getLocalBounds(rect?: Rectangle): Rectangle; - toGlobal(position: Point, point?: Point, skipUpdate?: boolean): Point; - toLocal(position: Point, from?: DisplayObject, point?: Point, skipUpdate?: boolean): Point; - protected renderWebGL(renderer: WebGLRenderer): void; - renderCanvas(renderer: CanvasRenderer): void; - setParent(container: Container): Container; - setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject; - destroy(): void; - - on(event: string, fn: Function, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - off(event: string, fn: Function, context?: any): utils.EventEmitter; - - /* - on(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - on(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - - once(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - once(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; - */ - -} - -export class TransformBase { - - static IDENTITY: TransformBase; - - worldTransform: Matrix; - localTransform: Matrix; - protected _worldID: number; - updateLocalTransform(): void; - updateTransform(parentTransform: TransformBase): void; - updateWorldTransform(parentTransform: TransformBase): void; - -} -export class TransformStatic extends TransformBase { - - position: ObservablePoint; - scale: ObservablePoint; - pivot: ObservablePoint; - skew: ObservablePoint; - - protected _rotation: number; - protected _sr: number; - protected _cr: number; - protected _cy: number; - protected _sy: number; - protected _nsx: number; - protected _cx: number; - protected _currentLocalID: number; - - protected onChange(): void; - updateSkew(): void; - updateLocalTransform(): void; - updateTransform(parentTransform: TransformBase): void; - setFromMatrix(matrix: Matrix): void; - - rotation: number; - -} -export class Transform extends TransformBase { - - constructor(); - - position: Point; - scale: Point; - skew: ObservablePoint; - pivot: Point; - - protected _rotation: number; - protected _sr: number; - protected _cr: number; - protected _cy: number; - protected _sy: number; - protected _nsx: number; - protected _cx: number; - - updateSkew(): void; - setFromMatrix(matrix: Matrix): void; - - rotation: number; - -} - -// graphics - -export class GraphicsData { - - constructor(lineWidth: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, fill: boolean, shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon); - - lineWidth: number; - lineColor: number; - lineAlpha: number; - protected _lineTint: number; - fillColor: number; - fillAlpha: number; - protected _fillTint: number; - fill: boolean; - protected holes: IShape[]; - shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon; - type: number; - clone(): GraphicsData; - addHole(shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon): void; - destroy(options?: IDestroyOptions | boolean): void; - -} -export class Graphics extends Container { - - fillAlpha: number; - lineWidth: number; - lineColor: number; - protected graphicsData: GraphicsData[]; - tint: number; - protected _prevTint: number; - blendMode: number; - currentPath: GraphicsData; - protected _webGL: any; - isMask: boolean; - boundsPadding: number; - protected _localBounds: Bounds; - dirty: boolean; - fastRectDirty: number; - clearDirty: number; - boundsDirty: number; - protected cachedSpriteDirty: boolean; - protected _spriteRect: Rectangle; - protected _fastRect: boolean; - - static _SPRITE_TEXTURE: Texture; - - clone(): Graphics; - lineStyle(lineWidth?: number, color?: number, alpha?: number): Graphics; - moveTo(x: number, y: number): Graphics; - lineTo(x: number, y: number): Graphics; - quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): Graphics; - bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): Graphics; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Graphics; - arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): Graphics; - beginFill(color: number, alpha?: number): Graphics; - endFill(): Graphics; - drawRect(x: number, y: number, width: number, height: number): Graphics; - drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Graphics; - drawCircle(x: number, y: number, radius: number): Graphics; - drawEllipse(x: number, y: number, width: number, height: number): Graphics; - drawPolygon(path: number[] | Point[]): Graphics; - clear(): Graphics; - isFastRect(): boolean; - protected _renderCanvas(renderer: CanvasRenderer): void; - protected _calculateBounds(): Rectangle; - protected _renderSpriteRect(renderer: PIXI.SystemRenderer): void; - containsPoint(point: Point): boolean; - updateLocalBounds(): void; - drawShape(shape: IShape | Circle | Rectangle | Ellipse | Polygon | RoundedRectangle): GraphicsData; - generateCanvasTexture(scaleMode?: number, resolution?: number): Texture; - protected closePath(): Graphics; - protected addHole(): Graphics; - destroy(options?: IDestroyOptions | boolean): void; - -} -export class CanvasGraphicsRenderer { - - constructor(renderer: SystemRenderer); - render(graphics: Graphics): void; - protected updateGraphicsTint(graphics: Graphics): void; - protected renderPolygon(points: Point[], close: boolean, context: CanvasRenderingContext2D): void; - destroy(): void; - -} -export class GraphicsRenderer extends ObjectRenderer { - - constructor(renderer: PIXI.CanvasRenderer); - - protected graphicsDataPool: GraphicsData[]; - protected primitiveShader: PrimitiveShader; - gl: WebGLRenderingContext; - - CONTEXT_UID: number; - - destroy(): void; - render(graphics: Graphics): void; - protected updateGraphics(graphics: PIXI.Graphics): void; - getWebGLData(webGL: WebGLRenderingContext, type: number): WebGLGraphicsData; - -} -export class WebGLGraphicsData { - - constructor(gl: WebGLRenderingContext, shader: glCore.GLShader, attribsState: glCore.IAttribState); - - gl: WebGLRenderingContext; - color: number[]; - points: Point[]; - indices: number[]; - buffer: WebGLBuffer; - indexBuffer: WebGLBuffer; - dirty: boolean; - glPoints: number[]; - glIndices: number[]; - shader: glCore.GLShader; - vao: glCore.VertexArrayObject; - - reset(): void; - upload(): void; - destroy(): void; - -} -export class PrimitiveShader extends glCore.GLShader { } - -// math - -export namespace GroupD8 { - - export var E: number; - export var SE: number; - export var S: number; - export var SW: number; - export var W: number; - export var NW: number; - export var N: number; - export var NE: number; - export var MIRROR_HORIZONTAL: number; - export var MIRROR_VERTICAL: number; - - export function uX(ind: number): number; - export function uY(ind: number): number; - export function vX(ind: number): number; - export function vY(ind: number): number; - export function inv(rotation: number): number; - export function add(rotationSecond: number, rotationFirst: number): number; - export function sub(rotationSecond: number, rotationFirst: number): number; - export function rotate180(rotation: number): number; - export function isSwapWidthHeight(rotation: number): boolean; - export function byDirection(dx: number, dy: number): number; - export function matrixAppendRotationInv(matrix: Matrix, rotation: number, tx: number, ty: number): void; - -} -export class Matrix { - - a: number; - b: number; - c: number; - d: number; - tx: number; - ty: number; - - fromArray(array: number[]): void; - set(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix; - toArray(transpose?: boolean, out?: number[]): number[]; - apply(pos: Point, newPos?: Point): Point; - applyInverse(pos: Point, newPos?: Point): Point; - translate(x: number, y: number): Matrix; - scale(x: number, y: number): Matrix; - rotate(angle: number): Matrix; - append(matrix: Matrix): Matrix; - setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number): PIXI.Matrix; - prepend(matrix: Matrix): Matrix; - invert(): Matrix; - identity(): Matrix; - decompose(transform: TransformBase): TransformBase; - clone(): Matrix; - copy(matrix: Matrix): Matrix; - - static IDENTITY: Matrix; - static TEMP_MATRIX: Matrix; - -} -export class ObservablePoint { - - constructor(cb: Function, scope?: any, x?: number, y?: number); - - x: number; - y: number; - cb: () => void; - scope: any; - - set(x?: number, y?: number): void; - copy(point: Point | ObservablePoint): void; - -} -export class Point { - - constructor(x?: number, y?: number); - - x: number; - y: number; - - clone(): Point; - copy(p: Point): void; - equals(p: Point): boolean; - set(x?: number, y?: number): void; - -} - -export interface IShape { -} -export interface IHitArea extends IShape { - - contains(x: number, y: number): boolean; - -} -export class Circle { - - constructor(x?: number, y?: number, radius?: number); - - x: number; - y: number; - radius: number; - type: number; - - clone(): Circle; - contains(x: number, y: number): boolean; - getBounds(): Rectangle; - -} -export class Ellipse { - - constructor(x?: number, y?: number, width?: number, height?: number); - - x: number; - y: number; - width: number; - height: number; - type: number; - - clone(): Ellipse; - contains(x: number, y: number): boolean; - getBounds(): Rectangle; - -} -export class Polygon { - - constructor(points: Point[] | number[]); - constructor(...points: Point[]); - constructor(...points: number[]); - - closed: boolean; - points: number[]; - type: number; - - clone(): Polygon; - contains(x: number, y: number): boolean; - close(): void; - -} -export class Rectangle { - - constructor(x?: number, y?: number, width?: number, height?: number); - - x: number; - y: number; - width: number; - height: number; - type: number; - left: number; - right: number; - top: number; - bottom: number; - - static EMPTY: Rectangle; - - clone(): Rectangle; - copy(rectangle: Rectangle): Rectangle; - contains(x: number, y: number): boolean; - pad(paddingX: number, paddingY: number): void; - fit(rectangle: Rectangle): void; - enlarge(rect: Rectangle): void; - -} -export class RoundedRectangle { - - constructor(x?: number, y?: number, width?: number, height?: number, radius?: number); - - x: number; - y: number; - width: number; - height: number; - radius: number; - type: number; - - clone(): RoundedRectangle; - contains(x: number, y: number): boolean; - -} - -// renderers - -export interface IRendererOptions { - - view?: HTMLCanvasElement; - transparent?: boolean; - autoResize?: boolean; - antialias?: boolean; - resolution?: number; - clearBeforeRender?: boolean; - backgroundColor?: number; - roundPixels?: boolean; - context?: WebGLRenderingContext; - -} -export class SystemRenderer extends utils.EventEmitter { - - constructor(system: string, width?: number, height?: number, options?: IRendererOptions); - - type: number; - width: number; - height: number; - view: HTMLCanvasElement; - resolution: number; - transparent: boolean; - autoResize: boolean; - blendModes: any; // todo? - preserveDrawingBuffer: boolean; - clearBeforeRender: boolean; - roundPixels: boolean; - protected _backgroundColor: number; - protected _backgroundColorRgba: number[]; - protected _backgroundColorString: string; - protected _tempDisplayObjectParent: Container; - protected _lastObjectRendered: DisplayObject; - backgroundColor: number; - - resize(width: number, height: number): void; - generateTexture(displayObject: DisplayObject, scaleMode?: number, resolution?: number): RenderTexture; - render(...args: any[]): void; - destroy(removeView?: boolean): void; - -} -export class CanvasRenderer extends SystemRenderer { - - // plugintarget mixin start - static __plugins: any[]; - static registerPlugin(pluginName: string, ctor: Function): void; - plugins: any; - initPlugins(): void; - destroyPlugins(): void; - // plugintarget mixin end - - constructor(width?: number, height?: number, options?: IRendererOptions); - - rootContext: CanvasRenderingContext2D; - rootResolution: number; - refresh: boolean; - maskManager: CanvasMaskManager; - smoothProperty: string; - extract: extract.CanvasExtract; - - context: CanvasRenderingContext2D; - - render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void - setBlendMode(blendMode: number): void; - destroy(removeView?: boolean): void; - resize(w: number, h: number): void; - - on(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; - on(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; - on(event: string, fn: Function, context?: any): utils.EventEmitter; - once(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; - once(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - off(event: string, fn: Function, context?: any): utils.EventEmitter; - -} -export class CanvasMaskManager { - - constructor(renderer: CanvasRenderer); - - pushMask(maskData: any): void; - protected renderGraphicsShape(graphics: Graphics): void; - popMask(renderer: WebGLRenderer | CanvasRenderer): void; - destroy(): void; - -} -export class CanvasRenderTarget { - - constructor(width: number, height: number, resolution: number); - - canvas: HTMLCanvasElement; - context: CanvasRenderingContext2D; - resolution: number; - - width: number; - height: number; - - clear(): void; - resize(width: number, height: number): void; - destroy(): void; - -} - -export interface IWebGLRendererOptions { - - view?: HTMLCanvasElement; - transparent?: boolean; - autoResize?: boolean; - antialias?: boolean; - forceFXAA?: boolean; - resolution?: number; - clearBeforeRender?: boolean; - preserveDrawingBuffer?: boolean; - roundPixels?: boolean; - -} -export class WebGLRenderer extends SystemRenderer { - - // plugintarget mixin start - static __plugins: any[]; - static registerPlugin(pluginName: string, ctor: Function): void; - plugins: any; - initPlugins(): void; - destroyPlugins(): void; - // plugintarget mixin end - - constructor(width?: number, height?: number, options?: IWebGLRendererOptions); - - protected _contextOptions: { - alpha: boolean; - antiAlias: boolean; - premultipliedAlpha: boolean; - stencil: boolean; - preseveDrawingBuffer: boolean; - }; - protected _backgroundColorRgba: number[]; - maskManager: MaskManager; - stencilManager: StencilManager; - emptyRenderer: ObjectRenderer; - currentRenderer: ObjectRenderer; - gl: WebGLRenderingContext; - CONTEXT_UID: number; - state: WebGLState; - renderingToScreen: boolean; - boundTextures: Texture[]; - filterManager: FilterManager; - textureManager: TextureManager; - extract: extract.WebGLExtract; - protected drawModes: any; - protected _activeShader: Shader; - _activeRenderTarget: RenderTarget; - protected _initContext(): void; - - render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void - setObjectRenderer(objectRenderer: ObjectRenderer): void; - flush(): void; - resize(width: number, height: number): void; - setBlendMode(blendMode: number): void; - clear(clearColor?: number): void; - setTransform(matrix: Matrix): void; - bindRenderTexture(renderTexture: RenderTexture, transform: Transform): WebGLRenderer; - bindRenderTarget(renderTarget: RenderTarget): WebGLRenderer; - bindShader(shader: Shader): WebGLRenderer; - bindTexture(texture: Texture | BaseTexture, location?: number, forceLocation?: boolean): number; - unbindTexture(texture: Texture | BaseTexture): WebGLRenderer; - createVao(): glCore.VertexArrayObject; - bindVao(vao: glCore.VertexArrayObject): WebGLRenderer; - reset(): WebGLRenderer; - handleContextLost: (event: WebGLContextEvent) => void; - handleContextRestored: () => void; - destroy(removeView?: boolean): void; - - on(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): utils.EventEmitter; - on(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; - on(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; - on(event: string, fn: Function, context?: any): utils.EventEmitter; - once(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): utils.EventEmitter; - once(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; - once(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - off(event: string, fn: Function, context?: any): utils.EventEmitter; - -} -export class WebGLState { - - constructor(gl: WebGLRenderingContext); - - activeState: number[]; - defaultState: number[]; - stackIndex: number; - stack: number[]; - gl: WebGLRenderingContext; - maxAttribs: number; - attribState: glCore.IAttribState; - nativeVaoExtension: any; - - push(): void; - pop(): void; - setState(state: number[]): void; - setBlend(value: number): void; - setBlendMode(value: number): void; - setDepthTest(value: number): void; - setCullFace(value: number): void; - setFrontFace(value: number): void; - resetAttributes(): void; - resetToDefault(): void; - -} -export class TextureManager { - - constructor(renderer: WebGLRenderer); - - renderer: WebGLRenderer; - gl: WebGLRenderingContext; - protected _managedTextures: WebGLTexture[]; - - bindTexture(): void; - getTexture(): WebGLTexture; - updateTexture(texture: BaseTexture | Texture): WebGLTexture; - destroyTexture(texture: BaseTexture, _skipRemove?: boolean): void; - removeAll(): void; - destroy(): void; - -} -export class TextureGarbageCollector { - - constructor(renderer: WebGLRenderer); - - renderer: WebGLRenderer; - count: number; - checkCount: number; - maxIdle: number; - checkCountMax: number; - mode: number; - - update(): void; - run(): void; - unload(): void; - -} -export abstract class ObjectRenderer extends WebGLManager { - - constructor(renderer: WebGLRenderer); - - start(): void; - stop(): void; - flush(): void; - - render(...args: any[]): void; - -} -export class Quad { - - constructor(gl: WebGLRenderingContext); - - gl: WebGLRenderingContext; - vertices: number[]; - uvs: number[]; - interleaved: number[]; - indices: number[]; - vertexBuffer: WebGLBuffer; - vao: glCore.VertexArrayObject; - initVao(shader: glCore.GLShader): void; - map(targetTextureFrame: Rectangle, destinationFrame: Rectangle): Quad; - upload(): Quad; - destroy(): void; - -} -export class RenderTarget { - - constructor(gl: WebGLRenderingContext, width: number, height: number, scaleMode: number, resolution: number, root?: boolean); - - gl: WebGLRenderingContext; - frameBuffer: glCore.GLFramebuffer; - texture: Texture; - clearColor: number[]; - size: Rectangle; - resolution: number; - projectionMatrix: Matrix; - transform: Matrix; - frame: Rectangle; - defaultFrame: Rectangle; - destinationFrame: Rectangle; - sourceFrame: Rectangle; - stencilBuffer: glCore.GLFramebuffer; - stencilMaskStack: Graphics[]; - filterData: { - index: number, - stack: Array<{ - renderTarget: RenderTarget, - filter: any[]; - bounds: Rectangle - }> - }; - scaleMode: number; - root: boolean; - - clear(clearColor?: number[]): void; - attachStencilBuffer(): void; - setFrame(destinationFrame: Rectangle, sourceFrame: Rectangle): void; - activate(): void; - calculateProjection(destinationFrame: Rectangle, sourceFrame: Rectangle): void; - resize(width: number, height: number): void; - destroy(): void; - -} - -export class BlendModeManager extends WebGLManager { - - constructor(renderer: WebGLRenderer); - - currentBlendMode: number; - - setBlendMode(blendMode: number): boolean; - -} -export class FilterManager extends WebGLManager { - - constructor(renderer: WebGLRenderer); - - gl: WebGLRenderingContext; - quad: Quad; - stack: Array<{ - renderTarget: RenderTarget; - sourceFrame: Rectangle; - destinationFrame: Rectangle; - filters: Filter[]; - target: any; - resolution: number; - }>; - stackIndex: number; - shaderCache: any; - filterData: any; - - pushFilter(target: RenderTarget, filters: Filter[]): void; - popFilter(): void; - applyFilter(shader: glCore.GLShader | Filter, inputTarget: RenderTarget, outputTarget: RenderTarget, clear?: boolean): void; - syncUniforms(shader: glCore.GLShader, filter: Filter): void; - getRenderTarget(clear?: boolean, resolution?: number): RenderTarget; - returnRenderTarget(renderTarget: RenderTarget): RenderTarget; - calculateScreenSpaceMatrix(outputMatrix: Matrix): Matrix; - calculateNormalisedScreenSpaceMatrix(outputMatrix: Matrix): Matrix; - calculateSpriteMatrix(outputMatrix: Matrix, sprite: Sprite): Matrix; - destroy(): void; - emptyPool(): void; - getPotRenderTarget(gl: WebGLRenderingContext, minWidth: number, minHeight: number, resolution: number): RenderTarget; - freePotRenderTarget(renderTarget: RenderTarget): void; - -} -export class StencilMaskStack { - - stencilStack: any[]; - reverse: boolean; - count: number; - -} -export class MaskManager extends WebGLManager { - - scissor: boolean; - scissorData: any; - scissorRenderTarget: RenderTarget; - enableScissor: boolean; - alphaMaskPool: number[]; - alphaMaskIndex: number; - pushMask(target: RenderTarget, maskData: Sprite | Graphics): void; - popMask(target: RenderTarget, maskData: Sprite | Graphics): void; - pushSpriteMask(target: RenderTarget, maskData: Sprite | Graphics): void; - popSpriteMask(): void; - pushStencilMask(maskData: Sprite | Graphics): void; - popStencilMask(): void; - pushScissorMask(target: RenderTarget, maskData: Sprite | Graphics): void; - popScissorMask(): void; - -} -export class StencilManager extends WebGLManager { - - constructor(renderer: WebGLRenderer); - - stencilMaskStack: Graphics[]; - - setMaskStack(stencilMasStack: Graphics[]): void; - pushStencil(graphics: Graphics): void; - popStencil(): void; - destroy(): void; - -} -export class WebGLManager { - - constructor(renderer: WebGLRenderer); - - renderer: WebGLRenderer; - onContextChange(): void; - destroy(): void; - -} -export interface IUniformData { - - type: string; - value: any; - - // name is set by pixi if uniforms were automatically extracted from shader code, but not used anywhere - name?: string; - -} -export class Filter { - - // param uniforms should be an object matching type {[name: string]: IUniformData}; - // left untyped as there's no way to define the type without requiring an index signature or making this class generic - constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: any); - - vertextSrc: string; - fragmentSrc: string; - protected uniformData: { [name: string]: IUniformData }; - uniforms: { [name: string]: any }; - glShaders: any; - glShaderKey: string; - padding: number; - resolution: number; - blendMode: number; - enabled: boolean; - apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget, clear?: boolean): void; - - static defaultVertexSrc: string; - static defaultFragmentSrc: string; - -} -export class SpriteMaskFilter extends Filter { - - constructor(sprite: Sprite); - - maskSprite: Sprite; - maskMatrix: Matrix; - apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget): void; - -} - -// sprites - -export class Sprite extends Container { - - constructor(texture?: Texture); - - protected _anchor: ObservablePoint; - anchor: ObservablePoint; - protected _texture: Texture; - protected _width: number; - protected _height: number; - tint: number; - protected _tint: number; - protected _tintRGB: number; - blendMode: number; - pluginName: string; - protected cachedTint: number; - texture: Texture; - protected textureDirty: boolean; - protected _textureID: number; - protected _transformID: number; - protected vertexTrimmedData: Float32Array; - vertexData: Float32Array; - width: number; - height: number; - - protected _onTextureUpdate(): void; - calculateVertices(): void; - protected _calculateBounds(): void; - protected calculateTrimmedVertices(): void; - protected onAnchorUpdate(): void; - protected _renderWebGL(renderer: WebGLRenderer): void; - protected _renderCanvas(renderer: CanvasRenderer): void; - getLocalBounds(): Rectangle; - containsPoint(point: Point): boolean; - destroy(options?: IDestroyOptions | boolean): void; - - static from(source: number | string | BaseTexture | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): Sprite; - static fromFrame(frameId: string): Sprite; - static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite; - -} -export class BatchBuffer { - - vertices: ArrayBuffer; - float32View: number[]; - uint32View: number[]; - - destroy(): void; - -} -export class SpriteRenderer extends ObjectRenderer { - - constructor(renderer: PIXI.WebGLRenderer); - - vertSize: number; - vertByteSize: number; - size: number; - buffers: BatchBuffer[]; - indices: number[]; - shaders: Shader[]; - currentIndex: number; - tick: number; - groups: any[]; - sprites: Sprite[]; - vertexBuffers: number[]; - vaos: glCore.VertexArrayObject[]; - vaoMax: number; - vertexCount: number; - - protected onContextChanged: () => void; - protected onPrerender: () => void; - render(sprite: Sprite): void; - flush(): void; - start(): void; - stop(): void; - destroy(): void; - -} -export class CanvasSpriteRenderer extends ObjectRenderer { - - constructor(renderer: WebGLRenderer); - - render(sprite: Sprite): void; - destroy(): void; - -} -export namespace CanvasTinter { - - export function getTintedTexture(sprite: Sprite, color: number): HTMLCanvasElement; - export function tintWithMultiply(texture: Texture, color: number, canvas: HTMLCanvasElement): void; - export function tintWithOverlay(texture: Texture, color: number, canvas: HTMLCanvasElement): void; - export function tintWithPerPixel(texture: Texture, color: number, canvas: HTMLCanvasElement): void; - export function roundColor(color: number): number; - - export var cacheStepsPerColorChannel: number; - export var convertTintToImage: boolean; - export var canUseMultiply: boolean; - export var tintMethod: Function; - -} - -// text -export interface TextStyleOptions { - align?: string; - breakWords?: boolean; - dropShadow?: boolean; - dropShadowAngle?: number; - dropShadowBlur?: number; - dropShadowColor?: string | number; - dropShadowDistance?: number; - fill?: string | string[] | number | number[] | CanvasGradient | CanvasPattern; - fillGradientType?: number; - fontFamily?: string; - fontSize?: number | string; - fontStyle?: string; - fontVariant?: string; - fontWeight?: string; - letterSpacing?: number; - lineHeight?: number; - lineJoin?: string; - miterLimit?: number; - padding?: number; - stroke?: string | number; - strokeThickness?: number; - styleID?: number; - textBaseline?: string; - wordWrap?: boolean; - wordWrapWidth?: number; -} - -export class TextStyle implements TextStyleOptions { - align: string; - breakWords: boolean; - dropShadow: boolean; - dropShadowAngle: number; - dropShadowBlur: number; - dropShadowColor: string | number; - dropShadowDistance: number; - fill: string | string[] | number | number[] | CanvasGradient | CanvasPattern; - fillGradientType: number; - fontFamily: string; - fontSize: number | string; - fontStyle: string; - fontVariant: string; - fontWeight: string; - letterSpacing: number; - lineHeight: number; - lineJoin: string; - miterLimit: number; - padding: number; - stroke: string | number; - strokeThickness: number; - styleID: number; - textBaseline: string; - wordWrap: boolean; - wordWrapWidth: number; - constructor(style?: TextStyleOptions); - clone(): TextStyle; - reset(): void; -} - -export class Text extends Sprite { - - static getFontStyle(style: TextStyleOptions): string; - static calculateFontProperties(style: string): any; - - constructor(text?: string, style?: TextStyleOptions); - - canvas: HTMLCanvasElement; - context: CanvasRenderingContext2D; - resolution: number; - protected _text: string; - protected _style: TextStyle; - protected _styleListener: Function; - protected _font: string; - protected localStyleID: number; - - static fontPropertiesCache: any; - static fontPropertiesCanvas: HTMLCanvasElement; - static fontPropertiesContext: CanvasRenderingContext2D; - - width: number; - height: number; - style: TextStyle; - text: string; - - protected updateText(respectDirty?: boolean): void; - protected drawLetterSpacing(text: string, x: number, y: number, isStroke?: boolean): void; - protected updateTexture(): void; - renderWebGL(renderer: WebGLRenderer): void; - protected _renderCanvas(renderer: CanvasRenderer): void; - protected wordWrap(text: string): string; - protected _calculateBounds(): void; - protected _onStyleChange: () => void; - protected _generateFillStyle(style: TextStyle, lines: string[]): string | number | CanvasGradient; - destroy(options?: IDestroyOptions | boolean): void; - dirty: boolean; - -} - -// textures - -export class BaseRenderTexture extends BaseTexture { - - constructor(width?: number, height?: number, scaleMode?: number, resolution?: number); - - height: number; - width: number; - realHeight: number; - realWidth: number; - resolution: number; - scaleMode: number; - hasLoaded: boolean; - protected _glRenderTargets: { [n: number]: WebGLTexture; }; - protected _canvasRenderTarget: { [n: number]: WebGLTexture; }; - valid: boolean; - - resize(width: number, height: number): void; - destroy(): void; - - once(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - on(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): utils.EventEmitter; - on(event: string, fn: Function, context?: any): utils.EventEmitter; - off(event: string, fn: Function, context?: any): utils.EventEmitter; - -} -export class BaseTexture extends utils.EventEmitter { - - constructor(source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, scaleMode?: number, resolution?: number); - - protected uuid: number; - protected touched: number; - resolution: number; - width: number; - height: number; - realWidth: number; - realHeight: number; - scaleMode: number; - hasLoaded: boolean; - isLoading: boolean; - wrapMode: number; - source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; - origSource: HTMLImageElement; - imageType: string; - sourceScale: number; - premultipliedAlpha: boolean; - imageUrl: string; - protected isPowerOfTwo: boolean; - mipmap: boolean; - wrap: boolean; - protected _glTextures: any; - protected _enabled: number; - protected _id: number; - - update(): void; - protected _updateImageType(): void; - protected _loadSvgSource(): void; - protected _loadSvgSourceUsingDataUri(dataUri: string): void; - protected _loadSvgSourceUsingXhr(): void; - protected _loadSvgSourceUsingString(svgString: string): void; - protected loadSource(source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; - protected _sourceLoaded(): void; - destroy(): void; - dispose(): void; - updateSourceImage(newSrc: string): void; - - static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number, sourceScale?: number): BaseTexture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): BaseTexture; - - on(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - on(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - on(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - on(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - on(event: string, fn: Function, context?: any): utils.EventEmitter; - once(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - once(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - once(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - once(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - off(event: string, fn: Function, context?: any): utils.EventEmitter; - -} -export class RenderTexture extends Texture { - - constructor(baseRenderTexture: BaseRenderTexture, frame?: Rectangle); - - protected legacyRenderer: any; - valid: boolean; - - resize(width: number, height: number, doNotResizeBaseTexture?: boolean): void; - - static create(width?: number, height?: number, scaleMode?: number, resolution?: number): RenderTexture; - -} -export class Texture extends utils.EventEmitter { - - constructor(baseTexture: BaseTexture, frame?: Rectangle, orig?: Rectangle, trim?: Rectangle, rotate?: number); - - noFrame: boolean; - baseTexture: BaseTexture; - protected _frame: Rectangle; - trim: Rectangle; - valid: boolean; - requiresUpdate: boolean; - protected _uvs: TextureUvs; - orig: Rectangle; - protected _updateID: number; - transform: any; - - update(): void; - protected onBaseTextureLoaded(baseTexture: BaseTexture): void; - protected onBaseTextureUpdated(baseTexture: BaseTexture): void; - destroy(destroyBase?: boolean): void; - clone(): Texture; - protected _updateUvs(): void; - - static fromImage(imageUrl: string, crossOrigin?: boolean, scaleMode?: number, sourceScale?: number): Texture; - static fromFrame(frameId: string): Texture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): Texture; - static fromVideo(video: HTMLVideoElement | string, scaleMode?: number): Texture; - static fromVideoUrl(videoUrl: string, scaleMode?: number): Texture; - static from(source: number | string | BaseTexture | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): Texture; - static addTextureToCache(texture: Texture, id: string): void; - static removeTextureFromCache(id: string): Texture; - - frame: Rectangle; - protected _rotate: boolean; - rotate: number; - width: number; - height: number; - - static EMPTY: Texture; - - on(event: "update", fn: (texture: Texture) => void, context?: any): utils.EventEmitter; - on(event: string, fn: Function, context?: any): utils.EventEmitter; - once(event: "update", fn: (texture: Texture) => void, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - off(event: string, fn: Function, context?: any): utils.EventEmitter; - -} -export class TextureUvs { - - x0: number; - y0: number; - x1: number; - y1: number; - x2: number; - y2: number; - x3: number; - y3: number; - - uvsUint32: Uint32Array; - - protected set(frame: Rectangle, baseFrame: Rectangle, rotate: number): void; - -} -export class VideoBaseTexture extends BaseTexture { - - constructor(source: HTMLVideoElement, scaleMode?: number); - - autoUpdate: boolean; - autoPlay: boolean; - protected _isAutoUpdating: boolean; - - update(): void; - protected _onCanPlay(): void; - protected _onPlayStart(): void; - protected _onPlayStop(): void; - destroy(): void; - protected _isSourcePlaying(): boolean; - protected _isSourceReady(): boolean; - - static fromVideo(video: HTMLVideoElement, scaleMode?: number): VideoBaseTexture; - static fromUrl(videoSrc: string | any | string[] | any[]): VideoBaseTexture; - static fromUrls(videoSrc: string | any | string[] | any[]): VideoBaseTexture; - - source: HTMLVideoElement; - protected loadSource(source: HTMLVideoElement): void; -} - -// ticker - -export namespace ticker { - - export var shared: Ticker; - - export class Ticker { - - protected _tick(time: number): void; - protected _emitter: utils.EventEmitter; - protected _requestId: number; - protected _maxElapsedMS: number; - - protected _requestIfNeeded(): void; - protected _cancelIfNeeded(): void; - protected _startIfPossible(): void; - - autoStart: boolean; - deltaTime: number; - elapsedMS: number; - lastTime: number; - speed: number; - started: boolean; - - FPS: number; - minFPS: number; - - add(fn: (deltaTime: number) => void, context?: any): Ticker; - addOnce(fn: (deltaTime: number) => void, context?: any): Ticker; - remove(fn: (deltaTime: number) => void, context?: any): Ticker; - start(): void; - stop(): void; - update(): void; - - } - -} - -// shader - -export class Shader extends glCore.GLShader { } - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////EXTRACT/////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace extract { - - export class CanvasExtract { - - protected renderer: CanvasRenderer; - - constructor(renderer: CanvasRenderer); - - image(target?: DisplayObject | RenderTexture): HTMLImageElement; - base64(target?: DisplayObject | RenderTexture): string; - canvas(target?: DisplayObject | RenderTexture): HTMLCanvasElement; - pixels(renderTexture?: DisplayObject | RenderTexture): number[]; - - destroy(): void; - - } - export class WebGLExtract { - protected renderer: WebGLRenderer; - - constructor(renderer: WebGLRenderer); - - image(target?: DisplayObject | RenderTexture): HTMLImageElement; - base64(target?: DisplayObject | RenderTexture): string; - canvas(target?: DisplayObject | RenderTexture): HTMLCanvasElement; - pixels(renderTexture?: DisplayObject | RenderTexture): number[]; - - destroy(): void; - } - -} - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////EXTRAS//////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace extras { - - export interface IBitmapTextStyle { - - font?: string | { - - name?: string; - size?: number; - - }; - align?: string; - tint?: number; - - } - export class BitmapText extends Container { - - constructor(text: string, style?: IBitmapTextStyle); - - textWidth: number; - textHeight: number; - protected _glyphs: Sprite[]; - protected _font: string | { - name?: string; - size?: number; - }; - font: string | { - name?: string; - size?: number; - }; - protected _text: string; - maxWidth: number; - maxLineHeight: number; - dirty: boolean; - tint: number; - align: string; - text: string; - anchor: PIXI.Point | number; - - protected updateText(): void; - updateTransform(): void; - getLocalBounds(): Rectangle; - validate(): void; - - static fonts: any; - - } - export class AnimatedSprite extends Sprite { - - constructor(textures: Texture[] | Array<{ texture: Texture, time?: number }>); - - protected _textures: Texture[]; - protected _durations: number[]; - textures: Texture[] | Array<{ texture: Texture, time?: number }>; - animationSpeed: number; - loop: boolean; - onComplete: () => void; - onFrameChange: (currentFrame: number) => void; - protected _currentTime: number; - playing: boolean; - totalFrames: number; - currentFrame: number; - stop(): void; - play(): void; - gotoAndStop(frameNumber: number): void; - gotoAndPlay(frameNumber: number): void; - protected update(deltaTime: number): void; - destroy(): void; - - static fromFrames(frame: string[]): AnimatedSprite; - static fromImages(images: string[]): AnimatedSprite; - - } - export class TextureTransform { - - constructor(texture: Texture, clampMargin?: number); - - protected _texture: Texture; - protected mapCoord: Matrix; - protected uClampFrame: Float32Array; - protected uClampOffset: Float32Array; - protected _lastTextureID: number; - - clampOffset: number; - clampMargin: number; - - texture: Texture; - - update(forceUpdate?: boolean): void; - - } - export class TilingSprite extends Sprite { - - constructor(texture: Texture, width?: number, height?: number); - - tileTransform: TransformStatic; - protected _width: number; - protected _height: number; - protected _canvasPattern: CanvasPattern; - uvTransform: TextureTransform; - - clampMargin: number; - tileScale: Point | ObservablePoint; - tilePosition: Point | ObservablePoint; - - protected _onTextureUpdate(): void; - protected _renderWebGL(renderer: WebGLRenderer): void; - protected _renderCanvas(renderer: CanvasRenderer): void; - protected _calculateBounds(): void; - getLocalBounds(rect?: Rectangle): Rectangle; - containsPoint(point: Point): boolean; - destroy(): void; - - static from(source: number | string | BaseTexture | HTMLCanvasElement | HTMLVideoElement, width?: number, height?: number): TilingSprite; - static fromFrame(frameId: string, width?: number, height?: number): TilingSprite; - // if you remove the next line, the class will break. https://github.com/pixijs/pixi-typescript/issues/96 - static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite; - static fromImage(imageId: string, width?: number, height?: number, crossorigin?: boolean, scaleMode?: number): TilingSprite; - - width: number; - height: number; - - } - export class TilingSpriteRenderer extends ObjectRenderer { - - constructor(renderer: WebGLRenderer); - - render(ts: TilingSprite): void; - - } - -} - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////FILTERS/////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace filters { - - export class FXAAFilter extends Filter { } - export class BlurFilter extends Filter { - - constructor(strength?: number, quality?: number, resolution?: number, kernelSize?: number); - - blurXFilter: BlurXFilter; - blurYFilter: BlurYFilter; - resolution: number; - padding: number; - passes: number; - blur: number; - blurX: number; - blurY: number; - quality: number; - - } - export class BlurXFilter extends Filter { - - constructor(strength?: number, quality?: number, resolution?: number, kernelSize?: number); - - protected _quality: number; - - quality: number; - passes: number; - resolution: number; - strength: number; - firstRun: boolean; - blur: number; - - } - export class BlurYFilter extends Filter { - - constructor(strength?: number, quality?: number, resolution?: number, kernelSize?: number); - - protected _quality: number; - - quality: number; - passes: number; - resolution: number; - strength: number; - firstRun: boolean; - blur: number; - - } - export class ColorMatrixFilter extends Filter { - - constructor(); - - protected _loadMatrix(matrix: number[], multiply?: boolean): void; - protected _multiply(out: number[], a: number[], b: number[]): void; - protected _colorMatrix(matrix: number[]): void; - - matrix: number[]; - - brightness(b: number, multiply?: boolean): void; - greyscale(scale: number, multiply?: boolean): void; - blackAndWhite(multiply?: boolean): void; - hue(rotation: number, multiply?: boolean): void; - contrast(amount: number, multiply?: boolean): void; - saturate(amount: number, multiply?: boolean): void; - desaturate(multiply?: boolean): void; - negative(multiply?: boolean): void; - sepia(multiply?: boolean): void; - technicolor(multiply?: boolean): void; - polaroid(multiply?: boolean): void; - toBGR(multiply?: boolean): void; - kodachrome(multiply?: boolean): void; - browni(multiply?: boolean): void; - vintage(multiply?: boolean): void; - colorTone(desaturation: number, toned: number, lightColor: string, darkColor: string, multiply?: boolean): void; - night(intensity: number, multiply?: boolean): void; - predator(amount: number, multiply?: boolean): void; - lsd(multiply?: boolean): void; - reset(): void; - - } - export class DisplacementFilter extends Filter { - - constructor(sprite: Sprite, scale?: number); - - scale: Point; - map: Texture; - - } - export class VoidFilter extends Filter { - glShaderKey: string; - } - - // pixi-filters.d.ts todo - // https://github.com/pixijs/pixi-filters/ - export class NoiseFilter extends Filter { - - noise: number; - - } - -} - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////INTERACTION/////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace interaction { - - export interface InteractionEvent { - - stopped: boolean; - target: DisplayObject; - currentTarget: DisplayObject; - type: string; - data: InteractionData; - stopPropagation(): void; - - } - export class InteractionData { - - global: Point; - - protected _target: DisplayObject; - target: DisplayObject; - targetProxy: DisplayObject; - originalEvent: Event; - - getLocalPosition(displayObject: DisplayObject, point?: Point, globalPos?: Point): Point; - - } - export class InteractionManager extends utils.EventEmitter { - - constructor(renderer: SystemRenderer, options?: { autoPreventDefault?: boolean; interactionFrequency?: number; }); - - renderer: SystemRenderer; - autoPreventDefault: boolean; - interactionFrequency: number; - mouse: InteractionData; - pointer: InteractionData; - eventData: { - stopped: boolean; - target: any; - type: any; - data: InteractionData; - stopPropagination(): void; - }; - interactiveDataPool: InteractionData[]; - protected interactionDOMElement: HTMLElement; - protected moveWhenInside: boolean; - protected eventsAdded: boolean; - mouseOverRenderer: boolean; - supportsTouchEvents: boolean; - supportsPointerEvents: boolean; - normalizeTouchEvents: boolean; - normalizeMouseEvents: boolean; - - protected onMouseUp: (event: MouseEvent) => void; - protected processMouseUp: (displayObject: DisplayObject, hit: boolean) => void; - protected onMouseDown: (event: MouseEvent) => void; - protected processMouseDown: (displayObject: DisplayObject, hit: boolean) => void; - protected onMouseMove: (event: MouseEvent) => void; - protected processMouseMove: (displayObject: DisplayObject, hit: boolean) => void; - protected onMouseOut: (event: MouseEvent) => void; - protected processMouseOverOut: (displayObject: DisplayObject, hit: boolean) => void; - protected onMouseOver: (event: MouseEvent) => void; - - protected onPointerUp: (event: PointerEvent) => void; - protected processPointerUp: (displayObject: DisplayObject, hit: boolean) => void; - protected onPointerDown: (event: PointerEvent) => void; - protected processPointerDown: (displayObject: DisplayObject, hit: boolean) => void; - protected onPointerMove: (event: PointerEvent) => void; - protected processPointerMove: (displayObject: DisplayObject, hit: boolean) => void; - protected onPointerOut: (event: PointerEvent) => void; - protected processPointerOut: (displayObject: DisplayObject, hit: boolean) => void; - protected onPointerOver: (event: PointerEvent) => void; - - protected onTouchStart: (event: TouchEvent) => void; - protected processTouchStart: (DisplayObject: DisplayObject, hit: boolean) => void; - protected onTouchEnd: (event: TouchEvent) => void; - protected processTouchEnd: (displayObject: DisplayObject, hit: boolean) => void; - protected onTouchMove: (event: TouchEvent) => void; - protected processTouchMove: (displayObject: DisplayObject, hit: boolean) => void; - defaultCursorStyle: string; - currentCursorStyle: string; - protected _tempPoint: Point; - resolution: number; - protected setTargetElement(element: HTMLElement, resolution: number): void; - protected addEvents(): void; - protected removeEvents(): void; - update(deltaTime: number): void; - protected dispatchEvent(displayObject: DisplayObject, eventString: string, eventData: any): void; - mapPositionToPoint(point: Point, x: number, y: number): void; - protected processInteractive(point: Point, displayObject: DisplayObject, func: (displayObject: DisplayObject, hit: boolean) => void, hitTest: boolean, interactive: boolean): boolean; - protected _startInteractionProcess(): void; - protected _queueAdd(displayObject: DisplayObject, order: number): void; - protected _finishInteractionProcess(func: Function): void; - protected getTouchData(touchEvent: InteractionData): InteractionData; - protected returnTouchData(touchData: InteractionData): void; - protected normalizeToPointerData(Event: Event): void; - - destroy(): void; - - } - export interface InteractiveTarget { - - interactive: boolean; - interactiveChildren: boolean; - hitArea: IHitArea; - buttonMode: boolean; - defaultCursor: string; - - } - export interface InteractiveTargetProxy extends InteractiveTarget { - } - -} - -////////////////////////////////////////////////////////////////////////////// -///////////////////////////////LOADER///////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// extends -// https://github.com/englercj/resource-loader/ -// 1.6.4 - -export namespace loaders { - - export interface ILoaderOptions { - - crossOrigin?: boolean | string; - loadType?: number; - xhrType?: string; - metaData?: any; - - } - export interface IResourceDictionary { - - [index: string]: PIXI.loaders.Resource; - - } - export class Loader extends utils.EventEmitter { - - protected static _pixiMiddleware: Function[]; - static addPixiMiddleware(fn: Function): void; - - constructor(baseUrl?: string, concurrency?: number); - - baseUrl: string; - progress: number; - loading: boolean; - resources: IResourceDictionary; - - add(name: string, url: string, options?: ILoaderOptions, cb?: () => void): Loader; - add(url: string, options?: ILoaderOptions, cb?: () => void): Loader; - // todo I am not sure of object literal notional (or its options) so just allowing any but would love to improve this - add(obj: any, options?: ILoaderOptions, cb?: () => void): Loader; - - on(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): utils.EventEmitter; - on(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; - on(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; - on(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; - on(event: "start", fn: (loader: loaders.Loader) => void, context?: any): utils.EventEmitter; - on(event: string, fn: Function, context?: any): utils.EventEmitter; - - once(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): utils.EventEmitter; - once(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; - once(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; - once(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; - once(event: "start", fn: (loader: loaders.Loader) => void, context?: any): utils.EventEmitter; - once(event: string, fn: Function, context?: any): utils.EventEmitter; - - before(fn: Function): Loader; - pre(fn: Function): Loader; - - after(fn: Function): Loader; - use(fn: Function): Loader; - - reset(): void; - - load(cb?: (loader: loaders.Loader, object: any) => void): Loader; - - } - export interface ITextureDictionary { - [index: string]: PIXI.Texture; - } - - export class Resource extends utils.EventEmitter { - - static LOAD_TYPE: { - XHR: number; - IMAGE: number; - AUDIO: number; - VIDEO: number; - }; - - static XHR_READ_STATE: { - UNSENT: number; - OPENED: number; - HEADERS_RECIEVED: number; - LOADING: number; - DONE: number; - }; - - static XHR_RESPONSE_TYPE: { - DEFAULT: number; - BUFFER: number; - BLOB: number; - DOCUMENT: number; - JSON: number; - TEXT: number; - }; - - constructor(name?: string, url?: string | string[], options?: ILoaderOptions); - - protected _loadSourceElement(type: string): void; - isLoading: boolean; - isComplete: boolean; - - isJson: boolean; - isXml: boolean; - isImage: boolean; - isAudio: boolean; - isVideo: boolean; - - name: string; - texture: Texture; - textures: ITextureDictionary; - url: string; - data: any; - crossOrigin: boolean | string; - loadType: number; - xhrType: string; - error: Error; - xhr: XMLHttpRequest; - SVGMetadataElement: any; - - metadata: any; - spineAtlas: any; - spineData: any; - - complete(): void; - load(cb?: () => void): void; - abort(message: string): void; - - } -} - -////////////////////////////////////////////////////////////////////////////// -///////////////////////////////MESH/////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace mesh { - - export class Mesh extends Container { - - constructor(texture: Texture, vertices?: Float32Array, uvs?: Float32Array, indices?: Uint16Array, drawMode?: number); - - protected _texture: Texture; - uvs: Float32Array; - vertices: Float32Array; - indices: Uint16Array; - dirty: number; - indexDirty: number; - dirtyVertex: boolean; - protected _geometryVersion: number; - blendMode: number; - pluginName: string; - canvasPadding: number; - drawMode: number; - texture: Texture; - tintRgb: Float32Array; - protected _glDatas: { [n: number]: any; }; - protected _renderWebGL(renderer: WebGLRenderer): void; - protected _renderCanvas(renderer: CanvasRenderer): void; - protected _onTextureUpdate(): void; - protected _calculateBounds(): void; - containsPoint(point: Point): boolean; - tint: number; - - static DRAW_MODES: { - TRIANGLE_MESH: number; - TRIANGLES: number; - }; - - } - - export class CanvasMeshRenderer { - - constructor(renderer: CanvasRenderer); - - renderer: CanvasRenderer; - - render(mesh: Mesh): void; - protected _renderTriangleMesh(mesh: Mesh): void; - protected _renderTriangles(mesh: Mesh): void; - protected _renderDrawTriangle(mesh: Mesh, index0: number, index1: number, index2: number): void; - protected renderMeshFlat(mesh: Mesh): void; - - destroy(): void; - - } - - export class MeshRenderer extends ObjectRenderer { - - constructor(renderer: WebGLRenderer); - - shader: Shader; - render(mesh: Mesh): void; - - } - - export class Plane extends Mesh { - - constructor(texture: Texture, verticesX?: number, verticesY?: number); - protected _ready: boolean; - verticesX: number; - verticesY: number; - drawMode: number; - - refresh(): void; - - protected _onTexureUpdate(): void; - - } - - export class NineSlicePlane extends Plane { - - constructor(texture: Texture, leftWidth?: number, topHeight?: number, rightWidth?: number, bottomHeight?: number); - - width: number; - height: number; - leftWidth: number; - rightWidth: number; - topHeight: number; - bottomHeight: number; - - protected _leftWidth: number; - protected _rightWidth: number; - protected _topHeight: number; - protected _bottomHeight: number; - protected _height: number; - protected _width: number; - protected _origHeight: number; - protected _origWidth: number; - protected _uvh: number; - protected _uvw: number; - - updateHorizontalVertices(): void; - updateVerticalVertices(): void; - protected drawSegment(context: CanvasRenderingContext2D | WebGLRenderingContext, textureSource: any, w: number, h: number, x1: number, y1: number, x2: number, y2: number): void; - - } - - export class Rope extends Mesh { - - constructor(texture: Texture, points: Point[]); - - points: Point[]; - colors: number[]; - protected _ready: boolean; - refresh(): void; - - protected _onTextureUpdate(): void; - updateTransform(): void; - - } -} - -////////////////////////////////////////////////////////////////////////////// -/////////////////////////////PARTICLES//////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace particles { - - export interface IParticleContainerProperties { - - scale?: boolean; - position?: boolean; - rotation?: boolean; - uvs?: boolean; - alpha?: boolean; - - } - export class ParticleContainer extends Container { - - constructor(size?: number, properties?: IParticleContainerProperties, batchSize?: number); - - protected _properties: boolean[]; - protected _maxSize: number; - protected _batchSize: number; - protected _glBuffers: { [n: number]: WebGLBuffer; }; - protected _bufferToUpdate: number; - interactiveChildren: boolean; - blendMode: number; - roundPixels: boolean; - baseTexture: BaseTexture; - - setProperties(properties: IParticleContainerProperties): void; - protected onChildrenChange: (smallestChildIndex?: number) => void; - - destroy(options?: IDestroyOptions | boolean): void; - - } - export class ParticleBuffer { - - constructor(gl: WebGLRenderingContext, properties: any, dynamicPropertyFlags: any[], size: number); - - gl: WebGLRenderingContext; - vertSize: number; - vertByteSize: number; - size: number; - dynamicProperties: any[]; - staticProperties: any[]; - staticStride: number; - staticBuffer: any; - staticData: any; - dynamicStride: number; - dynamicBuffer: any; - dynamicData: any; - - destroy(): void; - - } - export interface IParticleRendererProperty { - attribute: number; - size: number; - uploadFunction: (children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number) => void; - offset: number; - } - export class ParticleRenderer extends ObjectRenderer { - - constructor(renderer: WebGLRenderer); - - shader: glCore.GLShader; - indexBuffer: WebGLBuffer; - properties: IParticleRendererProperty[]; - protected tempMatrix: Matrix; - - start(): void; - generateBuffers(container: ParticleContainer): ParticleBuffer[]; - uploadVertices(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; - uploadPosition(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; - uploadRotation(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; - uploadUvs(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; - uploadAlpha(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; - destroy(): void; - - indices: Uint16Array; - - } - export interface IParticleShader extends glCore.GLShader { } - -} - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////PREPARE/////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export namespace prepare { - - type addHook = (item: any, queue: any[]) => boolean; - type uploadHook = (prepare: UploadHookSource, item: any) => boolean; - export abstract class BasePrepare{ - - constructor(renderer: SystemRenderer); - - limiter: CountLimiter | TimeLimiter; - protected renderer: SystemRenderer; - protected uploadHookHelper: UploadHookSource; - protected queue: any[]; - protected addHooks: addHook[]; - protected uploadHooks: Array>; - protected completes: Function[]; - protected ticking: boolean; - protected delayedTick: () => void; - - upload(item: Function | DisplayObject | BaseTexture | TextStyle | any, done?: () => void): void; - protected tick(): void; - protected prepareItems(): void; - register(addHook?: addHook, uploadHook?: uploadHook): this; - add(item: DisplayObject | any): this; - destroy(): void; - - } - export class CanvasPrepare extends BasePrepare { - - constructor(renderer: CanvasRenderer); - - protected canvas: HTMLCanvasElement; - protected ctx: CanvasRenderingContext2D; - - } - export class WebGLPrepare extends BasePrepare { - - constructor(renderer: WebGLRenderer); - - } - export class CountLimiter { - - constructor(maxItemsPerFrame: number); - - protected maxItemsPerFrame: number; - protected itemsLeft: number; - - } - export class TimeLimiter { - - constructor(maxMilliseconds: number); - - protected maxMilliseconds: number; - protected frameStart: number; - - } - -} - -////////////////////////////////////////////////////////////////////////////// -/////////////////////////////pixi-gl-core///////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// pixi-gl-core https://github.com/pixijs/pixi-gl-core -// sharedArrayBuffer as a type is not available yet. -// need to fully define what an `Attrib` is. -export namespace glCore { - - export interface IContextOptions { - /** - * Boolean that indicates if the canvas contains an alpha buffer. - */ - alpha?: boolean; - /** - * Boolean that indicates that the drawing buffer has a depth buffer of at least 16 bits. - */ - depth?: boolean; - /** - * Boolean that indicates that the drawing buffer has a stencil buffer of at least 8 bits. - */ - stencil?: boolean; - /** - * Boolean that indicates whether or not to perform anti-aliasing. - */ - antialias?: boolean; - /** - * Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha. - */ - premultipliedAlpha?: boolean; - /** - * If the value is true the buffers will not be cleared and will preserve their values until cleared or overwritten by the author. - */ - preserveDrawingBuffer?: boolean; - /** - * Boolean that indicates if a context will be created if the system performance is low. - */ - failIfMajorPerformanceCaveat?: boolean; - } - export function createContext(view: HTMLCanvasElement, options?: IContextOptions): WebGLRenderingContext; - export function setVertexAttribArrays(gl: WebGLRenderingContext, attribs: IAttrib[], state?: WebGLState): WebGLRenderingContext; - export class GLBuffer { - - static EMPTY_ARRAY_BUFFER: ArrayBuffer; - - constructor(gl: WebGLRenderingContext, type: number, data: ArrayBuffer | ArrayBufferView | any, drawType: number); - - protected _updateID: number; - gl: WebGLRenderingContext; - buffer: WebGLBuffer; - type: number; - drawType: number; - data: ArrayBuffer | ArrayBufferView | any; - - upload(data: ArrayBuffer | ArrayBufferView | any, offset?: number, dontBind?: boolean): void; - bind(): void; - - static createVertexBuffer(gl: WebGLRenderingContext, data: ArrayBuffer | ArrayBufferView | any, drawType: number): GLBuffer; - static createIndexBuffer(gl: WebGLRenderingContext, data: ArrayBuffer | ArrayBufferView | any, drawType: number): GLBuffer; - static create(gl: WebGLRenderingContext, type: number, data: ArrayBuffer | ArrayBufferView | any, drawType: number): GLBuffer; - - destroy(): void; - - } - export class GLFramebuffer { - - constructor(gl: WebGLRenderingContext, width: number, height: number); - - gl: WebGLRenderingContext; - frameBuffer: WebGLFramebuffer; - stencil: WebGLRenderbuffer; - texture: GLTexture; - width: number; - height: number; - - enableTexture(texture: GLTexture): void; - enableStencil(): void; - clear(r: number, g: number, b: number, a: number): void; - bind(): void; - unbind(): void; - resize(width: number, height: number): void; - destroy(): void; - - static createRGBA(gl: WebGLRenderingContext, width: number, height: number, data: ArrayBuffer | ArrayBufferView | any): GLFramebuffer; - static createFloat32(gl: WebGLRenderingContext, width: number, height: number, data: ArrayBuffer | ArrayBufferView | any): GLFramebuffer; - - } - export class GLShader { - - constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[]); - - gl: WebGLRenderingContext; - program: WebGLProgram; - uniforms: any; - attributes: any; - - bind(): void; - destroy(): void; - - } - export class GLTexture { - - constructor(gl: WebGLRenderingContext, width?: number, height?: number, format?: number, type?: number); - - gl: WebGLRenderingContext; - texture: WebGLTexture; - mipmap: boolean; - premultiplyAlpha: boolean; - width: number; - height: number; - format: number; - type: number; - - upload(source: HTMLImageElement | ImageData | HTMLVideoElement | HTMLCanvasElement): void; - uploadData(data: number, width: number, height: number): void; - bind(location?: number): void; - unbind(): void; - minFilter(linear: boolean): void; - magFilter(linear: boolean): void; - enableMipmap(): void; - enableLinearScaling(): void; - enableNearestScaling(): void; - enableWrapClamp(): void; - enableWrapRepeat(): void; - enableWrapMirrorRepeat(): void; - destroy(): void; - - static fromSource(gl: WebGLRenderingContext, source: HTMLImageElement | ImageData | HTMLVideoElement | HTMLCanvasElement, premultipleAlpha?: boolean): GLTexture; - static fromData(gl: WebGLRenderingContext, data: number[], width: number, height: number): GLTexture; - - } - export interface IAttrib { - - attribute: { - location: boolean; - size: number; - }; - normalized: boolean; - stride: number; - start: number; - buffer: ArrayBuffer; - - } - export interface IWebGLRenderingContextAttribute { - - buffer: WebGLBuffer; - attribute: any; - type: number; - normalized: boolean; - stride: number; - start: number; - - } - export interface IAttribState { - tempAttribState: IAttrib[]; - attribState: IAttrib[]; - } - - export class VertexArrayObject { - - static FORCE_NATIVE: boolean; - - constructor(gl: WebGLRenderingContext, state: WebGLState); - - protected nativeVaoExtension: any; - protected nativeState: IAttribState; - protected nativeVao: VertexArrayObject; - gl: WebGLRenderingContext; - attributes: IAttrib[]; - indexBuffer: GLBuffer; - dirty: boolean; - - bind(): VertexArrayObject; - unbind(): VertexArrayObject; - activate(): VertexArrayObject; - addAttribute(buffer: GLBuffer, attribute: IAttrib, type: number, normalized: boolean, stride: number, start: number): VertexArrayObject; - addIndex(buffer: GLBuffer, options?: any): VertexArrayObject; - clear(): VertexArrayObject; - draw(type: number, size: number, start: number): VertexArrayObject; - destroy(): void; - - } - -} - -////////////////////////////////////////////////////////////////////////////// -///////////////////////////////UTILS////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -export interface IDecomposedDataUri { - mediaType: string; - subType: string; - encoding: string; - data: any; -} - -export namespace utils { - - export function uid(): number; - export function hex2rgb(hex: number, out?: number[]): number[]; - export function hex2string(hex: number): string; - export function rgb2hex(rgb: Number[]): number; - export function canUseNewCanvasBlendModes(): boolean; - export function getResolutionOfUrl(url: string, defaultValue?: number): number; - export function getSvgSize(svgString: string): any; - export function decomposeDataUri(dataUri: string): IDecomposedDataUri; - export function getUrlFileExtension(url: string): string; - export function sayHello(type: string): void; - export function skipHello(): void; - export function isWebGLSupported(): boolean; - export function sign(n: number): number; - export function removeItems(arr: T[], startIdx: number, removeCount: number): void; - export var TextureCache: any; - export var BaseTextureCache: any; - - // https://github.com/kaimallea/isMobile - export namespace isMobile { - export var apple: { - phone: boolean; - ipod: boolean; - tablet: boolean; - device: boolean; - }; - export var android: { - phone: boolean; - tablet: boolean; - device: boolean; - }; - export var amazon: { - phone: boolean; - table: boolean; - device: boolean; - }; - export var windows: { - phone: boolean; - tablet: boolean; - device: boolean; - }; - export var seven_inch: boolean; - export var other: { - blackberry_10: boolean; - blackberry: boolean; - opera: boolean; - firefox: boolean; - chrome: boolean; - device: boolean; - }; - export var any: boolean; - export var phone: boolean; - export var tablet: boolean; - } - - // https://github.com/primus/eventemitter3 - export class EventEmitter { - - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - on(event: string, fn: Function, context?: any): EventEmitter; - once(event: string, fn: Function, context?: any): EventEmitter; - removeListener(event: string, fn: Function, context?: any, once?: boolean): EventEmitter; - removeAllListeners(event: string): EventEmitter; - eventNames(): string[]; - - off(event: string, fn: Function, context?: any, once?: boolean): EventEmitter; - addListener(event: string, fn: Function, context?: any): EventEmitter; - - } - -} - -////////////////////////////////////////////////////////////////////////////// -/////////////////////////////depreciation///////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// not sure how to handle blendmodes scalemodes basetexturecache -export namespace core { - - /** - * @class - * @private - * @name SpriteBatch - * @memberof PIXI - * @see PIXI.ParticleContainer - * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. - * @deprecated since version 3.0.0 - */ - type SpriteBatch = ParticleContainer; - - /** - * @class - * @private - * @name AssetLoader - * @memberof PIXI - * @see PIXI.loaders.Loader - * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. - * @deprecated since version 3.0.0 - */ - type AssetLoader = loaders.Loader; - - /** - * @class - * @private - * @name Stage - * @memberof PIXI - * @see PIXI.Container - * @deprecated since version 3.0.0 - */ - type Stage = Container; - - /** - * @class - * @private - * @name DisplayObjectContainer - * @memberof PIXI - * @see PIXI.Container - * @deprecated since version 3.0.0 - */ - type DisplayObjectContainer = Container; - - /** - * @class - * @private - * @name Strip - * @memberof PIXI - * @see PIXI.mesh.Mesh - * @deprecated since version 3.0.0 - */ - type Strip = mesh.Mesh; - - /** - * @class - * @private - * @name Rope - * @memberof PIXI - * @see PIXI.mesh.Rope - * @deprecated since version 3.0.0 - */ - type Rope = mesh.Rope; - - /** - * @class - * @private - * @name ParticleContainer - * @memberof PIXI - * @see PIXI.particles.ParticleContainer - * @deprecated since version 4.0.0 - */ - type ParticleContainer = particles.ParticleContainer; - - /** - * @class - * @private - * @name MovieClip - * @memberof PIXI - * @see PIXI.extras.MovieClip - * @deprecated since version 3.0.0 - */ - type MovieClip = extras.AnimatedSprite; - - /** - * @class - * @private - * @name TilingSprite - * @memberof PIXI - * @see PIXI.extras.TilingSprite - * @deprecated since version 3.0.0 - */ - type TilingSprite = extras.TilingSprite; - - /** - * @class - * @private - * @name BitmapText - * @memberof PIXI - * @see PIXI.extras.BitmapText - * @deprecated since version 3.0.0 - */ - type BitmapText = extras.BitmapText; - - /** - * @namespace - * @private - * @name math - * @memberof PIXI - * @see PIXI - * @deprecated since version 3.0.6 - */ - type math = any; - - /** - * @class - * @private - * @name PIXI.AbstractFilter - * @see PIXI.Filter - * @deprecated since version 3.0.6 - */ - type AbstractFilter = Filter; - - /** - * @class - * @private - * @name PIXI.TransformManual - * @see PIXI.TransformBase - * @deprecated since version 4.0.0 - */ - type TransformManual = TransformBase; - - /** - * @static - * @constant - * @name PIXI.TARGET_FPMS - * @see PIXI.settings.TARGET_FPMS - * @deprecated since version 4.2.0 - */ - type TARGET_FPMS = number; - - /** - * @static - * @constant - * @name PIXI.FILTER_RESOLUTION - * @see PIXI.settings.FILTER_RESOLUTION - * @deprecated since version 4.2.0 - */ - type FILTER_RESOLUTION = number; - - /** - * @static - * @constant - * @name PIXI.RESOLUTION - * @see PIXI.settings.RESOLUTION - * @deprecated since version 4.2.0 - */ - type RESOLUTION = number; - - /** - * @static - * @constant - * @name PIXI.MIPMAP_TEXTURES - * @see PIXI.settings.MIPMAP_TEXTURES - * @deprecated since version 4.2.0 - */ - type MIPMAP_TEXTURES = any; - - /** - * @static - * @constant - * @name PIXI.SPRITE_BATCH_SIZE - * @see PIXI.settings.SPRITE_BATCH_SIZE - * @deprecated since version 4.2.0 - */ - type SPRITE_BATCH_SIZE = number; - - /** - * @static - * @constant - * @name PIXI.SPRITE_MAX_TEXTURES - * @see PIXI.settings.SPRITE_MAX_TEXTURES - * @deprecated since version 4.2.0 - */ - type SPRITE_MAX_TEXTURES = number; - - /** - * @static - * @constant - * @name PIXI.RETINA_PREFIX - * @see PIXI.settings.RETINA_PREFIX - * @deprecated since version 4.2.0 - */ - type RETINA_PREFIX = RegExp | string; - - /** - * @static - * @constant - * @name PIXI.DEFAULT_RENDER_OPTIONS - * @see PIXI.settings.RENDER_OPTIONS - * @deprecated since version 4.2.0 - */ - type DEFAULT_RENDER_OPTIONS = number; - -} - -export namespace extras { - - /** - * @class - * @name MovieClip - * @memberof PIXI.extras - * @see PIXI.extras.AnimatedSprite - * @deprecated since version 4.2.0 - */ - type MovieClip = extras.AnimatedSprite; - -} - -declare global { - namespace pixi { - export var gl: typeof glCore; - } -} - -export as namespace PIXI; diff --git a/pixi.js/pixi.js-tests.ts b/pixi.js/pixi.js-tests.ts deleted file mode 100644 index 313ad7740e..0000000000 --- a/pixi.js/pixi.js-tests.ts +++ /dev/null @@ -1,2738 +0,0 @@ -import PIXI = require("pixi.js"); -namespace basics { - - export class Basics { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bunny: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a texture from an image path - var texture: PIXI.Texture = PIXI.Texture.fromImage("../../_assets/basics/bunny.png"); - - // create a new Sprite using the texture - this.bunny = new PIXI.Sprite(texture); - - // center the sprite's anchor point - this.bunny.anchor.x = 0.5; - this.bunny.anchor.y = 0.5; - - // move the sprite to the center of the screen - this.bunny.position.x = 200; - this.bunny.position.y = 150; - - // add it to the stage - this.stage.addChild(this.bunny); - - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.bunny.rotation += 0.1; - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class Click { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private sprite: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.sprite = PIXI.Sprite.fromImage('../../_assets/basics/bunny.png'); - this.sprite.position.set(230, 264); - this.sprite.interactive = true; - this.sprite.on('mousedown', this.onDown, this); - this.sprite.on('touchstart', this.onDown, this); - - // add it to the stage - this.stage.addChild(this.sprite); - - // start animatng - this.animate(); - - } - - private onDown = (eventData: PIXI.interaction.InteractionData): void => { - - this.sprite.scale.x += 0.3; - this.sprite.scale.y += 0.3; - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class Container { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private container: PIXI.Container; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.container = new PIXI.Container(); - - this.stage.addChild(this.container); - - for (var j = 0; j < 5; j++) { - for (var i = 0; i < 5; i++) { - var bunny: PIXI.Sprite = PIXI.Sprite.fromImage('../../_assets/basics/bunny.png'); - bunny.x = 40 * i; - bunny.y = 40 * j; - this.container.addChild(bunny); - } - } - - /* - * All the bunnies are added to the container with the addChild method - * when you do this, all the bunnies become children of the container, and when a container moves, - * so do all its children. - * This gives you a lot of flexibility and makes it easier to position elements on the screen - */ - this.container.x = 100; - this.container.y = 60; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class CustomFilter { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private filter: CustomizedFilter; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.background = PIXI.Sprite.fromImage('../../_assets/bkg-grass.jpg'); - this.background.scale.set(1.3, 1); - this.stage.addChild(this.background); - - - PIXI.loader.add('shader', '../../_assets/basics/shader.frag'); - PIXI.loader.once('complete', this.onLoaded, this); - PIXI.loader.load(); - - } - - private onLoaded(loader: PIXI.loaders.Loader, res: any) { - - var fragmentSrc = res.shader.data; - - this.filter = new CustomizedFilter(fragmentSrc); - this.background.filters = [this.filter]; - - this.animate(); - - - } - - private animate = (): void => { - - this.filter.uniforms['customUniform'].value += 0.04; - - this.renderer.render(this.stage); - requestAnimationFrame(this.animate); - - } - - } - - export class CustomizedFilter extends PIXI.Filter { - - constructor(fragmentSource: string) { - super(null, fragmentSource, { - customUniform: { - type: '1f', - value: 0 - } - }); - } - - } - -} - -namespace basics { - - export class Graphics { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private graphics: PIXI.Graphics; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.graphics = new PIXI.Graphics(); - - // draw a shape - this.graphics.moveTo(50, 50); - this.graphics.lineTo(250, 50); - this.graphics.lineTo(100, 100); - this.graphics.lineTo(50, 50); - this.graphics.endFill(); - - // set a fill and a line style again and draw a rectangle - this.graphics.lineStyle(2, 0x0000FF, 1); - this.graphics.beginFill(0xFF700B, 1); - this.graphics.drawRect(50, 250, 120, 120); - - // draw a rounded rectangle - this.graphics.lineStyle(2, 0xFF00FF, 1); - this.graphics.beginFill(0xFF00BB, 0.25); - this.graphics.drawRoundedRect(150, 450, 300, 100, 15); - this.graphics.endFill(); - - // draw a circle, set the lineStyle to zero so the circle doesn't have an outline - this.graphics.lineStyle(0); - this.graphics.beginFill(0xFFFF0B, 0.5); - this.graphics.drawCircle(470, 90, 60); - this.graphics.endFill(); - - this.stage.addChild(this.graphics); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class RenderTexture { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private container: PIXI.Container; - - private renderTexture: PIXI.RenderTexture; - - private sprite: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.container = new PIXI.Container(); - - this.stage.addChild(this.container); - - for (var j = 0; j < 5; j++) { - for (var i = 0; i < 5; i++) { - var bunny: PIXI.Sprite = PIXI.Sprite.fromImage('../../_assets/basics/bunny.png'); - bunny.x = 40 * i; - bunny.y = 40 * j; - bunny.rotation = Math.random() * (Math.PI * 2); - this.container.addChild(bunny); - } - } - - this.renderTexture = PIXI.RenderTexture.create(300, 200, PIXI.SCALE_MODES.LINEAR, 0.1); - - this.sprite = new PIXI.Sprite(this.renderTexture); - this.sprite.x = 450; - this.sprite.y = 60; - this.stage.addChild(this.sprite); - - this.container.x = 100; - this.container.y = 60; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.renderer.render(this.container, this.renderTexture); - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class SpriteSheet { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private movie: PIXI.extras.AnimatedSprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - PIXI.loader.add('../../_assets/basics/fighter.json').load((loader: PIXI.loaders.Loader, object: any): void => { - - // create an array of textures from an image path - var frames: PIXI.Texture[] = []; - - for (var i = 0; i < 30; i++) { - - var val = i < 10 ? '0' + i : i; - - // magically works since the spritesheet was loaded with the pixi loader - frames.push(PIXI.Texture.fromFrame('rollSequence00' + val + '.png')); - } - - - // create a AnimatedSprite (brings back memories from the days of Flash, right ?) - this.movie = new PIXI.extras.AnimatedSprite(frames); - - /* - * A AnimatedSprite inherits all the properties of a PIXI sprite - * so you can change its position, its anchor, mask it, etc - */ - this.movie.position.set(300); - this.movie.anchor.set(0.5); - this.movie.animationSpeed = 0.5; - this.movie.play(); - - this.stage.addChild(this.movie); - - this.animate(); - - }); - - } - - private animate = (): void => { - - this.movie.rotation += 0.01; - - // render the stage container - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace basics { - - export class Text { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private basicText: PIXI.Text; - - private richText: PIXI.Text; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.basicText = new PIXI.Text('Basic Text in Pixi'); - this.basicText.x = 30; - this.basicText.y = 90; - - this.stage.addChild(this.basicText); - - var style: PIXI.TextStyleOptions = { - fontSize: 36, - fontFamily: 'Arial', - fontWeight: 'bold', - fontStyle: 'italic', - fill: '#F7EDCA', - stroke: '#4a1850', - strokeThickness: 5, - dropShadow: true, - dropShadowColor: '#000000', - dropShadowAngle: Math.PI / 6, - dropShadowDistance: 6, - wordWrap: true, - wordWrapWidth: 440 - }; - - this.richText = new PIXI.Text('Rich Text with a lot of options and across multiple lines', style); - this.richText.x = 30; - this.richText.y = 180; - - this.stage.addChild(this.richText); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class TexturedMesh { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private strip: PIXI.mesh.Rope; - - private graphics: PIXI.Graphics; - - private count: number; - - private points: PIXI.Point[]; - - private ropeLength: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.count = 0; - - this.ropeLength = 918 / 20; - this.ropeLength = 45; - - this.points = []; - - for (var i = 0; i < 25; i++) { - this.points.push(new PIXI.Point(i * this.ropeLength, 0)); - } - - this.strip = new PIXI.mesh.Rope(PIXI.Texture.fromImage('../../_assets/snake.png'), this.points); - this.strip.position.x = -40; - this.strip.position.y = 300; - this.stage.addChild(this.strip); - - this.graphics = new PIXI.Graphics(); - this.graphics.x = this.strip.x; - this.graphics.y = this.strip.y; - this.stage.addChild(this.graphics); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.1; - - // make the snake - for (var i = 0; i < this.points.length; i++) { - this.points[i].y = Math.sin((i * 0.5) + this.count) * 30; - this.points[i].x = i * this.ropeLength + Math.cos((i * 0.3) + this.count) * 20; - } - - // render the stage - this.renderer.render(this.stage); - - this.renderPoints(); - - requestAnimationFrame(this.animate); - - } - - private renderPoints(): void { - this.graphics.clear(); - - this.graphics.lineStyle(2, 0xffc2c2); - this.graphics.moveTo(this.points[0].x, this.points[0].y); - - for (var i = 1; i < this.points.length; i++) { - this.graphics.lineTo(this.points[i].x, this.points[i].y); - } - - for (var i = 1; i < this.points.length; i++) { - this.graphics.beginFill(0xff0022); - this.graphics.drawCircle(this.points[i].x, this.points[i].y, 10); - this.graphics.endFill(); - } - } - - } - -} - -namespace basics { - - export class TilingSprite { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private texture: PIXI.Texture; - - private tilingSprite: PIXI.extras.TilingSprite; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a texture from an image path - this.texture = PIXI.Texture.fromImage('../../_assets/p2.jpeg'); - - /* create a tiling sprite ... - * requires a texture, a width and a height - * in WebGL the image size should preferably be a power of two - */ - this.tilingSprite = new PIXI.extras.TilingSprite(this.texture, this.renderer.width, this.renderer.height); - this.stage.addChild(this.tilingSprite); - - this.count = 0; - - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.005; - - this.tilingSprite.tileScale.x = 2 + Math.sin(this.count); - this.tilingSprite.tileScale.y = 2 + Math.cos(this.count); - - this.tilingSprite.tilePosition.x += 1; - this.tilingSprite.tilePosition.y += 1; - - // render the root container - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace basics { - - export class Video { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private texture: PIXI.Texture; - - private videoSprite: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a video texture from a path - this.texture = PIXI.Texture.fromVideo('../../_assets/testVideo.mp4'); - - // create a new sprite using the video texture (yes it's that easy) - this.videoSprite = new PIXI.Sprite(this.texture); - this.videoSprite.width = this.renderer.width; - this.videoSprite.height = this.renderer.height; - this.stage.addChild(this.videoSprite); - - this.stage.addChild(this.videoSprite); - - this.animate(); - - } - - private animate = (): void => { - - // render the stage - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class AlphaMask { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Container; - - private cells: PIXI.Sprite; - - private mask: PIXI.Sprite; - - private target: PIXI.Point; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.background = PIXI.Sprite.fromImage('../../_assets/bkg.jpg'); - this.stage.addChild(this.background); - - this.cells = PIXI.Sprite.fromImage('../../_assets/cells.png'); - this.cells.scale.set(1.5, 1.5); - - this.mask = PIXI.Sprite.fromImage('../../_assets/flowerTop.png'); - this.mask.anchor.set(0.5); - this.mask.position.x = 310; - this.mask.position.y = 190; - - this.cells.mask = this.mask; - - this.stage.addChild(this.mask); - - this.stage.addChild(this.cells); - - this.target = new PIXI.Point(); - - this.reset(); - - this.animate(); - - } - - private reset(): void { - - this.target.x = Math.floor(Math.random() * 550); - this.target.y = Math.floor(Math.random() * 300); - - } - - private animate = (): void => { - - this.mask.position.x += (this.target.x - this.mask.x) * 0.1; - this.mask.position.y += (this.target.y - this.mask.y) * 0.1; - - if (Math.abs(this.mask.x - this.target.x) < 1) { - this.reset(); - } - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class Batch { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private sprites: PIXI.particles.ParticleContainer; - - private maggots: BatchDude[]; - - private tick: number; - - private dudeBounds: PIXI.Rectangle; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.sprites = new PIXI.particles.ParticleContainer(10000, { - - scale: true, - position: true, - rotation: true, - uvs: true, - alpha: true - - }); - this.stage.addChild(this.sprites); - - // create an array to store all the sprites - this.maggots = []; - - var totalSprites = this.renderer instanceof PIXI.WebGLRenderer ? 10000 : 100; - - for (var i = 0; i < totalSprites; i++) { - - // create a new Sprite - var dude = new BatchDude(PIXI.Texture.fromImage('../../_assets/tinyMaggot.png')); - - dude.tint = Math.random() * 0xE8D4CD; - - // set the anchor point so the texture is centerd on the sprite - dude.anchor.set(0.5); - - // different maggots, different sizes - dude.scale.set(0.8 + Math.random() * 0.3); - - // scatter them all - dude.x = Math.random() * this.renderer.width; - dude.y = Math.random() * this.renderer.height; - - dude.tint = Math.random() * 0x808080; - - // create a random direction in radians - dude.direction = Math.random() * Math.PI * 2; - - // this number will be used to modify the direction of the sprite over time - dude.turningSpeed = Math.random() - 0.8; - - // create a random speed between 0 - 2, and these maggots are slooww - dude.speed = (2 + Math.random() * 2) * 0.2; - - dude.offset = Math.random() * 100; - - // finally we push the dude into the maggots array so it it can be easily accessed later - this.maggots.push(dude); - - this.sprites.addChild(dude); - - } - - // create a bounding box box for the little maggots - var dudeBoundsPadding = 100; - this.dudeBounds = new PIXI.Rectangle(-dudeBoundsPadding, - -dudeBoundsPadding, - this.renderer.width + dudeBoundsPadding * 2, - this.renderer.height + dudeBoundsPadding * 2); - - this.tick = 0; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // iterate through the sprites and update their position - for (const dude of this.maggots) { - dude.scale.y = 0.95 + Math.sin(this.tick + dude.offset) * 0.05; - dude.direction += dude.turningSpeed * 0.01; - dude.position.x += Math.sin(dude.direction) * (dude.speed * dude.scale.y); - dude.position.y += Math.cos(dude.direction) * (dude.speed * dude.scale.y); - dude.rotation = -dude.direction + Math.PI; - - // wrap the maggots - if (dude.position.x < this.dudeBounds.x) { - dude.position.x += this.dudeBounds.width; - } else if (dude.position.x > this.dudeBounds.x + this.dudeBounds.width) { - dude.position.x -= this.dudeBounds.width; - } - - if (dude.position.y < this.dudeBounds.y) { - dude.position.y += this.dudeBounds.height; - } else if (dude.position.y > this.dudeBounds.y + this.dudeBounds.height) { - dude.position.y -= this.dudeBounds.height; - } - } - - // increment the ticker - this.tick += 0.1; - - // time to render the stage ! - this.renderer.render(this.stage); - - // request another animation frame... - requestAnimationFrame(this.animate); - - } - - } - - export class BatchDude extends PIXI.Sprite { - - direction: number; - speed: number; - turningSpeed: number; - offset: number; - - constructor(texture: PIXI.Texture) { - - super(texture); - - } - - } - -} - -namespace demos { - - export class BlendModes { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private dudeArray: BlendModesDude[]; - - private totalDudes: number; - - private dudeBounds: PIXI.Rectangle; - - private tick: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a new background sprite - this.background = PIXI.Sprite.fromImage('../../_assets/BGrotate.jpg'); - this.stage.addChild(this.background); - - // create an array to store a reference to the dudes - this.dudeArray = []; - - this.totalDudes = 20; - - for (var i = 0; i < this.totalDudes; i++) { - - // create a new Sprite that uses the image name that we just generated as its source - var dude = new BlendModesDude(PIXI.Texture.fromImage('../../_assets/flowerTop.png')); - - dude.anchor.set(0.5); - - // set a random scale for the dude - dude.scale.set(0.8 + Math.random() * 0.3); - - // finally let's set the dude to be at a random position... - dude.position.x = Math.floor(Math.random() * this.renderer.width); - dude.position.y = Math.floor(Math.random() * this.renderer.height); - - // The important bit of this example, this is how you change the default blend mode of the sprite - dude.blendMode = PIXI.BLEND_MODES.ADD; - - // create some extra properties that will control movement - dude.direction = Math.random() * Math.PI * 2; - - // this number will be used to modify the direction of the dude over time - dude.turningSpeed = Math.random() - 0.8; - - // create a random speed for the dude between 0 - 2 - dude.speed = 2 + Math.random() * 2; - - // finally we push the dude into the dudeArray so it it can be easily accessed later - this.dudeArray.push(dude); - - this.stage.addChild(dude); - - } - - // create a bounding box box for the little maggots - var dudeBoundsPadding = 100; - this.dudeBounds = new PIXI.Rectangle(-dudeBoundsPadding, - -dudeBoundsPadding, - this.renderer.width + dudeBoundsPadding * 2, - this.renderer.height + dudeBoundsPadding * 2); - - this.tick = 0; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // iterate through the dudes and update the positions - for (const dude of this.dudeArray) { - dude.direction += dude.turningSpeed * 0.01; - dude.position.x += Math.sin(dude.direction) * dude.speed; - dude.position.y += Math.cos(dude.direction) * dude.speed; - dude.rotation = -dude.direction - Math.PI / 2; - - // wrap the dudes by testing their bounds... - if (dude.position.x < this.dudeBounds.x) { - dude.position.x += this.dudeBounds.width; - } else if (dude.position.x > this.dudeBounds.x + this.dudeBounds.width) { - dude.position.x -= this.dudeBounds.width; - } - - if (dude.position.y < this.dudeBounds.y) { - dude.position.y += this.dudeBounds.height; - } else if (dude.position.y > this.dudeBounds.y + this.dudeBounds.height) { - dude.position.y -= this.dudeBounds.height; - } - } - - // increment the ticker - this.tick += 0.1; - - // time to render the stage ! - this.renderer.render(this.stage); - - // request another animation frame... - requestAnimationFrame(this.animate); - - } - - } - - export class BlendModesDude extends PIXI.Sprite { - - direction: number; - speed: number; - turningSpeed: number; - offset: number; - - constructor(texture: PIXI.Texture) { - - super(texture); - - } - - } - -} - -namespace demos { - - export class CacheAsBitmap { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private aliens: PIXI.Sprite[]; - - private alienContainer: PIXI.Container; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // load resources - PIXI.loader - .add('spritesheet', '../../_assets/monsters.json') - .load(this.onAssetsLoaded); - - // holder to store aliens - this.aliens = []; - - this.count = 0; - - // create an empty container - this.alienContainer = new PIXI.Container(); - this.alienContainer.position.x = 400; - this.alienContainer.position.y = 300; - - // make the stage interactive - this.stage.interactive = true; - - this.stage.addChild(this.alienContainer); - - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - } - - private onClick = (event: PIXI.interaction.InteractionEvent): void => { - - this.alienContainer.cacheAsBitmap = !this.alienContainer.cacheAsBitmap; - - // feel free to play with what's below - // var sprite = new PIXI.Sprite(this.alienContainer.generateTexture()); - // this.stage.addChild(sprite); - // sprite.position.x = Math.random() * 800; - // sprite.position.y = Math.random() * 600; - - } - - private onAssetsLoaded = (): void => { - - // add a bunch of aliens with textures from image paths - - var alienFrames = ['eggHead.png', 'flowerTop.png', 'helmlok.png', 'skully.png']; - - for (var i = 0; i < 100; i++) { - - var frameName = alienFrames[i % 4]; - - // create an alien using the frame name.. - var alien = PIXI.Sprite.fromFrame(frameName); - alien.tint = Math.random() * 0xFFFFFF; - - /* - * fun fact for the day :) - * another way of doing the above would be - * var texture = PIXI.Texture.fromFrame(frameName); - * var alien = new PIXI.Sprite(texture); - */ - alien.position.x = Math.random() * 800 - 400; - alien.position.y = Math.random() * 600 - 300; - alien.anchor.x = 0.5; - alien.anchor.y = 0.5; - this.aliens.push(alien); - this.alienContainer.addChild(alien); - - } - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // let's rotate the aliens a little bit - for (var i = 0; i < 100; i++) { - var alien = this.aliens[i]; - alien.rotation += 0.1; - } - - this.count += 0.01; - - this.alienContainer.scale.x = Math.sin(this.count); - this.alienContainer.scale.y = Math.sin(this.count); - - this.alienContainer.rotation += 0.01; - - // render the stage - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class DraggableBunny extends PIXI.Sprite { - - // todo I dont know what event.data is at this time - private data: any; - - private dragging: boolean; - - constructor(texture?: PIXI.Texture) { - - super(texture); - - // enable the bunny to be interactive... this will allow it to respond to mouse and touch events - this.interactive = true; - - // this button mode will mean the hand cursor appears when you roll over the bunny with your mouse - this.buttonMode = true; - - // center the bunny's anchor point - this.anchor.set(0.5); - - // make it a bit bigger, so it's easier to grab - this.scale.set(3); - - // setup events - this - // events for drag start - .on('mousedown', this.onDragStart) - .on('touchstart', this.onDragStart) - // events for drag end - .on('mouseup', this.onDragEnd) - .on('mouseupoutside', this.onDragEnd) - .on('touchend', this.onDragEnd) - .on('touchendoutside', this.onDragEnd) - // events for drag move - .on('mousemove', this.onDragMove) - .on('touchmove', this.onDragMove); - - } - - private onDragStart = (event: PIXI.interaction.InteractionEvent): void => { - - // store a reference to the data - // the reason for this is because of multitouch - // we want to track the movement of this particular touch - this.data = event.data; - this.alpha = 0.5; - this.dragging = true; - - } - - private onDragEnd = (event: PIXI.interaction.InteractionEvent): void => { - - // set interactiondata to null - this.data = null; - this.alpha = 1; - this.dragging = false; - - } - - private onDragMove = (event: PIXI.interaction.InteractionEvent): void => { - - if (this.dragging) { - var newPosition = this.data.getLocalPosition(this.parent); - this.position.x = newPosition.x; - this.position.y = newPosition.y; - } - - } - - } - - export class Dragging { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private texture: PIXI.Texture; - - private data: PIXI.interaction.InteractionData; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a texture from an image - this.texture = PIXI.Texture.fromImage('../../_assets/bunny.png'); - - for (var i = 0; i < 10; i++) { - this.createBunny(Math.floor(Math.random() * 800), Math.floor(Math.random() * 600)); - } - - // start animating - this.animate(); - - } - - private createBunny(x: number, y: number): void { - - // create our little bunny friend.. - var bunny = new DraggableBunny(this.texture); - - // move the sprite to its designated position - bunny.position.x = x; - bunny.position.y = y; - - // add it to the stage - this.stage.addChild(bunny); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace demos { - - export class GraphicsDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private thing: PIXI.Graphics; - - private graphics: PIXI.Graphics; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.graphics = new PIXI.Graphics(); - - // set a fill and line style - this.graphics.beginFill(0xFF3300); - this.graphics.lineStyle(10, 0xffd900, 1); - - // draw a shape - this.graphics.moveTo(50, 50); - this.graphics.lineTo(250, 50); - this.graphics.lineTo(100, 100); - this.graphics.lineTo(250, 220); - this.graphics.lineTo(50, 220); - this.graphics.lineTo(50, 50); - this.graphics.endFill(); - - // set a fill and line style again - this.graphics.lineStyle(10, 0xFF0000, 0.8); - this.graphics.beginFill(0xFF700B, 1); - - // draw a second shape - this.graphics.moveTo(210, 300); - this.graphics.lineTo(450, 320); - this.graphics.lineTo(570, 350); - this.graphics.quadraticCurveTo(600, 0, 480, 100); - this.graphics.lineTo(330, 120); - this.graphics.lineTo(410, 200); - this.graphics.lineTo(210, 300); - this.graphics.endFill(); - - // draw a rectangle - this.graphics.lineStyle(2, 0x0000FF, 1); - this.graphics.drawRect(50, 250, 100, 100); - - // draw a circle - this.graphics.lineStyle(0); - this.graphics.beginFill(0xFFFF0B, 0.5); - this.graphics.drawCircle(470, 200, 100); - this.graphics.endFill(); - - this.graphics.lineStyle(20, 0x33FF00); - this.graphics.moveTo(30, 30); - this.graphics.lineTo(600, 300); - - this.stage.addChild(this.graphics); - - // let's create a moving shape - this.thing = new PIXI.Graphics(); - this.stage.addChild(this.thing); - this.thing.position.x = 620 / 2; - this.thing.position.y = 380 / 2; - - this.count = 0; - - // Just click on the stage to draw random lines - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - // start animating - this.animate(); - - } - - private onClick = (event: PIXI.interaction.InteractionEvent): void => { - - this.graphics.lineStyle(Math.random() * 30, Math.random() * 0xFFFFFF, 1); - this.graphics.moveTo(Math.random() * 620, Math.random() * 380); - this.graphics.bezierCurveTo(Math.random() * 620, Math.random() * 380, - Math.random() * 620, Math.random() * 380, - Math.random() * 620, Math.random() * 380); - } - - private animate = (): void => { - - this.thing.clear(); - - this.count += 0.1; - - this.thing.clear(); - this.thing.lineStyle(10, 0xff0000, 1); - this.thing.beginFill(0xffFF00, 0.5); - - this.thing.moveTo(-120 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - this.thing.lineTo(120 + Math.cos(this.count) * 20, -100 + Math.sin(this.count) * 20); - this.thing.lineTo(120 + Math.sin(this.count) * 20, 100 + Math.cos(this.count) * 20); - this.thing.lineTo(-120 + Math.cos(this.count) * 20, 100 + Math.sin(this.count) * 20); - this.thing.lineTo(-120 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - - this.thing.rotation = this.count * 0.1; - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - } - - } - -} - -namespace demos { - - export class Interactivity { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private buttons: InteractivityButton[]; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a background... - this.background = PIXI.Sprite.fromImage('../../_assets/button_test_BG.jpg'); - this.background.width = this.renderer.width; - this.background.height = this.renderer.height; - - // add background to stage... - this.stage.addChild(this.background); - - this.buttons = []; - - var buttonPositions = [ - 175, 75, - 655, 75, - 410, 325, - 150, 465, - 685, 445 - ]; - - function noop(): void { - console.log('click'); - } - - // create some textures from an image path - var textureButton = PIXI.Texture.fromImage('../../_assets/button.png'); - var textureButtonDown = PIXI.Texture.fromImage('../../_assets/buttonDown.png'); - var textureButtonOver = PIXI.Texture.fromImage('../../_assets/buttonOver.png'); - - for (var i = 0; i < 5; i++) { - - var button = new InteractivityButton(textureButton, textureButtonDown, textureButtonOver); - - button.position.x = buttonPositions[i * 2]; - button.position.y = buttonPositions[i * 2 + 1]; - - button.tap = noop; - button.click = noop; - - // add it to the stage - this.stage.addChild(button); - - // add button to array - this.buttons.push(button); - - } - - // set some silly values... - this.buttons[0].scale.set(1.2); - - this.buttons[2].rotation = Math.PI / 10; - - this.buttons[3].scale.set(0.8); - - this.buttons[4].scale.set(0.8, 1.2); - this.buttons[4].rotation = Math.PI; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - - export class InteractivityButton extends PIXI.Sprite { - - private textureButton: PIXI.Texture; - private textureButtonDown: PIXI.Texture; - private textureButtonOver: PIXI.Texture; - - tap: Function; - click: Function; - - isdown: boolean; - isOver: boolean; - - constructor(textureButton: PIXI.Texture, textureButtonDown: PIXI.Texture, textureButtonOver: PIXI.Texture) { - - super(textureButton); - - // create some textures from an image path - this.textureButton = textureButton; - this.textureButtonDown = textureButtonDown; - this.textureButtonOver = textureButtonOver; - - this.buttonMode = true; - this.anchor.set(0.5); - - // make the button interactive... - this.interactive = true; - - this - // set the mousedown and touchstart callback... - .on('mousedown', this.onButtonDown) - .on('touchstart', this.onButtonDown) - - // set the mouseup and touchend callback... - .on('mouseup', this.onButtonUp) - .on('touchend', this.onButtonUp) - .on('mouseupoutside', this.onButtonUp) - .on('touchendoutside', this.onButtonUp) - - // set the mouseover callback... - .on('mouseover', this.onButtonOver) - - // set the mouseout callback... - .on('mouseout', this.onButtonOut); - - // you can also listen to click and tap events : - // .on('click', this.noop) - - } - - private onButtonDown = (event: PIXI.interaction.InteractionEvent): void => { - - this.isdown = true; - this.texture = this.textureButtonDown; - this.alpha = 1; - - } - - private onButtonUp = (event: PIXI.interaction.InteractionEvent): void => { - - this.isdown = false; - - if (this.isOver) { - this.texture = this.textureButtonOver; - } else { - this.texture = this.textureButton; - } - } - - private onButtonOver = (event: PIXI.interaction.InteractionEvent): void => { - - this.isOver = true; - - if (this.isdown) { - return; - } - - this.texture = this.textureButtonOver; - - } - - private onButtonOut = (event: PIXI.interaction.InteractionEvent): void => { - - this.isOver = false; - - if (this.isdown) { - return; - } - - this.texture = this.textureButton; - } - - } - -} - -namespace demos { - - export class Masking { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bg: PIXI.Sprite; - - private container: PIXI.Container; - - private bgFront: PIXI.Sprite; - - private light1: PIXI.Sprite; - - private light2: PIXI.Sprite; - - private panda: PIXI.Sprite; - - private thing: PIXI.Graphics; - - private count: number; - - private help: PIXI.Text; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb, antialias: true }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.bg = PIXI.Sprite.fromImage('../../_assets/BGrotate.jpg'); - this.bg.anchor.x = 0.5; - this.bg.anchor.y = 0.5; - - this.bg.position.x = this.renderer.width / 2; - this.bg.position.y = this.renderer.height / 2; - - this.stage.addChild(this.bg); - - this.container = new PIXI.Container(); - this.container.position.x = this.renderer.width / 2; - this.container.position.y = this.renderer.height / 2; - - // add a bunch of sprites - - this.bgFront = PIXI.Sprite.fromImage('../../_assets/SceneRotate.jpg'); - this.bgFront.anchor.x = 0.5; - this.bgFront.anchor.y = 0.5; - - this.container.addChild(this.bgFront); - - this.light2 = PIXI.Sprite.fromImage('../../_assets/LightRotate2.png'); - this.light2.anchor.x = 0.5; - this.light2.anchor.y = 0.5; - this.container.addChild(this.light2); - - this.light1 = PIXI.Sprite.fromImage('../../_assets/LightRotate1.png'); - this.light1.anchor.x = 0.5; - this.light1.anchor.y = 0.5; - this.container.addChild(this.light1); - - this.panda = PIXI.Sprite.fromImage('../../_assets/panda.png'); - this.panda.anchor.x = 0.5; - this.panda.anchor.y = 0.5; - - this.container.addChild(this.panda); - - this.stage.addChild(this.container); - - // let's create a moving shape - this.thing = new PIXI.Graphics(); - this.stage.addChild(this.thing); - this.thing.position.x = this.renderer.width / 2; - this.thing.position.y = this.renderer.height / 2; - this.thing.lineStyle(0); - - this.container.mask = this.thing; - - this.count = 0; - - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - this.help = new PIXI.Text('Click to turn masking on / off.', { fontFamily: 'Arial', fontSize: 12, fontWeight: 'bold', fill: 'white' }); - this.help.position.y = this.renderer.height - 26; - this.help.position.x = 10; - this.stage.addChild(this.help); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.bg.rotation += 0.01; - this.bgFront.rotation -= 0.01; - - this.light1.rotation += 0.02; - this.light2.rotation += 0.01; - - this.panda.scale.x = 1 + Math.sin(this.count) * 0.04; - this.panda.scale.y = 1 + Math.cos(this.count) * 0.04; - - this.count += 0.1; - - this.thing.clear(); - - this.thing.beginFill(0x8bc5ff, 0.4); - this.thing.moveTo(-120 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - this.thing.lineTo(-320 + Math.cos(this.count) * 20, 100 + Math.sin(this.count) * 20); - this.thing.lineTo(120 + Math.cos(this.count) * 20, -100 + Math.sin(this.count) * 20); - this.thing.lineTo(120 + Math.sin(this.count) * 20, 100 + Math.cos(this.count) * 20); - this.thing.lineTo(-120 + Math.cos(this.count) * 20, 100 + Math.sin(this.count) * 20); - this.thing.lineTo(-120 + Math.sin(this.count) * 20, -300 + Math.cos(this.count) * 20); - this.thing.lineTo(-320 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - this.thing.rotation = this.count * 0.1; - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - private onClick = (event: PIXI.interaction.InteractionEvent): void => { - - if (!this.container.mask) { - this.container.mask = this.thing; - } else { - this.container.mask = null; - } - } - - } - -} - -namespace demos { - - export class AnimatedSpriteDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - PIXI.loader - .add('spritesheet', '../../_assets/mc.json') - .load(this.onAssetsLoaded); - - // start animating - this.animate(); - - } - - private onAssetsLoaded = (loader: PIXI.loaders.Loader): void => { - - // create an array to store the textures - var explosionTextures: PIXI.Texture[] = []; - var i: number; - - for (i = 0; i < 26; i++) { - - var texture = PIXI.Texture.fromFrame('Explosion_Sequence_A ' + (i + 1) + '.png'); - explosionTextures.push(texture); - - } - - for (i = 0; i < 50; i++) { - - // create an explosion AnimatedSprite - var explosion = new PIXI.extras.AnimatedSprite(explosionTextures); - - explosion.position.x = Math.random() * 800; - explosion.position.y = Math.random() * 600; - explosion.anchor.x = 0.5; - explosion.anchor.y = 0.5; - - explosion.rotation = Math.random() * Math.PI; - - explosion.scale.set(0.75 + Math.random() * 0.5); - - explosion.gotoAndPlay(Math.random() * 27); - - this.stage.addChild(explosion); - - } - - // start animating - this.animate(); - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace demos { - - export class RenderTextureDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private renderTexture: PIXI.RenderTexture; - private renderTexture2: PIXI.RenderTexture; - private currentTexture: PIXI.RenderTexture; - - private outputSprite: PIXI.Sprite; - private stuffContainer: PIXI.Container; - private items: PIXI.Sprite[]; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create two render textures... these dynamic textures will be used to draw the scene into itself - this.renderTexture = PIXI.RenderTexture.create(this.renderer.width, this.renderer.height); - this.renderTexture2 = PIXI.RenderTexture.create(this.renderer.width, this.renderer.height); - this.currentTexture = this.renderTexture; - - // create a new sprite that uses the render texture we created above - this.outputSprite = new PIXI.Sprite(this.currentTexture); - - // align the sprite - this.outputSprite.position.x = 400; - this.outputSprite.position.y = 300; - this.outputSprite.anchor.set(0.5); - - // add to stage - this.stage.addChild(this.outputSprite); - - this.stuffContainer = new PIXI.Container(); - - this.stuffContainer.position.x = 400; - this.stuffContainer.position.y = 300; - - this.stage.addChild(this.stuffContainer); - - // create an array of image ids.. - var fruits = [ - '../../_assets/spinObj_01.png', - '../../_assets/spinObj_02.png', - '../../_assets/spinObj_03.png', - '../../_assets/spinObj_04.png', - '../../_assets/spinObj_05.png', - '../../_assets/spinObj_06.png', - '../../_assets/spinObj_07.png', - '../../_assets/spinObj_08.png' - ]; - - // create an array of items - this.items = []; - - // now create some items and randomly position them in the stuff container - for (var i = 0; i < 20; i++) { - - var item = PIXI.Sprite.fromImage(fruits[i % fruits.length]); - item.position.x = Math.random() * 400 - 200; - item.position.y = Math.random() * 400 - 200; - - item.anchor.set(0.5); - - this.stuffContainer.addChild(item); - - this.items.push(item); - - } - - // used for spinning! - this.count = 0; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - for (const item of this.items) { - // rotate each item - item.rotation += 0.1; - } - - this.count += 0.01; - - // swap the buffers ... - var temp = this.renderTexture; - this.renderTexture = this.renderTexture2; - this.renderTexture2 = temp; - - // set the new texture - this.outputSprite.texture = this.renderTexture; - - // twist this up! - this.stuffContainer.rotation -= 0.01; - this.outputSprite.scale.set(1 + Math.sin(this.count) * 0.2); - - // render the stage to the texture - // the 'true' clears the texture before the content is rendered - this.renderer.render(this.stage, this.renderTexture2, false); - - // and finally render the stage - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class StripDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private count: number; - - private points: PIXI.Point[]; - - private strip: PIXI.mesh.Rope; - - private snakeContainer: PIXI.Container; - - private ropeLength: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.count = 0; - - // build a rope! - this.ropeLength = 918 / 20; - - this.points = []; - - for (var i = 0; i < 20; i++) { - this.points.push(new PIXI.Point(i * this.ropeLength, 0)); - } - - this.strip = new PIXI.mesh.Rope(PIXI.Texture.fromImage('../../_assets/snake.png'), this.points); - this.strip.x = -459; - - this.snakeContainer = new PIXI.Container(); - this.snakeContainer.position.x = 400; - this.snakeContainer.position.y = 300; - - this.snakeContainer.scale.set(800 / 1100); - this.stage.addChild(this.snakeContainer); - - this.snakeContainer.addChild(this.strip); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.1; - - // make the snake - for (var i = 0; i < this.points.length; i++) { - - this.points[i].y = Math.sin((i * 0.5) + this.count) * 30; - - this.points[i].x = i * this.ropeLength + Math.cos((i * 0.3) + this.count) * 20; - - } - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class TextDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bitmapFontText: PIXI.extras.BitmapText; - - private background: PIXI.Sprite; - - private textSample: PIXI.Text; - - private spinningText: PIXI.Text; - - private countingText: PIXI.Text; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - PIXI.loader - .add('desyrel', '../../_assets/desyrel.xml') - .load(this.onAssetsLoaded); - - // start animating - this.animate(); - - } - - private onAssetsLoaded = (): void => { - - this.bitmapFontText = new PIXI.extras.BitmapText('bitmap fonts are\n now supported!', { font: '35px Desyrel', align: 'right' }); - - this.bitmapFontText.position.x = 600 - this.bitmapFontText.textWidth; - this.bitmapFontText.position.y = 20; - - this.stage.addChild(this.bitmapFontText); - - // add a shiny background... - this.background = PIXI.Sprite.fromImage('../../_assets/textDemoBG.jpg'); - this.stage.addChild(this.background); - - // create some white text using the Snippet webfont - this.textSample = new PIXI.Text('Pixi.js can has\n multiline text!', { fontSize: 35, fontFamily: 'Snippet', fill: 'white', align: 'left' }); - this.textSample.position.set(20); - - // create a text object with a nice stroke - this.spinningText = new PIXI.Text('I\'m fun!', { fontWeight: 'bold', fontSize: 60, fontFamily: 'Arial', fill: '#cc00ff', align: 'center', stroke: '#FFFFFF', strokeThickness: 6 }); - - // setting the anchor point to 0.5 will center align the text... great for spinning! - this.spinningText.anchor.set(0.5); - this.spinningText.position.x = 310; - this.spinningText.position.y = 200; - - // create a text object that will be updated... - this.countingText = new PIXI.Text('COUNT 4EVAR: 0', { - fontWeight: 'bold', - fontStyle: 'italic', - fontSize: 60, fontFamily: - 'Arvo', fill: '#3e1707', - align: 'center', - stroke: '#a4410e', - strokeThickness: 7 - }); - - this.countingText.position.x = 310; - this.countingText.position.y = 320; - this.countingText.anchor.x = 0.5; - - this.stage.addChild(this.textSample); - this.stage.addChild(this.spinningText); - this.stage.addChild(this.countingText); - - this.count = 0; - - } - - private animate = (): void => { - - - this.renderer.render(this.stage); - - this.count += 0.05; - - // update the text with a new string - this.countingText.text = 'COUNT 4EVAR: ' + Math.floor(this.count); - - // let's spin the spinning text - this.spinningText.rotation += 0.03; - - requestAnimationFrame(this.animate); - } - - } - -} - -namespace demos { - - export class TextureSwap { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bol: boolean; - - private texture: PIXI.Texture; - private secondTexture: PIXI.Texture; - - private dude: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.bol = false; - - // an image path - this.texture = PIXI.Texture.fromImage('../../_assets/flowerTop.png'); - - // create a second texture - this.secondTexture = PIXI.Texture.fromImage('../../_assets/eggHead.png'); - - // create a new Sprite using the texture - this.dude = new PIXI.Sprite(this.texture); - - // center the sprites anchor point - this.dude.anchor.set(0.5); - - // move the sprite to the center of the screen - this.dude.position.x = this.renderer.width / 2; - this.dude.position.y = this.renderer.height / 2; - - this.stage.addChild(this.dude); - - // make the sprite interactive - this.dude.interactive = true; - - this.dude.on('click', (): void => { - this.bol = !this.bol; - - if (this.bol) { - this.dude.texture = this.secondTexture; - } else { - this.dude.texture = this.texture; - } - }); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // just for fun, let's rotate mr rabbit a little - this.dude.rotation += 0.1; - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class Tinting { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private totalDudes: number = 10; - private aliens: TintingDude[]; - - private dudeBounds: PIXI.Rectangle; - - private tick: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // holder to store the aliens - this.aliens = []; - - this.tick = 0; - - for (var i = 0; i < this.totalDudes; i++) { - - // create a new Sprite that uses the image name that we just generated as its source - var dude = new TintingDude(); - - // set the anchor point so the texture is centerd on the sprite - dude.anchor.set(0.5); - - // set a random scale for the dude - no point them all being the same size! - dude.scale.set(0.8 + Math.random() * 0.3); - - // finally lets set the dude to be at a random position.. - dude.position.x = Math.random() * this.renderer.width; - dude.position.y = Math.random() * this.renderer.height; - - dude.tint = Math.random() * 0xFFFFFF; - - // create some extra properties that will control movement : - // create a random direction in radians. This is a number between 0 and PI*2 which is the equivalent of 0 - 360 degrees - dude.direction = Math.random() * Math.PI * 2; - - // this number will be used to modify the direction of the dude over time - dude.turningSpeed = Math.random() - 0.8; - - // create a random speed for the dude between 0 - 2 - dude.speed = 2 + Math.random() * 2; - - // finally we push the dude into the aliens array so it it can be easily accessed later - this.aliens.push(dude); - - this.stage.addChild(dude); - - } - - // create a bounding box for the little dudes - var dudeBoundsPadding = 100; - this.dudeBounds = new PIXI.Rectangle(-dudeBoundsPadding, - -dudeBoundsPadding, - this.renderer.width + dudeBoundsPadding * 2, - this.renderer.height + dudeBoundsPadding * 2); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // iterate through the dudes and update their position - for (const dude of this.aliens) { - dude.direction += dude.turningSpeed * 0.01; - dude.position.x += Math.sin(dude.direction) * dude.speed; - dude.position.y += Math.cos(dude.direction) * dude.speed; - dude.rotation = -dude.direction - Math.PI / 2; - - // wrap the dudes by testing their bounds... - if (dude.position.x < this.dudeBounds.x) { - dude.position.x += this.dudeBounds.width; - } else if (dude.position.x > this.dudeBounds.x + this.dudeBounds.width) { - dude.position.x -= this.dudeBounds.width; - } - - if (dude.position.y < this.dudeBounds.y) { - dude.position.y += this.dudeBounds.height; - } else if (dude.position.y > this.dudeBounds.y + this.dudeBounds.height) { - dude.position.y -= this.dudeBounds.height; - } - - } - - // increment the ticker - this.tick += 0.1; - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - - export class TintingDude extends PIXI.Sprite { - - direction: number; - speed: number; - turningSpeed: number; - - constructor() { - super(PIXI.Texture.fromImage('../../_assets/eggHead.png')); - } - - } - -} - -namespace demos { - - export class TransparentBackground { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bunny: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb, transparent: true }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a new Sprite from an image path. - this.bunny = PIXI.Sprite.fromImage('../../_assets/bunny.png'); - - // center the sprite's anchor point - this.bunny.anchor.set(0.5); - - // move the sprite to the center of the screen - this.bunny.position.x = 200; - this.bunny.position.y = 150; - - this.stage.addChild(this.bunny); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // just for fun, let's rotate mr rabbit a little - this.bunny.rotation += 0.1; - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace filters { - - export class Blur { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bg: PIXI.Sprite; - - private littleDudes: PIXI.Sprite; - private littleRobot: PIXI.Sprite; - - private blurFilter1: PIXI.filters.BlurFilter; - private blurFilter2: PIXI.filters.BlurFilter; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.bg = PIXI.Sprite.fromImage('../../_assets/depth_blur_BG.jpg'); - this.bg.width = this.renderer.width; - this.bg.height = this.renderer.height; - this.stage.addChild(this.bg); - - this.littleDudes = PIXI.Sprite.fromImage('../../_assets/depth_blur_dudes.jpg'); - this.littleDudes.position.x = (this.renderer.width / 2) - 315; - this.littleDudes.position.y = 200; - this.stage.addChild(this.littleDudes); - - this.littleRobot = PIXI.Sprite.fromImage('../../_assets/depth_blur_moby.jpg'); - this.littleRobot.position.x = (this.renderer.width / 2) - 200; - this.littleRobot.position.y = 100; - this.stage.addChild(this.littleRobot); - - this.blurFilter1 = new PIXI.filters.BlurFilter(); - this.blurFilter2 = new PIXI.filters.BlurFilter(); - - this.littleDudes.filters = [this.blurFilter1]; - this.littleRobot.filters = [this.blurFilter2]; - - this.count = 0; - - // nimate - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.005; - - var blurAmount = Math.cos(this.count); - var blurAmount2 = Math.sin(this.count); - - this.blurFilter1.blur = 20 * (blurAmount); - this.blurFilter2.blur = 20 * (blurAmount2); - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace filters { - - export class DisplacementMap { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private container: PIXI.Container; - - private padding: number; - - private bounds: PIXI.Rectangle; - - private maggots: DisplacementMapDude[]; - - private displacementSprite: PIXI.Sprite; - - private displacementFilter: PIXI.filters.DisplacementFilter; - - private ring: PIXI.Sprite; - - private bg: PIXI.Sprite; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.container = new PIXI.Container(); - this.stage.addChild(this.container); - - this.padding = 100; - - this.bounds = new PIXI.Rectangle(-this.padding, -this.padding, this.renderer.width + this.padding * 2, this.renderer.height + this.padding * 2); - this.maggots = []; - - for (var i = 0; i < 20; i++) { - - var maggot = new DisplacementMapDude(); - maggot.anchor.set(0.5); - this.container.addChild(maggot); - - maggot.direction = Math.random() * Math.PI * 2; - maggot.speed = 1; - maggot.turnSpeed = Math.random() - 0.8; - - maggot.position.x = Math.random() * this.bounds.width; - maggot.position.y = Math.random() * this.bounds.height; - - maggot.scale.set(1 + Math.random() * 0.3); - maggot.original = maggot.scale.clone(); - this.maggots.push(maggot); - - } - - this.displacementSprite = PIXI.Sprite.fromImage('../../_assets/displace.png'); - this.displacementFilter = new PIXI.filters.DisplacementFilter(this.displacementSprite); - - this.stage.addChild(this.displacementSprite); - - this.container.filters = [this.displacementFilter]; - - this.displacementFilter.scale.x = 110; - this.displacementFilter.scale.y = 110; - - this.ring = PIXI.Sprite.fromImage('../../_assets/ring.png'); - - this.ring.anchor.set(0.5); - - this.ring.visible = false; - - this.stage.addChild(this.ring); - - this.bg = PIXI.Sprite.fromImage('../../_assets/bkg-grass.jpg'); - this.bg.width = this.renderer.width; - this.bg.height = this.renderer.height; - - this.bg.alpha = 0.4; - - this.container.addChild(this.bg); - - this.stage - .on('mousemove', this.onPointerMove) - .on('touchmove', this.onPointerMove); - - this.count = 0; - - this.animate(); - - } - - private onPointerMove = (eventData: PIXI.interaction.InteractionEvent): void => { - - this.ring.visible = true; - - this.displacementSprite.x = eventData.data.global.x - 100; - this.displacementSprite.y = eventData.data.global.y - this.displacementSprite.height / 2; - - this.ring.position.x = eventData.data.global.x - 25; - this.ring.position.y = eventData.data.global.y; - - } - - private animate = (): void => { - - this.count += 0.05; - - for (const maggot of this.maggots) { - maggot.direction += maggot.turnSpeed * 0.01; - maggot.position.x += Math.sin(maggot.direction) * maggot.speed; - maggot.position.y += Math.cos(maggot.direction) * maggot.speed; - - maggot.rotation = -maggot.direction - Math.PI / 2; - - maggot.scale.x = maggot.original.x + Math.sin(this.count) * 0.2; - - // wrap the maggots around as the crawl - if (maggot.position.x < this.bounds.x) { - maggot.position.x += this.bounds.width; - } else if (maggot.position.x > this.bounds.x + this.bounds.width) { - maggot.position.x -= this.bounds.width; - } - - if (maggot.position.y < this.bounds.y) { - maggot.position.y += this.bounds.height; - } else if (maggot.position.y > this.bounds.y + this.bounds.height) { - maggot.position.y -= this.bounds.height; - } - } - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - - export class DisplacementMapDude extends PIXI.Sprite { - - direction: number; - speed: number; - turnSpeed: number; - original: PIXI.Point; - - constructor() { - - super(PIXI.Texture.fromImage('../../_assets/maggot.png')); - - } - - } - -} - -namespace filters { - - export class Filter { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private filter: PIXI.filters.ColorMatrixFilter; - - private container: PIXI.Container; - - private bgFront: PIXI.Sprite; - private light2: PIXI.Sprite; - private light1: PIXI.Sprite; - private panda: PIXI.Sprite; - - private count: number; - private switchy: boolean; - - private help: PIXI.Text; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - // create a texture from an image path - var texture: PIXI.Texture = PIXI.Texture.fromImage("../../_assets/basics/bunny.png"); - - this.background = PIXI.Sprite.fromImage('_assets/BGrotate.jpg'); - this.background.anchor.set(0.5); - - this.background.position.x = this.renderer.width / 2; - this.background.position.y = this.renderer.height / 2; - - this.filter = new PIXI.filters.ColorMatrixFilter(); - - this.container = new PIXI.Container(); - this.container.position.x = this.renderer.width / 2; - this.container.position.y = this.renderer.height / 2; - - this.bgFront = PIXI.Sprite.fromImage('../../_assets/SceneRotate.jpg'); - this.bgFront.anchor.set(0.5); - - this.container.addChild(this.bgFront); - - this.light2 = PIXI.Sprite.fromImage('../../_assets/LightRotate2.png'); - this.light2.anchor.set(0.5); - this.container.addChild(this.light2); - - this.light1 = PIXI.Sprite.fromImage('../../_assets/LightRotate1.png'); - this.light1.anchor.set(0.5); - this.container.addChild(this.light1); - - this.panda = PIXI.Sprite.fromImage('../../_assets/panda.png'); - this.panda.anchor.set(0.5); - - this.container.addChild(this.panda); - - this.stage.addChild(this.container); - - this.stage.filters = [this.filter]; - - this.count = 0; - this.switchy = false; - - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - - this.help = new PIXI.Text('Click to turn filters on / off.', { fontWeight: 'bold', fontSize: 12, fontFamily: 'Arial', fill: 'white' }); - this.help.position.y = this.renderer.height - 25; - this.help.position.x = 10; - - this.stage.addChild(this.help); - - // animate - this.animate(); - - } - - private onClick = (): void => { - - this.switchy = !this.switchy; - - if (!this.switchy) { - this.stage.filters = [this.filter]; - } else { - this.stage.filters = null; - } - - } - - private animate = (): void => { - - this.background.rotation += 0.01; - this.bgFront.rotation -= 0.01; - - this.light1.rotation += 0.02; - this.light2.rotation += 0.01; - - this.panda.scale.x = 1 + Math.sin(this.count) * 0.04; - this.panda.scale.y = 1 + Math.cos(this.count) * 0.04; - - this.count += 0.1; - - var matrix = this.filter.matrix; - - matrix[1] = Math.sin(this.count) * 3; - matrix[2] = Math.cos(this.count); - matrix[3] = Math.cos(this.count) * 1.5; - matrix[4] = Math.sin(this.count / 3) * 2; - matrix[5] = Math.sin(this.count / 2); - matrix[6] = Math.sin(this.count / 4); - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} diff --git a/pixi.js/tslint.json b/pixi.js/tslint.json deleted file mode 100644 index 56ba128af1..0000000000 --- a/pixi.js/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false, - "interface-name": false, - "no-empty-interface": false, - "unified-signatures": false - } -} diff --git a/pixi.js/v3/index.d.ts b/pixi.js/v3/index.d.ts deleted file mode 100644 index aa573b2201..0000000000 --- a/pixi.js/v3/index.d.ts +++ /dev/null @@ -1,1747 +0,0 @@ -// Type definitions for Pixi.js 3.0 -// Project: https://github.com/GoodBoyDigital/pixi.js/ -// Definitions by: clark-stevenson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = PIXI; -export as namespace PIXI; - -declare class PIXI { - - static VERSION: string; - static PI_2: number; - static RAD_TO_DEG: number; - static DEG_TO_RAD: number; - static TARGET_FPMS: number; - static RENDERER_TYPE: { - UNKNOWN: number; - WEBGL: number; - CANVAS: number; - }; - static BLEND_MODES: { - NORMAL: number; - ADD: number; - MULTIPLY: number; - SCREEN: number; - OVERLAY: number; - DARKEN: number; - LIGHTEN: number; - COLOR_DODGE: number; - COLOR_BURN: number; - HARD_LIGHT: number; - SOFT_LIGHT: number; - DIFFERENCE: number; - EXCLUSION: number; - HUE: number; - SATURATION: number; - COLOR: number; - LUMINOSITY: number; - - }; - static DRAW_MODES: { - POINTS: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - TRIANGLES: number; - TRIANGLE_STRIP: number; - TRIANGLE_FAN: number; - }; - static SCALE_MODES: { - DEFAULT: number; - LINEAR: number; - NEAREST: number; - }; - static RETINA_PREFIX: string; - static RESOLUTION: number; - static FILTER_RESOLUTION: number; - static DEFAULT_RENDER_OPTIONS: { - view: HTMLCanvasElement; - resolution: number; - antialias: boolean; - forceFXAA: boolean; - autoResize: boolean; - transparent: boolean; - backgroundColor: number; - clearBeforeRender: boolean; - preserveDrawingBuffer: boolean; - roundPixels: boolean; - }; - static SHAPES: { - POLY: number; - RECT: number; - CIRC: number; - ELIP: number; - RREC: number; - }; - static SPRITE_BATCH_SIZE: number; - -} - -declare namespace PIXI { - - export function autoDetectRenderer(width: number, height: number, options?: PIXI.RendererOptions, noWebGL?: boolean): PIXI.WebGLRenderer | PIXI.CanvasRenderer; - export var loader: PIXI.loaders.Loader; - - // https://github.com/primus/eventemitter3 - export class EventEmitter { - - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - on(event: string, fn: Function, context?: any): EventEmitter; - once(event: string, fn: Function, context?: any): EventEmitter; - removeListener(event: string, fn?: Function, context?: any, once?: boolean): EventEmitter; - removeAllListeners(event?: string): EventEmitter; - - off(event: string, fn?: Function, context?: any, once?: boolean): EventEmitter; - addListener(event: string, fn: Function, context?: any): EventEmitter; - - } - - ////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////CORE////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// - - // display - - export class DisplayObject extends EventEmitter implements interaction.InteractiveTarget { - - // begin extras.cacheAsBitmap see https://github.com/pixijs/pixi-typescript/commit/1207b7f4752d79a088d6a9a465a3ec799906b1db - protected _originalRenderWebGL: WebGLRenderer; - protected _originalRenderCanvas: CanvasRenderer; - protected _originalUpdateTransform: boolean; - protected _originalHitTest: any; - protected _cachedSprite: any; - protected _originalDestroy: any; - - cacheAsBitmap: boolean; - - protected _renderCachedWebGL(renderer: WebGLRenderer): void; - protected _initCachedDisplayObject(renderer: WebGLRenderer): void; - protected _renderCachedCanvas(renderer: CanvasRenderer): void; - protected _initCachedDisplayObjectCanvas(renderer: CanvasRenderer): void; - protected _getCachedBounds(): Rectangle; - protected _destroyCachedDisplayObject(): void; - protected _cacheAsBitmapDestroy(): void; - // end extras.cacheAsBitmap - - protected _sr: number; - protected _cr: number; - protected _bounds: Rectangle; - protected _currentBounds: Rectangle; - protected _mask: Rectangle; - protected _cachedObject: any; - - updateTransform(): void; - - position: Point; - scale: Point; - pivot: Point; - rotation: number; - renderable: boolean; - alpha: number; - visible: boolean; - parent: Container; - worldAlpha: number; - worldTransform: Matrix; - filterArea: Rectangle; - - x: number; - y: number; - worldVisible: boolean; - mask: Graphics | Sprite; - filters: AbstractFilter[]; - name: string; - - getBounds(matrix?: Matrix): Rectangle; - getLocalBounds(): Rectangle; - toGlobal(position: Point): Point; - toLocal(position: Point, from?: DisplayObject): Point; - generateTexture(renderer: CanvasRenderer | WebGLRenderer, scaleMode: number, resolution: number): Texture; - setParent(container: Container): Container; - setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject; - destroy(): void; - getChildByName(name: string): DisplayObject; - getGlobalPosition(point: Point): Point; - - interactive: boolean; - buttonMode: boolean; - interactiveChildren: boolean; - defaultCursor: string; - hitArea: HitArea; - - on(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: string, fn: Function, context?: any): EventEmitter; - - once(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: string, fn: Function, context?: any): EventEmitter; - - } - - export class Container extends DisplayObject { - - protected _renderWebGL(renderer: WebGLRenderer): void; - protected _renderCanvas(renderer: CanvasRenderer): void; - - protected onChildrenChange: () => void; - - children: DisplayObject[]; - - width: number; - height: number; - - addChild(...child: DisplayObject[]): DisplayObject; - addChildAt(child: DisplayObject, index: number): DisplayObject; - swapChildren(child: DisplayObject, child2: DisplayObject): void; - getChildIndex(child: DisplayObject): number; - setChildIndex(child: DisplayObject, index: number): void; - getChildAt(index: number): DisplayObject; - removeChild(child: DisplayObject): DisplayObject; - removeChildAt(index: number): DisplayObject; - removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; - destroy(destroyChildren?: boolean): void; - generateTexture(renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer, resolution?: number, scaleMode?: number): Texture; - - renderWebGL(renderer: WebGLRenderer): void; - renderCanvas(renderer: CanvasRenderer): void; - - once(event: 'added', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: string, fn: Function, context?: any): EventEmitter; - once(event: 'removed', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - once(event: string, fn: Function, context?: any): EventEmitter; - on(event: 'added', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: string, fn: Function, context?: any): EventEmitter; - on(event: 'removed', fn: (event: interaction.InteractionEvent) => void, context?: any): EventEmitter; - on(event: string, fn: Function, context?: any): EventEmitter; - - } - - // graphics - - export class GraphicsData { - - constructor(lineWidth: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, fill: boolean, shape: Circle | Rectangle | Ellipse | Polygon); - - lineWidth: number; - lineColor: number; - lineAlpha: number; - fillColor: number; - fillAlpha: number; - fill: boolean; - shape: Circle | Rectangle | Ellipse | Polygon; - type: number; - - clone(): GraphicsData; - - protected _lineTint: number; - protected _fillTint: number; - - } - export class Graphics extends Container { - - protected boundsDirty: boolean; - protected dirty: boolean; - protected glDirty: boolean; - - fillAlpha: number; - lineWidth: number; - lineColor: number; - tint: number; - blendMode: number; - isMask: boolean; - boundsPadding: number; - - clone(): Graphics; - lineStyle(lineWidth?: number, color?: number, alpha?: number): Graphics; - moveTo(x: number, y: number): Graphics; - lineTo(x: number, y: number): Graphics; - quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): Graphics; - bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): Graphics; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Graphics; - arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): Graphics; - beginFill(color: number, alpha?: number): Graphics; - endFill(): Graphics; - drawRect(x: number, y: number, width: number, height: number): Graphics; - drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Graphics; - drawCircle(x: number, y: number, radius: number): Graphics; - drawEllipse(x: number, y: number, width: number, height: number): Graphics; - drawPolygon(path: number[] | Point[]): Graphics; - clear(): Graphics; - // todo - generateTexture(renderer: WebGLRenderer | CanvasRenderer, resolution?: number, scaleMode?: number): Texture; - getBounds(matrix?: Matrix): Rectangle; - containsPoint(point: Point): boolean; - updateLocalBounds(): void; - drawShape(shape: Circle | Rectangle | Ellipse | Polygon): GraphicsData; - - } - export interface GraphicsRenderer extends ObjectRenderer { - // yikes todo - } - export interface WebGLGraphicsData { - // yikes todo! - } - - // math - - export class Point { - - x: number; - y: number; - - constructor(x?: number, y?: number); - - clone(): Point; - copy(p: Point): void; - equals(p: Point): boolean; - set(x?: number, y?: number): void; - - } - export class Matrix { - - a: number; - b: number; - c: number; - d: number; - tx: number; - ty: number; - - fromArray(array: number[]): void; - toArray(transpose?: boolean, out?: number[]): number[]; - apply(pos: Point, newPos?: Point): Point; - applyInverse(pos: Point, newPos?: Point): Point; - translate(x: number, y: number): Matrix; - scale(x: number, y: number): Matrix; - rotate(angle: number): Matrix; - append(matrix: Matrix): Matrix; - prepend(matrix: Matrix): Matrix; - invert(): Matrix; - identity(): Matrix; - clone(): Matrix; - copy(matrix: Matrix): Matrix; - set(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix; - setTransform(a: number, b: number, c: number, d: number, sr: number, cr: number, cy: number, sy: number, nsx: number, cs: number): PIXI.Matrix; - - static IDENTITY: Matrix; - static TEMP_MATRIX: Matrix; - - } - - export interface HitArea { - - contains(x: number, y: number): boolean; - - } - - export class Circle implements HitArea { - - constructor(x?: number, y?: number, radius?: number); - - x: number; - y: number; - radius: number; - type: number; - - clone(): Circle; - contains(x: number, y: number): boolean; - getBounds(): Rectangle; - - } - export class Ellipse implements HitArea { - - constructor(x?: number, y?: number, width?: number, height?: number); - - x: number; - y: number; - width: number; - height: number; - type: number; - - clone(): Ellipse; - contains(x: number, y: number): boolean; - getBounds(): Rectangle; - - } - export class Polygon implements HitArea { - - constructor(points: Point[]); - constructor(points: number[]); - constructor(...points: Point[]); - constructor(...points: number[]); - - closed: boolean; - points: number[]; - type: number; - - clone(): Polygon; - contains(x: number, y: number): boolean; - - - } - export class Rectangle implements HitArea { - - constructor(x?: number, y?: number, width?: number, height?: number); - - x: number; - y: number; - width: number; - height: number; - type: number; - - static EMPTY: Rectangle; - - clone(): Rectangle; - contains(x: number, y: number): boolean; - - } - export class RoundedRectangle implements HitArea { - - constructor(x?: number, y?: number, width?: number, height?: number, radius?: number); - - x: number; - y: number; - width: number; - height: number; - radius: number; - type: number; - - static EMPTY: Rectangle; - - clone(): Rectangle; - contains(x: number, y: number): boolean; - - } - - // particles - - export interface ParticleContainerProperties { - - scale?: boolean; - position?: boolean; - rotation?: boolean; - uvs?: boolean; - alpha?: boolean; - - } - export class ParticleContainer extends Container { - - constructor(size?: number, properties?: ParticleContainerProperties, batchSize?: number); - - protected _maxSize: number; - protected _batchSize: number; - protected _properties: boolean[]; - protected _buffers: WebGLBuffer[]; - protected _bufferToUpdate: number; - - protected onChildrenChange: (smallestChildIndex?: number) => void; - - interactiveChildren: boolean; - blendMode: number; - roundPixels: boolean; - - setProperties(properties: ParticleContainerProperties): void; - - } - export interface ParticleBuffer { - - gl: WebGLRenderingContext; - vertSize: number; - vertByteSize: number; - size: number; - dynamicProperties: any[]; - staticProperties: any[]; - - staticStride: number; - staticBuffer: any; - staticData: any; - dynamicStride: number; - dynamicBuffer: any; - dynamicData: any; - - initBuffers(): void; - bind(): void; - destroy(): void; - - } - export interface ParticleRenderer { - - } - export interface ParticleShader { - - } - - // renderers - - export interface RendererOptions { - - view?: HTMLCanvasElement; - transparent?: boolean; - antialias?: boolean; - autoResize?: boolean; - resolution?: number; - clearBeforeRendering?: boolean; - preserveDrawingBuffer?: boolean; - forceFXAA?: boolean; - roundPixels?: boolean; - backgroundColor?: number; - - } - export class SystemRenderer extends EventEmitter { - - protected _backgroundColor: number; - protected _backgroundColorRgb: number[]; - protected _backgroundColorString: string; - protected _tempDisplayObjectParent: any; - protected _lastObjectRendered: DisplayObject; - - constructor(system: string, width?: number, height?: number, options?: RendererOptions); - - type: number; - width: number; - height: number; - view: HTMLCanvasElement; - resolution: number; - transparent: boolean; - autoResize: boolean; - blendModes: any; // todo? - preserveDrawingBuffer: boolean; - clearBeforeRender: boolean; - roundPixels: boolean; - backgroundColor: number; - - render(object: DisplayObject): void; - resize(width: number, height: number): void; - destroy(removeView?: boolean): void; - - } - export class CanvasRenderer extends SystemRenderer { - - protected renderDisplayObject(displayObject: DisplayObject, context: CanvasRenderingContext2D): void; - protected _mapBlendModes(): void; - - constructor(width?: number, height?: number, options?: RendererOptions); - - context: CanvasRenderingContext2D; - refresh: boolean; - maskManager: CanvasMaskManager; - roundPixels: boolean; - smoothProperty: string; - - render(object: DisplayObject): void; - resize(w: number, h: number): void; - - } - export class CanvasBuffer { - - protected clear(): void; - - constructor(width: number, height: number); - - canvas: HTMLCanvasElement; - context: CanvasRenderingContext2D; - - width: number; - height: number; - - resize(width: number, height: number): void; - destroy(): void; - - } - export class CanvasGraphics { - - static renderGraphicsMask(graphics: Graphics, context: CanvasRenderingContext2D): void; - static updateGraphicsTint(graphics: Graphics): void; - - static renderGraphics(graphics: Graphics, context: CanvasRenderingContext2D): void; - - } - export class CanvasMaskManager { - - pushMask(maskData: any, renderer: WebGLRenderer | CanvasRenderer): void; - popMask(renderer: WebGLRenderer | CanvasRenderer): void; - destroy(): void; - - } - export class CanvasTinter { - - static getTintedTexture(sprite: DisplayObject, color: number): HTMLCanvasElement; - static tintWithMultiply(texture: Texture, color: number, canvas: HTMLDivElement): void; - static tintWithOverlay(texture: Texture, color: number, canvas: HTMLCanvasElement): void; - static tintWithPerPixel(texture: Texture, color: number, canvas: HTMLCanvasElement): void; - static roundColor(color: number): number; - static cacheStepsPerColorChannel: number; - static convertTintToImage: boolean; - static vanUseMultiply: boolean; - static tintMethod: Function; - - } - export class WebGLRenderer extends SystemRenderer { - - protected _useFXAA: boolean; - protected _FXAAFilter: filters.FXAAFilter; - protected _contextOptions: { - alpha: boolean; - antiAlias: boolean; - premultipliedAlpha: boolean; - stencil: boolean; - preseveDrawingBuffer: boolean; - }; - protected _renderTargetStack: RenderTarget[]; - - protected _initContext(): void; - protected _createContext(): void; - protected handleContextLost: (event: WebGLContextEvent) => void; - protected _mapGlModes(): void; - protected _managedTextures: Texture[]; - - constructor(width?: number, height?: number, options?: RendererOptions); - - drawCount: number; - shaderManager: ShaderManager; - maskManager: MaskManager; - stencilManager: StencilManager; - filterManager: FilterManager; - blendModeManager: BlendModeManager; - currentRenderTarget: RenderTarget; - currentRenderer: ObjectRenderer; - - render(object: DisplayObject): void; - renderDisplayObject(displayObject: DisplayObject, renderTarget: RenderTarget, clear: boolean): void; - setObjectRenderer(objectRenderer: ObjectRenderer): void; - setRenderTarget(renderTarget: RenderTarget): void; - updateTexture(texture: BaseTexture | Texture): BaseTexture | Texture; - destroyTexture(texture: BaseTexture | Texture, _skipRemove?: boolean): void; - - } - export class AbstractFilter { - - protected vertexSrc: string[]; - protected fragmentSrc: string[]; - - constructor(vertexSrc?: string | string[], fragmentSrc?: string | string[], uniforms?: any); - - uniforms: any; - - padding: number; - - getShader(renderer: WebGLRenderer): Shader; - applyFilter(renderer: WebGLRenderer, input: RenderTarget, output: RenderTarget, clear?: boolean): void; - syncUniform(uniform: WebGLUniformLocation): void; - - } - export class SpriteMaskFilter extends AbstractFilter { - - constructor(sprite: Sprite); - - maskSprite: Sprite; - maskMatrix: Matrix; - - applyFilter(renderer: WebGLRenderbuffer, input: RenderTarget, output: RenderTarget): void; - map: Texture; - offset: Point; - - } - export class BlendModeManager extends WebGLManager { - - constructor(renderer: WebGLRenderer); - - setBlendMode(blendMode: number): boolean; - - } - - export class FilterManager extends WebGLManager { - - constructor(renderer: WebGLRenderer); - - filterStack: any[]; - renderer: WebGLRenderer; - texturePool: any[]; - - onContextChange: () => void; - setFilterStack(filterStack: any[]): void; - pushFilter(target: RenderTarget, filters: any[]): void; - popFilter(): AbstractFilter; - getRenderTarget(clear?: boolean): RenderTarget; - protected returnRenderTarget(renderTarget: RenderTarget): void; - applyFilter(shader: Shader | AbstractFilter, inputTarget: RenderTarget, outputTarget: RenderTarget, clear?: boolean): void; - calculateMappedMatrix(filterArea: Rectangle, sprite: Sprite, outputMatrix?: Matrix): Matrix; - capFilterArea(filterArea: Rectangle): void; - resize(width: number, height: number): void; - destroy(): void; - - } - - export class MaskManager extends WebGLManager { - - stencilStack: StencilMaskStack; - reverse: boolean; - count: number; - alphaMaskPool: any[]; - - pushMask(target: RenderTarget, maskData: any): void; - popMask(target: RenderTarget, maskData: any): void; - pushSpriteMask(target: RenderTarget, maskData: any): void; - popSpriteMask(): void; - pushStencilMask(target: RenderTarget, maskData: any): void; - popStencilMask(target: RenderTarget, maskData: any): void; - - } - export class ShaderManager extends WebGLManager { - - protected _currentId: number; - protected currentShader: Shader; - - constructor(renderer: WebGLRenderer); - - maxAttibs: number; - attribState: any[]; - tempAttribState: any[]; - stack: any[]; - - setAttribs(attribs: any[]): void; - setShader(shader: Shader): boolean; - destroy(): void; - - } - export class StencilManager extends WebGLManager { - - constructor(renderer: WebGLRenderer); - - setMaskStack(stencilMaskStack: StencilMaskStack): void; - pushStencil(graphics: Graphics, webGLData: WebGLGraphicsData): void; - bindGraphics(graphics: Graphics, webGLData: WebGLGraphicsData): void; - popStencil(graphics: Graphics, webGLData: WebGLGraphicsData): void; - destroy(): void; - pushMask(maskData: any[]): void; - popMask(maskData: any[]): void; - - } - export class WebGLManager { - - protected onContextChange: () => void; - - constructor(renderer: WebGLRenderer); - - renderer: WebGLRenderer; - - destroy(): void; - - } - export class Shader { - - protected attributes: any; - protected textureCount: number; - protected uniforms: any; - - protected _glCompile(type: any, src: any): Shader; - - constructor(shaderManager: ShaderManager, vertexSrc: string, fragmentSrc: string, uniforms: any, attributes: any); - - uuid: number; - gl: WebGLRenderingContext; - shaderManager: ShaderManager; - program: WebGLProgram; - vertexSrc: string; - fragmentSrc: string; - - init(): void; - cacheUniformLocations(keys: string[]): void; - cacheAttributeLocations(keys: string[]): void; - compile(): WebGLProgram; - syncUniform(uniform: any): void; - syncUniforms(): void; - initSampler2D(uniform: any): void; - destroy(): void; - - } - export class ComplexPrimitiveShader extends Shader { - - constructor(shaderManager: ShaderManager); - - } - export class PrimitiveShader extends Shader { - - constructor(shaderManager: ShaderManager); - - } - export class TextureShader extends Shader { - - constructor(shaderManager: ShaderManager, vertexSrc?: string, fragmentSrc?: string, customUniforms?: any, customAttributes?: any); - - } - export interface StencilMaskStack { - - stencilStack: any[]; - reverse: boolean; - count: number; - - } - export class ObjectRenderer extends WebGLManager { - - start(): void; - stop(): void; - flush(): void; - render(object?: any): void; - - } - export class RenderTarget { - - constructor(gl: WebGLRenderingContext, width: number, height: number, scaleMode: number, resolution: number, root: boolean); - - gl: WebGLRenderingContext; - frameBuffer: WebGLFramebuffer; - texture: Texture; - size: Rectangle; - resolution: number; - projectionMatrix: Matrix; - transform: Matrix; - frame: Rectangle; - stencilBuffer: WebGLRenderbuffer; - stencilMaskStack: StencilMaskStack; - filterStack: any[]; - scaleMode: number; - root: boolean; - - clear(bind?: boolean): void; - attachStencilBuffer(): void; - activate(): void; - calculateProjection(protectionFrame: Matrix): void; - resize(width: number, height: number): void; - destroy(): void; - - } - export interface Quad { - - gl: WebGLRenderingContext; - vertices: number[]; - uvs: number[]; - colors: number[]; - indices: number[]; - vertexBuffer: WebGLBuffer; - indexBuffer: WebGLBuffer; - - map(rect: Rectangle, rect2: Rectangle): void; - upload(): void; - destroy(): void; - - } - - // sprites - - export class Sprite extends Container { - - static fromFrame(frameId: string): Sprite; - static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite; - - protected _texture: Texture; - protected _width: number; - protected _height: number; - protected cachedTint: number; - - protected _onTextureUpdate(): void; - - constructor(texture?: Texture); - - anchor: Point; - tint: number; - blendMode: number; - shader: Shader | AbstractFilter; - texture: Texture; - - width: number; - height: number; - - getBounds(matrix?: Matrix): Rectangle; - getLocalBounds(): Rectangle; - containsPoint(point: Point): boolean; - destroy(destroyTexture?: boolean, destroyBaseTexture?: boolean): void; - - } - export class SpriteRenderer extends ObjectRenderer { - - protected renderBatch(texture: Texture, size: number, startIndex: number): void; - - vertSize: number; - vertByteSize: number; - size: number; - vertices: number[]; - positions: number[]; - colors: number[]; - indices: number[]; - currentBatchSize: number; - sprites: Sprite[]; - shader: Shader | AbstractFilter; - - render(sprite: Sprite): void; - flush(): void; - start(): void; - destroy(): void; - - } - - // text - - export interface TextStyle { - - font?: string; - fill?: string | number; - align?: string; - stroke?: string | number; - strokeThickness?: number; - wordWrap?: boolean; - wordWrapWidth?: number; - lineHeight?: number; - dropShadow?: boolean; - dropShadowColor?: string | number; - dropShadowAngle?: number; - dropShadowDistance?: number; - padding?: number; - textBaseline?: string; - lineJoin?: string; - miterLimit?: number; - - } - export class Text extends Sprite { - - static fontPropertiesCache: any; - static fontPropertiesCanvas: HTMLCanvasElement; - static fontPropertiesContext: CanvasRenderingContext2D; - - protected _text: string; - protected _style: TextStyle; - - protected updateText(): void; - protected updateTexture(): void; - protected determineFontProperties(fontStyle: TextStyle): TextStyle; - protected wordWrap(text: string): boolean; - - constructor(text?: string, style?: TextStyle, resolution?: number); - - canvas: HTMLCanvasElement; - context: CanvasRenderingContext2D; - dirty: boolean; - resolution: number; - text: string; - style: TextStyle; - - width: number; - height: number; - - } - - // textures - - export class BaseTexture extends EventEmitter { - - static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number): BaseTexture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): BaseTexture; - - protected _glTextures: any; - - protected _sourceLoaded(): void; - - constructor(source: HTMLImageElement | HTMLCanvasElement, scaleMode?: number, resolution?: number); - - uuid: number; - resolution: number; - width: number; - height: number; - realWidth: number; - realHeight: number; - scaleMode: number; - hasLoaded: boolean; - isLoading: boolean; - source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; - premultipliedAlpha: boolean; - imageUrl: string; - isPowerOfTwo: boolean; - mipmap: boolean; - - update(): void; - loadSource(source: HTMLImageElement | HTMLCanvasElement): void; - destroy(): void; - dispose(): void; - updateSourceImage(newSrc: string): void; - - on(event: 'dispose', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - on(event: 'error', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - on(event: 'loaded', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - on(event: 'update', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - on(event: string, fn: Function, context?: any): EventEmitter; - - once(event: 'dispose', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - once(event: 'error', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - once(event: 'loaded', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - once(event: 'update', fn: (baseTexture: BaseTexture) => void, context?: any): EventEmitter; - once(event: string, fn: Function, context?: any): EventEmitter; - - } - export class RenderTexture extends Texture { - - protected renderWebGL(displayObject: DisplayObject, matrix?: Matrix, clear?: boolean, updateTransform?: boolean): void; - protected renderCanvas(displayObject: DisplayObject, matrix?: Matrix, clear?: boolean, updateTransform?: boolean): void; - - constructor(renderer: CanvasRenderer | WebGLRenderer, width?: number, height?: number, scaleMode?: number, resolution?: number); - - width: number; - height: number; - resolution: number; - renderer: CanvasRenderer | WebGLRenderer; - valid: boolean; - - render(displayObject: DisplayObject, matrix?: Matrix, clear?: boolean, updateTransform?: boolean): void; - resize(width: number, height: number, updateBase?: boolean): void; - clear(): void; - destroy(): void; - getImage(): HTMLImageElement; - getPixels(): number[]; - getPixel(x: number, y: number): number[]; - getBase64(): string; - getCanvas(): HTMLCanvasElement; - - } - export class Texture extends BaseTexture { - - static fromImage(imageUrl: string, crossOrigin?: boolean, scaleMode?: number): Texture; - static fromFrame(frameId: string): Texture; - static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): Texture; - static fromVideo(video: HTMLVideoElement | string, scaleMode?: number): Texture; - static fromVideoUrl(videoUrl: string, scaleMode?: number): Texture; - static addTextureToCache(texture: Texture, id: string): void; - static removeTextureFromCache(id: string): Texture; - static EMPTY: Texture; - - protected _frame: Rectangle; - protected _uvs: TextureUvs; - - protected onBaseTextureUpdated(baseTexture: BaseTexture): void; - protected onBaseTextureLoaded(baseTexture: BaseTexture): void; - protected _updateUvs(): void; - - constructor(baseTexture: BaseTexture, frame?: Rectangle, crop?: Rectangle, trim?: Rectangle, rotate?: boolean); - - noFrame: boolean; - baseTexture: BaseTexture; - trim: Rectangle; - valid: boolean; - requiresUpdate: boolean; - width: number; - height: number; - crop: Rectangle; - rotate: boolean; - - frame: Rectangle; - - update(): void; - destroy(destroyBase?: boolean): void; - clone(): Texture; - - } - export class TextureUvs { - - x0: number; - y0: number; - x1: number; - y1: number; - x2: number; - y2: number; - x3: number; - y3: number; - - set(frame: Rectangle, baseFrame: Rectangle, rotate: boolean): void; - - } - export class VideoBaseTexture extends BaseTexture { - - static fromVideo(video: HTMLVideoElement, scaleMode?: number): VideoBaseTexture; - static fromUrl(videoSrc: string | any | string[] | any[]): VideoBaseTexture; - - protected _loaded: boolean; - protected _onUpdate(): void; - protected _onPlayStart(): void; - protected _onPlayStop(): void; - protected _onCanPlay(): void; - - constructor(source: HTMLVideoElement, scaleMode?: number); - - autoUpdate: boolean; - - destroy(): void; - - } - - // utils - - export class utils { - - static uuid(): number; - static hex2rgb(hex: number, out?: number[]): number[]; - static hex2string(hex: number): string; - static rgb2hex(rgb: Number[]): number; - static canUseNewCanvasBlendModel(): boolean; - static getNextPowerOfTwo(number: number): number; - static isPowerOfTwo(width: number, height: number): boolean; - static getResolutionOfUrl(url: string): number; - static sayHello(type: string): void; - static isWebGLSupported(): boolean; - static sign(n: number): number; - static TextureCache: any; - static BaseTextureCache: any; - - } - - ////////////////////////////////////////////////////////////////////////////// - ////////////////////////////EXTRAS//////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// - - export namespace extras { - - export interface BitmapTextStyle { - - font?: string | { - - name?: string; - size?: number; - - }; - align?: string; - tint?: number; - - } - export class BitmapText extends Container { - - static fonts: any; - - protected _glyphs: Sprite[]; - protected _font: string | { - tint: number; - align: string; - name: string; - size: number; - }; - protected _text: string; - - protected updateText(): void; - - constructor(text: string, style?: BitmapTextStyle); - - textWidth: number; - textHeight: number; - maxWidth: number; - maxLineHeight: number; - dirty: boolean; - - tint: number; - align: string; - font: string | { - tint: number; - align: string; - name: string; - size: number; - }; - text: string; - - } - export class MovieClip extends Sprite { - - static fromFrames(frame: string[]): MovieClip; - static fromImages(images: string[]): MovieClip; - - protected _textures: Texture[]; - protected _durations: number[]; - protected _currentTime: number; - - protected update(deltaTime: number): void; - - constructor(textures: Texture[]); - - animationSpeed: number; - loop: boolean; - onComplete: () => void; - currentFrame: number; - playing: boolean; - - totalFrames: number; - textures: Texture[]; - - stop(): void; - play(): void; - gotoAndStop(frameName: number): void; - gotoAndPlay(frameName: number): void; - destroy(): void; - - } - export class TilingSprite extends Sprite { - - // This is really unclean but is the only way :( - // See http://stackoverflow.com/questions/29593905/typescript-declaration-extending-class-with-static-method/29595798#29595798 - // Thanks bas! - static fromFrame(frameId: string): Sprite; - static fromFrame(frameId: string, width?: number, height?: number): TilingSprite; - - static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite; - static fromImage(imageId: string, width?: number, height?: number, crossorigin?: boolean, scaleMode?: number): TilingSprite; - - protected _tileScaleOffset: Point; - protected _tilingTexture: boolean; - protected _refreshTexture: boolean; - protected _uvs: TextureUvs[]; - - constructor(texture: Texture, width: number, height: number); - - tileScale: Point; - tilePosition: Point; - - width: number; - height: number; - originalTexture: Texture; - - getBounds(): Rectangle; - generateTilingTexture(renderer: WebGLRenderer | CanvasRenderer, texture: Texture, forcePowerOfTwo?: boolean): Texture; - containsPoint(point: Point): boolean; - destroy(): void; - - } - - } - - ////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////FILTERS//////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// - - namespace filters { - - export class AsciiFilter extends AbstractFilter { - size: number; - } - export class BloomFilter extends AbstractFilter { - - blur: number; - blurX: number; - blurY: number; - - } - export class BlurFilter extends AbstractFilter { - - protected blurXFilter: BlurXFilter; - protected blurYFilter: BlurYFilter; - - blur: number; - passes: number; - blurX: number; - blurY: number; - - } - export class BlurXFilter extends AbstractFilter { - - passes: number; - strength: number; - blur: number; - - } - export class BlurYFilter extends AbstractFilter { - - passes: number; - strength: number; - blur: number; - - } - export class SmartBlurFilter extends AbstractFilter { - - } - export class ColorMatrixFilter extends AbstractFilter { - - protected _loadMatrix(matrix: number[], multiply: boolean): void; - protected _multiply(out: number[], a: number[], b: number[]): void; - protected _colorMatrix(matrix: number[]): void; - - matrix: number[]; - - brightness(b: number, multiply?: boolean): void; - greyscale(scale: number, multiply?: boolean): void; - blackAndWhite(multiply?: boolean): void; - hue(rotation: number, multiply?: boolean): void; - contrast(amount: number, multiply?: boolean): void; - saturate(amount: number, multiply?: boolean): void; - desaturate(multiply?: boolean): void; - negative(multiply?: boolean): void; - sepia(multiply?: boolean): void; - technicolor(multiply?: boolean): void; - polaroid(multiply?: boolean): void; - toBGR(multiply?: boolean): void; - kodachrome(multiply?: boolean): void; - browni(multiply?: boolean): void; - vintage(multiply?: boolean): void; - colorTone(desaturation: number, toned: number, lightColor: string, darkColor: string, multiply?: boolean): void; - night(intensity: number, multiply?: boolean): void; - predator(amount: number, multiply?: boolean): void; - lsd(multiply?: boolean): void; - reset(): void; - - } - export class ColorStepFilter extends AbstractFilter { - - step: number; - - } - export class ConvolutionFilter extends AbstractFilter { - - constructor(matrix: number[], width: number, height: number); - - matrix: number[]; - width: number; - height: number; - - } - export class CrossHatchFilter extends AbstractFilter { - - } - export class DisplacementFilter extends AbstractFilter { - - constructor(sprite: Sprite, scale?: number); - - map: Texture; - - scale: Point; - - } - export class DotScreenFilter extends AbstractFilter { - - scale: number; - angle: number; - - } - export class BlurYTintFilter extends AbstractFilter { - - blur: number; - - } - export class DropShadowFilter extends AbstractFilter { - - blur: number; - blurX: number; - blurY: number; - color: number; - alpha: number; - distance: number; - angle: number; - - } - export class GrayFilter extends AbstractFilter { - - gray: number; - - } - export class InvertFilter extends AbstractFilter { - - invert: number; - - } - export class NoiseFilter extends AbstractFilter { - - noise: number; - - } - export class PixelateFilter extends AbstractFilter { - - size: Point; - - } - export class RGBSplitFilter extends AbstractFilter { - - red: number; - green: number; - blue: number; - - } - export class SepiaFilter extends AbstractFilter { - - sepia: number; - - } - export class ShockwaveFilter extends AbstractFilter { - - center: number[]; - params: any; - time: number; - - } - export class TiltShiftAxisFilter extends AbstractFilter { - - blur: number; - gradientBlur: number; - start: number; - end: number; - - updateDelta(): void; - - } - export class TiltShiftFilter extends AbstractFilter { - - blur: number; - gradientBlur: number; - start: number; - end: number; - - } - export class TiltShiftXFilter extends AbstractFilter { - - updateDelta(): void; - - } - export class TiltShiftYFilter extends AbstractFilter { - - updateDelta(): void; - - } - export class TwistFilter extends AbstractFilter { - - offset: Point; - radius: number; - angle: number; - - } - export class FXAAFilter extends AbstractFilter { - - applyFilter(renderer: WebGLRenderer, input: RenderTarget, output: RenderTarget): void; - - } - } - - ////////////////////////////////////////////////////////////////////////////// - ////////////////////////////INTERACTION/////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// - - export namespace interaction { - - export interface InteractionEvent { - - stopped: boolean; - target: any; - type: string; - data: InteractionData; - stopPropagation(): void; - - } - - export class InteractionData { - - global: Point; - target: DisplayObject; - originalEvent: Event; - identifier: number; - - getLocalPosition(displayObject: DisplayObject, point?: Point, globalPos?: Point): Point; - - } - - export class InteractionManager { - - protected interactionDOMElement: HTMLElement; - protected eventsAdded: boolean; - protected _tempPoint: Point; - - protected setTargetElement(element: HTMLElement, resolution: number): void; - protected addEvents(): void; - protected removeEvents(): void; - protected dispatchEvent(displayObject: DisplayObject, eventString: string, eventData: any): void; - protected onMouseDown: (event: Event) => void; - protected processMouseDown: (displayObject: DisplayObject, hit: boolean) => void; - protected onMouseUp: (event: Event) => void; - protected processMouseUp: (displayObject: DisplayObject, hit: boolean) => void; - protected onMouseMove: (event: Event) => void; - protected processMouseMove: (displayObject: DisplayObject, hit: boolean) => void; - protected onMouseOut: (event: Event) => void; - protected processMouseOverOut: (displayObject: DisplayObject, hit: boolean) => void; - protected onTouchStart: (event: Event) => void; - protected processTouchStart: (DisplayObject: DisplayObject, hit: boolean) => void; - protected onTouchEnd: (event: Event) => void; - protected processTouchEnd: (displayObject: DisplayObject, hit: boolean) => void; - protected onTouchMove: (event: Event) => void; - protected processTouchMove: (displayObject: DisplayObject, hit: boolean) => void; - protected getTouchData(touchEvent: InteractionData): InteractionData; - protected returnTouchData(touchData: InteractionData): void; - - constructor(renderer: CanvasRenderer | WebGLRenderer, options?: { autoPreventDefault?: boolean; interactionFrequence?: number; }); - - renderer: CanvasRenderer | WebGLRenderer; - autoPreventDefault: boolean; - interactionFrequency: number; - mouse: InteractionData; - eventData: { - stopped: boolean; - target: any; - type: any; - data: InteractionData; - }; - interactiveDataPool: InteractionData[]; - last: number; - currentCursorStyle: string; - resolution: number; - update(deltaTime: number): void; - - mapPositionToPoint(point: Point, x: number, y: number): void; - processInteractive(point: Point, displayObject: DisplayObject, func: (displayObject: DisplayObject, hit: boolean) => void, hitTest: boolean, interactive: boolean): boolean; - destroy(): void; - - } - - export interface InteractiveTarget { - - interactive: boolean; - buttonMode: boolean; - interactiveChildren: boolean; - defaultCursor: string; - hitArea: HitArea; - - } - - } - - ////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////LOADER///////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// - // https://github.com/englercj/resource-loader/blob/master/src/Loader.js - - export namespace loaders { - export interface LoaderOptions { - - crossOrigin?: boolean; - loadType?: number; - xhrType?: string; - - } - export interface ResourceDictionary { - - [index: string]: PIXI.loaders.Resource; - } - export class Loader extends EventEmitter { - - constructor(baseUrl?: string, concurrency?: number); - - baseUrl: string; - progress: number; - loading: boolean; - resources: ResourceDictionary; - - add(name: string, url: string, options?: LoaderOptions, cb?: () => void): Loader; - add(url: string, options?: LoaderOptions, cb?: () => void): Loader; - // todo I am not sure of object literal notional (or its options) so just allowing any but would love to improve this - add(obj: any, options?: LoaderOptions, cb?: () => void): Loader; - - on(event: 'complete', fn: (loader: loaders.Loader, object: any) => void, context?: any): EventEmitter; - on(event: 'error', fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): EventEmitter; - on(event: 'load', fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): EventEmitter; - on(event: 'progress', fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): EventEmitter; - on(event: 'start', fn: (loader: loaders.Loader) => void, context?: any): EventEmitter; - on(event: string, fn: Function, context?: any): EventEmitter; - - once(event: 'complete', fn: (loader: loaders.Loader, object: any) => void, context?: any): EventEmitter; - once(event: 'error', fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): EventEmitter; - once(event: 'load', fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): EventEmitter; - once(event: 'progress', fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): EventEmitter; - once(event: 'start', fn: (loader: loaders.Loader) => void, context?: any): EventEmitter; - once(event: string, fn: Function, context?: any): EventEmitter; - - before(fn: Function): Loader; - pre(fn: Function): Loader; - - after(fn: Function): Loader; - use(fn: Function): Loader; - - reset(): void; - - load(cb?: (loader: loaders.Loader, object: any) => void): Loader; - - } - export class Resource extends EventEmitter { - - static LOAD_TYPE: { - XHR: number; - IMAGE: number; - AUDIO: number; - VIDEO: number; - }; - - static XHR_READ_STATE: { - UNSENT: number; - OPENED: number; - HEADERS_RECIEVED: number; - LOADING: number; - DONE: number; - }; - - static XHR_RESPONSE_TYPE: { - DEFAULT: number; - BUFFER: number; - BLOB: number; - DOCUMENT: number; - JSON: number; - TEXT: number; - }; - - constructor(name?: string, url?: string | string[], options?: LoaderOptions); - - name: string; - texture: Texture; - textures: Texture[]; - url: string; - data: any; - crossOrigin: string; - loadType: number; - xhrType: string; - error: Error; - xhr: XMLHttpRequest; - - complete(): void; - load(cb?: () => void): void; - - } - } - - ////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////MESH/////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////// - - export namespace mesh { - - export class Mesh extends Container { - - static DRAW_MODES: { - TRIANGLE_MESH: number; - TRIANGLES: number; - }; - - constructor(texture: Texture, vertices?: number[], uvs?: number[], indices?: number[], drawMode?: number); - - texture: Texture; - uvs: number[]; - vertices: number[]; - indices: number[]; - dirty: boolean; - blendMode: number; - canvasPadding: number; - drawMode: number; - shader: Shader | AbstractFilter; - - getBounds(matrix?: Matrix): Rectangle; - containsPoint(point: Point): boolean; - - protected _texture: Texture; - - protected _renderCanvasTriangleMesh(context: CanvasRenderingContext2D): void; - protected _renderCanvasTriangles(context: CanvasRenderingContext2D): void; - protected _renderCanvasDrawTriangle(context: CanvasRenderingContext2D, vertices: number, uvs: number, index0: number, index1: number, index2: number): void; - protected renderMeshFlat(Mesh: Mesh): void; - protected _onTextureUpdate(): void; - - } - export class Rope extends Mesh { - - protected _ready: boolean; - - protected getTextureUvs(): TextureUvs; - - constructor(texture: Texture, points: Point[]); - - points: Point[]; - colors: number[]; - - refresh(): void; - - } - export class Plane extends Mesh { - - segmentsX: number; - segmentsY: number; - - constructor(texture: Texture, segmentsX?: number, segmentsY?: number); - - } - - - export class MeshRenderer extends ObjectRenderer { - - protected _initWebGL(mesh: Mesh): void; - - indices: number[]; - - constructor(renderer: WebGLRenderer); - - render(mesh: Mesh): void; - flush(): void; - start(): void; - destroy(): void; - - } - - export interface MeshShader extends Shader { } - - } - - namespace ticker { - - export var shared: Ticker; - - export class Ticker { - - protected _tick(time: number): void; - protected _emitter: EventEmitter; - protected _requestId: number; - protected _maxElapsedMS: number; - - protected _requestIfNeeded(): void; - protected _cancelIfNeeded(): void; - protected _startIfPossible(): void; - - autoStart: boolean; - deltaTime: number; - elapsedMS: number; - lastTime: number; - speed: number; - started: boolean; - - FPS: number; - minFPS: number; - - add(fn: (deltaTime: number) => void, context?: any): Ticker; - addOnce(fn: (deltaTime: number) => void, context?: any): Ticker; - remove(fn: (deltaTime: number) => void, context?: any): Ticker; - start(): void; - stop(): void; - update(): void; - - } - - } -} diff --git a/pixi.js/v3/pixi.js-tests.ts b/pixi.js/v3/pixi.js-tests.ts deleted file mode 100644 index ec4c5329c0..0000000000 --- a/pixi.js/v3/pixi.js-tests.ts +++ /dev/null @@ -1,2739 +0,0 @@ -namespace basics { - - export class Basics { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bunny: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a texture from an image path - var texture: PIXI.Texture = PIXI.Texture.fromImage("../../_assets/basics/bunny.png"); - - // create a new Sprite using the texture - this.bunny = new PIXI.Sprite(texture); - - // center the sprite's anchor point - this.bunny.anchor.x = 0.5; - this.bunny.anchor.y = 0.5; - - // move the sprite to the center of the screen - this.bunny.position.x = 200; - this.bunny.position.y = 150; - - // add it to the stage - this.stage.addChild(this.bunny); - - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.bunny.rotation += 0.1; - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class Click { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private sprite: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.sprite = PIXI.Sprite.fromImage('../../_assets/basics/bunny.png'); - this.sprite.position.set(230, 264); - this.sprite.interactive = true; - this.sprite.on('mousedown', this.onDown, this); - this.sprite.on('touchstart', this.onDown, this); - - // add it to the stage - this.stage.addChild(this.sprite); - - // start animatng - this.animate(); - - } - - private onDown = (eventData: PIXI.interaction.InteractionData): void => { - - this.sprite.scale.x += 0.3; - this.sprite.scale.y += 0.3; - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class Container { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private container: PIXI.Container; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.container = new PIXI.Container(); - - this.stage.addChild(this.container); - - for (var j = 0; j < 5; j++) { - - for (var i = 0; i < 5; i++) { - - var bunny: PIXI.Sprite = PIXI.Sprite.fromImage('../../_assets/basics/bunny.png'); - bunny.x = 40 * i; - bunny.y = 40 * j; - this.container.addChild(bunny); - - } - - } - - /* - * All the bunnies are added to the container with the addChild method - * when you do this, all the bunnies become children of the container, and when a container moves, - * so do all its children. - * This gives you a lot of flexibility and makes it easier to position elements on the screen - */ - this.container.x = 100; - this.container.y = 60; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class CustomFilter { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private filter: CustomizedFilter; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.background = PIXI.Sprite.fromImage('../../_assets/bkg-grass.jpg'); - this.background.scale.set(1.3, 1); - this.stage.addChild(this.background); - - - PIXI.loader.add('shader', '../../_assets/basics/shader.frag'); - PIXI.loader.once('complete', this.onLoaded, this); - PIXI.loader.load(); - - } - - private onLoaded(loader: PIXI.loaders.Loader, res: any) { - - var fragmentSrc = res.shader.data; - - this.filter = new CustomizedFilter(fragmentSrc); - this.background.filters = [this.filter]; - - this.animate(); - - - } - - private animate = (): void => { - - this.filter.uniforms.customUniform.value += 0.04; - - this.renderer.render(this.stage); - requestAnimationFrame(this.animate); - - } - - } - - export class CustomizedFilter extends PIXI.AbstractFilter { - - constructor(fragmentSource: string | string[]) { - super(null, fragmentSource, { - customUniform: { - type: '1f', - value: 0 - } - }); - } - - } - -} - -namespace basics { - - export class Graphics { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private graphics: PIXI.Graphics; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.graphics = new PIXI.Graphics(); - - // draw a shape - this.graphics.moveTo(50, 50); - this.graphics.lineTo(250, 50); - this.graphics.lineTo(100, 100); - this.graphics.lineTo(50, 50); - this.graphics.endFill(); - - // set a fill and a line style again and draw a rectangle - this.graphics.lineStyle(2, 0x0000FF, 1); - this.graphics.beginFill(0xFF700B, 1); - this.graphics.drawRect(50, 250, 120, 120); - - // draw a rounded rectangle - this.graphics.lineStyle(2, 0xFF00FF, 1); - this.graphics.beginFill(0xFF00BB, 0.25); - this.graphics.drawRoundedRect(150, 450, 300, 100, 15); - this.graphics.endFill(); - - // draw a circle, set the lineStyle to zero so the circle doesn't have an outline - this.graphics.lineStyle(0); - this.graphics.beginFill(0xFFFF0B, 0.5); - this.graphics.drawCircle(470, 90, 60); - this.graphics.endFill(); - - this.stage.addChild(this.graphics); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class RenderTexture { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private container: PIXI.Container; - - private renderTexture: PIXI.RenderTexture; - - private sprite: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.container = new PIXI.Container(); - - this.stage.addChild(this.container); - - for (var j = 0; j < 5; j++) { - - for (var i = 0; i < 5; i++) { - - var bunny: PIXI.Sprite = PIXI.Sprite.fromImage('../../_assets/basics/bunny.png'); - bunny.x = 40 * i; - bunny.y = 40 * j; - bunny.rotation = Math.random() * (Math.PI * 2); - this.container.addChild(bunny); - - } - - } - - this.renderTexture = new PIXI.RenderTexture(this.renderer, 300, 200, PIXI.SCALE_MODES.LINEAR, 0.1); - - this.sprite = new PIXI.Sprite(this.renderTexture); - this.sprite.x = 450; - this.sprite.y = 60; - this.stage.addChild(this.sprite); - - this.container.x = 100; - this.container.y = 60; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.renderTexture.render(this.container); - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class SpriteSheet { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private movie: PIXI.extras.MovieClip; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - PIXI.loader.add('../../_assets/basics/fighter.json').load((loader: PIXI.loaders.Loader, object: any): void => { - - // create an array of textures from an image path - var frames: PIXI.Texture[] = []; - - for (var i = 0; i < 30; i++) { - - var val = i < 10 ? '0' + i : i; - - // magically works since the spritesheet was loaded with the pixi loader - frames.push(PIXI.Texture.fromFrame('rollSequence00' + val + '.png')); - } - - - // create a MovieClip (brings back memories from the days of Flash, right ?) - this.movie = new PIXI.extras.MovieClip(frames); - - /* - * A MovieClip inherits all the properties of a PIXI sprite - * so you can change its position, its anchor, mask it, etc - */ - this.movie.position.set(300); - this.movie.anchor.set(0.5); - this.movie.animationSpeed = 0.5; - this.movie.play(); - - this.stage.addChild(this.movie); - - this.animate(); - - }); - - } - - private animate = (): void => { - - this.movie.rotation += 0.01; - - // render the stage container - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace basics { - - export class Text { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private basicText: PIXI.Text; - - private richText: PIXI.Text; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.basicText = new PIXI.Text('Basic Text in Pixi'); - this.basicText.x = 30; - this.basicText.y = 90; - - this.stage.addChild(this.basicText); - - var style: PIXI.TextStyle = { - font: '36px Arial bold italic', - fill: PIXI.utils.hex2string(0xF7EDCA), - stroke: '#4a1850', - strokeThickness: 5, - dropShadow: true, - dropShadowColor: '#000000', - dropShadowAngle: Math.PI / 6, - dropShadowDistance: 6, - wordWrap: true, - wordWrapWidth: 440 - }; - - this.richText = new PIXI.Text('Rich Text with a lot of options and across multiple lines', style); - this.richText.x = 30; - this.richText.y = 180; - - this.stage.addChild(this.richText); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace basics { - - export class TexturedMesh { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private strip: PIXI.mesh.Rope; - - private graphics: PIXI.Graphics; - - private count: number; - - private points: PIXI.Point[]; - - private ropeLength: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.count = 0; - - this.ropeLength = 918 / 20; - this.ropeLength = 45; - - this.points = []; - - for (var i = 0; i < 25; i++) { - this.points.push(new PIXI.Point(i * this.ropeLength, 0)); - } - - this.strip = new PIXI.mesh.Rope(PIXI.Texture.fromImage('../../_assets/snake.png'), this.points); - this.strip.position.x = -40; - this.strip.position.y = 300; - this.stage.addChild(this.strip); - - this.graphics = new PIXI.Graphics(); - this.graphics.x = this.strip.x; - this.graphics.y = this.strip.y; - this.stage.addChild(this.graphics); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.1; - - // make the snake - for (var i = 0; i < this.points.length; i++) { - - this.points[i].y = Math.sin((i * 0.5) + this.count) * 30; - - this.points[i].x = i * this.ropeLength + Math.cos((i * 0.3) + this.count) * 20; - - } - - // render the stage - this.renderer.render(this.stage); - - this.renderPoints(); - - requestAnimationFrame(this.animate); - - } - - private renderPoints(): void { - - this.graphics.clear(); - - this.graphics.lineStyle(2, 0xffc2c2); - this.graphics.moveTo(this.points[0].x, this.points[0].y); - - for (var i = 1; i < this.points.length; i++) { - this.graphics.lineTo(this.points[i].x, this.points[i].y); - } - - for (var i = 1; i < this.points.length; i++) { - this.graphics.beginFill(0xff0022); - this.graphics.drawCircle(this.points[i].x, this.points[i].y, 10); - this.graphics.endFill(); - } - - } - - } - -} - -namespace basics { - - export class TilingSprite { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private texture: PIXI.Texture; - - private tilingSprite: PIXI.extras.TilingSprite; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a texture from an image path - this.texture = PIXI.Texture.fromImage('../../_assets/p2.jpeg'); - - /* create a tiling sprite ... - * requires a texture, a width and a height - * in WebGL the image size should preferably be a power of two - */ - this.tilingSprite = new PIXI.extras.TilingSprite(this.texture, this.renderer.width, this.renderer.height); - this.stage.addChild(this.tilingSprite); - - this.count = 0; - - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.005; - - this.tilingSprite.tileScale.x = 2 + Math.sin(this.count); - this.tilingSprite.tileScale.y = 2 + Math.cos(this.count); - - this.tilingSprite.tilePosition.x += 1; - this.tilingSprite.tilePosition.y += 1; - - // render the root container - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace basics { - - export class Video { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private texture: PIXI.Texture; - - private videoSprite: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a video texture from a path - this.texture = PIXI.Texture.fromVideo('../../_assets/testVideo.mp4'); - - // create a new sprite using the video texture (yes it's that easy) - this.videoSprite = new PIXI.Sprite(this.texture); - this.videoSprite.width = this.renderer.width; - this.videoSprite.height = this.renderer.height; - this.stage.addChild(this.videoSprite); - - this.stage.addChild(this.videoSprite); - - this.animate(); - - } - - private animate = (): void => { - - // render the stage - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class AlphaMask { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Container; - - private cells: PIXI.Sprite; - - private mask: PIXI.Sprite; - - private target: PIXI.Point; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.background = PIXI.Sprite.fromImage('../../_assets/bkg.jpg'); - this.stage.addChild(this.background); - - this.cells = PIXI.Sprite.fromImage('../../_assets/cells.png'); - this.cells.scale.set(1.5, 1.5); - - this.mask = PIXI.Sprite.fromImage('../../_assets/flowerTop.png'); - this.mask.anchor.set(0.5); - this.mask.position.x = 310; - this.mask.position.y = 190; - - this.cells.mask = this.mask; - - this.stage.addChild(this.mask); - - this.stage.addChild(this.cells); - - this.target = new PIXI.Point(); - - this.reset(); - - this.animate(); - - } - - private reset(): void { - - this.target.x = Math.floor(Math.random() * 550); - this.target.y = Math.floor(Math.random() * 300); - - } - - private animate = (): void => { - - this.mask.position.x += (this.target.x - this.mask.x) * 0.1; - this.mask.position.y += (this.target.y - this.mask.y) * 0.1; - - if (Math.abs(this.mask.x - this.target.x) < 1) { - this.reset(); - } - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class Batch { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private sprites: PIXI.ParticleContainer; - - private maggots: BatchDude[]; - - private tick: number; - - private dudeBounds: PIXI.Rectangle; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.sprites = new PIXI.ParticleContainer(10000, { - - scale: true, - position: true, - rotation: true, - uvs: true, - alpha: true - - }); - this.stage.addChild(this.sprites); - - // create an array to store all the sprites - this.maggots = []; - - var totalSprites = this.renderer instanceof PIXI.WebGLRenderer ? 10000 : 100; - - for (var i = 0; i < totalSprites; i++) { - - // create a new Sprite - var dude = new BatchDude(PIXI.Texture.fromImage('../../_assets/tinyMaggot.png')); - - dude.tint = Math.random() * 0xE8D4CD; - - // set the anchor point so the texture is centerd on the sprite - dude.anchor.set(0.5); - - // different maggots, different sizes - dude.scale.set(0.8 + Math.random() * 0.3); - - // scatter them all - dude.x = Math.random() * this.renderer.width; - dude.y = Math.random() * this.renderer.height; - - dude.tint = Math.random() * 0x808080; - - // create a random direction in radians - dude.direction = Math.random() * Math.PI * 2; - - // this number will be used to modify the direction of the sprite over time - dude.turningSpeed = Math.random() - 0.8; - - // create a random speed between 0 - 2, and these maggots are slooww - dude.speed = (2 + Math.random() * 2) * 0.2; - - dude.offset = Math.random() * 100; - - // finally we push the dude into the maggots array so it it can be easily accessed later - this.maggots.push(dude); - - this.sprites.addChild(dude); - - } - - // create a bounding box box for the little maggots - var dudeBoundsPadding = 100; - this.dudeBounds = new PIXI.Rectangle(-dudeBoundsPadding, - -dudeBoundsPadding, - this.renderer.width + dudeBoundsPadding * 2, - this.renderer.height + dudeBoundsPadding * 2); - - this.tick = 0; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // iterate through the sprites and update their position - for (const dude of this.maggots) { - dude.scale.y = 0.95 + Math.sin(this.tick + dude.offset) * 0.05; - dude.direction += dude.turningSpeed * 0.01; - dude.position.x += Math.sin(dude.direction) * (dude.speed * dude.scale.y); - dude.position.y += Math.cos(dude.direction) * (dude.speed * dude.scale.y); - dude.rotation = -dude.direction + Math.PI; - - // wrap the maggots - if (dude.position.x < this.dudeBounds.x) { - dude.position.x += this.dudeBounds.width; - } else if (dude.position.x > this.dudeBounds.x + this.dudeBounds.width) { - dude.position.x -= this.dudeBounds.width; - } - - if (dude.position.y < this.dudeBounds.y) { - dude.position.y += this.dudeBounds.height; - } else if (dude.position.y > this.dudeBounds.y + this.dudeBounds.height) { - dude.position.y -= this.dudeBounds.height; - } - } - - // increment the ticker - this.tick += 0.1; - - // time to render the stage ! - this.renderer.render(this.stage); - - // request another animation frame... - requestAnimationFrame(this.animate); - - } - - } - - export class BatchDude extends PIXI.Sprite { - - direction: number; - speed: number; - turningSpeed: number; - offset: number; - - constructor(texture: PIXI.Texture) { - - super(texture); - - } - - } - -} - -namespace demos { - - export class BlendModes { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private dudeArray: BlendModesDude[]; - - private totalDudes: number; - - private dudeBounds: PIXI.Rectangle; - - private tick: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a new background sprite - this.background = PIXI.Sprite.fromImage('../../_assets/BGrotate.jpg'); - this.stage.addChild(this.background); - - // create an array to store a reference to the dudes - this.dudeArray = []; - - this.totalDudes = 20; - - for (var i = 0; i < this.totalDudes; i++) { - - // create a new Sprite that uses the image name that we just generated as its source - var dude = new BlendModesDude(PIXI.Texture.fromImage('../../_assets/flowerTop.png')); - - dude.anchor.set(0.5); - - // set a random scale for the dude - dude.scale.set(0.8 + Math.random() * 0.3); - - // finally let's set the dude to be at a random position... - dude.position.x = Math.floor(Math.random() * this.renderer.width); - dude.position.y = Math.floor(Math.random() * this.renderer.height); - - // The important bit of this example, this is how you change the default blend mode of the sprite - dude.blendMode = PIXI.BLEND_MODES.ADD; - - // create some extra properties that will control movement - dude.direction = Math.random() * Math.PI * 2; - - // this number will be used to modify the direction of the dude over time - dude.turningSpeed = Math.random() - 0.8; - - // create a random speed for the dude between 0 - 2 - dude.speed = 2 + Math.random() * 2; - - // finally we push the dude into the dudeArray so it it can be easily accessed later - this.dudeArray.push(dude); - - this.stage.addChild(dude); - - } - - // create a bounding box box for the little maggots - var dudeBoundsPadding = 100; - this.dudeBounds = new PIXI.Rectangle(-dudeBoundsPadding, - -dudeBoundsPadding, - this.renderer.width + dudeBoundsPadding * 2, - this.renderer.height + dudeBoundsPadding * 2); - - this.tick = 0; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // iterate through the dudes and update the positions - for (const dude of this.dudeArray) { - dude.direction += dude.turningSpeed * 0.01; - dude.position.x += Math.sin(dude.direction) * dude.speed; - dude.position.y += Math.cos(dude.direction) * dude.speed; - dude.rotation = -dude.direction - Math.PI / 2; - - // wrap the dudes by testing their bounds... - if (dude.position.x < this.dudeBounds.x) { - dude.position.x += this.dudeBounds.width; - } else if (dude.position.x > this.dudeBounds.x + this.dudeBounds.width) { - dude.position.x -= this.dudeBounds.width; - } - - if (dude.position.y < this.dudeBounds.y) { - dude.position.y += this.dudeBounds.height; - } else if (dude.position.y > this.dudeBounds.y + this.dudeBounds.height) { - dude.position.y -= this.dudeBounds.height; - } - } - - // increment the ticker - this.tick += 0.1; - - // time to render the stage ! - this.renderer.render(this.stage); - - // request another animation frame... - requestAnimationFrame(this.animate); - - } - - } - - export class BlendModesDude extends PIXI.Sprite { - - direction: number; - speed: number; - turningSpeed: number; - offset: number; - - constructor(texture: PIXI.Texture) { - - super(texture); - - } - - } - -} - -namespace demos { - - export class CacheAsBitmap { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private aliens: PIXI.Sprite[]; - - private alienContainer: PIXI.Container; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // load resources - PIXI.loader - .add('spritesheet', '../../_assets/monsters.json') - .load(this.onAssetsLoaded); - - // holder to store aliens - this.aliens = []; - - this.count = 0; - - // create an empty container - this.alienContainer = new PIXI.Container(); - this.alienContainer.position.x = 400; - this.alienContainer.position.y = 300; - - // make the stage interactive - this.stage.interactive = true; - - this.stage.addChild(this.alienContainer); - - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - } - - private onClick = (event: PIXI.interaction.InteractionEvent): void => { - - this.alienContainer.cacheAsBitmap = !this.alienContainer.cacheAsBitmap; - - // feel free to play with what's below - // var sprite = new PIXI.Sprite(this.alienContainer.generateTexture()); - // this.stage.addChild(sprite); - // sprite.position.x = Math.random() * 800; - // sprite.position.y = Math.random() * 600; - - } - - private onAssetsLoaded = (): void => { - - // add a bunch of aliens with textures from image paths - - var alienFrames = ['eggHead.png', 'flowerTop.png', 'helmlok.png', 'skully.png']; - - for (var i = 0; i < 100; i++) { - - var frameName = alienFrames[i % 4]; - - // create an alien using the frame name.. - var alien = PIXI.Sprite.fromFrame(frameName); - alien.tint = Math.random() * 0xFFFFFF; - - /* - * fun fact for the day :) - * another way of doing the above would be - * var texture = PIXI.Texture.fromFrame(frameName); - * var alien = new PIXI.Sprite(texture); - */ - alien.position.x = Math.random() * 800 - 400; - alien.position.y = Math.random() * 600 - 300; - alien.anchor.x = 0.5; - alien.anchor.y = 0.5; - this.aliens.push(alien); - this.alienContainer.addChild(alien); - - } - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // let's rotate the aliens a little bit - for (var i = 0; i < 100; i++) { - var alien = this.aliens[i]; - alien.rotation += 0.1; - } - - this.count += 0.01; - - this.alienContainer.scale.x = Math.sin(this.count); - this.alienContainer.scale.y = Math.sin(this.count); - - this.alienContainer.rotation += 0.01; - - // render the stage - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class DraggableBunny extends PIXI.Sprite { - - // todo I dont know what event.data is at this time - private data: any; - - private dragging: boolean; - - constructor(texture?: PIXI.Texture) { - - super(texture); - - // enable the bunny to be interactive... this will allow it to respond to mouse and touch events - this.interactive = true; - - // this button mode will mean the hand cursor appears when you roll over the bunny with your mouse - this.buttonMode = true; - - // center the bunny's anchor point - this.anchor.set(0.5); - - // make it a bit bigger, so it's easier to grab - this.scale.set(3); - - // setup events - this - // events for drag start - .on('mousedown', this.onDragStart) - .on('touchstart', this.onDragStart) - // events for drag end - .on('mouseup', this.onDragEnd) - .on('mouseupoutside', this.onDragEnd) - .on('touchend', this.onDragEnd) - .on('touchendoutside', this.onDragEnd) - // events for drag move - .on('mousemove', this.onDragMove) - .on('touchmove', this.onDragMove); - - } - - private onDragStart = (event: PIXI.interaction.InteractionEvent): void => { - - // store a reference to the data - // the reason for this is because of multitouch - // we want to track the movement of this particular touch - this.data = event.data; - this.alpha = 0.5; - this.dragging = true; - - } - - private onDragEnd = (event: PIXI.interaction.InteractionEvent): void => { - - // set interactiondata to null - this.data = null; - this.alpha = 1; - this.dragging = false; - - } - - private onDragMove = (event: PIXI.interaction.InteractionEvent): void => { - - if (this.dragging) { - var newPosition = this.data.getLocalPosition(this.parent); - this.position.x = newPosition.x; - this.position.y = newPosition.y; - } - - } - - } - - export class Dragging { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private texture: PIXI.Texture; - - private data: PIXI.interaction.InteractionData; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a texture from an image - this.texture = PIXI.Texture.fromImage('../../_assets/bunny.png'); - - for (var i = 0; i < 10; i++) { - this.createBunny(Math.floor(Math.random() * 800), Math.floor(Math.random() * 600)); - } - - // start animating - this.animate(); - - } - - private createBunny(x: number, y: number): void { - - // create our little bunny friend.. - var bunny = new DraggableBunny(this.texture); - - // move the sprite to its designated position - bunny.position.x = x; - bunny.position.y = y; - - // add it to the stage - this.stage.addChild(bunny); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace demos { - - export class GraphicsDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private thing: PIXI.Graphics; - - private graphics: PIXI.Graphics; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.graphics = new PIXI.Graphics(); - - // set a fill and line style - this.graphics.beginFill(0xFF3300); - this.graphics.lineStyle(10, 0xffd900, 1); - - // draw a shape - this.graphics.moveTo(50, 50); - this.graphics.lineTo(250, 50); - this.graphics.lineTo(100, 100); - this.graphics.lineTo(250, 220); - this.graphics.lineTo(50, 220); - this.graphics.lineTo(50, 50); - this.graphics.endFill(); - - // set a fill and line style again - this.graphics.lineStyle(10, 0xFF0000, 0.8); - this.graphics.beginFill(0xFF700B, 1); - - // draw a second shape - this.graphics.moveTo(210, 300); - this.graphics.lineTo(450, 320); - this.graphics.lineTo(570, 350); - this.graphics.quadraticCurveTo(600, 0, 480, 100); - this.graphics.lineTo(330, 120); - this.graphics.lineTo(410, 200); - this.graphics.lineTo(210, 300); - this.graphics.endFill(); - - // draw a rectangle - this.graphics.lineStyle(2, 0x0000FF, 1); - this.graphics.drawRect(50, 250, 100, 100); - - // draw a circle - this.graphics.lineStyle(0); - this.graphics.beginFill(0xFFFF0B, 0.5); - this.graphics.drawCircle(470, 200, 100); - this.graphics.endFill(); - - this.graphics.lineStyle(20, 0x33FF00); - this.graphics.moveTo(30, 30); - this.graphics.lineTo(600, 300); - - this.stage.addChild(this.graphics); - - // let's create a moving shape - this.thing = new PIXI.Graphics(); - this.stage.addChild(this.thing); - this.thing.position.x = 620 / 2; - this.thing.position.y = 380 / 2; - - this.count = 0; - - // Just click on the stage to draw random lines - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - // start animating - this.animate(); - - } - - private onClick = (event: PIXI.interaction.InteractionEvent): void => { - - this.graphics.lineStyle(Math.random() * 30, Math.random() * 0xFFFFFF, 1); - this.graphics.moveTo(Math.random() * 620, Math.random() * 380); - this.graphics.bezierCurveTo(Math.random() * 620, Math.random() * 380, - Math.random() * 620, Math.random() * 380, - Math.random() * 620, Math.random() * 380); - } - - private animate = (): void => { - - this.thing.clear(); - - this.count += 0.1; - - this.thing.clear(); - this.thing.lineStyle(10, 0xff0000, 1); - this.thing.beginFill(0xffFF00, 0.5); - - this.thing.moveTo(-120 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - this.thing.lineTo(120 + Math.cos(this.count) * 20, -100 + Math.sin(this.count) * 20); - this.thing.lineTo(120 + Math.sin(this.count) * 20, 100 + Math.cos(this.count) * 20); - this.thing.lineTo(-120 + Math.cos(this.count) * 20, 100 + Math.sin(this.count) * 20); - this.thing.lineTo(-120 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - - this.thing.rotation = this.count * 0.1; - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - } - - } - -} - -namespace demos { - - export class Interactivity { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private buttons: InteractivityButton[]; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a background... - this.background = PIXI.Sprite.fromImage('../../_assets/button_test_BG.jpg'); - this.background.width = this.renderer.width; - this.background.height = this.renderer.height; - - // add background to stage... - this.stage.addChild(this.background); - - this.buttons = []; - - var buttonPositions = [ - 175, 75, - 655, 75, - 410, 325, - 150, 465, - 685, 445 - ]; - - function noop(): void { - console.log('click'); - } - - // create some textures from an image path - var textureButton = PIXI.Texture.fromImage('../../_assets/button.png'); - var textureButtonDown = PIXI.Texture.fromImage('../../_assets/buttonDown.png'); - var textureButtonOver = PIXI.Texture.fromImage('../../_assets/buttonOver.png'); - - for (var i = 0; i < 5; i++) { - - var button = new InteractivityButton(textureButton, textureButtonDown, textureButtonOver); - - button.position.x = buttonPositions[i * 2]; - button.position.y = buttonPositions[i * 2 + 1]; - - button.tap = noop; - button.click = noop; - - // add it to the stage - this.stage.addChild(button); - - // add button to array - this.buttons.push(button); - - } - - // set some silly values... - this.buttons[0].scale.set(1.2); - - this.buttons[2].rotation = Math.PI / 10; - - this.buttons[3].scale.set(0.8); - - this.buttons[4].scale.set(0.8, 1.2); - this.buttons[4].rotation = Math.PI; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - - export class InteractivityButton extends PIXI.Sprite { - - private textureButton: PIXI.Texture; - private textureButtonDown: PIXI.Texture; - private textureButtonOver: PIXI.Texture; - - tap: Function; - click: Function; - - isdown: boolean; - isOver: boolean; - - constructor(textureButton: PIXI.Texture, textureButtonDown: PIXI.Texture, textureButtonOver: PIXI.Texture) { - - super(textureButton); - - // create some textures from an image path - this.textureButton = textureButton; - this.textureButtonDown = textureButtonDown; - this.textureButtonOver = textureButtonOver; - - this.buttonMode = true; - this.anchor.set(0.5); - - // make the button interactive... - this.interactive = true; - - this - // set the mousedown and touchstart callback... - .on('mousedown', this.onButtonDown) - .on('touchstart', this.onButtonDown) - - // set the mouseup and touchend callback... - .on('mouseup', this.onButtonUp) - .on('touchend', this.onButtonUp) - .on('mouseupoutside', this.onButtonUp) - .on('touchendoutside', this.onButtonUp) - - // set the mouseover callback... - .on('mouseover', this.onButtonOver) - - // set the mouseout callback... - .on('mouseout', this.onButtonOut); - - // you can also listen to click and tap events : - // .on('click', this.noop) - - } - - private onButtonDown = (event: PIXI.interaction.InteractionEvent): void => { - - this.isdown = true; - this.texture = this.textureButtonDown; - this.alpha = 1; - - } - - private onButtonUp = (event: PIXI.interaction.InteractionEvent): void => { - - this.isdown = false; - - if (this.isOver) { - this.texture = this.textureButtonOver; - } else { - this.texture = this.textureButton; - } - } - - private onButtonOver = (event: PIXI.interaction.InteractionEvent): void => { - - this.isOver = true; - - if (this.isdown) { - return; - } - - this.texture = this.textureButtonOver; - - } - - private onButtonOut = (event: PIXI.interaction.InteractionEvent): void => { - - this.isOver = false; - - if (this.isdown) { - return; - } - - this.texture = this.textureButton; - } - - } - -} - -namespace demos { - - export class Masking { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bg: PIXI.Sprite; - - private container: PIXI.Container; - - private bgFront: PIXI.Sprite; - - private light1: PIXI.Sprite; - - private light2: PIXI.Sprite; - - private panda: PIXI.Sprite; - - private thing: PIXI.Graphics; - - private count: number; - - private help: PIXI.Text; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb, antialias: true }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.bg = PIXI.Sprite.fromImage('../../_assets/BGrotate.jpg'); - this.bg.anchor.x = 0.5; - this.bg.anchor.y = 0.5; - - this.bg.position.x = this.renderer.width / 2; - this.bg.position.y = this.renderer.height / 2; - - this.stage.addChild(this.bg); - - this.container = new PIXI.Container(); - this.container.position.x = this.renderer.width / 2; - this.container.position.y = this.renderer.height / 2; - - // add a bunch of sprites - - this.bgFront = PIXI.Sprite.fromImage('../../_assets/SceneRotate.jpg'); - this.bgFront.anchor.x = 0.5; - this.bgFront.anchor.y = 0.5; - - this.container.addChild(this.bgFront); - - this.light2 = PIXI.Sprite.fromImage('../../_assets/LightRotate2.png'); - this.light2.anchor.x = 0.5; - this.light2.anchor.y = 0.5; - this.container.addChild(this.light2); - - this.light1 = PIXI.Sprite.fromImage('../../_assets/LightRotate1.png'); - this.light1.anchor.x = 0.5; - this.light1.anchor.y = 0.5; - this.container.addChild(this.light1); - - this.panda = PIXI.Sprite.fromImage('../../_assets/panda.png'); - this.panda.anchor.x = 0.5; - this.panda.anchor.y = 0.5; - - this.container.addChild(this.panda); - - this.stage.addChild(this.container); - - // let's create a moving shape - this.thing = new PIXI.Graphics(); - this.stage.addChild(this.thing); - this.thing.position.x = this.renderer.width / 2; - this.thing.position.y = this.renderer.height / 2; - this.thing.lineStyle(0); - - this.container.mask = this.thing; - - this.count = 0; - - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - this.help = new PIXI.Text('Click to turn masking on / off.', { font: 'bold 12pt Arial', fill: 'white' }); - this.help.position.y = this.renderer.height - 26; - this.help.position.x = 10; - this.stage.addChild(this.help); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.bg.rotation += 0.01; - this.bgFront.rotation -= 0.01; - - this.light1.rotation += 0.02; - this.light2.rotation += 0.01; - - this.panda.scale.x = 1 + Math.sin(this.count) * 0.04; - this.panda.scale.y = 1 + Math.cos(this.count) * 0.04; - - this.count += 0.1; - - this.thing.clear(); - - this.thing.beginFill(0x8bc5ff, 0.4); - this.thing.moveTo(-120 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - this.thing.lineTo(-320 + Math.cos(this.count) * 20, 100 + Math.sin(this.count) * 20); - this.thing.lineTo(120 + Math.cos(this.count) * 20, -100 + Math.sin(this.count) * 20); - this.thing.lineTo(120 + Math.sin(this.count) * 20, 100 + Math.cos(this.count) * 20); - this.thing.lineTo(-120 + Math.cos(this.count) * 20, 100 + Math.sin(this.count) * 20); - this.thing.lineTo(-120 + Math.sin(this.count) * 20, -300 + Math.cos(this.count) * 20); - this.thing.lineTo(-320 + Math.sin(this.count) * 20, -100 + Math.cos(this.count) * 20); - this.thing.rotation = this.count * 0.1; - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - private onClick = (event: PIXI.interaction.InteractionEvent): void => { - - if (!this.container.mask) { - this.container.mask = this.thing; - } else { - this.container.mask = null; - } - } - - } - -} - -namespace demos { - - export class MovieClipDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - PIXI.loader - .add('spritesheet', '../../_assets/mc.json') - .load(this.onAssetsLoaded); - - // start animating - this.animate(); - - } - - private onAssetsLoaded = (loader: PIXI.loaders.Loader): void => { - - // create an array to store the textures - var explosionTextures: PIXI.Texture[] = []; - var i: number; - - for (i = 0; i < 26; i++) { - - var texture = PIXI.Texture.fromFrame('Explosion_Sequence_A ' + (i + 1) + '.png'); - explosionTextures.push(texture); - - } - - for (i = 0; i < 50; i++) { - - // create an explosion MovieClip - var explosion = new PIXI.extras.MovieClip(explosionTextures); - - explosion.position.x = Math.random() * 800; - explosion.position.y = Math.random() * 600; - explosion.anchor.x = 0.5; - explosion.anchor.y = 0.5; - - explosion.rotation = Math.random() * Math.PI; - - explosion.scale.set(0.75 + Math.random() * 0.5); - - explosion.gotoAndPlay(Math.random() * 27); - - this.stage.addChild(explosion); - - } - - // start animating - this.animate(); - } - - private animate = (): void => { - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - -} - -namespace demos { - - export class RenderTextureDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private renderTexture: PIXI.RenderTexture; - private renderTexture2: PIXI.RenderTexture; - private currentTexture: PIXI.RenderTexture; - - private outputSprite: PIXI.Sprite; - private stuffContainer: PIXI.Container; - private items: PIXI.Sprite[]; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create two render textures... these dynamic textures will be used to draw the scene into itself - this.renderTexture = new PIXI.RenderTexture(this.renderer, this.renderer.width, this.renderer.height); - this.renderTexture2 = new PIXI.RenderTexture(this.renderer, this.renderer.width, this.renderer.height); - this.currentTexture = this.renderTexture; - - // create a new sprite that uses the render texture we created above - this.outputSprite = new PIXI.Sprite(this.currentTexture); - - // align the sprite - this.outputSprite.position.x = 400; - this.outputSprite.position.y = 300; - this.outputSprite.anchor.set(0.5); - - // add to stage - this.stage.addChild(this.outputSprite); - - this.stuffContainer = new PIXI.Container(); - - this.stuffContainer.position.x = 400; - this.stuffContainer.position.y = 300; - - this.stage.addChild(this.stuffContainer); - - // create an array of image ids.. - var fruits = [ - '../../_assets/spinObj_01.png', - '../../_assets/spinObj_02.png', - '../../_assets/spinObj_03.png', - '../../_assets/spinObj_04.png', - '../../_assets/spinObj_05.png', - '../../_assets/spinObj_06.png', - '../../_assets/spinObj_07.png', - '../../_assets/spinObj_08.png' - ]; - - // create an array of items - this.items = []; - - // now create some items and randomly position them in the stuff container - for (var i = 0; i < 20; i++) { - - var item = PIXI.Sprite.fromImage(fruits[i % fruits.length]); - item.position.x = Math.random() * 400 - 200; - item.position.y = Math.random() * 400 - 200; - - item.anchor.set(0.5); - - this.stuffContainer.addChild(item); - - this.items.push(item); - - } - - // used for spinning! - this.count = 0; - - // start animating - this.animate(); - - } - - private animate = (): void => { - - for (const item of this.items) { - // rotate each item - item.rotation += 0.1; - } - - this.count += 0.01; - - // swap the buffers ... - var temp = this.renderTexture; - this.renderTexture = this.renderTexture2; - this.renderTexture2 = temp; - - // set the new texture - this.outputSprite.texture = this.renderTexture; - - // twist this up! - this.stuffContainer.rotation -= 0.01; - this.outputSprite.scale.set(1 + Math.sin(this.count) * 0.2); - - // render the stage to the texture - // the 'true' clears the texture before the content is rendered - this.renderTexture2.render(this.stage, null, false); - - // and finally render the stage - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class StripDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private count: number; - - private points: PIXI.Point[]; - - private strip: PIXI.mesh.Rope; - - private snakeContainer: PIXI.Container; - - private ropeLength: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.count = 0; - - // build a rope! - this.ropeLength = 918 / 20; - - this.points = []; - - for (var i = 0; i < 20; i++) { - this.points.push(new PIXI.Point(i * this.ropeLength, 0)); - } - - this.strip = new PIXI.mesh.Rope(PIXI.Texture.fromImage('../../_assets/snake.png'), this.points); - this.strip.x = -459; - - this.snakeContainer = new PIXI.Container(); - this.snakeContainer.position.x = 400; - this.snakeContainer.position.y = 300; - - this.snakeContainer.scale.set(800 / 1100); - this.stage.addChild(this.snakeContainer); - - this.snakeContainer.addChild(this.strip); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.1; - - // make the snake - for (var i = 0; i < this.points.length; i++) { - - this.points[i].y = Math.sin((i * 0.5) + this.count) * 30; - - this.points[i].x = i * this.ropeLength + Math.cos((i * 0.3) + this.count) * 20; - - } - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class TextDemo { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bitmapFontText: PIXI.extras.BitmapText; - - private background: PIXI.Sprite; - - private textSample: PIXI.Text; - - private spinningText: PIXI.Text; - - private countingText: PIXI.Text; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - PIXI.loader - .add('desyrel', '../../_assets/desyrel.xml') - .load(this.onAssetsLoaded); - - // start animating - this.animate(); - - } - - private onAssetsLoaded = (): void => { - - this.bitmapFontText = new PIXI.extras.BitmapText('bitmap fonts are\n now supported!', { font: '35px Desyrel', align: 'right' }); - - this.bitmapFontText.position.x = 600 - this.bitmapFontText.textWidth; - this.bitmapFontText.position.y = 20; - - this.stage.addChild(this.bitmapFontText); - - // add a shiny background... - this.background = PIXI.Sprite.fromImage('../../_assets/textDemoBG.jpg'); - this.stage.addChild(this.background); - - // create some white text using the Snippet webfont - this.textSample = new PIXI.Text('Pixi.js can has\n multiline text!', { font: '35px Snippet', fill: 'white', align: 'left' }); - this.textSample.position.set(20); - - // create a text object with a nice stroke - this.spinningText = new PIXI.Text('I\'m fun!', { font: 'bold 60px Arial', fill: '#cc00ff', align: 'center', stroke: '#FFFFFF', strokeThickness: 6 }); - - // setting the anchor point to 0.5 will center align the text... great for spinning! - this.spinningText.anchor.set(0.5); - this.spinningText.position.x = 310; - this.spinningText.position.y = 200; - - // create a text object that will be updated... - this.countingText = new PIXI.Text('COUNT 4EVAR: 0', { font: 'bold italic 60px Arvo', fill: '#3e1707', align: 'center', stroke: '#a4410e', strokeThickness: 7 }); - - this.countingText.position.x = 310; - this.countingText.position.y = 320; - this.countingText.anchor.x = 0.5; - - this.stage.addChild(this.textSample); - this.stage.addChild(this.spinningText); - this.stage.addChild(this.countingText); - - this.count = 0; - - } - - private animate = (): void => { - - - this.renderer.render(this.stage); - - this.count += 0.05; - - // update the text with a new string - this.countingText.text = 'COUNT 4EVAR: ' + Math.floor(this.count); - - // let's spin the spinning text - this.spinningText.rotation += 0.03; - - requestAnimationFrame(this.animate); - } - - } - -} - -namespace demos { - - export class TextureSwap { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bol: boolean; - - private texture: PIXI.Texture; - private secondTexture: PIXI.Texture; - - private dude: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.bol = false; - - // an image path - this.texture = PIXI.Texture.fromImage('../../_assets/flowerTop.png'); - - // create a second texture - this.secondTexture = PIXI.Texture.fromImage('../../_assets/eggHead.png'); - - // create a new Sprite using the texture - this.dude = new PIXI.Sprite(this.texture); - - // center the sprites anchor point - this.dude.anchor.set(0.5); - - // move the sprite to the center of the screen - this.dude.position.x = this.renderer.width / 2; - this.dude.position.y = this.renderer.height / 2; - - this.stage.addChild(this.dude); - - // make the sprite interactive - this.dude.interactive = true; - - this.dude.on('click', (): void => { - this.bol = !this.bol; - - if (this.bol) { - this.dude.texture = this.secondTexture; - } else { - this.dude.texture = this.texture; - } - }); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // just for fun, let's rotate mr rabbit a little - this.dude.rotation += 0.1; - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace demos { - - export class Tinting { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private totalDudes: number = 10; - private aliens: TintingDude[]; - - private dudeBounds: PIXI.Rectangle; - - private tick: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // holder to store the aliens - this.aliens = []; - - this.tick = 0; - - for (var i = 0; i < this.totalDudes; i++) { - - // create a new Sprite that uses the image name that we just generated as its source - var dude = new TintingDude(); - - // set the anchor point so the texture is centerd on the sprite - dude.anchor.set(0.5); - - // set a random scale for the dude - no point them all being the same size! - dude.scale.set(0.8 + Math.random() * 0.3); - - // finally lets set the dude to be at a random position.. - dude.position.x = Math.random() * this.renderer.width; - dude.position.y = Math.random() * this.renderer.height; - - dude.tint = Math.random() * 0xFFFFFF; - - // create some extra properties that will control movement : - // create a random direction in radians. This is a number between 0 and PI*2 which is the equivalent of 0 - 360 degrees - dude.direction = Math.random() * Math.PI * 2; - - // this number will be used to modify the direction of the dude over time - dude.turningSpeed = Math.random() - 0.8; - - // create a random speed for the dude between 0 - 2 - dude.speed = 2 + Math.random() * 2; - - // finally we push the dude into the aliens array so it it can be easily accessed later - this.aliens.push(dude); - - this.stage.addChild(dude); - - } - - // create a bounding box for the little dudes - var dudeBoundsPadding = 100; - this.dudeBounds = new PIXI.Rectangle(-dudeBoundsPadding, - -dudeBoundsPadding, - this.renderer.width + dudeBoundsPadding * 2, - this.renderer.height + dudeBoundsPadding * 2); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // iterate through the dudes and update their position - for (const dude of this.aliens) { - dude.direction += dude.turningSpeed * 0.01; - dude.position.x += Math.sin(dude.direction) * dude.speed; - dude.position.y += Math.cos(dude.direction) * dude.speed; - dude.rotation = -dude.direction - Math.PI / 2; - - // wrap the dudes by testing their bounds... - if (dude.position.x < this.dudeBounds.x) { - dude.position.x += this.dudeBounds.width; - } else if (dude.position.x > this.dudeBounds.x + this.dudeBounds.width) { - dude.position.x -= this.dudeBounds.width; - } - - if (dude.position.y < this.dudeBounds.y) { - dude.position.y += this.dudeBounds.height; - } else if (dude.position.y > this.dudeBounds.y + this.dudeBounds.height) { - dude.position.y -= this.dudeBounds.height; - } - - } - - // increment the ticker - this.tick += 0.1; - - requestAnimationFrame(this.animate); - - this.renderer.render(this.stage); - - } - - } - - export class TintingDude extends PIXI.Sprite { - - direction: number; - speed: number; - turningSpeed: number; - - constructor() { - super(PIXI.Texture.fromImage('../../_assets/eggHead.png')); - } - - } - -} - -namespace demos { - - export class TransparentBackground { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bunny: PIXI.Sprite; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600, { backgroundColor: 0x1099bb, transparent: true }); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - // create a new Sprite from an image path. - this.bunny = PIXI.Sprite.fromImage('../../_assets/bunny.png'); - - // center the sprite's anchor point - this.bunny.anchor.set(0.5); - - // move the sprite to the center of the screen - this.bunny.position.x = 200; - this.bunny.position.y = 150; - - this.stage.addChild(this.bunny); - - // start animating - this.animate(); - - } - - private animate = (): void => { - - // just for fun, let's rotate mr rabbit a little - this.bunny.rotation += 0.1; - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace filters { - - export class Blur { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private bg: PIXI.Sprite; - - private littleDudes: PIXI.Sprite; - private littleRobot: PIXI.Sprite; - - private blurFilter1: PIXI.filters.BlurFilter; - private blurFilter2: PIXI.filters.BlurFilter; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - - this.bg = PIXI.Sprite.fromImage('../../_assets/depth_blur_BG.jpg'); - this.bg.width = this.renderer.width; - this.bg.height = this.renderer.height; - this.stage.addChild(this.bg); - - this.littleDudes = PIXI.Sprite.fromImage('../../_assets/depth_blur_dudes.jpg'); - this.littleDudes.position.x = (this.renderer.width / 2) - 315; - this.littleDudes.position.y = 200; - this.stage.addChild(this.littleDudes); - - this.littleRobot = PIXI.Sprite.fromImage('../../_assets/depth_blur_moby.jpg'); - this.littleRobot.position.x = (this.renderer.width / 2) - 200; - this.littleRobot.position.y = 100; - this.stage.addChild(this.littleRobot); - - this.blurFilter1 = new PIXI.filters.BlurFilter(); - this.blurFilter2 = new PIXI.filters.BlurFilter(); - - this.littleDudes.filters = [this.blurFilter1]; - this.littleRobot.filters = [this.blurFilter2]; - - this.count = 0; - - // nimate - this.animate(); - - } - - private animate = (): void => { - - this.count += 0.005; - - var blurAmount = Math.cos(this.count); - var blurAmount2 = Math.sin(this.count); - - this.blurFilter1.blur = 20 * (blurAmount); - this.blurFilter2.blur = 20 * (blurAmount2); - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} - -namespace filters { - - export class DisplacementMap { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private container: PIXI.Container; - - private padding: number; - - private bounds: PIXI.Rectangle; - - private maggots: DisplacementMapDude[]; - - private displacementSprite: PIXI.Sprite; - - private displacementFilter: PIXI.filters.DisplacementFilter; - - private ring: PIXI.Sprite; - - private bg: PIXI.Sprite; - - private count: number; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - this.container = new PIXI.Container(); - this.stage.addChild(this.container); - - this.padding = 100; - - this.bounds = new PIXI.Rectangle(-this.padding, -this.padding, this.renderer.width + this.padding * 2, this.renderer.height + this.padding * 2); - this.maggots = []; - - for (var i = 0; i < 20; i++) { - - var maggot = new DisplacementMapDude(); - maggot.anchor.set(0.5); - this.container.addChild(maggot); - - maggot.direction = Math.random() * Math.PI * 2; - maggot.speed = 1; - maggot.turnSpeed = Math.random() - 0.8; - - maggot.position.x = Math.random() * this.bounds.width; - maggot.position.y = Math.random() * this.bounds.height; - - maggot.scale.set(1 + Math.random() * 0.3); - maggot.original = maggot.scale.clone(); - this.maggots.push(maggot); - - } - - this.displacementSprite = PIXI.Sprite.fromImage('../../_assets/displace.png'); - this.displacementFilter = new PIXI.filters.DisplacementFilter(this.displacementSprite); - - this.stage.addChild(this.displacementSprite); - - this.container.filters = [this.displacementFilter]; - - this.displacementFilter.scale.x = 110; - this.displacementFilter.scale.y = 110; - - this.ring = PIXI.Sprite.fromImage('../../_assets/ring.png'); - - this.ring.anchor.set(0.5); - - this.ring.visible = false; - - this.stage.addChild(this.ring); - - this.bg = PIXI.Sprite.fromImage('../../_assets/bkg-grass.jpg'); - this.bg.width = this.renderer.width; - this.bg.height = this.renderer.height; - - this.bg.alpha = 0.4; - - this.container.addChild(this.bg); - - this.stage - .on('mousemove', this.onPointerMove) - .on('touchmove', this.onPointerMove); - - this.count = 0; - - this.animate(); - - } - - private onPointerMove = (eventData: PIXI.interaction.InteractionEvent): void => { - - this.ring.visible = true; - - this.displacementSprite.x = eventData.data.global.x - 100; - this.displacementSprite.y = eventData.data.global.y - this.displacementSprite.height / 2; - - this.ring.position.x = eventData.data.global.x - 25; - this.ring.position.y = eventData.data.global.y; - - } - - private animate = (): void => { - - this.count += 0.05; - - for (const maggot of this.maggots) { - maggot.direction += maggot.turnSpeed * 0.01; - maggot.position.x += Math.sin(maggot.direction) * maggot.speed; - maggot.position.y += Math.cos(maggot.direction) * maggot.speed; - - maggot.rotation = -maggot.direction - Math.PI / 2; - - maggot.scale.x = maggot.original.x + Math.sin(this.count) * 0.2; - - // wrap the maggots around as the crawl - if (maggot.position.x < this.bounds.x) { - maggot.position.x += this.bounds.width; - } else if (maggot.position.x > this.bounds.x + this.bounds.width) { - maggot.position.x -= this.bounds.width; - } - - if (maggot.position.y < this.bounds.y) { - maggot.position.y += this.bounds.height; - } else if (maggot.position.y > this.bounds.y + this.bounds.height) { - maggot.position.y -= this.bounds.height; - } - } - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - - export class DisplacementMapDude extends PIXI.Sprite { - - direction: number; - speed: number; - turnSpeed: number; - original: PIXI.Point; - - constructor() { - - super(PIXI.Texture.fromImage('../../_assets/maggot.png')); - - } - - } - -} - -namespace filters { - - export class Filter { - - private renderer: PIXI.CanvasRenderer | PIXI.WebGLRenderer; - - private stage: PIXI.Container; - - private background: PIXI.Sprite; - - private filter: PIXI.filters.ColorMatrixFilter; - - private container: PIXI.Container; - - private bgFront: PIXI.Sprite; - private light2: PIXI.Sprite; - private light1: PIXI.Sprite; - private panda: PIXI.Sprite; - - private count: number; - private switchy: boolean; - - private help: PIXI.Text; - - constructor() { - - this.renderer = PIXI.autoDetectRenderer(800, 600); - document.body.appendChild(this.renderer.view); - - // create the root of the scene graph - this.stage = new PIXI.Container(); - this.stage.interactive = true; - - // create a texture from an image path - var texture: PIXI.Texture = PIXI.Texture.fromImage("../../_assets/basics/bunny.png"); - - this.background = PIXI.Sprite.fromImage('_assets/BGrotate.jpg'); - this.background.anchor.set(0.5); - - this.background.position.x = this.renderer.width / 2; - this.background.position.y = this.renderer.height / 2; - - this.filter = new PIXI.filters.ColorMatrixFilter(); - - this.container = new PIXI.Container(); - this.container.position.x = this.renderer.width / 2; - this.container.position.y = this.renderer.height / 2; - - this.bgFront = PIXI.Sprite.fromImage('../../_assets/SceneRotate.jpg'); - this.bgFront.anchor.set(0.5); - - this.container.addChild(this.bgFront); - - this.light2 = PIXI.Sprite.fromImage('../../_assets/LightRotate2.png'); - this.light2.anchor.set(0.5); - this.container.addChild(this.light2); - - this.light1 = PIXI.Sprite.fromImage('../../_assets/LightRotate1.png'); - this.light1.anchor.set(0.5); - this.container.addChild(this.light1); - - this.panda = PIXI.Sprite.fromImage('../../_assets/panda.png'); - this.panda.anchor.set(0.5); - - this.container.addChild(this.panda); - - this.stage.addChild(this.container); - - this.stage.filters = [this.filter]; - - this.count = 0; - this.switchy = false; - - this.stage.on('click', this.onClick); - this.stage.on('tap', this.onClick); - - - this.help = new PIXI.Text('Click to turn filters on / off.', { font: 'bold 12pt Arial', fill: 'white' }); - this.help.position.y = this.renderer.height - 25; - this.help.position.x = 10; - - this.stage.addChild(this.help); - - // animate - this.animate(); - - } - - private onClick = (): void => { - - this.switchy = !this.switchy; - - if (!this.switchy) { - this.stage.filters = [this.filter]; - } else { - this.stage.filters = null; - } - - } - - private animate = (): void => { - - this.background.rotation += 0.01; - this.bgFront.rotation -= 0.01; - - this.light1.rotation += 0.02; - this.light2.rotation += 0.01; - - this.panda.scale.x = 1 + Math.sin(this.count) * 0.04; - this.panda.scale.y = 1 + Math.cos(this.count) * 0.04; - - this.count += 0.1; - - var matrix = this.filter.matrix; - - matrix[1] = Math.sin(this.count) * 3; - matrix[2] = Math.cos(this.count); - matrix[3] = Math.cos(this.count) * 1.5; - matrix[4] = Math.sin(this.count / 3) * 2; - matrix[5] = Math.sin(this.count / 2); - matrix[6] = Math.sin(this.count / 4); - - this.renderer.render(this.stage); - - requestAnimationFrame(this.animate); - - } - - } - -} diff --git a/pixi.js/v3/tslint.json b/pixi.js/v3/tslint.json deleted file mode 100644 index dca585dadc..0000000000 --- a/pixi.js/v3/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false, - "no-empty-interface": false, - "unified-signatures": false - } -} diff --git a/poly2tri/index.d.ts b/poly2tri/index.d.ts deleted file mode 100644 index ed8d9e838f..0000000000 --- a/poly2tri/index.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -// Type definitions for poly2tri v0.9.10 -// Project: http://github.com/r3mi/poly2tri.js/ -// Definitions by: Elemar Junior -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace poly2tri { - - interface IPointLike { - x: number; - y: number; - } - - class Point implements IPointLike { - - x: number; - y: number; - - constructor(x: number, y: number); - - toString(): string; - - toJSON(): JSON; - - clone(): Point; - - set_zero(): Point; - - set(x: number, y: number): Point; - - negate(): Point; - - add(n: IPointLike): Point; - - sub(n: IPointLike): Point; - - mul(s: number): Point; - - length(): number; - - normalize(): number; - - equals(p: IPointLike): boolean; - - static negate(p: IPointLike): Point; - - static add(a: IPointLike, b: IPointLike): Point; - - static sub(a: IPointLike, b: IPointLike): Point; - - static mul(s: number, p: IPointLike): Point; - - static cross(a: number, b: number): number; - - static cross(a: IPointLike, b: number): number; - - static cross(a: IPointLike, b: IPointLike): number; - - static cross(a: number, b: IPointLike): number; - - static toStringBase(p: IPointLike): string; - - static toString(p: IPointLike): string; - - static compare(a: IPointLike, b: IPointLike): number; - - static equals(a: IPointLike, b: IPointLike): boolean; - - static dot(a: IPointLike, b: IPointLike): number; - } - - - class SweepContext { - constructor(contour: Array); - - constructor(contour: Array, options: JSON); - - addHole(polyline: Array): SweepContext; - - addHoles(holes: Array>): SweepContext; - - addPoint(point: IPointLike): SweepContext; - - addPoints(point: Array): SweepContext; - - triangulate(): SweepContext; - - getBoundingBox(): { min: IPointLike; max: IPointLike; }; - - getTriangles(): Array; - } - - class Triangle { - constructor(a: IPointLike, b: IPointLike, c: IPointLike); - - toString(): string; - - getPoint(index: number): IPointLike; - - getPoints(): Array; - - containsPoint(point: IPointLike): boolean; - - containsPoints(p1: IPointLike, p2: IPointLike): boolean; - - isInterior(): boolean; - } -} - - - - - - diff --git a/poly2tri/poly2tri-tests.ts b/poly2tri/poly2tri-tests.ts deleted file mode 100644 index 578596c8d1..0000000000 --- a/poly2tri/poly2tri-tests.ts +++ /dev/null @@ -1,92 +0,0 @@ - - -function initializeCDT(): poly2tri.SweepContext { - var contour = [ - new poly2tri.Point(100, 100), - new poly2tri.Point(100, 300), - new poly2tri.Point(300, 300), - new poly2tri.Point(300, 100) - ]; - - var swctx = new poly2tri.SweepContext(contour); - return swctx; -} - -function addHole() { - var swctx = initializeCDT(); - var hole = [ - new poly2tri.Point(200, 200), - new poly2tri.Point(200, 250), - new poly2tri.Point(250, 250) - ]; - swctx.addHole(hole); -} - -function addHoles() { - var swctx = initializeCDT(); - var hole1 = [ - new poly2tri.Point(200, 200), - new poly2tri.Point(200, 250), - new poly2tri.Point(250, 250) - ]; - - var hole2 = [ - new poly2tri.Point(110, 110), - new poly2tri.Point(110, 120), - new poly2tri.Point(120, 120) - ]; - - swctx.addHoles([hole1, hole2]); -} - -function addPoint() { - var swctx = initializeCDT(); - var point = new poly2tri.Point(150, 150); - swctx.addPoint(point); -} - -function addPoints() { - var swctx = initializeCDT(); - var point1 = new poly2tri.Point(150, 150); - var point2 = new poly2tri.Point(155, 155); - swctx.addPoints([point1, point2]); - swctx.addPoints([{x: 110, y: 120}]); -} - -function triangulate() { - var swctx = initializeCDT(); - swctx.triangulate(); - var triangles = swctx.getTriangles(); - - triangles.forEach(t => { - t.getPoints().forEach(p => { - console.log(p.x, p.y); - }); - var p1 = t.getPoint(0); - var p2 = t.getPoint(1); - var p3 = t.getPoint(2); - }); -} - -function chaining() { - var swctx = initializeCDT(); - - var hole1 = [ - new poly2tri.Point(200, 200), - new poly2tri.Point(200, 250), - new poly2tri.Point(250, 250) - ]; - - var hole2 = [ - new poly2tri.Point(110, 110), - new poly2tri.Point(110, 120), - new poly2tri.Point(120, 120) - ]; - - var holes = [hole1, hole2]; - var point1 = new poly2tri.Point(150, 150); - var point2 = new poly2tri.Point(155, 155); - var points = [point1, point2, { x: 153, y: 153 }]; - - var triangles = swctx.addHoles(holes).addPoints(points).triangulate().getTriangles(); -} diff --git a/poly2tri/tsconfig.json b/poly2tri/tsconfig.json deleted file mode 100644 index 1fb436fbcb..0000000000 --- a/poly2tri/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", - "poly2tri-tests.ts" - ] -} \ No newline at end of file diff --git a/prismjs/index.d.ts b/prismjs/index.d.ts deleted file mode 100644 index c3bbffae02..0000000000 --- a/prismjs/index.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -// Type definitions for prism v1.4.4 -// Project: http://prismjs.com/ -// Definitions by: Erik Lieben -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace PrismJS { - - /** - * The Prism object - */ - interface Prism { - - util: Util; - languages: Languages; - plugins: any; - - /** - * This is the most high-level function in Prism’s API. It fetches all the elements that have a .language-xxxx class and then calls Prism.highlightElement() on each one of them. - * - * @param {boolean} async - Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting very large chunks of code. False by default. - * @param {(element:Element)=>void} callback? - An optional callback to be invoked after the highlighting is done. Mostly useful when async is true, since in that case, the highlighting is done asynchronously. - * @returns void - */ - highlightAll(async: boolean, callback?: (element: Element) => void): void; - - /** - * Highlights the code inside a single element. - * - * @param {Element} element - The element containing the code. It must have a class of language-xxxx to be processed, where xxxx is a valid language identifier. - * @param {boolean} async - Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting very large chunks of code. False by default. - * @param {(element:Element)=>void} callback? - An optional callback to be invoked after the highlighting is done. Mostly useful when async is true, since in that case, the highlighting is done asynchronously. - * @returns void - */ - highlightElement(element: Element, async: boolean, callback?: (element: Element) => void): void; - - - /** - * Low-level function, only use if you know what you’re doing. It accepts a string of text as input and the language definitions to use, and returns a string with the HTML produced. - * - * @param {string} text - A string with the code to be highlighted. - * @param {LanguageDefinition} grammer - An object containing the tokens to use. Usually a language definition like Prism.languages.markup - * @param {LanguageDefinition} language - * @returns string - The highlighted HTML - */ - highlight(text: string, grammer: LanguageDefinition, language?: LanguageDefinition): string; - - /** - * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input and the language definitions to use, - * and returns an array with the tokenized code. When the language definition includes nested tokens, the function is called recursively on each of - * these tokens. This method could be useful in other contexts as well, as a very crude parser. - * - * @param {string} text - A string with the code to be highlighted. - * @param {LanguageDefinition} grammar - An object containing the tokens to use. Usually a language definition like Prism.languages.markup - * @param {LanguageDefinition} language - * @returns Array - An array of strings, tokens (class Prism.Token) and other arrays. - */ - tokenize(text: string, grammar: LanguageDefinition, language?: LanguageDefinition): Array; - - fileHighlight(): void; - - hooks: Hooks; - } - - interface Environment { - element?: Element; - language?: LanguageDefinition; - grammer?: any; - code?: any; - highlightedCode?: any; - type?: string; - content?:string; - tag?: string; - classes?: Array; - attributes?: Array | Object; - parent?: Element; - } - - interface Identifier { - value: number; - } - - interface Util { - encode(tokens:Token | Array | string): Token | Array | string; - type(o: Object): string; - objId(obj: Object): Identifier; - clone(o: LanguageDefinition): LanguageDefinition; - } - - interface LanguageDefinition { - keyword?: RegExp | LanguageDefinition; - number?: RegExp | LanguageDefinition; - function?: RegExp | LanguageDefinition; - string?: RegExp | LanguageDefinition; - boolean?: RegExp | LanguageDefinition; - operator?: RegExp | LanguageDefinition; - punctuation?: RegExp | LanguageDefinition; - atrule?: RegExp | LanguageDefinition; - url?: RegExp | LanguageDefinition; - selector?: RegExp | LanguageDefinition; - property?: RegExp | LanguageDefinition; - important?: RegExp | LanguageDefinition; - style?: RegExp | LanguageDefinition; - - /** - * This option can be used to define one or more aliases for the matched token. The result will be, that the styles - * of the token and its aliases are combined. This can be useful, to combine the styling of a well known token, - * which is already supported by most of the themes, with a semantically correct token name. The option can be - * set to a string literal or an array of string literals. In the following example the token name latex-equation - * is not supported by any theme, but it will be highlighted the same as a string. - */ - alias?: string; - - pattern?: RegExp; - - /** - * This option mitigates JavaScript’s lack of lookbehind. When set to true, the first capturing group in the regex - * pattern is discarded when matching this token, so it effectively behaves as if it was lookbehind - */ - lookbehind?: boolean; - - /** - * This property accepts another object literal, with tokens that are allowed to be nested in this token. - * This makes it easier to define certain languages. However, keep in mind that they’re slower and if coded poorly, - * can even result in infinite recursion. For an example of nested tokens, check out the Markup language definition - */ - inside?: LanguageDefinition; - - /** - * Accepts an object literal with tokens and appends them to the end of the current object literal. - */ - rest?: Array; - } - - interface Languages extends Array { - - extend(id: string, redef: LanguageDefinition): LanguageDefinition; - - /** - * Insert a token before another token in a language literal - * As this needs to recreate the object (we cannot actually insert before keys in object literals), - * we cannot just provide an object, we need anobject and a key. - * @param inside The key (or language id) of the parent - * @param before The key to insert before. If not provided, the function appends instead. - * @param insert Object with the key/value pairs to insert - * @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted. - */ - insertBefore(inside: string, before: string, insert: LanguageDefinition, root: Object): any; - } - - interface Hooks { - all: Array void>>; - add(name: string, callback: (env: Environment) => void):void; - run(name: string, env: Environment): void; - } - - interface Token { - type: string; - content: Token | Array | string; - alias: string; - stringify(o:string| Array, language: LanguageDefinition, parent: HTMLPreElement): string; - } -} - -declare var Prism : PrismJS.Prism; \ No newline at end of file diff --git a/prismjs/prismjs-tests.ts b/prismjs/prismjs-tests.ts deleted file mode 100644 index 6d87b9b217..0000000000 --- a/prismjs/prismjs-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ - - -var element = document.createElement("code"); -var callback = (element: Element) => console.log(element); - -Prism.highlightElement(element, false, callback); -Prism.highlightElement(element, false); -Prism.highlightAll(true, callback); -Prism.highlightAll(true); - diff --git a/promises-a-plus/index.d.ts b/promises-a-plus/index.d.ts deleted file mode 100644 index 806020d051..0000000000 --- a/promises-a-plus/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for promises-a-plus -// Project: http://promisesaplus.com/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace PromisesAPlus { - interface PromiseCtor { - (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable; - } - - interface PromiseImpl { - new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable; - } - - interface Thenable { - then(onFulfill?: (value: T) => Thenable|R, onReject?: (error: any) => Thenable|R): Thenable; - } -} diff --git a/promises-a-plus/promises-a-plus-tests.ts b/promises-a-plus/promises-a-plus-tests.ts deleted file mode 100644 index 222cca14d8..0000000000 --- a/promises-a-plus/promises-a-plus-tests.ts +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// -/// - -var thenNum: PromisesAPlus.Thenable; -var thenStr: PromisesAPlus.Thenable; -var thenBool: PromisesAPlus.Thenable; - -var impl: PromisesAPlus.PromiseImpl; - -declare class PromiseImpl { - constructor(resolver: (resolvePromise: (value: R) => void, rejectPromise: (reason: any) => void) => void); - - then(onFulfill: (value: R) => PromiseImpl, onReject: (error: any) => PromiseImpl): PromiseImpl; - then(onFulfill: (value: R) => PromiseImpl, onReject?: (error: any) => U): PromiseImpl; - then(onFulfill: (value: R) => U, onReject: (error: any) => PromiseImpl): PromiseImpl; - then(onFulfill?: (value: R) => U, onReject?: (error: any) => U): PromiseImpl; -} - -function testCompatibleWithPromiseImpl() { - var pNum: PromiseImpl = thenNum; - - thenNum = pNum; - - impl = PromiseImpl; -} - -function testCompatibleWithRxJS() { - // from spec to Rx - var rxThenNum: Rx.IPromise = thenNum; - var rxThenStr: Rx.IPromise = thenStr; - - // from Rx to spec - thenNum = rxThenNum; - thenStr = rxThenStr; - - var obsNum: Rx.Observable; - - // implementation usage - thenNum = obsNum.toPromise>(impl); - thenNum = obsNum.toPromise(impl); - obsNum.toPromise(PromiseImpl); -} - -function testCompatibleWithES6Promises() { - // define ES6 thenables - var es6ThenNum: PromiseLike; - var es6ThenStr: PromiseLike; - - // from ES6 to spec - thenNum = es6ThenNum; - thenStr = es6ThenStr; - - // implementation - impl = Promise; -} - -function testCompatibleWithQ() { - // from spec to ES6 - var qThenNum: Q.IPromise = thenNum; - var qThenStr: Q.IPromise = thenStr; - - // from ES6 to spec - thenNum = qThenNum; - thenStr = qThenStr; - - // there's no standart implementation with constructor behaviour -} - -function testCompatibleWithWhen() { - var whenPromiseNum: When.Promise; - var whenPromiseStr: When.Promise; - - // from ES6 to spec - thenNum = whenPromiseNum; - thenStr = whenPromiseStr; - - // there's no standart implementation with constructor behaviour -} diff --git a/promises-a-plus/tsconfig.json b/promises-a-plus/tsconfig.json deleted file mode 100644 index d5ccf86f75..0000000000 --- a/promises-a-plus/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", - "promises-a-plus-tests.ts" - ] -} \ No newline at end of file diff --git a/q-io/index.d.ts b/q-io/index.d.ts deleted file mode 100644 index b69a9c72e0..0000000000 --- a/q-io/index.d.ts +++ /dev/null @@ -1,257 +0,0 @@ -// Type definitions for Q-io -// Project: https://github.com/kriskowal/q-io -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -//TODO add support for q-io/http-apps -//TODO add verified support for q-io/fs-mock -//TODO fix Readers/Writers properly -//TODO find solution for overloaded return types (QioFS.open/QioFS.read) -// for some ideas see https://typescript.codeplex.com/discussions/461587#post1105930 - -declare namespace QioFS { - - //TODO how to define the multiple return types? use any for now? - export function open(path:string, options?:any):Q.Promise; - //export function open(path:string, options?:any):Q.Promise; - //export function open(path:string, options?:any):Q.Promise; - //export function open(path:string, options?:any):Q.Promise; - - //TODO how to define the multiple return types? use any for now? - export function read(path:string, options?:any):Q.Promise; - //export function read(path:string, options?:any):Q.Promise; - //export function read(path:string, options?:any):Q.Promise; - - export function write(path:string, content:Buffer, options?:any):Q.Promise; - export function write(path:string, content:string, options?:any):Q.Promise; - - export function append(path:string, content:Buffer, options?:any):Q.Promise; - export function append(path:string, content:string, options?:any):Q.Promise; - - export function copy(source:string, target:string):Q.Promise; - export function copyTree(source:string, target:string):Q.Promise; - - export function list(path:string):Q.Promise; - export function listTree(path:string, guard?:(path:string, stat:any) => boolean):Q.Promise; - export function listDirectoryTree(path:string):Q.Promise; - - export function makeDirectory(path:string, mode?:string):Q.Promise; - export function makeDirectory(path:string, mode?:number):Q.Promise; - export function makeTree(path:string, mode?:string):Q.Promise; - export function makeTree(path:string, mode?:number):Q.Promise; - - export function remove(path:string):Q.Promise; - export function removeTree(path:string):Q.Promise; - - export function rename(source:string, target:string):Q.Promise; - export function move(source:string, target:string):Q.Promise; - - export function link(source:string, target:any):Q.Promise; - - export function symbolicCopy(source:string, target:string, type:string):Q.Promise; - export function symbolicLink(target:string, link:string, type:string):Q.Promise; - - export function chown(path:string, uid:number, gid:number):Q.Promise; - export function chmod(path:string, mode?:string):Q.Promise; - export function chmod(path:string, mode?:number):Q.Promise; - - export function stat(path:string):Q.Promise; - export function statLink(path:string):Q.Promise; - export function statFd(fd:number):Q.Promise; - - export function exists(path:string):Q.Promise; - - export function isFile(path:string):Q.Promise; - export function isDirectory(path:string):Q.Promise; - export function isSymbolicLink(path:string):Q.Promise; - - export function lastModified(path:string):Q.Promise; - export function lastAccessed(path:string):Q.Promise; - - export function split(path:string):string[]; - export function join(...paths:string[]):string; - export function join(paths:string[]):string; - export function resolve(...path:string[]):string; - export function resolve(paths:string[]):string; - export function normal(...path:string[]):string; - export function normal(paths:string[]):string; - export function absolute(path:string):string; - - export function canonical(path:string):Q.Promise; - export function readLink(path:string):Q.Promise; - - export function contains(parent:string, child:string):boolean; - - export function relative(source:string, target:string):Q.Promise; - - export function relativeFromFile(source:string, target:string):string; - export function relativeFromDirectory(source:string, target:string):string; - - export function isAbsolute(path:string):boolean; - export function isRelative(path:string):boolean; - export function isRoot(path:string):boolean; - - export function root(path:string):string; - export function directory(path:string):string; - export function base(path:string, extension:string):string; - export function extension(path:string):string; - - //this should return a q-io/fs-mock MockFS - export function reroot(path:string):typeof QioFS; - - export function toObject(path:string):{[path:string]:Buffer}; - - //listed but not implemented by Q-io - //export function glob(pattern):Q.Promise; - //export function match(pattern, path:string):Q.Promise; - - //TODO link this to node.js FS module (no lazy clones) - interface Stats { - node:NodeStats; - size:number; - } - interface NodeStats { - isFile():boolean; - isDirectory():boolean; - isBlockDevice():boolean; - isCharacterDevice():boolean; - isSymbolicLink():boolean; - isFIFO():boolean; - isSocket():boolean; - node:NodeStats; - dev:number; - ino:number; - mode:number; - nlink:number; - uid:number; - gid:number; - rdev:number; - size:number; - blksize:number; - blocks:number; - atime:Date; - mtime:Date; - ctime:Date; - } -} - -declare namespace QioHTTP { - export function request(request:Request):Q.Promise; - export function request(url:string):Q.Promise; - - export function read(request:Request):Q.Promise; - export function read(url:string):Q.Promise; - - export function normalizeRequest(request:Request):Request; - export function normalizeRequest(url:string):Request; - export function normalizeResponse(response:Response):Response; - - interface Request { - url:string; - path:string; - scriptName:string; - pathInfo:string; - version:string[]; - method:string; - scheme:string; - - host:string; - port:number; - remoteHost:string; - remotePort:number; - - headers:Headers; - agent:any; - body:any; - node:any; - } - interface Response { - status:number; - headers:Headers; - body:Qio.Reader - onclose:() => void; - node:any; - } - interface Headers { - [name:string]:any; - // [name:string]:any[]; - } - interface Body extends Qio.Stream { - - } - interface Application { - (req:Request):Q.Promise; - } -} - -declare namespace Qio { - interface ForEachCallback { - (chunk:Buffer):Q.Promise; - (chunk:string):Q.Promise; - } - interface ForEach { - forEach(callback:ForEachCallback):Q.Promise; - } - - interface Reader extends ForEach { - read(charset:string):Q.Promise; - read():Q.Promise; - close():void; - node: NodeJS.ReadableStream; - } - interface Writer { - write(content:string):void; - write(content:Buffer):void; - flush():Q.Promise; - close():void; - destroy():void; - node: NodeJS.WritableStream; - } - - interface Stream { - read(charset:string):Q.Promise; - read():Q.Promise; - write(content:string):void; - write(content:Buffer):void; - flush():Q.Promise; - close():void; - destroy():void; - node:any; - } - - interface BufferReader extends QioBufferReader { - - } -} -interface QioBufferReader { - new ():Qio.Reader; - read(stream:Qio.Reader, charset:string):string; - read(stream:Qio.Reader):Buffer; - join(buffers:Buffer[]):Buffer; -} -interface QioBufferWriter { - (writer:Buffer):Qio.Writer; - Writer:Qio.Writer; -} -interface QioBufferStream { - (buffer:Buffer, encoding:string):Qio.Stream -} - -declare module "q-io/http" { -export = QioHTTP; -} -declare module "q-io/fs" { -export = QioFS; -} -declare module "q-io/reader" { -export = QioBufferReader; -} -declare module "q-io/writer" { -export = QioBufferWriter; -} -declare module "q-io/buffer-stream" { -export = QioBufferStream; -} diff --git a/qajax/index.d.ts b/qajax/index.d.ts deleted file mode 100644 index 3476cb280e..0000000000 --- a/qajax/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Type definitions for Qajax -// Project: https://github.com/gre/qajax -// Definitions by: Boltmade -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as Q from "q"; - -export = Qajax; -export as namespace Qajax; - -declare function Qajax(url : string) : Q.Promise; -declare function Qajax(options : any) : Q.Promise; -declare function Qajax(url : string, options : any) : Q.Promise; - -declare namespace Qajax { - export var defaults : any; - export function filterStatus(validStatus : number) : (xhr : XMLHttpRequest) => Q.Promise; - export function filterStatus(validStatus : (status : number) => boolean) : (xhr : XMLHttpRequest) => Q.Promise; - export function filterSuccess() : Q.Promise; - - export function toJSON(xhr : XMLHttpRequest) : Q.Promise; - - export function getJSON(url : string) : Q.Promise; - - export function serialize(paramsObj : any) : string; -} \ No newline at end of file diff --git a/qajax/qajax-tests.ts b/qajax/qajax-tests.ts deleted file mode 100644 index 6770270cf4..0000000000 --- a/qajax/qajax-tests.ts +++ /dev/null @@ -1,69 +0,0 @@ -import Qajax = require("qajax"); -import * as Q from 'q'; - -// Based on https://github.com/gre/qajax/blob/master/test/qajax.js - -function resetDefaults () { - Qajax.defaults.logs = true; - Qajax.defaults.timeout = 1000; - Qajax.defaults.method = "GET"; - Qajax.defaults.headers = {}; - Qajax.defaults.base = ""; -} - -var sample01url = "/test/dataset/sample01.json"; -var sample01json = [ - { "name": "Jerome", "age": 20 }, - { "name": "Gerard", "age": 30 }, - { "name": "Martine", "age": 43 } -]; - -var emptyUrl = "/test/dataset/empty"; - -function urlWithOptions (url : string, options : any) { - return url+"?"+Qajax.serialize(options); -} - -Qajax; -Qajax.filterStatus; -Qajax.filterSuccess; -Qajax.getJSON; -Qajax.serialize({ foo: 123, bar: "toto" }); -Qajax.getJSON(sample01url).then((res) => true, (err) => true); -Qajax(sample01url).then(Qajax.filterSuccess).then(Qajax.toJSON); -Qajax(emptyUrl, { params: { status: 404 } }).then(Qajax.filterSuccess).then(Qajax.toJSON); -Qajax({method: "POST", url: "/ECHO", data: "1234567890\nazerty\nuiopqsdfghjklm\nwxcvbn\n"}).then(Qajax.filterSuccess); -Qajax({method: "POST", url: "/ECHO", data: { foo: 123, bar: { value: 42 }, arr: [1, 2, 3] }}).then(Qajax.filterSuccess).then(Qajax.toJSON); -Qajax({ url: emptyUrl, params: { status: 201 } }).then(Qajax.filterStatus(200)); -Qajax({method: "POST", url: emptyUrl, params: { status: 500 }}).then(Qajax.filterSuccess).then(Qajax.toJSON); - -var cancellationD = Q.defer(); -var cancellation = cancellationD.promise; -Qajax({ cancellation: cancellation, url: urlWithOptions(emptyUrl, { latency: 400 }) }).then(Qajax.filterSuccess).then(Qajax.toJSON); - -Qajax.defaults.timeout = 200; -Qajax({method: "DELETE", url: sample01url, params: { latency: 500 }}); - -resetDefaults(); -Qajax({method: "POST", url: sample01url, params: { latency: 300 }, timeout: 2000}); - -Qajax.defaults.timeout = 200; -Qajax({method: "DELETE", url: sample01url, params: { latency: 500 }, timeout: 0}); - -resetDefaults(); -Qajax({headers: { "X-Hello": "world" }, method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON); -Qajax({headers: { "X-Hi": "world" }, method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON); -Qajax.defaults.headers = {"X-Foo": "bar"}; -Qajax({method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON); - -resetDefaults(); -Qajax("sample01.json", {base: "/test/dataset/"}).then(Qajax.filterSuccess).then(Qajax.toJSON); -Qajax.defaults.base = "/test/dataset/"; -Qajax("empty").then(Qajax.filterSuccess); - -resetDefaults(); -Qajax.defaults.method = "POST"; -Qajax("/ECHO", { data: "1234567890\nazerty\nuiopqsdfghjklm\nwxcvbn\n", responseType: "text/plain" }).then(Qajax.filterSuccess); - -resetDefaults(); -Qajax.getJSON(urlWithOptions(sample01url, { latency: 50 })).then((res) => true, (err) => true, () => true); diff --git a/qs/qs-tests.ts b/qs/qs-tests.ts deleted file mode 100644 index bcff0a0762..0000000000 --- a/qs/qs-tests.ts +++ /dev/null @@ -1,251 +0,0 @@ -import qs = require('qs'); -import * as assert from "power-assert"; - -qs.stringify({ a: 'b' }); -qs.stringify({ a: 'b', c: 'd' }, { delimiter: '&' }); - -qs.parse('a=b'); -qs.parse('a=b&c=d', { delimiter: '&' }); - -() => { - var obj = qs.parse('a=c'); - assert.deepEqual(obj, { a: 'c' }); - - var str = qs.stringify(obj); - assert.equal(str, 'a=c'); -} - -() => { - var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); - assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } }); -} - -() => { - var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); - assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); -} - -() => { - assert.deepEqual(qs.parse('a%5Bb%5D=c'), { - a: { b: 'c' } - }); -} - -() => { - assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { - foo: { - bar: { - baz: 'foobarbaz' - } - } - }); -} - -() => { - var expected = { - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } - } - } - } - } - } - }; - var string = 'a[b][c][d][e][f][g][h][i]=j'; - assert.deepEqual(qs.parse(string), expected); -} - -() => { - var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); - assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); -} - -() => { - var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); - assert.deepEqual(limited, { a: 'b' }); -} - -() => { - var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); - assert.deepEqual(delimited, { a: 'b', c: 'd' }); -} - -() => { - var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); - assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); -} - -() => { - var withDots = qs.parse('a.b=c', { allowDots: true }); - assert.deepEqual(withDots, { a: { b: 'c' } }); -} - -() => { - var withArray = qs.parse('a[]=b&a[]=c'); - assert.deepEqual(withArray, { a: ['b', 'c'] }); -} - -() => { - var withIndexes = qs.parse('a[1]=c&a[0]=b'); - assert.deepEqual(withIndexes, { a: ['b', 'c'] }); -} - -() => { - var noSparse = qs.parse('a[1]=b&a[15]=c'); - assert.deepEqual(noSparse, { a: ['b', 'c'] }); -} - -() => { - var withEmptyString = qs.parse('a[]=&a[]=b'); - assert.deepEqual(withEmptyString, { a: ['', 'b'] }); - - var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); - assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); -} - -() => { - var withMaxIndex = qs.parse('a[100]=b'); - assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); -} - -() => { - var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); - assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); -} - -() => { - var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); - assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); -} - -() => { - var mixedNotation = qs.parse('a[0]=b&a[b]=c'); - assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); -} - -() => { - var arraysOfObjects = qs.parse('a[][b]=c'); - assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); -} - -() => { - assert.equal(qs.stringify({ a: 'b' }), 'a=b'); - assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); -} - -() => { - var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); - assert.equal(unencoded, 'a[b]=c'); -} - -() => { - var encoded = qs.stringify({ a: { b: 'c' } }, { - encoder: function (str) { - // Passed in values `a`, `b`, `c` - return // Return encoded string - } - }) -} - -() => { - var decoded = qs.parse('x=z', { - decoder: function (str) { - // Passed in values `x`, `z` - return // Return decoded string - } - }) -} - -() => { - qs.stringify({ a: ['b', 'c', 'd'] }); - // 'a[0]=b&a[1]=c&a[2]=d' -} - -() => { - qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); - // 'a=b&a=c&a=d' -} - -() => { - qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) - // 'a[0]=b&a[1]=c' - qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) - // 'a[]=b&a[]=c' - qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) - // 'a=b&a=c' -} - -() => { - assert.equal(qs.stringify({ a: '' }), 'a='); -} - -() => { - assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); -} - -() => { - assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); -} - -() => { - qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: function (prefix, value) { - if (prefix == 'b') { - // Return an `undefined` value to omit a property. - return; - } - if (prefix == 'e[f]') { - return value.getTime(); - } - if (prefix == 'e[g][0]') { - return value * 2; - } - return value; - } }); - // 'a=b&c=d&e[f]=123&e[g][0]=4' - qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); - // 'a=b&e=f' - qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); -} - -() => { - var withNull = qs.stringify({ a: null, b: '' }); - assert.equal(withNull, 'a=&b='); -} - -() => { - var equalsInsensitive = qs.parse('a&b='); - assert.deepEqual(equalsInsensitive, { a: '', b: '' }); -} - -() => { - var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); - assert.equal(strictNull, 'a&b='); -} - -() => { - var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); - assert.deepEqual(parsedStrictNull, { a: null, b: '' }); -} - -() => { - var nullsSkipped = qs.stringify({ a: 'b', c: null }, { skipNulls: true }); - assert.equal(nullsSkipped, 'a=b'); -} - -() => { - var encoder = () => {}; - var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); - assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); -} - -() => { - var decoder = () => {}; - var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); - assert.deepEqual(obj, { a: 'こんにちは!' }); -} diff --git a/query-string/query-string-tests.ts b/query-string/query-string-tests.ts deleted file mode 100644 index c39c2f4982..0000000000 --- a/query-string/query-string-tests.ts +++ /dev/null @@ -1,34 +0,0 @@ - -import qs = require('query-string'); - - -namespace stringify_tests { - let result: string; - // test obj - result = qs.stringify({ - str: 'bar', - strArray: ['baz'], - num: 123, - numArray: [456], - bool: true, - boolArray: [false], - }); - - // test options - result = qs.stringify({ foo: 'bar' }, { strict: false }) - result = qs.stringify({ foo: 'bar' }, { encode: false }) - result = qs.stringify({ foo: 'bar' }, { strict: false, encode: false }) -} - -namespace parse_tests { - let result: { [key: string]: string | string[] }; - result = qs.parse('?foo=bar'); - result = qs.parse('#foo=bar'); - result = qs.parse('&foo=bar&foo=baz'); -} - -namespace extract_tests { - let result: string; - result = qs.extract('http://foo.bar/?abc=def&hij=klm'); - result = qs.extract('http://foo.bar/?foo=bar'); -} diff --git a/rappid/index.d.ts b/rappid/index.d.ts deleted file mode 100644 index 5cbf07b995..0000000000 --- a/rappid/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Type definitions for Rappid 1.5 -// Project: http://jointjs.com/about-rappid -// Definitions by: Ewout Van Gossum -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace joint { - namespace ui { - interface Handle { - name: string; - position: string; - icon: string; - } - - class SelectionView extends Backbone.Model { - paper: joint.dia.Paper; - graph: joint.dia.Graph; - model: Backbone.Collection; - - constructor(opt: { - paper: joint.dia.Paper; - graph: joint.dia.Graph; - model: Backbone.Collection - }); - - createSelectionBox(cellView: joint.dia.CellView): void; - destroySelectionBox(cellView: joint.dia.CellView): void; - startSelecting(evt: any): void; - cancelSelection(): void; - - addHandle(handle: Handle): void; - removeHandle(name: string): void; - changeHandle(name: string, handle: Handle): void; - } - } -} diff --git a/react-bootstrap-table/react-bootstrap-table-tests.tsx b/react-bootstrap-table/react-bootstrap-table-tests.tsx deleted file mode 100644 index 47682dd36a..0000000000 --- a/react-bootstrap-table/react-bootstrap-table-tests.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/// - -import * as React from 'react'; -import { render } from 'react-dom'; -import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; - -var products = [{ - id: 1, - name: "Item name 1", - price: 100 -}, { - id: 2, - name: "Item name 2", - price: 100 -}]; - -// It's a data format example. -function priceFormatter(cell: any, row: any) { - return ' ' + cell; -} - -render( - - Product ID - Product Name - Product Price - , - document.getElementById("app") -); diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts deleted file mode 100644 index 01c5492922..0000000000 --- a/react-day-picker/index.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -// Type definitions for react-day-picker v1.2.0 -// Project: https://github.com/gpbl/react-day-picker -// Definitions by: Giampaolo Bellavite , Jason Killian -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare module "react-day-picker" { - import DayPicker = ReactDayPicker.DayPicker; - export = DayPicker; -} - -declare var DayPicker: typeof ReactDayPicker.DayPicker; - -declare namespace ReactDayPicker { - interface LocaleUtils { - formatMonthTitle: (month: Date, locale: string) => string; - formatWeekdayShort: (weekday: number, locale: string) => string; - formatWeekdayLong: (weekday: number, locale: string) => string; - getFirstDayOfWeek: (locale: string) => number; - getMonths: (locale: string) => string[]; - } - - interface DayModifiers { - selected?: boolean; - disabled?: boolean; - [name: string]: boolean | undefined; - } - - interface Modifiers { - [name: string]: (date: Date) => boolean; - } - - interface CaptionElementProps extends React.Props { - date?: Date; - localeUtils?: LocaleUtils; - locale?: string; - onClick?: React.MouseEventHandler<{}>; - } - - interface NavbarElementProps extends React.Props { - className?: string; - previousMonth?: Date; - nextMonth?: Date; - showPreviousButton?: boolean; - showNextButton?: boolean; - onPreviousClick(): void; - onNextClick(): void; - dir?: string; - localeUtils?: LocaleUtils; - locale?: string; - - } - - interface WeekdayElementProps extends React.Props { - weekday?: number; - className?: string; - localeUtils?: LocaleUtils; - locale?: string; - } - - interface Props extends React.Props{ - modifiers?: Modifiers; - initialMonth?: Date; - numberOfMonths?: number; - renderDay?: (date: Date) => number | string | JSX.Element; - enableOutsideDays?: boolean; - firstDayOfWeek?:number; - canChangeMonth?: boolean; - disabledDays?: (date: Date) => boolean; - fixedWeeks?: boolean; - fromMonth?: Date; - reverseMonths?: boolean; - toMonth?: Date; - localeUtils?: LocaleUtils; - locale?: string; - captionElement?: React.ReactElement; - onDayClick?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayTouchTap?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayMouseEnter?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayMouseLeave?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayTouchEnd?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayTouchStart?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - navbarElement?: React.ReactElement; - weekdayElement?: React.ReactElement; - onMonthChange?: (month: Date) => any; - onCaptionClick?: (e: React.SyntheticEvent<{}>, month: Date) => any; - className?: string; - selectedDays?: (date: Date) => boolean; - style?: React.CSSProperties; - tabIndex?: number; - } - - class DayPicker extends React.Component { - showMonth(month: Date): void; - showPreviousMonth(): void; - showNextMonth(): void; - } - - namespace DayPicker { - var LocaleUtils: LocaleUtils; - namespace DateUtils { - function addMonths(d: Date, n: number): Date; - function clone(d: Date): Date; - function isSameDay(d1?: Date, d2?: Date): boolean; - function isPastDay(d: Date): boolean; - function isDayBetween(day: Date, startDate: Date, endDate: Date): boolean; - function addDayToRange(day: Date, range: { from?: Date, to?: Date }): { from?: Date, to?: Date }; - function isDayInRange(day: Date, range: { from?: Date, to?: Date }): boolean; - } - } -} diff --git a/react-day-picker/react-day-picker-tests.tsx b/react-day-picker/react-day-picker-tests.tsx deleted file mode 100644 index e8a17b5087..0000000000 --- a/react-day-picker/react-day-picker-tests.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from 'react'; -import * as DayPicker2 from "react-day-picker"; - -function isSunday(day: Date) { - return day.getDay() === 0; -} - -// make sure global variable version works -function MyComponent2() { - return -} -DayPicker.DateUtils.clone(new Date()); -DayPicker.DateUtils.isDayInRange(new Date(), {from: new Date()}); - -// make sure imported version works -function MyComponent() { - return -} -DayPicker2.DateUtils.clone(new Date()); -DayPicker2.DateUtils.isDayInRange(new Date(), { from: new Date() }); - -// test interface for captionElement prop -interface MyCaptionProps extends ReactDayPicker.CaptionElementProps { } -class Caption extends React.Component { - render() { - const { date, locale, localeUtils, onClick } = this.props; - - if (!date || !localeUtils || typeof locale === 'undefined') { - return null - } - - return ( -
- { localeUtils.formatMonthTitle(date, locale) } -
- ); - } -} -}/> diff --git a/react-dnd/UNUSED_FILES.txt b/react-dnd/UNUSED_FILES.txt deleted file mode 100644 index ff694923a2..0000000000 --- a/react-dnd/UNUSED_FILES.txt +++ /dev/null @@ -1 +0,0 @@ -react-dnd-test-backend.d.ts \ No newline at end of file diff --git a/react-dnd/react-dnd-test-backend.d.ts b/react-dnd/react-dnd-test-backend.d.ts deleted file mode 100644 index 095c890483..0000000000 --- a/react-dnd/react-dnd-test-backend.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for React DnD HTML 5 Backend v2.0.0 -// Project: https://github.com/gaearon/react-dnd -// Definitions by: Asana -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module "react-dnd-test-backend" { - class TestBackend { - setup(): void; - teardown(): void; - connectDragSource(): void; - connectDropTarget(): void; - simulateBeginDrag(sourceIds: __ReactDnd.Identifier[], options?: {}): void; - simulatePublishDragSource(): void; - simulateHover(targetIds: __ReactDnd.Identifier[], options?: {}): void; - simulateDrop(): void; - simulateEndDrag(): void; - } - - export { TestBackend as default }; -} diff --git a/react-native/index.d.ts b/react-native/index.d.ts deleted file mode 100644 index 950451e574..0000000000 --- a/react-native/index.d.ts +++ /dev/null @@ -1,8333 +0,0 @@ -// Type definitions for react-native 0.42 -// Project: https://github.com/facebook/react-native -// Definitions by: Needs A Maintainer -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// USING: these definitions are meant to be used with the TSC compiler target set to ES6 -// -// USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer -// -// CONTRIBUTING: please open pull requests -// -// CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -import * as React from 'react'; - -export = React; - -//react-native "extends" react -declare module "react" { - export type MeasureOnSuccessCallback = ( - x: number, - y: number, - width: number, - height: number, - pageX: number, - pageY: number - ) => void - - export type MeasureInWindowOnSuccessCallback = ( - x: number, - y: number, - width: number, - height: number - ) => void - - export type MeasureLayoutOnSuccessCallback = ( - left: number, - top: number, - width: number, - height: number - ) => void - - /** - * EventSubscription represents a subscription to a particular event. It can - * remove its own subscription. - */ - interface EventSubscription { - - eventType: string; - key: number; - subscriber: EventSubscriptionVendor; - - /** - * @param {EventSubscriptionVendor} subscriber the subscriber that controls - * this subscription. - */ - new(subscriber: EventSubscriptionVendor): EventSubscription - - /** - * Removes this subscription from the subscriber that controls it. - */ - remove(): void - } - - /** - * EventSubscriptionVendor stores a set of EventSubscriptions that are - * subscribed to a particular event type. - */ - interface EventSubscriptionVendor { - - constructor(): EventSubscriptionVendor - - /** - * Adds a subscription keyed by an event type. - * - * @param {string} eventType - * @param {EventSubscription} subscription - */ - addSubscription(eventType: string, subscription: EventSubscription): EventSubscription - - /** - * Removes a bulk set of the subscriptions. - * - * @param {?string} eventType - Optional name of the event type whose - * registered supscriptions to remove, if null remove all subscriptions. - */ - removeAllSubscriptions(eventType?: string): void - - /** - * Removes a specific subscription. Instead of calling this function, call - * `subscription.remove()` directly. - * - * @param {object} subscription - */ - removeSubscription(subscription: any): void - - /** - * Returns the array of subscriptions that are currently registered for the - * given event type. - * - * Note: This array can be potentially sparse as subscriptions are deleted - * from it when they are removed. - * - * @param {string} eventType - * @returns {?array} - */ - getSubscriptionsForType(eventType: string): EventSubscription[] - } - - /** - * EmitterSubscription represents a subscription with listener and context data. - */ - interface EmitterSubscription extends EventSubscription { - emitter: EventEmitter - listener: () => any - context: any - - /** - * @param {EventEmitter} emitter - The event emitter that registered this - * subscription - * @param {EventSubscriptionVendor} subscriber - The subscriber that controls - * this subscription - * @param {function} listener - Function to invoke when the specified event is - * emitted - * @param {*} context - Optional context object to use when invoking the - * listener - */ - new(emitter: EventEmitter, subscriber: EventSubscriptionVendor, listener: () => any, context: any): EmitterSubscription - - /** - * Removes this subscription from the emitter that registered it. - * Note: we're overriding the `remove()` method of EventSubscription here - * but deliberately not calling `super.remove()` as the responsibility - * for removing the subscription lies with the EventEmitter. - */ - remove(): void - } - - interface EventEmitter { - /** - * @constructor - * - * @param {EventSubscriptionVendor} subscriber - Optional subscriber instance - * to use. If omitted, a new subscriber will be created for the emitter. - */ - new(subscriber?: EventSubscriptionVendor): EventEmitter - - /** - * Adds a listener to be invoked when events of the specified type are - * emitted. An optional calling context may be provided. The data arguments - * emitted will be passed to the listener function. - * - * @param {string} eventType - Name of the event to listen to - * @param {function} listener - Function to invoke when the specified event is - * emitted - * @param {*} context - Optional context object to use when invoking the - * listener - */ - addListener(eventType: string, listener: (...args: any[]) => any, context: any): EmitterSubscription - - /** - * Similar to addListener, except that the listener is removed after it is - * invoked once. - * - * @param {string} eventType - Name of the event to listen to - * @param {function} listener - Function to invoke only once when the - * specified event is emitted - * @param {*} context - Optional context object to use when invoking the - * listener - */ - once(eventType: string, listener: (...args: any[]) => any, context: any): EmitterSubscription - - /** - * Removes all of the registered listeners, including those registered as - * listener maps. - * - * @param {?string} eventType - Optional name of the event whose registered - * listeners to remove - */ - removeAllListeners(eventType?: string): void - - /** - * Provides an API that can be called during an eventing cycle to remove the - * last listener that was invoked. This allows a developer to provide an event - * object that can remove the listener (or listener map) during the - * invocation. - * - * If it is called when not inside of an emitting cycle it will throw. - * - * @throws {Error} When called not during an eventing cycle - * - * @example - * var subscription = emitter.addListenerMap({ - * someEvent: function(data, event) { - * console.log(data); - * emitter.removeCurrentListener(); - * } - * }); - * - * emitter.emit('someEvent', 'abc'); // logs 'abc' - * emitter.emit('someEvent', 'def'); // does not log anything - */ - removeCurrentListener(): void - - /** - * Removes a specific subscription. Called by the `remove()` method of the - * subscription itself to ensure any necessary cleanup is performed. - */ - removeSubscription(subscription: EmitterSubscription): void - - /** - * Returns an array of listeners that are currently registered for the given - * event. - * - * @param {string} eventType - Name of the event to query - * @returns {array} - */ - listeners(eventType: string): EmitterSubscription[] - - /** - * Emits an event of the given type with the given data. All handlers of that - * particular type will be notified. - * - * @param {string} eventType - Name of the event to emit - * @param {...*} Arbitrary arguments to be passed to each registered listener - * - * @example - * emitter.addListener('someEvent', function(message) { - * console.log(message); - * }); - * - * emitter.emit('someEvent', 'abc'); // logs 'abc' - */ - emit(eventType: string): void - - /** - * Removes the given listener for event of specific type. - * - * @param {string} eventType - Name of the event to emit - * @param {function} listener - Function to invoke when the specified event is - * emitted - * - * @example - * emitter.removeListener('someEvent', function(message) { - * console.log(message); - * }); // removes the listener if already registered - * - */ - removeListener(eventType: string, listener: (...args: any[]) => any): void - } - - /** NativeMethodsMixin provides methods to access the underlying native component directly. - * This can be useful in cases when you want to focus a view or measure its on-screen dimensions, - * for example. - * The methods described here are available on most of the default components provided by React Native. - * Note, however, that they are not available on composite components that aren't directly backed by a - * native view. This will generally include most components that you define in your own app. - * For more information, see [Direct Manipulation](http://facebook.github.io/react-native/docs/direct-manipulation.html). - * @see https://github.com/facebook/react-native/blob/master/Libraries/ReactIOS/NativeMethodsMixin.js - */ - export interface NativeMethodsMixinStatic { - /** - * Determines the location on screen, width, and height of the given view and - * returns the values via an async callback. If successful, the callback will - * be called with the following arguments: - * - * - x - * - y - * - width - * - height - * - pageX - * - pageY - * - * Note that these measurements are not available until after the rendering - * has been completed in native. If you need the measurements as soon as - * possible, consider using the [`onLayout` - * prop](docs/view.html#onlayout) instead. - */ - measure(callback: MeasureOnSuccessCallback): void; - - /** - * Determines the location of the given view in the window and returns the - * values via an async callback. If the React root view is embedded in - * another native view, this will give you the absolute coordinates. If - * successful, the callback will be called with the following - * arguments: - * - * - x - * - y - * - width - * - height - * - * Note that these measurements are not available until after the rendering - * has been completed in native. - */ - measureInWindow(callback: MeasureInWindowOnSuccessCallback): void; - - /** - * Like [`measure()`](#measure), but measures the view relative an ancestor, - * specified as `relativeToNativeNode`. This means that the returned x, y - * are relative to the origin x, y of the ancestor view. - * - * As always, to obtain a native node handle for a component, you can use - * `React.findNodeHandle(component)`. - */ - measureLayout( - relativeToNativeNode: number, - onSuccess: MeasureLayoutOnSuccessCallback, - onFail: () => void /* currently unused */ - ): void; - - /** - * This function sends props straight to native. They will not participate in - * future diff process - this means that if you do not include them in the - * next render, they will remain active (see [Direct - * Manipulation](docs/direct-manipulation.html)). - */ - setNativeProps(nativeProps: Object): void; - - /** - * Requests focus for the given input or view. The exact behavior triggered - * will depend on the platform and type of view. - */ - focus(): void; - - /** - * Removes focus from an input or view. This is the opposite of `focus()`. - */ - blur(): void; - - refs: { - [key: string]: Component - }; - } - - // see react-jsx.d.ts - export function createElement

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

; - - - export type Runnable = (appParameters: any) => void; - - - // Similar to React.SyntheticEvent except for nativeEvent - interface NativeSyntheticEvent { - bubbles: boolean - cancelable: boolean - currentTarget: EventTarget - defaultPrevented: boolean - eventPhase: number - isTrusted: boolean - nativeEvent: T - preventDefault(): void - stopPropagation(): void - target: EventTarget - timeStamp: Date - type: string - } - - export interface NativeTouchEvent { - /** - * Array of all touch events that have changed since the last event - */ - changedTouches: NativeTouchEvent[] - - /** - * The ID of the touch - */ - identifier: string - - /** - * The X position of the touch, relative to the element - */ - locationX: number - - /** - * The Y position of the touch, relative to the element - */ - locationY: number - - /** - * The X position of the touch, relative to the screen - */ - pageX: number - - /** - * The Y position of the touch, relative to the screen - */ - pageY: number - - /** - * The node id of the element receiving the touch event - */ - target: string - - /** - * A time identifier for the touch, useful for velocity calculation - */ - timestamp: number - - /** - * Array of all current touches on the screen - */ - touches: NativeTouchEvent[] - } - - export interface GestureResponderEvent extends NativeSyntheticEvent { - } - - - export interface PointProperties { - x: number - y: number - } - - export interface Insets { - top?: number - left?: number - bottom?: number - right?: number - } - - /** - * //FIXME: need to find documentation on which component is a TTouchable and can implement that interface - * @see React.DOMAtributes - */ - export interface Touchable { - onTouchStart?: (event: GestureResponderEvent) => void - onTouchMove?: (event: GestureResponderEvent) => void - onTouchEnd?: (event: GestureResponderEvent) => void - onTouchCancel?: (event: GestureResponderEvent) => void - onTouchEndCapture?: (event: GestureResponderEvent) => void - } - - export type ComponentProvider = () => React.ComponentClass - - export type AppConfig = { - appKey: string; - component?: ComponentProvider - run?: Runnable; - } - - // https://github.com/facebook/react-native/blob/master/Libraries/AppRegistry/AppRegistry.js - /** - * `AppRegistry` is the JS entry point to running all React Native apps. App - * root components should register themselves with - * `AppRegistry.registerComponent`, then the native system can load the bundle - * for the app and then actually run the app when it's ready by invoking - * `AppRegistry.runApplication`. - * - * To "stop" an application when a view should be destroyed, call - * `AppRegistry.unmountApplicationComponentAtRootTag` with the tag that was - * pass into `runApplication`. These should always be used as a pair. - * - * `AppRegistry` should be `require`d early in the `require` sequence to make - * sure the JS execution environment is setup before other modules are - * `require`d. - */ - export class AppRegistry { - static registerConfig(config: AppConfig[]): void; - - static registerComponent( appKey: string, getComponentFunc: ComponentProvider ): string; - - static registerRunnable(appKey: string, func: Runnable): string; - - static getAppKeys(): string[]; - - static unmountApplicationComponentAtRootTag(rootTag: number): void; - - static runApplication(appKey: string, appParameters: any): void; - } - - export interface LayoutAnimationTypes { - spring: string - linear: string - easeInEaseOut: string - easeIn: string - easeOut: string - } - - export interface LayoutAnimationProperties { - opacity: string - scaleXY: string - } - - export interface LayoutAnimationAnim { - duration?: number - delay?: number - springDamping?: number - initialVelocity?: number - type?: string //LayoutAnimationTypes - property?: string //LayoutAnimationProperties - } - - export interface LayoutAnimationConfig { - duration: number - create?: LayoutAnimationAnim - update?: LayoutAnimationAnim - delete?: LayoutAnimationAnim - } - - /** Automatically animates views to their new positions when the next layout happens. - * A common way to use this API is to call LayoutAnimation.configureNext before - * calling setState. */ - export interface LayoutAnimationStatic { - /** Schedules an animation to happen on the next layout. - * @param config Specifies animation properties: - * `duration` in milliseconds - * `create`, config for animating in new views (see Anim type) - * `update`, config for animating views that have been updated (see Anim type) - * @param onAnimationDidEnd Called when the animation finished. Only supported on iOS. - */ - configureNext: ( config: LayoutAnimationConfig, onAnimationDidEnd?: () => void ) => void - /** Helper for creating a config for configureNext. */ - create: (duration: number, type?: string, creationProp?: string) => LayoutAnimationConfig - Types: LayoutAnimationTypes - Properties: LayoutAnimationProperties - configChecker: (shapeTypes: {[key: string]: any}) => any - Presets: { - easeInEaseOut: LayoutAnimationConfig - linear: LayoutAnimationConfig - spring: LayoutAnimationConfig - } - easeInEaseOut: (config: LayoutAnimationConfig, onAnimationDidEnd?: () => void) => void - linear: (config: LayoutAnimationConfig, onAnimationDidEnd?: () => void) => void - spring: (config: LayoutAnimationConfig, onAnimationDidEnd?: () => void) => void - } - - export type FlexAlignType = "flex-start" | "flex-end" | "center" | "stretch"; - export type FlexJustifyType = "flex-start" | "flex-end" | "center" | "space-between" | "space-around"; - export type FlexDirection = "row" | "column" | "row-reverse" | "column-reverse"; - - /** - * Flex Prop Types - * @see https://facebook.github.io/react-native/docs/flexbox.html#proptypes - * @see LayoutPropTypes.js - */ - export interface FlexStyle { - - alignItems?: FlexAlignType; - alignSelf?: "auto" | FlexAlignType; - borderBottomWidth?: number - borderLeftWidth?: number - borderRightWidth?: number - borderTopWidth?: number - borderWidth?: number - bottom?: number - flex?: number - flexGrow?: number - flexShrink?: number - flexBasis?: number - flexDirection?: FlexDirection - flexWrap?: "wrap" | "nowrap" - height?: number - justifyContent?: FlexJustifyType - left?: number - minWidth?: number - maxWidth?: number - minHeight?: number - maxHeight?: number - margin?: number - marginBottom?: number - marginHorizontal?: number - marginLeft?: number - marginRight?: number - marginTop?: number - marginVertical?: number - overflow?: "visible" | "hidden" | "scroll" - padding?: number - paddingBottom?: number - paddingHorizontal?: number - paddingLeft?: number - paddingRight?: number - paddingTop?: number - paddingVertical?: number - position?: "absolute" | "relative" - right?: number - top?: number - width?: number - - /** - * @platform ios - */ - zIndex?: number - } - - /** - * @see ShadowPropTypesIOS.js - */ - export interface ShadowPropTypesIOSStatic { - /** - * Sets the drop shadow color - * @platform ios - */ - shadowColor: string - - /** - * Sets the drop shadow offset - * @platform ios - */ - shadowOffset: { width: number, height: number } - - /** - * Sets the drop shadow opacity (multiplied by the color's alpha component) - * @platform ios - */ - shadowOpacity: number - - /** - * Sets the drop shadow blur radius - * @platform ios - */ - shadowRadius: number - } - - type GetCurrentPositionOptions = { - timeout: number - maximumAge: number - enableHighAccuracy: boolean - distanceFilter: number - } - - type WatchPositionOptions = { - timeout: number - maximumAge: number - enableHighAccuracy: boolean - distanceFilter: number - } - - type GeolocationReturnType = { - coords: { - latitude: number - longitude: number - altitude?: number - accuracy?: number - altitudeAccuracy?: number - heading?: number - speed?: number - } - timestamp: number - } - - interface PerpectiveTransform { - perspective: number; - } - - interface RotateTransform { - rotate: string; - } - - interface RotateXTransform { - rotateX: string; - } - - interface RotateYTransform { - rotateY: string; - } - - interface RotateZTransform { - rotateZ: string; - } - - interface ScaleTransform { - scale: number; - } - - interface ScaleXTransform { - scaleX: number; - } - - interface ScaleYTransform { - scaleY: number; - } - - interface TranslateXTransform { - translateX: number; - } - - interface TranslateYTransform { - translateY: number; - } - - interface SkewXTransform { - skewX: string; - } - - interface SkewYTransform { - skewY: string; - } - - export interface TransformsStyle { - - transform?: (PerpectiveTransform|RotateTransform|RotateXTransform|RotateYTransform|RotateZTransform|ScaleTransform|ScaleXTransform|ScaleYTransform|TranslateXTransform|TranslateYTransform|SkewXTransform|SkewYTransform)[] - transformMatrix?: Array - rotation?: number - scaleX?: number - scaleY?: number - translateX?: number - translateY?: number - } - - - export interface StyleSheetProperties { - hairlineWidth: number - flatten(style: T): T - } - - export interface LayoutRectangle { - x: number; - y: number; - width: number; - height: number; - } - - // @see TextProperties.onLayout - export interface LayoutChangeEvent { - nativeEvent: { - layout: LayoutRectangle - } - } - - export interface TextStyleIOS extends ViewStyle { - letterSpacing?: number - textDecorationColor?: string - textDecorationStyle?: "solid" | "double" | "dotted" | "dashed" - writingDirection?: "auto" | "ltr" | "rtl" - } - - export interface TextStyleAndroid extends ViewStyle { - textAlignVertical?: "auto" | "top" | "bottom" | "center" - } - - // @see https://facebook.github.io/react-native/docs/text.html#style - export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { - color?: string - fontFamily?: string - fontSize?: number - fontStyle?: "normal" | "italic" - /** - * Specifies font weight. The values 'normal' and 'bold' are supported - * for most fonts. Not all fonts have a variant for each of the numeric - * values, in that case the closest one is chosen. - */ - fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" - letterSpacing?: number - lineHeight?: number - /** - * Specifies text alignment. - * The value 'justify' is only supported on iOS. - */ - textAlign?: "auto" | "left" | "right" | "center" - textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through" - textDecorationStyle?: "solid" | "double" | "dotted" | "dashed" - textDecorationColor?: string - textShadowColor?: string - textShadowOffset?: { width: number, height: number } - textShadowRadius?: number - testID?: string - } - - export interface TextPropertiesIOS { - /** - * Specifies whether fonts should scale to respect Text Size accessibility setting on iOS. The - * default is `true`. - */ - allowFontScaling?: boolean - - /** - * Specifies whether font should be scaled down automatically to fit given style constraints. - */ - adjustsFontSizeToFit?: boolean - - /** - * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0). - */ - minimumFontScale?: number - - /** - * When `true`, no visual change is made when text is pressed down. By - * default, a gray oval highlights the text on press down. - */ - suppressHighlighting?: boolean - } - - export interface TextPropertiesAndroid { - /** - * Lets the user select text, to use the native copy and paste functionality. - */ - selectable?: boolean - } - - // https://facebook.github.io/react-native/docs/text.html#props - export interface TextProperties extends TextPropertiesIOS, TextPropertiesAndroid, React.Props { - - /** - * When set to `true`, indicates that the view is an accessibility element. The default value - * for a `Text` element is `true`. - * - * See the - * [Accessibility guide](/react-native/docs/accessibility.html#accessible-ios-android) - * for more information. - */ - accessible?: boolean - - /** - * This can be one of the following values: - * - * - `head` - The line is displayed so that the end fits in the container and the missing text - * at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz" - * - `middle` - The line is displayed so that the beginning and end fit in the container and the - * missing text in the middle is indicated by an ellipsis glyph. "ab...yz" - * - `tail` - The line is displayed so that the beginning fits in the container and the - * missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..." - * - `clip` - Lines are not drawn past the edge of the text container. - * - * The default is `tail`. - * - * `numberOfLines` must be set in conjunction with this prop. - * - * > `clip` is working only for iOS - */ - ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' - - /** - * Line Break mode. Works only with numberOfLines. - * clip is working only for iOS - */ - lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip' - - /** - * Used to truncate the text with an ellipsis after computing the text - * layout, including line wrapping, such that the total number of lines - * does not exceed this number. - * - * This prop is commonly used with `ellipsizeMode`. - */ - numberOfLines?: number - - /** - * Invoked on mount and layout changes with - * - * {nativeEvent: { layout: {x, y, width, height}}}. - */ - onLayout?: (event: LayoutChangeEvent) => void - - /** - * This function is called on press. - * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting). - */ - onPress?: () => void - - /** - * This function is called on long press. - * e.g., `onLongPress={this.increaseSize}>`` - */ - onLongPress?: () => void - - /** - * @see https://facebook.github.io/react-native/docs/text.html#style - */ - style?: TextStyle - - /** - * Used to locate this view in end-to-end tests. - */ - testID?: string - } - - /** - * A React component for displaying text which supports nesting, styling, and touch handling. - */ - export interface TextStatic extends NativeMethodsMixin, React.ClassicComponentClass { - - } - - type DataDetectorTypes = 'phoneNumber' | 'link' | 'address' | 'calendarEvent' | 'none' | 'all'; - - /** - * DocumentSelectionState is responsible for maintaining selection information - * for a document. - * - * It is intended for use by AbstractTextEditor-based components for - * identifying the appropriate start/end positions to modify the - * DocumentContent, and for programatically setting browser selection when - * components re-render. - */ - export interface DocumentSelectionState extends EventEmitter { - new(anchor: number, focus: number): DocumentSelectionState - - /** - * Apply an update to the state. If either offset value has changed, - * set the values and emit the `change` event. Otherwise no-op. - * - * @param {number} anchor - * @param {number} focus - */ - update(anchor: number, focus: number): void - - /** - * Given a max text length, constrain our selection offsets to ensure - * that the selection remains strictly within the text range. - * - * @param {number} maxLength - */ - constrainLength(maxLength: number): void - - focus(): void - blur(): void - hasFocus(): boolean - isCollapsed(): boolean - isBackward(): boolean - - getAnchorOffset(): number - getFocusOffset(): number - getStartOffset(): number - getEndOffset(): number - overlaps(start: number, end: number): boolean - } - - - /** - * IOS Specific properties for TextInput - * @see https://facebook.github.io/react-native/docs/textinput.html#props - */ - export interface TextInputIOSProperties { - - /** - * enum('never', 'while-editing', 'unless-editing', 'always') - * When the clear button should appear on the right side of the text view - */ - clearButtonMode?: 'never' | 'while-editing' | 'unless-editing' | 'always' - - /** - * If true, clears the text field automatically when editing begins - */ - clearTextOnFocus?: boolean - - /** - * Determines the types of data converted to clickable URLs in the text input. - * Only valid if `multiline={true}` and `editable={false}`. - * By default no data types are detected. - * - * You can provide one type or an array of many types. - * - * Possible values for `dataDetectorTypes` are: - * - * - `'phoneNumber'` - * - `'link'` - * - `'address'` - * - `'calendarEvent'` - * - `'none'` - * - `'all'` - */ - dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[] - - /** - * If true, the keyboard disables the return key when there is no text and automatically enables it when there is text. - * The default value is false. - */ - enablesReturnKeyAutomatically?: boolean - - /** - * Determines the color of the keyboard. - */ - keyboardAppearance?: 'default' | 'light' | 'dark' - - /** - * Callback that is called when a key is pressed. - * Pressed key value is passed as an argument to the callback handler. - * Fires before onChange callbacks. - */ - onKeyPress?: (key: string) => void - - /** - * See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document - */ - selectionState?: DocumentSelectionState - - - } - - /** - * Android Specific properties for TextInput - * @see https://facebook.github.io/react-native/docs/textinput.html#props - */ - export interface TextInputAndroidProperties { - - /** - * If defined, the provided image resource will be rendered on the left. - */ - inlineImageLeft?: string - - /** - * Padding between the inline image, if any, and the text input itself. - */ - inlineImagePadding?: number - - /** - * Sets the number of lines for a TextInput. - * Use it with multiline set to true to be able to fill the lines. - */ - numberOfLines?: number - - /** - * Sets the return key to the label. Use it instead of `returnKeyType`. - * @platform android - */ - returnKeyLabel?: string - - /** - * The color of the textInput underline. - */ - underlineColorAndroid?: string - } - - export type KeyboardType = "default" | "email-address" | "numeric" | "phone-pad" - export type KeyboardTypeIOS = "ascii-capable" | "numbers-and-punctuation" | "url" | "number-pad" | "name-phone-pad" | "decimal-pad" | "twitter" | "web-search" - - export type ReturnKeyType = "done" | "go" | "next" | "search" | "send" - export type ReturnKeyTypeAndroid = "none" | "previous" - export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call" - - /** - * @see https://facebook.github.io/react-native/docs/textinput.html#props - */ - export interface TextInputProperties extends ViewProperties, TextInputIOSProperties, TextInputAndroidProperties, React.Props { - - /** - * Can tell TextInput to automatically capitalize certain characters. - * characters: all characters, - * words: first letter of each word - * sentences: first letter of each sentence (default) - * none: don't auto capitalize anything - * - * https://facebook.github.io/react-native/docs/textinput.html#autocapitalize - */ - autoCapitalize?: "none" | "sentences" | "words" | "characters" - - /** - * If false, disables auto-correct. - * The default value is true. - */ - autoCorrect?: boolean - - /** - * If true, focuses the input on componentDidMount. - * The default value is false. - */ - autoFocus?: boolean - - /** - * If true, the text field will blur when submitted. - * The default value is true. - */ - blurOnSubmit?: boolean - - /** - * Provides an initial value that will change when the user starts typing. - * Useful for simple use-cases where you don't want to deal with listening to events - * and updating the value prop to keep the controlled state in sync. - */ - defaultValue?: string - - /** - * If false, text is not editable. The default value is true. - */ - editable?: boolean - - /** - * enum("default", 'numeric', 'email-address', "ascii-capable", 'numbers-and-punctuation', 'url', 'number-pad', 'phone-pad', 'name-phone-pad', 'decimal-pad', 'twitter', 'web-search') - * Determines which keyboard to open, e.g.numeric. - * The following values work across platforms: - default - numeric - email-address - phone-pad - */ - keyboardType?: KeyboardType | KeyboardTypeIOS - - /** - * Limits the maximum number of characters that can be entered. - * Use this instead of implementing the logic in JS to avoid flicker. - */ - maxLength?: number - - /** - * If true, the text input can be multiple lines. The default value is false. - */ - multiline?: boolean - - /** - * Callback that is called when the text input is blurred - */ - onBlur?: () => void - - /** - * Callback that is called when the text input's text changes. - */ - onChange?: (event: { nativeEvent: { text: string, contentSize: { width: number, height: number }, target: number, eventCount: number } }) => void - - /** - * Callback that is called when the text input's text changes. - * Changed text is passed as an argument to the callback handler. - */ - onChangeText?: (text: string) => void - - /** - * Callback that is called when the text input's content size changes. - * This will be called with - * `{ nativeEvent: { contentSize: { width, height } } }`. - * - * Only called for multiline text inputs. - */ - onContentSizeChange?: ( event: {nativeEvent: {contentSize: { width: number, height: number}}} ) => void - - /** - * Callback that is called when text input ends. - */ - onEndEditing?: (event: { nativeEvent: { text: string } }) => void - - /** - * Callback that is called when the text input is focused - */ - onFocus?: () => void - - /** - * Callback that is called when the text input selection is changed. - */ - onSelectionChange?: (event: { nativeEvent: { selection: { start: number, end: number }, target: number } }) => void - - /** - * Callback that is called when the text input's submit button is pressed. - */ - onSubmitEditing?: (event: { nativeEvent: { text: string } }) => void - - /** - * The string that will be rendered before text input has been entered - */ - placeholder?: string - - /** - * The text color of the placeholder string - */ - placeholderTextColor?: string - - /** - * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call') - * Determines how the return key should look. - */ - returnKeyType?: ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS - - /** - * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. - * The default value is false. - */ - secureTextEntry?: boolean - - /** - * If true, all text will automatically be selected on focus - */ - selectTextOnFocus?: boolean - - /** - * The start and end of the text input's selection. Set start and end to - * the same value to position the cursor. - */ - selection?: { start: number, end?: number } - - /** - * The highlight (and cursor on ios) color of the text input - */ - selectionColor?: string - - /** - * Styles - */ - style?: TextStyle - - /** - * Used to locate this view in end-to-end tests - */ - testID?: string - - /** - * The value to show for the text input. TextInput is a controlled component, - * which means the native value will be forced to match this value prop if provided. - * For most uses this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. - * In addition to simply setting the same value, either set editable={false}, - * or set/update maxLength to prevent unwanted edits without flicker. - */ - value?: string - - ref?: Ref - } - - /** - * This class is responsible for coordinating the "focused" - * state for TextInputs. All calls relating to the keyboard - * should be funneled through here - */ - interface TextInputState { - /** - * Returns the ID of the currently focused text field, if one exists - * If no text field is focused it returns null - */ - currentlyFocusedField(): number - - /** - * @param {number} TextInputID id of the text field to focus - * Focuses the specified text field - * noop if the text field was already focused - */ - focusTextInput(textFieldID?: number): void - - /** - * @param {number} textFieldID id of the text field to focus - * Unfocuses the specified text field - * noop if it wasn't focused - */ - blurTextInput(textFieldID?: number) : void - } - - /** - * @see https://facebook.github.io/react-native/docs/textinput.html#methods - */ - export interface TextInputStatic extends NativeMethodsMixin, TimerMixin, React.ComponentClass { - State: TextInputState - - /** - * Returns if the input is currently focused. - */ - isFocused: () => boolean - - /** - * Removes all text from the input. - */ - clear: () => void - } - - export type ToolbarAndroidAction = { - /** - * title: required, the title of this action - */ - title: string - - /** - * icon: the icon for this action, e.g. require('./some_icon.png') - */ - icon?: ImageURISource - - /** - * show: when to show this action as an icon or hide it in the overflow menu: always, ifRoom or never - */ - show?: "always" | "ifRoom" | "never" - - /** - * showWithText: boolean, whether to show text alongside the icon or not - */ - showWithText?: boolean - } - - export interface ToolbarAndroidProperties extends ViewProperties, React.Props { - - /** - * Sets possible actions on the toolbar as part of the action menu. These are displayed as icons - * or text on the right side of the widget. If they don't fit they are placed in an 'overflow' - * menu. - * - * This property takes an array of objects, where each object has the following keys: - * - * * `title`: **required**, the title of this action - * * `icon`: the icon for this action, e.g. `require('./some_icon.png')` - * * `show`: when to show this action as an icon or hide it in the overflow menu: `always`, - * `ifRoom` or `never` - * * `showWithText`: boolean, whether to show text alongside the icon or not - */ - actions?: ToolbarAndroidAction[] - - /** - * Sets the content inset for the toolbar ending edge. - * The content inset affects the valid area for Toolbar content other - * than the navigation button and menu. Insets define the minimum - * margin for these components and can be used to effectively align - * Toolbar content along well-known gridlines. - */ - contentInsetEnd?: number - - /** - * Sets the content inset for the toolbar starting edge. - * The content inset affects the valid area for Toolbar content - * other than the navigation button and menu. Insets define the - * minimum margin for these components and can be used to effectively - * align Toolbar content along well-known gridlines. - */ - contentInsetStart?: number - - /** - * Sets the toolbar logo. - */ - logo?: ImageURISource - - /** - * Sets the navigation icon. - */ - navIcon?: ImageURISource - - /** - * Callback that is called when an action is selected. The only - * argument that is passed to the callback is the position of the - * action in the actions array. - */ - onActionSelected?: (position: number) => void - - /** - * Callback called when the icon is selected. - */ - onIconClicked?: () => void - - /** - * Sets the overflow icon. - */ - overflowIcon?: ImageURISource - - /** - * Used to set the toolbar direction to RTL. - * In addition to this property you need to add - * android:supportsRtl="true" - * to your application AndroidManifest.xml and then call - * setLayoutDirection(LayoutDirection.RTL) in your MainActivity - * onCreate method. - */ - rtl?: boolean - - /** - * Sets the toolbar subtitle. - */ - subtitle?: string - - /** - * Sets the toolbar subtitle color. - */ - subtitleColor?: string - - /** - * Used to locate this view in end-to-end tests. - */ - testID?: string - - /** - * Sets the toolbar title. - */ - title?: string - - /** - * Sets the toolbar title color. - */ - titleColor?: string - - ref?: Ref - } - - /** - * React component that wraps the Android-only [`Toolbar` widget][0]. A Toolbar can display a logo, - * navigation icon (e.g. hamburger menu), a title & subtitle and a list of actions. The title and - * subtitle are expanded so the logo and navigation icons are displayed on the left, title and - * subtitle in the middle and the actions on the right. - * - * If the toolbar has an only child, it will be displayed between the title and actions. - * - * Although the Toolbar supports remote images for the logo, navigation and action icons, this - * should only be used in DEV mode where `require('./some_icon.png')` translates into a packager - * URL. In release mode you should always use a drawable resource for these icons. Using - * `require('./some_icon.png')` will do this automatically for you, so as long as you don't - * explicitly use e.g. `{uri: 'http://...'}`, you will be good. - * - * [0]: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html - */ - export interface ToolbarAndroidStatic extends NativeMethodsMixin, React.ComponentClass { - - } - - - /** - * Gesture recognition on mobile devices is much more complicated than web. - * A touch can go through several phases as the app determines what the user's intention is. - * For example, the app needs to determine if the touch is scrolling, sliding on a widget, or tapping. - * This can even change during the duration of a touch. There can also be multiple simultaneous touches. - * - * The touch responder system is needed to allow components to negotiate these touch interactions - * without any additional knowledge about their parent or child components. - * This system is implemented in ResponderEventPlugin.js, which contains further details and documentation. - * - * Best Practices - * Users can feel huge differences in the usability of web apps vs. native, and this is one of the big causes. - * Every action should have the following attributes: - * Feedback/highlighting- show the user what is handling their touch, and what will happen when they release the gesture - * Cancel-ability- when making an action, the user should be able to abort it mid-touch by dragging their finger away - * - * These features make users more comfortable while using an app, - * because it allows people to experiment and interact without fear of making mistakes. - * - * TouchableHighlight and Touchable* - * The responder system can be complicated to use. - * So we have provided an abstract Touchable implementation for things that should be "tappable". - * This uses the responder system and allows you to easily configure tap interactions declaratively. - * Use TouchableHighlight anywhere where you would use a button or link on web. - */ - export interface GestureResponderHandlers { - - /** - * A view can become the touch responder by implementing the correct negotiation methods. - * There are two methods to ask the view if it wants to become responder: - */ - - /** - * Does this view want to become responder on the start of a touch? - */ - onStartShouldSetResponder?: (event: GestureResponderEvent) => boolean - - /** - * Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness? - */ - onMoveShouldSetResponder?: (event: GestureResponderEvent) => boolean - - /** - * If the View returns true and attempts to become the responder, one of the following will happen: - */ - - onResponderEnd?: ( event: GestureResponderEvent ) => void - - /** - * The View is now responding for touch events. - * This is the time to highlight and show the user what is happening - */ - onResponderGrant?: (event: GestureResponderEvent) => void - - /** - * Something else is the responder right now and will not release it - */ - onResponderReject?: (event: GestureResponderEvent) => void - - /** - * If the view is responding, the following handlers can be called: - */ - - /** - * The user is moving their finger - */ - onResponderMove?: (event: GestureResponderEvent) => void - - /** - * Fired at the end of the touch, ie "touchUp" - */ - onResponderRelease?: (event: GestureResponderEvent) => void - - onResponderStart?: ( event: GestureResponderEvent ) => void - - /** - * Something else wants to become responder. - * Should this view release the responder? Returning true allows release - */ - onResponderTerminationRequest?: (event: GestureResponderEvent) => boolean - - /** - * The responder has been taken from the View. - * Might be taken by other views after a call to onResponderTerminationRequest, - * or might be taken by the OS without asking (happens with control center/ notification center on iOS) - */ - onResponderTerminate?: (event: GestureResponderEvent) => void - - /** - * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, - * where the deepest node is called first. - * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. - * This is desirable in most cases, because it makes sure all controls and buttons are usable. - * - * However, sometimes a parent will want to make sure that it becomes responder. - * This can be handled by using the capture phase. - * Before the responder system bubbles up from the deepest component, - * it will do a capture phase, firing on*ShouldSetResponderCapture. - * So if a parent View wants to prevent the child from becoming responder on a touch start, - * it should have a onStartShouldSetResponderCapture handler which returns true. - */ - onStartShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean - - /** - * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, - * where the deepest node is called first. - * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. - * This is desirable in most cases, because it makes sure all controls and buttons are usable. - * - * However, sometimes a parent will want to make sure that it becomes responder. - * This can be handled by using the capture phase. - * Before the responder system bubbles up from the deepest component, - * it will do a capture phase, firing on*ShouldSetResponderCapture. - * So if a parent View wants to prevent the child from becoming responder on a touch start, - * it should have a onStartShouldSetResponderCapture handler which returns true. - */ - onMoveShouldSetResponderCapture?: () => void; - - } - - // @see https://facebook.github.io/react-native/docs/view.html#style - export interface ViewStyle extends FlexStyle, TransformsStyle { - backfaceVisibility?: "visible" | "hidden" - backgroundColor?: string; - borderBottomColor?: string; - borderBottomLeftRadius?: number; - borderBottomRightRadius?: number; - borderBottomWidth?: number; - borderColor?: string; - borderLeftColor?: string; - borderRadius?: number; - borderRightColor?: string; - borderRightWidth?: number; - borderStyle?: "solid" | "dotted" | "dashed" - borderTopColor?: string; - borderTopLeftRadius?: number; - borderTopRightRadius?: number; - borderTopWidth?: number - opacity?: number; - overflow?: "visible" | "hidden" - shadowColor?: string; - shadowOffset?: { width: number, height: number }; - shadowOpacity?: number; - shadowRadius?: number; - elevation?: number; - testID?: string; - } - - - export interface ViewPropertiesIOS { - - /** - * Provides additional traits to screen reader. - * By default no traits are provided unless specified otherwise in element - * - * @enum('none', 'button', 'link', 'header', 'search', 'image', 'selected', 'plays', 'key', 'text','summary', 'disabled', 'frequentUpdates', 'startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn') - */ - accessibilityTraits?: ViewAccessibilityTraits | ViewAccessibilityTraits[]; - - /** - * Whether this view should be rendered as a bitmap before compositing. - * - * On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children; - * for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view - * and quickly composite it during each frame. - * - * Rasterization incurs an off-screen drawing pass and the bitmap consumes memory. - * Test and measure when using this property. - */ - shouldRasterizeIOS?: boolean - } - - export interface ViewPropertiesAndroid { - - /** - * Indicates to accessibility services to treat UI component like a native one. - * Works for Android only. - * - * @enum('none', 'button', 'radiobutton_checked', 'radiobutton_unchecked' ) - */ - accessibilityComponentType?: 'none' | 'button' | 'radiobutton_checked' | 'radiobutton_unchecked' - - - /** - * Indicates to accessibility services whether the user should be notified when this view changes. - * Works for Android API >= 19 only. - * See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion for references. - */ - accessibilityLiveRegion?: 'none' | 'polite' | 'assertive' - - /** - * Views that are only used to layout their children or otherwise don't draw anything - * may be automatically removed from the native hierarchy as an optimization. - * Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy. - */ - collapsable?: boolean - - - /** - * Controls how view is important for accessibility which is if it fires accessibility events - * and if it is reported to accessibility services that query the screen. - * Works for Android only. See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility for references. - * - * Possible values: - * 'auto' - The system determines whether the view is important for accessibility - default (recommended). - * 'yes' - The view is important for accessibility. - * 'no' - The view is not important for accessibility. - * 'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views. - */ - importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants' - - - /** - * Whether this view needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior. - * The default (false) falls back to drawing the component and its children - * with an alpha applied to the paint used to draw each element instead of rendering the full component offscreen and compositing it back with an alpha value. - * This default may be noticeable and undesired in the case where the View you are setting an opacity on - * has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background). - * - * Rendering offscreen to preserve correct alpha behavior is extremely expensive - * and hard to debug for non-native developers, which is why it is not turned on by default. - * If you do need to enable this property for an animation, - * consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame). - * If that property is enabled, this View will be rendered off-screen once, - * saved in a hardware texture, and then composited onto the screen with an alpha each frame without having to switch rendering targets on the GPU. - */ - needsOffscreenAlphaCompositing?: boolean - - - /** - * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. - * - * On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale: - * in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can just be - * re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation. - */ - renderToHardwareTextureAndroid?: boolean; - - } - - /** - * @see https://facebook.github.io/react-native/docs/view.html#props - */ - export interface ViewProperties extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, React.Props { - - /** - * Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space. - */ - accessibilityLabel?: string; - - /** - * When true, indicates that the view is an accessibility element. - * By default, all the touchable elements are accessible. - */ - accessible?: boolean; - - /** - * This defines how far a touch event can start away from the view. - * Typical interface guidelines recommend touch targets that are at least - * 30 - 40 points/density-independent pixels. If a Touchable view has - * a height of 20 the touchable height can be extended to 40 with - * hitSlop={{top: 10, bottom: 10, left: 0, right: 0}} - * NOTE The touch area never extends past the parent view bounds and - * the Z-index of sibling views always takes precedence if a touch - * hits two overlapping views. - */ - - hitSlop?: Insets - - /** - * When `accessible` is true, the system will try to invoke this function when the user performs accessibility tap gesture. - */ - onAcccessibilityTap?: () => void; - - /** - * Invoked on mount and layout changes with - * - * {nativeEvent: { layout: {x, y, width, height}}}. - */ - onLayout?: (event: LayoutChangeEvent) => void; - - /** - * When accessible is true, the system will invoke this function when the user performs the magic tap gesture. - */ - onMagicTap?: () => void; - - /** - * - * In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class: - * - * .box-none { - * pointer-events: none; - * } - * .box-none * { - * pointer-events: all; - * } - * - * box-only is the equivalent of - * - * .box-only { - * pointer-events: all; - * } - * .box-only * { - * pointer-events: none; - * } - * - * But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes, - * we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform. - */ - pointerEvents?: "box-none" | "none" | "box-only" | "auto" - - /** - * - * This is a special performance property exposed by RCTView and is useful for scrolling content when there are many subviews, - * most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound. - * The subviews must also have overflow: hidden, as should the containing view (or one of its superviews). - */ - removeClippedSubviews?: boolean - - style?: ViewStyle; - - /** - * Used to locate this view in end-to-end tests. - */ - testID?: string; - } - - /** - * The most fundamental component for building UI, View is a container that supports layout with flexbox, style, some touch handling, - * and accessibility controls, and is designed to be nested inside other views and to have 0 to many children of any type. - * View maps directly to the native view equivalent on whatever platform React is running on, - * whether that is a UIView,

, android.view, etc. - */ - export interface ViewStatic extends NativeMethodsMixin, React.ClassicComponentClass { - AccessibilityTraits: [ - 'none', - 'button', - 'link', - 'header', - 'search', - 'image', - 'selected', - 'plays', - 'key', - 'text', - 'summary', - 'disabled', - 'frequentUpdates', - 'startsMedia', - 'adjustable', - 'allowsDirectInteraction', - 'pageTurn' - ] - - AccessibilityComponentType: [ - 'none', - 'button', - 'radiobutton_checked', - 'radiobutton_unchecked' - ], - - /** - * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) - * @platform ios - */ - forceTouchAvailable: boolean, - } - - /** - * @see https://facebook.github.io/react-native/docs/viewpagerandroid.html#props - */ - - - export interface ViewPagerAndroidOnPageScrollEventData { - position: number; - offset: number; - } - - export interface ViewPagerAndroidOnPageSelectedEventData { - position: number; - } - - export interface ViewPagerAndroidProperties extends ViewProperties { - /** - * Index of initial page that should be selected. Use `setPage` method to - * update the page, and `onPageSelected` to monitor page changes - */ - initialPage?: number; - - /** - * When false, the content does not scroll. - * The default value is true. - */ - scrollEnabled?: boolean; - - /** - * Executed when transitioning between pages (ether because of animation for - * the requested page change or when user is swiping/dragging between pages) - * The `event.nativeEvent` object for this callback will carry following data: - * - position - index of first page from the left that is currently visible - * - offset - value from range [0,1) describing stage between page transitions. - * Value x means that (1 - x) fraction of the page at "position" index is - * visible, and x fraction of the next page is visible. - */ - onPageScroll?: (event: NativeSyntheticEvent) => void; - - /** - * This callback will be called once ViewPager finish navigating to selected page - * (when user swipes between pages). The `event.nativeEvent` object passed to this - * callback will have following fields: - * - position - index of page that has been selected - */ - onPageSelected?: (event: NativeSyntheticEvent) => void; - - /** - * Function called when the page scrolling state has changed. - * The page scrolling state can be in 3 states: - * - idle, meaning there is no interaction with the page scroller happening at the time - * - dragging, meaning there is currently an interaction with the page scroller - * - settling, meaning that there was an interaction with the page scroller, and the - * page scroller is now finishing it's closing or opening animation - */ - onPageScrollStateChanged?: (state: "Idle" | "Dragging" | "Settling") => void - - /** - * Determines whether the keyboard gets dismissed in response to a drag. - * - 'none' (the default), drags do not dismiss the keyboard. - * - 'on-drag', the keyboard is dismissed when a drag begins. - */ - keyboardDismissMode?: "none" | "on-drag" - - /** - * Blank space to show between pages. This is only visible while scrolling, pages are still - * edge-to-edge. - */ - pageMargin?: number - } - - export interface ViewPagerAndroidStatic extends NativeMethodsMixin, React.ComponentClass { - /** - * A helper function to scroll to a specific page in the ViewPager. - * The transition between pages will be animated. - */ - setPage(selectedPage: number): void - - /** - * A helper function to scroll to a specific page in the ViewPager. - * The transition between pages will *not* be animated. - */ - setPageWithoutAnimation(selectedPage: number): void - } - - /** - * It is a component to solve the common problem of views that need to move out of the way of the virtual keyboard. - * It can automatically adjust either its position or bottom padding based on the position of the keyboard. - */ - export interface KeyboardAvoidingViewStatic extends TimerMixin, React.ClassicComponentClass { - - } - - export interface KeyboardAvoidingViewProps extends ViewProperties, React.Props { - - behavior?: 'height' | 'position' | 'padding' - - /** - * The style of the content container(View) when behavior is 'position'. - */ - contentContainerStyle: ViewStyle - - /** - * This is the distance between the top of the user screen and the react native view, - * may be non-zero in some use cases. - */ - keyboardVerticalOffset: number - - ref?: Ref - } - - /** - * //FIXME: No documentation extracted from code comment on WebView.ios.js - */ - export interface NavState { - - url?: string - title?: string - loading?: boolean - canGoBack?: boolean - canGoForward?: boolean; - - [key: string]: any - } - - /** - * Passed data from WebView via window.postMessage. - */ - export interface WebViewMessageEventData { - /** - * The data sent from a WebView; can only be a string. - */ - data: string - } - - export interface WebViewPropertiesAndroid { - - /** - * Used for android only, JS is enabled by default for WebView on iOS - */ - javaScriptEnabled?: boolean - - /** - * Used on Android only, controls whether DOM Storage is enabled - * or not android - */ - domStorageEnabled?: boolean, - - /** - * Sets the user-agent for the WebView. - */ - userAgent?: string - } - - export interface WebViewIOSLoadRequestEvent { - target: number - canGoBack: boolean - lockIdentifier: number - loading: boolean - title: string - canGoForward: boolean - navigationType: 'other' | 'click' - url: string - } - - export interface WebViewPropertiesIOS { - - /** - * Determines whether HTML5 videos play inline or use the native - * full-screen controller. default value false - * NOTE : "In order * for video to play inline, not only does - * this property need to be set to true, but the video element - * in the HTML document must also include the webkit-playsinline - * attribute." - */ - allowsInlineMediaPlayback?: boolean - - /** - * Boolean value that determines whether the web view bounces - * when it reaches the edge of the content. The default value is `true`. - * @platform ios - */ - bounces?: boolean - - /** - * A floating-point number that determines how quickly the scroll - * view decelerates after the user lifts their finger. You may also - * use string shortcuts "normal" and "fast" which match the - * underlying iOS settings for UIScrollViewDecelerationRateNormal - * and UIScrollViewDecelerationRateFast respectively. - * - normal: 0.998 - fast: 0.99 (the default for iOS WebView) - */ - decelerationRate?: "normal" | "fast" | number - - /** - * Allows custom handling of any webview requests by a JS handler. - * Return true or false from this method to continue loading the - * request. - */ - onShouldStartLoadWithRequest?: (event: WebViewIOSLoadRequestEvent) => boolean - - /** - * Boolean value that determines whether scrolling is enabled in the - * `WebView`. The default value is `true`. - */ - scrollEnabled?: boolean - } - - export interface WebViewUriSource { - - /* - * The URI to load in the WebView. Can be a local or remote file. - */ - uri?: string; - - /* - * The HTTP Method to use. Defaults to GET if not specified. - * NOTE: On Android, only GET and POST are supported. - */ - method?: string; - - /* - * Additional HTTP headers to send with the request. - * NOTE: On Android, this can only be used with GET requests. - */ - headers?: any; - - /* - * The HTTP body to send with the request. This must be a valid - * UTF-8 string, and will be sent exactly as specified, with no - * additional encoding (e.g. URL-escaping or base64) applied. - * NOTE: On Android, this can only be used with POST requests. - */ - body?: string; - } - - export interface WebViewHtmlSource { - - /* - * A static HTML page to display in the WebView. - */ - html: string; - - /* - * The base URL to be used for any relative links in the HTML. - */ - baseUrl?: string; - } - - /** - * @see https://facebook.github.io/react-native/docs/webview.html#props - */ - export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndroid, WebViewPropertiesIOS, React.Props { - - /** - * Controls whether to adjust the content inset for web views that are - * placed behind a navigation bar, tab bar, or toolbar. The default value - * is `true`. - */ - automaticallyAdjustContentInsets?: boolean - - /** - * The amount by which the web view content is inset from the edges of - * the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}. - */ - contentInset?: Insets - - /** - * @deprecated - */ - html?: string - - /** - * Set this to provide JavaScript that will be injected into the web page - * when the view loads. - */ - injectedJavaScript?: string - - /** - * Invoked when load fails - */ - onError?: (event: NavState) => void - - /** - * Invoked when load finish - */ - onLoad?: (event: NavState) => void - - /** - * Invoked when load either succeeds or fails - */ - onLoadEnd?: (event: NavState) => void - - /** - * Invoked on load start - */ - onLoadStart?: (event: NavState) => void - - /** - * Invoked when window.postMessage is called from WebView. - */ - onMessage?: ( event: NativeSyntheticEvent ) => void - - /** - * Function that is invoked when the `WebView` loading starts or ends. - */ - onNavigationStateChange?: ( event: NavState ) => void - - /** - * Function that returns a view to show if there's an error. - */ - renderError?: () => React.ReactElement - - /** - * Function that returns a loading indicator. - */ - renderLoading?: () => React.ReactElement - - /** - * Boolean value that forces the `WebView` to show the loading view - * on the first load. - */ - startInLoadingState?: boolean - - style?: ViewStyle - - // Deprecated: Use the `source` prop instead. - url?: string - - source?: WebViewUriSource | WebViewHtmlSource | number - - /** - * Determines whether HTML5 audio & videos require the user to tap - * before they can start playing. The default value is false. - */ - mediaPlaybackRequiresUserAction?: boolean - - /** - * sets whether the webpage scales to fit the view and the user can change the scale - */ - scalesPageToFit?: boolean - - ref?: Ref - } - - - export interface WebViewStatic extends React.ClassicComponentClass { - - /** - * Go back one page in the webview's history. - */ - goBack: () => void - - /** - * Go forward one page in the webview's history. - */ - goForward: () => void - - /** - * Post a message to the WebView in the form of a string. - */ - postMessage: (message: string) => void - - /** - * Reloads the current page. - */ - reload: () => void - - /** - * Stop loading the current page. - */ - stopLoading(): void - - /** - * Returns the native webview node. - */ - getWebViewHandle: () => any - } - - - /** - * @see https://facebook.github.io/react-native/docs/segmentedcontrolios.html - * @see SegmentedControlIOS.ios.js - */ - export interface NativeSegmentedControlIOSChangeEvent { - value: string - selectedSegmentIndex: number - target: number - } - - export interface SegmentedControlIOSProperties extends ViewProperties, React.Props { - - /** - * If false the user won't be able to interact with the control. Default value is true. - */ - enabled?: boolean - - /** - * If true, then selecting a segment won't persist visually. - * The onValueChange callback will still work as expected. - */ - momentary?: boolean - - /** - * Callback that is called when the user taps a segment; - * passes the event as an argument - * @param event - */ - onChange?: (event: NativeSyntheticEvent) => void - - /** - * Callback that is called when the user taps a segment; passes the segment's value as an argument - * @param value - */ - onValueChange?: (value: string) => void - - /** - * The index in props.values of the segment to be (pre)selected. - */ - selectedIndex?: number - - /** - * Accent color of the control. - */ - tintColor?: string - - /** - * The labels for the control's segment buttons, in order. - */ - values?: string[] - - ref?: Ref - } - - /** - * Use `SegmentedControlIOS` to render a UISegmentedControl iOS. - * - * #### Programmatically changing selected index - * - * The selected index can be changed on the fly by assigning the - * selectIndex prop to a state variable, then changing that variable. - * Note that the state variable would need to be updated as the user - * selects a value and changes the index, as shown in the example below. - * - * ```` - * { - * this.setState({selectedIndex: event.nativeEvent.selectedSegmentIndex}); - * }} - * /> - * ```` - */ - export interface SegmentedControlIOSStatic extends NativeMethodsMixin, React.ClassicComponentClass { - - } - - - export interface NavigatorIOSProperties extends React.Props { - /** - * The default background color of the navigation bar. - */ - barTintColor?: string - - /** - * NavigatorIOS uses "route" objects to identify child views, their props, and navigation bar configuration. - * "push" and all the other navigation operations expect routes to be like this - */ - initialRoute: Route - - /** - * The default wrapper style for components in the navigator. - * A common use case is to set the backgroundColor for every page - */ - itemWrapperStyle?: ViewStyle - - /** - * Boolean value that indicates whether the interactive pop gesture is - * enabled. This is useful for enabling/disabling the back swipe navigation - * gesture. - * - * If this prop is not provided, the default behavior is for the back swipe - * gesture to be enabled when the navigation bar is shown and disabled when - * the navigation bar is hidden. Once you've provided the - * `interactivePopGestureEnabled` prop, you can never restore the default - * behavior. - */ - interactivePopGestureEnabled?: boolean - - /** - * A Boolean value that indicates whether the navigation bar is hidden - */ - navigationBarHidden?: boolean - - /** - * A Boolean value that indicates whether to hide the 1px hairline shadow - */ - shadowHidden?: boolean - - /** - * The color used for buttons in the navigation bar - */ - tintColor?: string - - /** - * The text color of the navigation bar title - */ - titleTextColor?: string - - /** - * A Boolean value that indicates whether the navigation bar is translucent - */ - translucent?: boolean - - /** - * NOT IN THE DOC BUT IN THE EXAMPLES - */ - style?: ViewStyle - } - - /** - * A navigator is an object of navigation functions that a view can call. - * It is passed as a prop to any component rendered by NavigatorIOS. - * - * Navigator functions are also available on the NavigatorIOS component: - * - * @see https://facebook.github.io/react-native/docs/navigatorios.html#navigator - */ - export interface NavigationIOS { - /** - * Navigate forward to a new route - */ - push: (route: Route) => void - - /** - * Go back one page - */ - pop: () => void - - /** - * Go back N pages at once. When N=1, behavior matches pop() - */ - popN: (n: number) => void - - /** - * Replace the route for the current page and immediately load the view for the new route - */ - replace: (route: Route) => void - - /** - * Replace the route/view for the previous page - */ - replacePrevious: (route: Route) => void - - /** - * Replaces the previous route/view and transitions back to it - */ - replacePreviousAndPop: (route: Route) => void - - /** - * Replaces the top item and popToTop - */ - resetTo: (route: Route) => void - - /** - * Go back to the item for a particular route object - */ - popToRoute(route: Route): void - - /** - * Go back to the top item - */ - popToTop(): void - } - - export interface NavigatorIOSStatic extends NavigationIOS, React.ComponentClass { - } - - - /** - * @see https://facebook.github.io/react-native/docs/activityindicator.html#props - */ - export interface ActivityIndicatorProperties extends ViewProperties, React.Props { - - /** - * Whether to show the indicator (true, the default) or hide it (false). - */ - animating?: boolean - - /** - * The foreground color of the spinner (default is gray). - */ - color?: string - - /** - * Whether the indicator should hide when not animating (true by default). - */ - hidesWhenStopped?: boolean - - /** - * Size of the indicator. - * Small has a height of 20, large has a height of 36. - * - * enum('small', 'large') - */ - size?: number | 'small' | 'large' - - style?: ViewStyle - - ref?: Ref - } - - export interface ActivityIndicatorStatic extends React.NativeMethodsMixin, React.ClassicComponentClass { - } - - - /** - * @see https://facebook.github.io/react-native/docs/activityindicatorios.html#props - */ - export interface ActivityIndicatorIOSProperties extends ViewProperties, React.Props { - - /** - * Whether to show the indicator (true, the default) or hide it (false). - */ - animating?: boolean - - /** - * The foreground color of the spinner (default is gray). - */ - color?: string - - /** - * Whether the indicator should hide when not animating (true by default). - */ - hidesWhenStopped?: boolean - - /** - * Invoked on mount and layout changes with - */ - onLayout?: (event: { nativeEvent: { layout: { x: number, y: number, width: number, height: number } } }) => void - - /** - * Size of the indicator. - * Small has a height of 20, large has a height of 36. - * - * enum('small', 'large') - */ - size?: 'small' | 'large' - - style?: ViewStyle - - ref?: Ref - } - - /** - * @Deprecated since version 0.28.0 - */ - export interface ActivityIndicatorIOSStatic extends React.ComponentClass { - } - - - export interface DatePickerIOSProperties extends ViewProperties, React.Props { - - /** - * The currently selected date. - */ - date: Date - - - /** - * Maximum date. - * Restricts the range of possible date/time values. - */ - maximumDate?: Date - - /** - * Maximum date. - * Restricts the range of possible date/time values. - */ - minimumDate?: Date - - /** - * enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) - * The interval at which minutes can be selected. - */ - minuteInterval?: number - - /** - * enum('date', 'time', 'datetime') - * The date picker mode. - */ - mode?: "date" | "time" | "datetime" - - /** - * Date change handler. - * This is called when the user changes the date or time in the UI. - * The first and only argument is a Date object representing the new date and time. - */ - onDateChange: ( newDate: Date ) => void - - /** - * Timezone offset in minutes. - * By default, the date picker will use the device's timezone. With this parameter, it is possible to force a certain timezone offset. - * For instance, to show times in Pacific Standard Time, pass -7 * 60. - */ - timeZoneOffsetInMinutes?: number - - ref?: Ref - } - - export interface DatePickerIOSStatic extends React.NativeMethodsMixin, React.ComponentClass { - } - - export interface DrawerSlideEvent extends NativeSyntheticEvent { - } - - /** - * @see DrawerLayoutAndroid.android.js - */ - export interface DrawerLayoutAndroidProperties extends ViewProperties, React.Props { - - /** - * Specifies the background color of the drawer. The default value - * is white. If you want to set the opacity of the drawer, use rgba. - * Example: - * return ( - * - * - *); - */ - drawerBackgroundColor?: string; - - /** - * Specifies the lock mode of the drawer. The drawer can be locked - * in 3 states: - * - * - unlocked (default), meaning that the drawer will respond - * (open/close) to touch gestures. - * - * - locked-closed, meaning that the drawer will stay closed and not - * respond to gestures. - * - * - locked-open, meaning that the drawer will stay opened and - * not respond to gestures. The drawer may still be opened and - * closed programmatically (openDrawer/closeDrawer). - */ - drawerLockMode?: "unlocked" | "locked-closed" | "locked-open"; - - /** - * Specifies the side of the screen from which the drawer will slide in. - * enum(DrawerConsts.DrawerPosition.Left, DrawerConsts.DrawerPosition.Right) - */ - drawerPosition?: any; - - /** - * Specifies the width of the drawer, more precisely the width of the - * view that be pulled in from the edge of the window. - */ - drawerWidth?: number; - - /** - * Determines whether the keyboard gets dismissed in response to a drag. - * - 'none' (the default), drags do not dismiss the keyboard. - * - 'on-drag', the keyboard is dismissed when a drag begins. - */ - keyboardDismissMode?: "none" | "on-drag" - - /** - * Function called whenever the navigation view has been closed. - */ - onDrawerClose?: () => void - - /** - * Function called whenever the navigation view has been opened. - */ - onDrawerOpen?: () => void - - /** - * Function called whenever there is an interaction with the navigation view. - * @param event - */ - onDrawerSlide?: (event: DrawerSlideEvent) => void - - /** - * Function called when the drawer state has changed. - * The drawer can be in 3 states: - * - idle, meaning there is no interaction with the navigation - * view happening at the time - * - dragging, meaning there is currently an interaction with the - * navigation view - * - settling, meaning that there was an interaction with the - * navigation view, and the navigation view is now finishing - * it's closing or opening animation - * @param event - */ - onDrawerStateChanged?: (event: "Idle" | "Dragging" | "Settling") => void - - /** - * The navigation view that will be rendered to the side of the - * screen and can be pulled in. - */ - renderNavigationView: () => JSX.Element - - /** - * Make the drawer take the entire screen and draw the background of - * the status bar to allow it to open over the status bar. It will - * only have an effect on API 21+. - */ - statusBarBackgroundColor?: string - - ref?: Ref - } - - export interface DrawerLayoutAndroidStatic extends NativeMethodsMixin, React.ClassicComponentClass { - - /** - * Opens the drawer. - */ - openDrawer(): void - - /** - * Closes the drawer. - */ - closeDrawer(): void - } - - - /** - * @see PickerIOS.ios.js - */ - export interface PickerIOSItemProperties extends React.Props { - value?: string | number - label?: string - } - - /** - * @see PickerIOS.ios.js - */ - export interface PickerIOSItemStatic extends React.ComponentClass { - } - - /** - * @see Picker.js - */ - export interface PickerItemProperties extends React.Props { - label: string - value?: any - } - - export interface PickerItemStatic extends React.ComponentClass { - } - - export interface PickerPropertiesIOS extends ViewProperties, React.Props { - - /** - * Style to apply to each of the item labels. - * @platform ios - */ - itemStyle?: ViewStyle, - - ref?: Ref - } - - export interface PickerPropertiesAndroid extends ViewProperties, React.Props { - - /** - * If set to false, the picker will be disabled, i.e. the user will not be able to make a - * selection. - * @platform android - */ - enabled?: boolean - - /** - * On Android, specifies how to display the selection items when the user taps on the picker: - * - * - 'dialog': Show a modal dialog. This is the default. - * - 'dropdown': Shows a dropdown anchored to the picker view - * - * @platform android - */ - mode?: "dialog" | "dropdown" - - /** - * Prompt string for this picker, used on Android in dialog mode as the title of the dialog. - * @platform android - */ - prompt?: string - - ref?: Ref - } - - /** - * @see https://facebook.github.io/react-native/docs/picker.html - * @see Picker.js - */ - export interface PickerProperties extends PickerPropertiesIOS, PickerPropertiesAndroid, React.Props { - - /** - * Callback for when an item is selected. This is called with the - * following parameters: - * - itemValue: the value prop of the item that was selected - * - itemPosition: the index of the selected item in this picker - * @param itemValue - * @param itemPosition - */ - onValueChange?: (itemValue: any, itemPosition: number) => void - - /** - * Value matching value of one of the items. - * Can be a string or an integer. - */ - selectedValue?: any - - style?: ViewStyle - - /** - * Used to locate this view in end-to-end tests. - */ - testId?: string - - ref?: Ref - } - - /** - * @see https://facebook.github.io/react-native/docs/picker.html - * @see Picker.js - */ - export interface PickerStatic extends React.ComponentClass { - - /** - * On Android, display the options in a dialog. - */ - MODE_DIALOG: string - /** - * On Android, display the options in a dropdown (this is the default). - */ - MODE_DROPDOWN: string - - Item?: PickerItemStatic - } - - /** - * @see https://facebook.github.io/react-native/docs/pickerios.html - * @see PickerIOS.ios.js - */ - export interface PickerIOSProperties extends ViewProperties, React.Props { - - itemStyle?: TextStyle - onValueChange?: ( value: string | number ) => void - selectedValue?: string | number - - ref?: Ref - } - - /** - * @see https://facebook.github.io/react-native/docs/pickerios.html - * @see PickerIOS.ios.js - */ - export interface PickerIOSStatic extends NativeMethodsMixin, React.ClassicComponentClass { - - Item: PickerIOSItemStatic - } - - /** - * @see https://facebook.github.io/react-native/docs/progressbarandroid.html - * @see ProgressBarAndroid.android.js - */ - export interface ProgressBarAndroidProperties extends ViewProperties, React.Props { - - /** - * Style of the ProgressBar. One of: - Horizontal - Normal (default) - Small - Large - Inverse - SmallInverse - LargeInverse - */ - styleAttr?: "Horizontal" | "Normal" | "Small" | "Large" | "Inverse" | "SmallInverse" | "LargeInverse" - - /** - * If the progress bar will show indeterminate progress. - * Note that this can only be false if styleAttr is Horizontal. - */ - indeterminate?: boolean - - /** - * The progress value (between 0 and 1). - */ - progress?: number - - /** - * Color of the progress bar. - */ - color?: string - - /** - * Used to locate this view in end-to-end tests. - */ - testID?: string - - ref?: Ref - } - /** - * React component that wraps the Android-only `ProgressBar`. This component is used to indicate - * that the app is loading or there is some activity in the app. - */ - export interface ProgressBarAndroidStatic extends NativeMethodsMixin, React.ClassicComponentClass { - } - - /** - * @see https://facebook.github.io/react-native/docs/progressviewios.html - * @see ProgressViewIOS.ios.js - */ - export interface ProgressViewIOSProperties extends ViewProperties, React.Props { - - /** - * The progress bar style. - */ - progressViewStyle?: "default" | "bar" - - /** - * The progress value (between 0 and 1). - */ - progress?: number - - /** - * The tint color of the progress bar itself. - */ - progressTintColor?: string - - /** - * The tint color of the progress bar track. - */ - trackTintColor?: string - - /** - * A stretchable image to display as the progress bar. - */ - progressImage?: ImageURISource | ImageURISource[] - - /** - * A stretchable image to display behind the progress bar. - */ - trackImage?: ImageURISource | ImageURISource[] - - ref?: Ref - } - export interface ProgressViewIOSStatic extends NativeMethodsMixin, React.ClassicComponentClass { - } - - export interface RefreshControlPropertiesIOS extends ViewProperties, React.Props { - - /** - * The color of the refresh indicator. - */ - tintColor?: string - - /** - * The title displayed under the refresh indicator. - */ - title?: string - - /** - * Title color. - */ - titleColor?: string - - ref?: Ref - } - - export interface RefreshControlPropertiesAndroid extends ViewProperties, React.Props { - - /** - * The colors (at least one) that will be used to draw the refresh indicator. - */ - colors?: string[] - - /** - * Whether the pull to refresh functionality is enabled. - */ - enabled?: boolean - - /** - * The background color of the refresh indicator. - */ - progressBackgroundColor?: string - - /** - * Size of the refresh indicator, see RefreshControl.SIZE. - */ - size?: number - - /** - * Progress view top offset - * @platform android - */ - progressViewOffset?: number - - ref?: Ref - } - - export interface RefreshControlProperties extends RefreshControlPropertiesIOS, RefreshControlPropertiesAndroid, React.Props { - - /** - * Called when the view starts refreshing. - */ - onRefresh?: () => void - - /** - * Whether the view should be indicating an active refresh. - */ - refreshing: boolean - - ref?: Ref - } - - /** - * This component is used inside a ScrollView or ListView to add pull to refresh - * functionality. When the ScrollView is at `scrollY: 0`, swiping down - * triggers an `onRefresh` event. - * - * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true - * in the `onRefresh` function otherwise the refresh indicator will stop immediately. - */ - export interface RefreshControlStatic extends NativeMethodsMixin, React.ClassicComponentClass { - SIZE: Object // Undocumented - } - - export interface RecyclerViewBackedScrollViewProperties extends ScrollViewProperties, React.Props { - ref?: Ref - } - - /** - * Wrapper around android native recycler view. - * - * It simply renders rows passed as children in a separate recycler view cells - * similarly to how `ScrollView` is doing it. Thanks to the fact that it uses - * native `RecyclerView` though, rows that are out of sight are going to be - * automatically detached (similarly on how this would work with - * `removeClippedSubviews = true` on a `ScrollView.js`). - * - * CAUTION: This is an experimental component and should only be used together - * with javascript implementation of list view (see ListView.js). In order to - * use it pass this component as `renderScrollComponent` to the list view. For - * now only horizontal scrolling is supported. - */ - export interface RecyclerViewBackedScrollViewStatic extends ScrollResponderMixin, React.ClassicComponentClass { - - /** - * A helper function to scroll to a specific point in the scrollview. - * This is currently used to help focus on child textviews, but can also - * be used to quickly scroll to any element we want to focus. Syntax: - * - * scrollResponderScrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true}) - * - * Note: The weird argument signature is due to the fact that, for historical reasons, - * the function also accepts separate arguments as as alternative to the options object. - * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. - */ - scrollTo( - y?: number | { x?: number, y?: number, animated?: boolean }, - x?: number, - animated?: boolean - ): void; - - /** - * Returns a reference to the underlying scroll responder, which supports - * operations like `scrollTo`. All ScrollView-like components should - * implement this method so that they can be composed while providing access - * to the underlying scroll responder's methods. - */ - getScrollResponder(): JSX.Element; - } - - export interface SliderPropertiesIOS extends ViewProperties, React.Props { - - /** - * Assigns a maximum track image. Only static images are supported. - * The leftmost pixel of the image will be stretched to fill the track. - */ - maximumTrackImage?: ImageURISource - - /** - * The color used for the track to the right of the button. - * Overrides the default blue gradient image. - */ - maximumTrackTintColor?: string - - /** - * Assigns a minimum track image. Only static images are supported. - * The rightmost pixel of the image will be stretched to fill the track. - */ - minimumTrackImage?: ImageURISource - - /** - * The color used for the track to the left of the button. - * Overrides the default blue gradient image. - */ - minimumTrackTintColor?: string - - /** - * Sets an image for the thumb. Only static images are supported. - */ - thumbImage?: ImageURISource - - /** - * Assigns a single image for the track. Only static images - * are supported. The center pixel of the image will be stretched - * to fill the track. - */ - trackImage?: ImageURISource - - ref?: Ref - } - - export interface SliderProperties extends SliderPropertiesIOS, React.Props { - - /** - * If true the user won't be able to move the slider. - * Default value is false. - */ - disabled?: boolean - - /** - * Initial maximum value of the slider. Default value is 1. - */ - maximumValue?: number - - /** - * Initial minimum value of the slider. Default value is 0. - */ - minimumValue?: number - - /** - * Callback called when the user finishes changing the value (e.g. when the slider is released). - * @param value - */ - onSlidingComplete?: (value: number) => void - - /** - * Callback continuously called while the user is dragging the slider. - * @param value - */ - onValueChange?: (value: number) => void - - /** - * Step value of the slider. The value should be between 0 and (maximumValue - minimumValue). Default value is 0. - */ - step?: number - - /** - * Used to style and layout the Slider. See StyleSheet.js and ViewStylePropTypes.js for more info. - */ - style?: ViewStyle - - /** - * Used to locate this view in UI automation tests. - */ - testID?: string - - /** - * Initial value of the slider. The value should be between minimumValue - * and maximumValue, which default to 0 and 1 respectively. - * Default value is 0. - * This is not a controlled component, you don't need to update - * the value during dragging. - */ - value?: number - } - - /** - * A component used to select a single value from a range of values. - */ - export interface SliderStatic extends NativeMethodsMixin, React.ClassicComponentClass { - - } - - /** - * https://facebook.github.io/react-native/docs/switchios.html#props - */ - export interface SwitchIOSProperties extends ViewProperties, React.Props { - - /** - * If true the user won't be able to toggle the switch. Default value is false. - */ - disabled?: boolean - - /** - * Background color when the switch is turned on. - */ - onTintColor?: string - - /** - * Callback that is called when the user toggles the switch. - */ - onValueChange?: (value: boolean) => void - - /** - * Background color for the switch round button. - */ - thumbTintColor?: string - - /** - * Background color when the switch is turned off. - */ - tintColor?: string - - /** - * The value of the switch, if true the switch will be turned on. Default value is false. - */ - value?: boolean - - ref?: Ref - } - - /** - * - * Use SwitchIOS to render a boolean input on iOS. - * - * This is a controlled component, so you must hook in to the onValueChange callback and update the value prop in order for the component to update, - * otherwise the user's change will be reverted immediately to reflect props.value as the source of truth. - * - * @see https://facebook.github.io/react-native/docs/switchios.html - */ - export interface SwitchIOSStatic extends React.ComponentClass { - - } - - export type ImageResizeMode = "contain" | "cover" | "stretch" | "center" | "repeat" - - /** - * @see ImageResizeMode.js - */ - export interface ImageResizeModeStatic { - /** - * contain - The image will be resized such that it will be completely - * visible, contained within the frame of the View. - */ - contain: ImageResizeMode - /** - * cover - The image will be resized such that the entire area of the view - * is covered by the image, potentially clipping parts of the image. - */ - cover: ImageResizeMode - /** - * stretch - The image will be stretched to fill the entire frame of the - * view without clipping. This may change the aspect ratio of the image, - * distoring it. Only supported on iOS. - */ - stretch: ImageResizeMode - /** - * center - The image will be scaled down such that it is completely visible, - * if bigger than the area of the view. - * The image will not be scaled up. - */ - center: ImageResizeMode, - - /** - * repeat - The image will be repeated to cover the frame of the View. The - * image will keep it's size and aspect ratio. - */ - repeat: ImageResizeMode, - } - - export interface ShadowStyleIOS { - shadowColor?: string - shadowOffset?: {width: number, height: number} - shadowOpacity?: number - shadowRadius?: number - } - - /** - * Image style - * @see https://facebook.github.io/react-native/docs/image.html#style - */ - export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS { - resizeMode?: ImageResizeMode - backfaceVisibility?: "visible" | "hidden" - borderBottomLeftRadius?: number - borderBottomRightRadius?: number - backgroundColor?: string - borderColor?: string - borderWidth?: number - borderRadius?: number - borderTopLeftRadius?: number - borderTopRightRadius?: number - overflow?: "visible" | "hidden" - overlayColor?: string - tintColor?: string - opacity?: number - } - - export interface ImagePropertiesIOS { - /** - * The text that's read by the screen reader when the user interacts with the image. - */ - accessibilityLabel?: string; - - /** - * When true, indicates the image is an accessibility element. - */ - accessible?: boolean; - - /** - * blurRadius: the blur radius of the blur filter added to the image - * @platform ios - */ - blurRadius?: number, - - /** - * When the image is resized, the corners of the size specified by capInsets will stay a fixed size, - * but the center content and borders of the image will be stretched. - * This is useful for creating resizable rounded buttons, shadows, and other resizable assets. - * More info on Apple documentation - */ - capInsets?: Insets - - /** - * A static image to display while downloading the final image off the network. - */ - defaultSource?: ImageURISource | number - - /** - * Invoked on load error with {nativeEvent: {error}} - */ - onError?: (error: { nativeEvent: any }) => void - - /** - * Invoked on download progress with {nativeEvent: {loaded, total}} - */ - onProgress?: () => void - - /** - * Invoked when a partial load of the image is complete. The definition of - * what constitutes a "partial load" is loader specific though this is meant - * for progressive JPEG loads. - * @platform ios - */ - onPartialLoad?: () => void, - } - - /* - * @see https://github.com/facebook/react-native/blob/master/Libraries/Image/ImageSourcePropType.js - */ - interface ImageURISource { - /** - * `uri` is a string representing the resource identifier for the image, which - * could be an http address, a local file path, or the name of a static image - * resource (which should be wrapped in the `require('./path/to/image.png')` - * function). - */ - uri?: string, - /** - * `bundle` is the iOS asset bundle which the image is included in. This - * will default to [NSBundle mainBundle] if not set. - * @platform ios - */ - bundle?: string, - /** - * `method` is the HTTP Method to use. Defaults to GET if not specified. - */ - method?: string, - /** - * `headers` is an object representing the HTTP headers to send along with the - * request for a remote image. - */ - headers?: {[key: string]: string}, - /** - * `body` is the HTTP body to send with the request. This must be a valid - * UTF-8 string, and will be sent exactly as specified, with no - * additional encoding (e.g. URL-escaping or base64) applied. - */ - body?: string, - /** - * `width` and `height` can be specified if known at build time, in which case - * these will be used to set the default `` component dimensions. - */ - width?: number, - height?: number, - /** - * `scale` is used to indicate the scale factor of the image. Defaults to 1.0 if - * unspecified, meaning that one image pixel equates to one display point / DIP. - */ - scale?: number, - } - - /** - * @see https://facebook.github.io/react-native/docs/image.html - */ - export interface ImageProperties extends ImagePropertiesIOS, React.Props { - fadeDuration?: number - /** - * onLayout function - * - * Invoked on mount and layout changes with - * - * {nativeEvent: { layout: {x, y, width, height}}}. - */ - onLayout?: (event: LayoutChangeEvent) => void; - - /** - * Invoked when load completes successfully - */ - onLoad?: () => void - - /** - * Invoked when load either succeeds or fails - */ - onLoadEnd?: () => void - - /** - * Invoked on load start - */ - onLoadStart?: () => void - - progressiveRenderingEnabled?: boolean - - /** - * Determines how to resize the image when the frame doesn't match the raw - * image dimensions. - * - * 'cover': Scale the image uniformly (maintain the image's aspect ratio) - * so that both dimensions (width and height) of the image will be equal - * to or larger than the corresponding dimension of the view (minus padding). - * - * 'contain': Scale the image uniformly (maintain the image's aspect ratio) - * so that both dimensions (width and height) of the image will be equal to - * or less than the corresponding dimension of the view (minus padding). - * - * 'stretch': Scale width and height independently, This may change the - * aspect ratio of the src. - * - * 'center': Scale the image down so that it is completely visible, - * if bigger than the area of the view. - * The image will not be scaled up. - */ - resizeMode?: 'cover' |'contain' |'stretch' |'center' - - /** - * The mechanism that should be used to resize the image when the image's dimensions - * differ from the image view's dimensions. Defaults to `auto`. - * - * - `auto`: Use heuristics to pick between `resize` and `scale`. - * - * - `resize`: A software operation which changes the encoded image in memory before it - * gets decoded. This should be used instead of `scale` when the image is much larger - * than the view. - * - * - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is - * faster (usually hardware accelerated) and produces higher quality images. This - * should be used if the image is smaller than the view. It should also be used if the - * image is slightly bigger than the view. - * - * More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html. - * - * @platform android - */ - resizeMethod?: 'auto' | 'resize' | 'scale' - - /** - * `uri` is a string representing the resource identifier for the image, which - * could be an http address, a local file path, or a static image - * resource (which should be wrapped in the `require('./path/to/image.png')` function). - * This prop can also contain several remote `uri`, specified together with - * their width and height. The native side will then choose the best `uri` to display - * based on the measured size of the image container. - */ - source: ImageURISource | ImageURISource[] - - /** - * similarly to `source`, this property represents the resource used to render - * the loading indicator for the image, displayed until image is ready to be - * displayed, typically after when it got downloaded from network. - */ - loadingIndicatorSource?: ImageURISource; - - /** - * - * Style - */ - style?: ImageStyle; - - /** - * A unique identifier for this element to be used in UI Automation testing scripts. - */ - testID?: string; - - } - - export interface ImageStatic extends React.NativeMethodsMixin, React.ComponentClass { - resizeMode: ImageResizeMode - getSize(uri: string, success: (width: number, height: number) => void, failure: (error: any) => void): any - prefetch(url: string): any - abortPrefetch?(requestId: number): void - queryCache?(urls: string[]): Promise> - } - - /** - * @see https://facebook.github.io/react-native/docs/listview.html#props - */ - export interface ListViewProperties extends ScrollViewProperties, React.Props { - - /** - * An instance of [ListView.DataSource](docs/listviewdatasource.html) to use - */ - dataSource: ListViewDataSource - - /** - * Flag indicating whether empty section headers should be rendered. - * In the future release empty section headers will be rendered by - * default, and the flag will be deprecated. If empty sections are not - * desired to be rendered their indices should be excluded from - * sectionID object. - */ - enableEmptySections?: boolean - - /** - * How many rows to render on initial component mount. Use this to make - * it so that the first screen worth of data apears at one time instead of - * over the course of multiple frames. - */ - initialListSize?: number - - /** - * (visibleRows, changedRows) => void - * - * Called when the set of visible rows changes. `visibleRows` maps - * { sectionID: { rowID: true }} for all the visible rows, and - * `changedRows` maps { sectionID: { rowID: true | false }} for the rows - * that have changed their visibility, with true indicating visible, and - * false indicating the view has moved out of view. - */ - onChangeVisibleRows?: (visibleRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>, changedRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>) => void - - /** - * Called when all rows have been rendered and the list has been scrolled - * to within onEndReachedThreshold of the bottom. The native scroll - * event is provided. - */ - onEndReached?: () => void - - /** - * Threshold in pixels for onEndReached. - */ - onEndReachedThreshold?: number - - /** - * Number of rows to render per event loop. - */ - pageSize?: number - - /** - * A performance optimization for improving scroll perf of - * large lists, used in conjunction with overflow: 'hidden' on the row - * containers. Use at your own risk. - */ - removeClippedSubviews?: boolean - - /** - * () => renderable - * - * The header and footer are always rendered (if these props are provided) - * on every render pass. If they are expensive to re-render, wrap them - * in StaticContainer or other mechanism as appropriate. Footer is always - * at the bottom of the list, and header at the top, on every render pass. - */ - renderFooter?: () => React.ReactElement - - /** - * () => renderable - * - * The header and footer are always rendered (if these props are provided) - * on every render pass. If they are expensive to re-render, wrap them - * in StaticContainer or other mechanism as appropriate. Footer is always - * at the bottom of the list, and header at the top, on every render pass. - */ - renderHeader?: () => React.ReactElement - - /** - * (rowData, sectionID, rowID) => renderable - * Takes a data entry from the data source and its ids and should return - * a renderable component to be rendered as the row. By default the data - * is exactly what was put into the data source, but it's also possible to - * provide custom extractors. - */ - renderRow: ( rowData: any, sectionID: string | number, rowID: string | number, highlightRow?: boolean ) => React.ReactElement - - - /** - * A function that returns the scrollable component in which the list rows are rendered. - * Defaults to returning a ScrollView with the given props. - */ - renderScrollComponent?: (props: ScrollViewProperties) => React.ReactElement - - /** - * (sectionData, sectionID) => renderable - * - * If provided, a sticky header is rendered for this section. The sticky - * behavior means that it will scroll with the content at the top of the - * section until it reaches the top of the screen, at which point it will - * stick to the top until it is pushed off the screen by the next section - * header. - */ - renderSectionHeader?: (sectionData: any, sectionId: string | number) => React.ReactElement - - - /** - * (sectionID, rowID, adjacentRowHighlighted) => renderable - * If provided, a renderable component to be rendered as the separator below each row - * but not the last row if there is a section header below. - * Take a sectionID and rowID of the row above and whether its adjacent row is highlighted. - */ - renderSeparator?: (sectionID: string | number, rowID: string | number, adjacentRowHighlighted?: boolean) => React.ReactElement - - /** - * How early to start rendering rows before they come on screen, in - * pixels. - */ - scrollRenderAheadDistance?: number - - /** - * An array of child indices determining which children get docked to the - * top of the screen when scrolling. For example, passing - * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the - * top of the scroll view. This property is not supported in conjunction - * with `horizontal={true}`. - * @platform ios - */ - stickyHeaderIndices?: number[] - - ref?: Ref - } - - - interface TimerMixin { - setTimeout: typeof setTimeout, - clearTimeout: typeof clearTimeout, - setInterval: typeof setInterval, - clearInterval: typeof clearInterval, - setImmediate: typeof setImmediate, - clearImmediate: typeof clearImmediate, - requestAnimationFrame: typeof requestAnimationFrame, - cancelAnimationFrame: typeof cancelAnimationFrame, - } - - export interface ListViewStatic extends ScrollResponderMixin, TimerMixin, React.ComponentClass { - DataSource: ListViewDataSource; - - /** - * Exports some data, e.g. for perf investigations or analytics. - */ - getMetrics: () => { - contentLength: number, - totalRows: number, - renderedRows: number, - visibleRows: number, - } - - /** - * Provides a handle to the underlying scroll responder. - */ - getScrollResponder: () => any, - - /** - * Scrolls to a given x, y offset, either immediately or with a smooth animation. - * - * See `ScrollView#scrollTo`. - */ - scrollTo: ( y?: number | { x?: number, y?: number, animated?: boolean } , x?: number, animated?: boolean ) => void, - } - - - export interface MapViewAnnotation { - latitude: number - longitude: number - animateDrop?: boolean - draggable?: boolean - onDragStateChange?: () => any, - onFocus?: () => any, - onBlur?: () => any, - title?: string - subtitle?: string - leftCalloutView?: ReactElement - rightCalloutView?: ReactElement - detailCalloutView?: ReactElement - tintColor?: string - image?: ImageURISource - view?: ReactElement - hasLeftCallout?: boolean - hasRightCallout?: boolean - onLeftCalloutPress?: () => void - onRightCalloutPress?: () => void - id?: string - } - - export interface MapViewRegion { - latitude: number - longitude: number - latitudeDelta?: number - longitudeDelta?: number - } - - export interface MapViewOverlay { - coordinates: ({ latitude: number, longitude: number })[] - lineWidth?: number - strokeColor?: string - fillColor?: string - id?: string - } - - export interface MapViewProperties extends ViewProperties, React.Props { - - /** - * If false points of interest won't be displayed on the map. - * Default value is true. - */ - showsPointsOfInterest?: boolean - - /** - * Map annotations with title/subtitle. - */ - annotations?: MapViewAnnotation[] - - /** - * If true the map will follow the user's location whenever it changes. - * Note that this has no effect unless showsUserLocation is enabled. - * Default value is true. - */ - followUserLocation?: boolean - - /** - * Insets for the map's legal label, originally at bottom left of the map. See EdgeInsetsPropType.js for more information. - */ - legalLabelInsets?: Insets - - /** - * The map type to be displayed. - * standard: standard road map (default) - * satellite: satellite view - * hybrid: satellite view with roads and points of interest overlayed - * - * enum('standard', 'satellite', 'hybrid') - */ - mapType?: 'standard' |'satellite' |'hybrid' - - /** - * Maximum size of area that can be displayed. - */ - maxDelta?: number - - /** - * Minimum size of area that can be displayed. - */ - minDelta?: number - - /** - * Map overlays - */ - overlays?: MapViewOverlay[] - - /** - * If false compass won't be displayed on the map. - * Default value is true. - */ - showsCompass?: boolean - - /** - * Callback that is called once, when the user taps an annotation. - */ - onAnnotationPress?: () => void - - /** - * Callback that is called continuously when the user is dragging the map. - */ - onRegionChange?: (region: MapViewRegion) => void - - /** - * Callback that is called once, when the user is done moving the map. - */ - onRegionChangeComplete?: (region: MapViewRegion) => void - - /** - * When this property is set to true and a valid camera is associated with the map, - * the camera’s pitch angle is used to tilt the plane of the map. - * - * When this property is set to false, the camera’s pitch angle is ignored and - * the map is always displayed as if the user is looking straight down onto it. - */ - pitchEnabled?: boolean - - /** - * The region to be displayed by the map. - * The region is defined by the center coordinates and the span of coordinates to display. - */ - region?: MapViewRegion - - /** - * When this property is set to true and a valid camera is associated with the map, - * the camera’s heading angle is used to rotate the plane of the map around its center point. - * - * When this property is set to false, the camera’s heading angle is ignored and the map is always oriented - * so that true north is situated at the top of the map view - */ - rotateEnabled?: boolean - - /** - * If false the user won't be able to change the map region being displayed. - * Default value is true. - */ - scrollEnabled?: boolean - - /** - * If true the app will ask for the user's location and focus on it. - * Default value is false. - * - * NOTE: You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, - * otherwise it is going to fail silently! - */ - showsUserLocation?: boolean - - /** - * Used to style and layout the MapView. - * See StyleSheet.js and ViewStylePropTypes.js for more info. - */ - style?: ViewStyle - - /** - * If false the user won't be able to pinch/zoom the map. - * Default value is true. - */ - zoomEnabled?: boolean - - ref?: Ref - } - - /** - * @see https://facebook.github.io/react-native/docs/mapview.html#content - */ - export interface MapViewStatic extends React.NativeMethodsMixin, React.ComponentClass { - PinColors: { - RED: string, - GREEN: string, - PURPLE: string - } - } - - export interface ModalProperties extends React.Props { - - // Only `animated` is documented. The JS code says `animated` is - // deprecated and `animationType` is preferred. - animated?: boolean - /** - * The `animationType` prop controls how the modal animates. - * - * - `slide` slides in from the bottom - * - `fade` fades into view - * - `none` appears without an animation - */ - animationType?: "none" | "slide" | "fade" - /** - * The `transparent` prop determines whether your modal will fill the entire view. - * Setting this to `true` will render the modal over a transparent background. - */ - transparent?: boolean - /** - * The `visible` prop determines whether your modal is visible. - */ - visible?: boolean - /** - * The `onRequestClose` prop allows passing a function that will be called once the modal has been dismissed. - * _On the Android platform, this is a required function._ - */ - onRequestClose?: () => void - /** - * The `onShow` prop allows passing a function that will be called once the modal has been shown. - */ - onShow?: (event: NativeSyntheticEvent) => void - /** - * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations. - * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field. - * @platform ios - */ - supportedOrientations?: ('portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right')[] - /** - * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed. - * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation. - * @platform ios - */ - onOrientationChange?: () => void - } - - export interface ModalStatic extends React.ComponentClass { - - } - - /** - * @see https://github.com/facebook/react-native/blob/0.34-stable\Libraries\Components\Touchable\Touchable.js - */ - interface TouchableMixin { - - /** - * Invoked when the item should be highlighted. Mixers should implement this - * to visually distinguish the `VisualRect` so that the user knows that - * releasing a touch will result in a "selection" (analog to click). - */ - touchableHandleActivePressIn(e: Event): void - - /** - * Invoked when the item is "active" (in that it is still eligible to become - * a "select") but the touch has left the `PressRect`. Usually the mixer will - * want to unhighlight the `VisualRect`. If the user (while pressing) moves - * back into the `PressRect` `touchableHandleActivePressIn` will be invoked - * again and the mixer should probably highlight the `VisualRect` again. This - * event will not fire on an `touchEnd/mouseUp` event, only move events while - * the user is depressing the mouse/touch. - */ - touchableHandleActivePressOut(e: Event): void - - /** - * Invoked when the item is "selected" - meaning the interaction ended by - * letting up while the item was either in the state - * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`. - */ - touchableHandlePress(e: Event): void - - /** - * Invoked when the item is long pressed - meaning the interaction ended by - * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If - * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will - * be called as it normally is. If `touchableHandleLongPress` is provided, by - * default any `touchableHandlePress` callback will not be invoked. To - * override this default behavior, override `touchableLongPressCancelsPress` - * to return false. As a result, `touchableHandlePress` will be called when - * lifting up, even if `touchableHandleLongPress` has also been called. - */ - touchableHandleLongPress(e: Event): void - - /** - * Returns the amount to extend the `HitRect` into the `PressRect`. Positive - * numbers mean the size expands outwards. - */ - touchableGetPressRectOffset(): Insets - - /** - * Returns the number of millis to wait before triggering a highlight. - */ - touchableGetHighlightDelayMS(): number - - // These methods are undocumented but still being used by TouchableMixin internals - touchableGetLongPressDelayMS(): number - touchableGetPressOutDelayMS(): number - touchableGetHitSlop(): Insets - } - - export interface TouchableWithoutFeedbackAndroidProperties { - - /** - * Indicates to accessibility services to treat UI component like a native one. - * Works for Android only. - * - * @enum('none', 'button', 'radiobutton_checked', 'radiobutton_unchecked' ) - */ - accessibilityComponentType?: 'none' | 'button' | 'radiobutton_checked' | 'radiobutton_unchecked' - } - - type ViewAccessibilityTraits = 'none' | 'button' | 'link' | 'header' | 'search' | 'image' | 'selected' | 'plays' | 'key' | 'text' | 'summary' | 'disabled' | 'frequentUpdates' | 'startsMedia' | 'adjustable' | 'allowsDirectInteraction' | 'pageTurn' - - export interface TouchableWithoutFeedbackIOSProperties { - - /** - * Provides additional traits to screen reader. - * By default no traits are provided unless specified otherwise in element - * - * @enum('none', 'button', 'link', 'header', 'search', 'image', 'selected', 'plays', 'key', 'text','summary', 'disabled', 'frequentUpdates', 'startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn') - */ - accessibilityTraits?: ViewAccessibilityTraits | ViewAccessibilityTraits[] - - } - - /** - * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#props - */ - export interface TouchableWithoutFeedbackProperties extends TouchableWithoutFeedbackAndroidProperties, TouchableWithoutFeedbackIOSProperties { - - - /** - * Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock). - */ - accessible?: boolean - - /** - * Delay in ms, from onPressIn, before onLongPress is called. - */ - delayLongPress?: number; - - /** - * Delay in ms, from the start of the touch, before onPressIn is called. - */ - delayPressIn?: number; - - /** - * Delay in ms, from the release of the touch, before onPressOut is called. - */ - delayPressOut?: number; - - /** - * If true, disable all interactions for this component. - */ - disabled?: boolean - - /** - * This defines how far your touch can start away from the button. - * This is added to pressRetentionOffset when moving off of the button. - * NOTE The touch area never extends past the parent view bounds and - * the Z-index of sibling views always takes precedence if a touch hits - * two overlapping views. - */ - hitSlop?: Insets - - /** - * Invoked on mount and layout changes with - * {nativeEvent: {layout: {x, y, width, height}}} - */ - onLayout?: (event: LayoutChangeEvent) => void - - onLongPress?: () => void; - - /** - * Called when the touch is released, - * but not if cancelled (e.g. by a scroll that steals the responder lock). - */ - onPress?: () => void; - - onPressIn?: () => void; - - onPressOut?: () => void; - - /** - * //FIXME: not in doc but available in examples - */ - style?: ViewStyle - - /** - * When the scroll view is disabled, this defines how far your - * touch may move off of the button, before deactivating the button. - * Once deactivated, try moving it back and you'll see that the button - * is once again reactivated! Move it back and forth several times - * while the scroll view is disabled. Ensure you pass in a constant - * to reduce memory allocations. - */ - pressRetentionOffset?: Insets - } - - - export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackProperties, React.Props { - - } - - /** - * Do not use unless you have a very good reason. - * All the elements that respond to press should have a visual feedback when touched. - * This is one of the primary reason a "web" app doesn't feel "native". - * - * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html - */ - export interface TouchableWithoutFeedbackStatic extends TimerMixin, TouchableMixin, React.ClassicComponentClass { - - } - - /** - * @see https://facebook.github.io/react-native/docs/touchablehighlight.html#props - */ - export interface TouchableHighlightProperties extends TouchableWithoutFeedbackProperties, React.Props { - - /** - * Determines what the opacity of the wrapped view should be when touch is active. - */ - activeOpacity?: number - - /** - * - * Called immediately after the underlay is hidden - */ - onHideUnderlay?: () => void - - /** - * Called immediately after the underlay is shown - */ - onShowUnderlay?: () => void - - /** - * @see https://facebook.github.io/react-native/docs/view.html#style - */ - style?: ViewStyle - - - /** - * The color of the underlay that will show through when the touch is active. - */ - underlayColor?: string - } - - /** - * A wrapper for making views respond properly to touches. - * On press down, the opacity of the wrapped view is decreased, - * which allows the underlay color to show through, darkening or tinting the view. - * The underlay comes from adding a view to the view hierarchy, - * which can sometimes cause unwanted visual artifacts if not used correctly, - * for example if the backgroundColor of the wrapped view isn't explicitly set to an opaque color. - * - * NOTE: TouchableHighlight supports only one child - * If you wish to have several child components, wrap them in a View. - * - * @see https://facebook.github.io/react-native/docs/touchablehighlight.html - */ - export interface TouchableHighlightStatic extends NativeMethodsMixin, TimerMixin, TouchableMixin, React.ClassicComponentClass { - } - - - /** - * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props - */ - export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProperties, React.Props { - /** - * Determines what the opacity of the wrapped view should be when touch is active. - * Defaults to 0.2 - */ - activeOpacity?: number - } - - /** - * A wrapper for making views respond properly to touches. - * On press down, the opacity of the wrapped view is decreased, dimming it. - * This is done without actually changing the view hierarchy, - * and in general is easy to add to an app without weird side-effects. - * - * @see https://facebook.github.io/react-native/docs/touchableopacity.html - */ - export interface TouchableOpacityStatic extends TimerMixin, TouchableMixin, NativeMethodsMixin, React.ClassicComponentClass { - /** - * Animate the touchable to a new opacity. - */ - setOpacityTo: (value: number) => void - } - - interface BaseBackgroundPropType { - type: string - } - - interface RippleBackgroundPropType extends BaseBackgroundPropType { - type: 'RippleAndroid' - color?: number, - borderless?: boolean - } - - interface ThemeAttributeBackgroundPropType extends BaseBackgroundPropType { - type: 'ThemeAttrAndroid' - attribute: string - } - - type BackgroundPropType = RippleBackgroundPropType | ThemeAttributeBackgroundPropType - - /** - * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props - */ - export interface TouchableNativeFeedbackProperties extends TouchableWithoutFeedbackProperties, React.Props { - /** - * Determines the type of background drawable that's going to be used to display feedback. - * It takes an object with type property and extra data depending on the type. - * It's recommended to use one of the following static methods to generate that dictionary: - * 1) TouchableNativeFeedback.SelectableBackground() - will create object that represents android theme's default background for selectable elements (?android:attr/selectableItemBackground) - * 2) TouchableNativeFeedback.SelectableBackgroundBorderless() - will create object that represent android theme's default background for borderless selectable elements (?android:attr/selectableItemBackgroundBorderless). Available on android API level 21+ - * 3) TouchableNativeFeedback.Ripple(color, borderless) - will create object that represents ripple drawable with specified color (as a string). If property borderless evaluates to true the ripple will render outside of the view bounds (see native actionbar buttons as an example of that behavior). This background type is available on Android API level 21+ - */ - background?: BackgroundPropType - } - - /** - * A wrapper for making views respond properly to touches (Android only). - * On Android this component uses native state drawable to display touch feedback. - * At the moment it only supports having a single View instance as a child node, - * as it's implemented by replacing that View with another instance of RCTView node with some additional properties set. - * - * Background drawable of native feedback touchable can be customized with background property. - * - * @see https://facebook.github.io/react-native/docs/touchablenativefeedback.html#content - */ - export interface TouchableNativeFeedbackStatic extends TouchableMixin, React.ClassicComponentClass { - - /** - * Creates an object that represents android theme's default background for - * selectable elements (?android:attr/selectableItemBackground). - */ - SelectableBackground(): ThemeAttributeBackgroundPropType - - /** - * Creates an object that represent android theme's default background for borderless - * selectable elements (?android:attr/selectableItemBackgroundBorderless). - * Available on android API level 21+. - */ - SelectableBackgroundBorderless(): ThemeAttributeBackgroundPropType - - /** - * Creates an object that represents ripple drawable with specified color (as a - * string). If property `borderless` evaluates to true the ripple will - * render outside of the view bounds (see native actionbar buttons as an - * example of that behavior). This background type is available on Android - * API level 21+. - * - * @param color The ripple color - * @param borderless If the ripple can render outside it's bounds - */ - Ripple( color: string, borderless?: boolean ): RippleBackgroundPropType - } - - - export interface LeftToRightGesture { - // If the gesture can end and restart during one continuous touch - isDetachable: boolean; - // How far the swipe must drag to start transitioning - gestureDetectMovement: number; - // Amplitude of release velocity that is considered still - notMoving: number; - // Fraction of directional move required. - directionRatio: number; - // Velocity to transition with when the gesture release was "not moving" - snapVelocity: number; - // Region that can trigger swipe. iOS default is 30px from the left edge - edgeHitWidth: number; - // Ratio of gesture completion when non-velocity release will cause action - stillCompletionRatio: number; - fullDistance: any; - direction: string; - } - - export interface JumpGesture extends LeftToRightGesture{ - overswipe: { - frictionConstant: number - frictionByDistance: number - } - } - - // see /NavigatorSceneConfigs.js - export interface SceneConfig { - // A list of all gestures that are enabled on this scene - gestures?: { - pop?: LeftToRightGesture, - }, - - // Rebound spring parameters when transitioning FROM this scene - springFriction: number; - springTension: number; - - // Velocity to start at when transitioning without gesture - defaultTransitionVelocity: number; - - // Animation interpolators for horizontal transitioning: - animationInterpolators: { - into: () => boolean, - out: () => boolean - }; - } - - export interface JumpSceneConfig extends SceneConfig { - gestures: { - jumpBack: JumpGesture - jumpForward: JumpGesture - } - } - - // see /NavigatorSceneConfigs.js - export interface SceneConfigs { - PushFromRight: SceneConfig; - PushFromLeft: SceneConfig; - FloatFromRight: SceneConfig; - FloatFromLeft: SceneConfig; - FloatFromBottom: SceneConfig; - FloatFromBottomAndroid: SceneConfig; - FadeAndroid: SceneConfig; - HorizontalSwipeJump: SceneConfig; - HorizontalSwipeJumpFromRight: SceneConfig; - VerticalUpSwipeJump: SceneConfig; - VerticalDownSwipeJump: SceneConfig; - } - - export interface Route { - component?: React.ComponentClass - id?: string - title?: string - passProps?: Object; - - //anything else - [key: string]: any - - //Commonly found properties - backButtonTitle?: string - content?: string - message?: string; - index?: number - onRightButtonPress?: () => void - rightButtonTitle?: string - sceneConfig?: SceneConfig - wrapperStyle?: any - } - - - /** - * @see https://facebook.github.io/react-native/docs/navigator.html#content - */ - export interface NavigatorProperties extends React.Props { - /** - * Optional function that allows configuration about scene animations and gestures. - * Will be invoked with `route` and `routeStack` parameters, where `route` - * corresponds to the current scene being rendered by the `Navigator` and - * `routeStack` is the set of currently mounted routes that the navigator - * could transition to. The function should return a scene configuration object. - * @param route - * @param routeStack - */ - configureScene?: (route: Route, routeStack: Route[]) => SceneConfig - /** - * Specify a route to start on. - * A route is an object that the navigator will use to identify each scene to render. - * initialRoute must be a route in the initialRouteStack if both props are provided. - * The initialRoute will default to the last item in the initialRouteStack. - */ - initialRoute?: Route - /** - * Provide a set of routes to initially mount. - * Required if no initialRoute is provided. - * Otherwise, it will default to an array containing only the initialRoute - */ - initialRouteStack?: Route[] - - /** - * Optionally provide a navigation bar that persists across scene transitions - */ - navigationBar?: React.ReactElement - - /** - * Optionally provide the navigator object from a parent Navigator - */ - navigator?: Navigator - - /** - * @deprecated Use navigationContext.addListener('willfocus', callback) instead. - */ - onDidFocus?: Function - - /** - * @deprecated Use navigationContext.addListener('willfocus', callback) instead. - */ - onWillFocus?: Function - - /** - * Required function which renders the scene for a given route. - * Will be invoked with the route and the navigator object - * @param route - * @param navigator - */ - renderScene: ( route: Route, navigator: Navigator ) => React.ReactElement - - /** - * Styles to apply to the container of each scene - */ - sceneStyle?: ViewStyle - - } - - /** - * Class that contains the info and methods for app navigation. - */ - export interface NavigationContext { - parent: NavigationContext; - top: NavigationContext; - currentRoute: any; - appendChild(childContext: NavigationContext): void; - addListener(eventType: string, listener: () => void, useCapture?: boolean): NativeEventSubscription; - emit(eventType: string, data: any, didEmitCallback?: () => void): void; - dispose(): void; - } - - interface InteractionMixin { - createInteractionHandle(): number - clearInteractionHandle(clearHandle: number): void - /** - * Schedule work for after all interactions have completed. - * - * @param {function} callback - */ - runAfterInteractions(callback: () => any): void - } - - interface SubscribableMixin { - /** - * Special form of calling `addListener` that *guarantees* that a - * subscription *must* be tied to a component instance, and therefore will - * be cleaned up when the component is unmounted. It is impossible to create - * the subscription and pass it in - this method must be the one to create - * the subscription and therefore can guarantee it is retained in a way that - * will be cleaned up. - * - * @param {EventEmitter} eventEmitter emitter to subscribe to. - * @param {string} eventType Type of event to listen to. - * @param {function} listener Function to invoke when event occurs. - * @param {object} context Object to use as listener context. - */ - addListenerOn( eventEmitter: any, eventType: string, listener: () => any, context: any ): void - } - - /** - * Use Navigator to transition between different scenes in your app. - * To accomplish this, provide route objects to the navigator to identify each scene, - * and also a renderScene function that the navigator can use to render the scene for a given route. - * - * To change the animation or gesture properties of the scene, provide a configureScene prop to get the config object for a given route. - * See Navigator.SceneConfigs for default animations and more info on scene config options. - * @see https://facebook.github.io/react-native/docs/navigator.html - */ - export interface NavigatorStatic extends TimerMixin, InteractionMixin, SubscribableMixin, React.ComponentClass { - SceneConfigs: SceneConfigs; - NavigationBar: NavigatorStatic.NavigationBarStatic; - BreadcrumbNavigationBar: NavigatorStatic.BreadcrumbNavigationBarStatic; - - navigationContext: NavigationContext; - - /** - * returns the current list of routes - */ - getCurrentRoutes(): Route[]; - - /** - * Jump backward without unmounting the current scen - */ - jumpBack(): void; - - /** - * Jump forward to the next scene in the route stack - */ - jumpForward(): void; - - /** - * Transition to an existing scene without unmounting - */ - jumpTo(route: Route): void; - - /** - * Navigate forward to a new scene, squashing any scenes that you could jumpForward to - */ - push(route: Route): void; - - /** - * Transition back and unmount the current scene - */ - pop(): void; - - /** - * Go back N scenes at once. When N=1, behavior matches `pop()`. - * When N is invalid(negative or bigger than current routes count), do nothing. - * @param {number} n The number of scenes to pop. Should be an integer. - */ - popN(n: number): void - - /** - * Replace the current scene with a new route - */ - replace(route: Route): void; - - /** - * Replace a scene as specified by an index - */ - replaceAtIndex(route: Route, index: number): void; - - /** - * Replace the previous scene - */ - replacePrevious(route: Route): void; - - /** - * Reset every scene with an array of routes - */ - immediatelyResetRouteStack(routes: Route[]): void; - - /** - * Pop to a particular scene, as specified by its route. All scenes after it will be unmounted - */ - popToRoute(route: Route): void; - - /** - * Pop to the first scene in the stack, unmounting every other scene - */ - popToTop(): void; - - /** - * Replace the previous scene and pop to it. - */ - replacePreviousAndPop( route: Route ): void; - - /** - * Navigate to a new scene and reset route stack. - */ - resetTo( route: Route ): void; - - } - - namespace NavigatorStatic { - - - export interface NavState { - routeStack: Route[] - presentedIndex: number - } - - // @see NavigationBarStyle.ios.js - export interface NavigationBarStyle { - General: { - NavBarHeight: number - StatusBarHeight: number - TotalNavHeight: number - }, - Interpolators: { - // Animating *into* the center stage from the right - RightToCenter: () => boolean - // Animating out of the center stage, to the left - CenterToLeft: () => boolean - // Both stages (animating *past* the center stage) - RightToLeft: () => boolean - }, - Stages: { - Left: { - Title: FlexStyle - LeftButton: FlexStyle - RightButton: FlexStyle - }, - Center: { - Title: FlexStyle - LeftButton: FlexStyle - RightButton: FlexStyle - }, - Right: { - Title: FlexStyle - LeftButton: FlexStyle - RightButton: FlexStyle - }, - } - } - - - export interface NavigationBarRouteMapper { - Title: (route: Route, nav: Navigator, index: number, navState: NavState) => JSX.Element | null; - LeftButton: (route: Route, nav: Navigator, index: number, navState: NavState) => JSX.Element | null; - RightButton: (route: Route, nav: Navigator, index: number, navState: NavState) => JSX.Element | null; - } - - /** - * @see NavigatorNavigationBar.js - */ - export interface NavigationBarProperties extends React.Props { - navigator?: Navigator - routeMapper?: NavigationBarRouteMapper - navState?: NavState - navigationStyles?: NavigationBarStyle - style?: ViewStyle - } - - export interface NavigationBarStatic extends React.ComponentClass { - Styles: NavigationBarStyle - StylesAndroid: NavigationBarStyle; - StylesIOS: NavigationBarStyle; - - /** - * Stop transtion, immediately resets the cached state and re-render the - * whole view. - */ - immediatelyRefresh(): void; - } - - export type NavigationBar = NavigationBarStatic - export var NavigationBar: NavigationBarStatic - - - export interface BreadcrumbNavigationBarStyle { - //TODO &see NavigatorBreadcrumbNavigationBar.js - } - - export interface BreadcrumbNavigationBarRouteMapper { - rightContentForRoute: (route: Route, navigator: Navigator) => React.ReactElement - titleContentForRoute: (route: Route, navigator: Navigator) => React.ReactElement - iconForRoute: (route: Route, navigator: Navigator) => React.ReactElement - //in samples... - separatorForRoute: (route: Route, navigator: Navigator) => React.ReactElement - } - - /** - * @see NavigatorNavigationBar.js - */ - export interface BreadcrumbNavigationBarProperties extends React.Props { - navigator?: Navigator - routeMapper?: BreadcrumbNavigationBarRouteMapper - navState?: NavState - style?: ViewStyle - } - - export interface BreadcrumbNavigationBarStatic extends React.ComponentClass { - Styles: BreadcrumbNavigationBarStyle - - immediatelyRefresh(): void - } - - export type BreadcrumbNavigationBar = BreadcrumbNavigationBarStatic - var BreadcrumbNavigationBar: BreadcrumbNavigationBarStatic - - } - - // @see https://github.com/facebook/react-native/blob/0.34-stable\Libraries\StyleSheet\StyleSheetTypes.js - export namespace StyleSheet { - - type Style = ViewStyle | TextStyle | ImageStyle - - /** - * Creates a StyleSheet style reference from the given object. - */ - export function create( styles: T ): T; - - /** - * Flattens an array of style objects, into one aggregated style object. - * Alternatively, this method can be used to lookup IDs, returned by - * StyleSheet.register. - * - * > **NOTE**: Exercise caution as abusing this can tax you in terms of - * > optimizations. - * > - * > IDs enable optimizations through the bridge and memory in general. Refering - * > to style objects directly will deprive you of these optimizations. - * - * Example: - * ``` - * var styles = StyleSheet.create({ - * listItem: { - * flex: 1, - * fontSize: 16, - * color: 'white' - * }, - * selectedListItem: { - * color: 'green' - * } - * }); - * - * StyleSheet.flatten([styles.listItem, styles.selectedListItem]) - * // returns { flex: 1, fontSize: 16, color: 'green' } - * ``` - * Alternative use: - * ``` - * StyleSheet.flatten(styles.listItem); - * // return { flex: 1, fontSize: 16, color: 'white' } - * // Simply styles.listItem would return its ID (number) - * ``` - * This method internally uses `StyleSheetRegistry.getStyleByID(style)` - * to resolve style objects represented by IDs. Thus, an array of style - * objects (instances of StyleSheet.create), are individually resolved to, - * their respective objects, merged as one and then returned. This also explains - * the alternative use. - */ - export function flatten(style?: Style | Style[]): Style - - /** - * This is defined as the width of a thin line on the platform. It can be - * used as the thickness of a border or division between two elements. - * Example: - * ``` - * { - * borderBottomColor: '#bbb', - * borderBottomWidth: StyleSheet.hairlineWidth - * } - * ``` - * - * This constant will always be a round number of pixels (so a line defined - * by it look crisp) and will try to match the standard width of a thin line - * on the underlying platform. However, you should not rely on it being a - * constant size, because on different platforms and screen densities its - * value may be calculated differently. - */ - export var hairlineWidth: number - - /** - * A very common pattern is to create overlays with position absolute and zero positioning, - * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated - * styles. - */ - export var absoluteFill: number - - /** - * Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be - * used to create a customized entry in a `StyleSheet`, e.g.: - * - * const styles = StyleSheet.create({ - * wrapper: { - * ...StyleSheet.absoluteFillObject, - * top: 10, - * backgroundColor: 'transparent', - * }, - * }); - */ - export var absoluteFillObject: { - position: string - left: number - right: number - top: number - bottom: number - } - } - - export interface RelayProfiler { - attachProfileHandler( - name: string, - handler: (name: string, state?: any) => () => void - ): void, - - attachAggregateHandler( - name: string, - handler: (name: string, callback: () => void) => void - ): void, - } - - export interface SystraceStatic { - setEnabled(enabled: boolean): void - /** - * beginEvent/endEvent for starting and then ending a profile within the same call stack frame - **/ - beginEvent(profileName?: any, args?: any): void - endEvent(): void - /** - * beginAsyncEvent/endAsyncEvent for starting and then ending a profile where the end can either - * occur on another thread or out of the current stack frame, eg await - * the returned cookie variable should be used as input into the endAsyncEvent call to end the profile - **/ - beginAsyncEvent(profileName?: any): any - endAsyncEvent(profileName?: any, cookie?: any): void - /** - * counterEvent registers the value to the profileName on the systrace timeline - **/ - counterEvent(profileName?: any, value?: any): void - /** - * Relay profiles use await calls, so likely occur out of current stack frame - * therefore async variant of profiling is used - **/ - attachToRelayProfiler(relayProfiler: RelayProfiler): void - /* This is not called by default due to perf overhead but it's useful - if you want to find traces which spend too much time in JSON. */ - swizzleJSON(): void - /** - * Measures multiple methods of a class. For example, you can do: - * Systrace.measureMethods(JSON, 'JSON', ['parse', 'stringify']); - * - * @param object - * @param objectName - * @param methodNames Map from method names to method display names. - */ - measureMethods(object: any, objectName: string, methodNames: Array): void - /** - * Returns an profiled version of the input function. For example, you can: - * JSON.parse = Systrace.measure('JSON', 'parse', JSON.parse); - * - * @param objName - * @param fnName - * @param {function} func - * @return {function} replacement function - */ - measure(objName: string, fnName: string, func: Function): Function - } - - /** - * //FIXME: Could not find docs. Inferred from examples and jscode : ListViewDataSource.js - */ - export interface DataSourceAssetCallback { - rowHasChanged?: (r1: any, r2: any) => boolean - sectionHeaderHasChanged?: (h1: any, h2: any) => boolean - getRowData?: (dataBlob: any, sectionID: number | string, rowID: number | string) => T - getSectionHeaderData?: (dataBlob: any, sectionID: number | string) => T - } - - /** - * Provides efficient data processing and access to the - * `ListView` component. A `ListViewDataSource` is created with functions for - * extracting data from the input blob, and comparing elements (with default - * implementations for convenience). The input blob can be as simple as an - * array of strings, or an object with rows nested inside section objects. - * - * To update the data in the datasource, use `cloneWithRows` (or - * `cloneWithRowsAndSections` if you care about sections). The data in the - * data source is immutable, so you can't modify it directly. The clone methods - * suck in the new data and compute a diff for each row so ListView knows - * whether to re-render it or not. - */ - export interface ListViewDataSource { - /** - * You can provide custom extraction and `hasChanged` functions for section - * headers and rows. If absent, data will be extracted with the - * `defaultGetRowData` and `defaultGetSectionHeaderData` functions. - * - * The default extractor expects data of one of the following forms: - * - * { sectionID_1: { rowID_1: , ... }, ... } - * - * or - * - * { sectionID_1: [ , , ... ], ... } - * - * or - * - * [ [ , , ... ], ... ] - * - * The constructor takes in a params argument that can contain any of the - * following: - * - * - getRowData(dataBlob, sectionID, rowID); - * - getSectionHeaderData(dataBlob, sectionID); - * - rowHasChanged(prevRowData, nextRowData); - * - sectionHeaderHasChanged(prevSectionData, nextSectionData); - */ - new (onAsset: DataSourceAssetCallback): ListViewDataSource; - - /** - * Clones this `ListViewDataSource` with the specified `dataBlob` and - * `rowIdentities`. The `dataBlob` is just an aribitrary blob of data. At - * construction an extractor to get the interesting informatoin was defined - * (or the default was used). - * - * The `rowIdentities` is is a 2D array of identifiers for rows. - * ie. [['a1', 'a2'], ['b1', 'b2', 'b3'], ...]. If not provided, it's - * assumed that the keys of the section data are the row identities. - * - * Note: This function does NOT clone the data in this data source. It simply - * passes the functions defined at construction to a new data source with - * the data specified. If you wish to maintain the existing data you must - * handle merging of old and new data separately and then pass that into - * this function as the `dataBlob`. - */ - cloneWithRows(dataBlob: Array | { [key: string]: any }, rowIdentities?: Array): ListViewDataSource - - /** - * This performs the same function as the `cloneWithRows` function but here - * you also specify what your `sectionIdentities` are. If you don't care - * about sections you should safely be able to use `cloneWithRows`. - * - * `sectionIdentities` is an array of identifiers for sections. - * ie. ['s1', 's2', ...]. If not provided, it's assumed that the - * keys of dataBlob are the section identities. - * - * Note: this returns a new object! - */ - cloneWithRowsAndSections(dataBlob: Array | { [key: string]: any }, sectionIdentities?: Array, rowIdentities?: Array>): ListViewDataSource - - getRowCount(): number - getRowAndSectionCount(): number - - /** - * Returns if the row is dirtied and needs to be rerendered - */ - rowShouldUpdate(sectionIndex: number, rowIndex: number): boolean - - /** - * Gets the data required to render the row. - */ - getRowData(sectionIndex: number, rowIndex: number): any - - /** - * Gets the rowID at index provided if the dataSource arrays were flattened, - * or null of out of range indexes. - */ - getRowIDForFlatIndex(index: number): string - - /** - * Gets the sectionID at index provided if the dataSource arrays were flattened, - * or null for out of range indexes. - */ - getSectionIDForFlatIndex(index: number): string - - /** - * Returns an array containing the number of rows in each section - */ - getSectionLengths(): Array - - /** - * Returns if the section header is dirtied and needs to be rerendered - */ - sectionHeaderShouldUpdate(sectionIndex: number): boolean - - /** - * Gets the data required to render the section header - */ - getSectionHeaderData(sectionIndex: number): any - } - - - /** - * @see https://facebook.github.io/react-native/docs/tabbarios-item.html#props - */ - export interface TabBarItemProperties extends ViewProperties, React.Props { - - /** - * Little red bubble that sits at the top right of the icon. - */ - badge?: string | number - - /** - * A custom icon for the tab. It is ignored when a system icon is defined. - */ - icon?: ImageURISource - - /** - * Callback when this tab is being selected, - * you should change the state of your component to set selected={true}. - */ - onPress?: () => void - - /** - * If set to true it renders the image as original, - * it defaults to being displayed as a template - */ - renderAsOriginal?: boolean - - /** - * It specifies whether the children are visible or not. If you see a blank content, you probably forgot to add a selected one. - */ - selected?: boolean - - /** - * A custom icon when the tab is selected. - * It is ignored when a system icon is defined. If left empty, the icon will be tinted in blue. - */ - selectedIcon?: ImageURISource - - /** - * React style object. - */ - style?: ViewStyle - - /** - * Items comes with a few predefined system icons. - * Note that if you are using them, the title and selectedIcon will be overriden with the system ones. - * - * enum('bookmarks', 'contacts', 'downloads', 'favorites', 'featured', 'history', 'more', 'most-recent', 'most-viewed', 'recents', 'search', 'top-rated') - */ - systemIcon?: "bookmarks" | "contacts" | "downloads" | "favorites" | "featured" | "history" | "more" | "most-recent" | "most-viewed" | "recents" | "search" | "top-rated" - - /** - * Text that appears under the icon. It is ignored when a system icon is defined. - */ - title?: string - - ref?: Ref - } - - export interface TabBarItemStatic extends React.ComponentClass { - } - - /** - * @see https://facebook.github.io/react-native/docs/tabbarios.html#props - */ - export interface TabBarIOSProperties extends ViewProperties, React.Props { - - /** - * Background color of the tab bar - */ - barTintColor?: string - - /** - * Specifies tab bar item positioning. Available values are: - * - fill - distributes items across the entire width of the tab bar - * - center - centers item in the available tab bar space - * - auto (default) - distributes items dynamically according to the - * user interface idiom. In a horizontally compact environment (e.g. iPhone 5) - * this value defaults to `fill`, in a horizontally regular one (e.g. iPad) - * it defaults to center. - */ - itemPositioning?: 'fill' | 'center' | 'auto' - - /** - * Color of the currently selected tab icon - */ - tintColor?: string - - /** - * A Boolean value that indicates whether the tab bar is translucent - */ - translucent?: boolean - - /** - * Color of text on unselected tabs - */ - unselectedTintColor?: string - - ref?: Ref - } - - export interface TabBarIOSStatic extends React.ComponentClass { - Item: TabBarItemStatic; - } - - - export interface PixelRatioStatic { - - /* - Returns the device pixel density. Some examples: - PixelRatio.get() === 1 - mdpi Android devices (160 dpi) - PixelRatio.get() === 1.5 - hdpi Android devices (240 dpi) - PixelRatio.get() === 2 - iPhone 4, 4S - iPhone 5, 5c, 5s - iPhone 6 - xhdpi Android devices (320 dpi) - PixelRatio.get() === 3 - iPhone 6 plus - xxhdpi Android devices (480 dpi) - PixelRatio.get() === 3.5 - Nexus 6 - */ - get(): number; - - /* - Returns the scaling factor for font sizes. This is the ratio that is - used to calculate the absolute font size, so any elements that - heavily depend on that should use this to do calculations. - - If a font scale is not set, this returns the device pixel ratio. - - Currently this is only implemented on Android and reflects the user - preference set in Settings > Display > Font size, - on iOS it will always return the default pixel ratio. - */ - getFontScale(): number - - /** - * Converts a layout size (dp) to pixel size (px). - * Guaranteed to return an integer number. - * @param layoutSize - */ - getPixelSizeForLayoutSize(layoutSize: number): number - - /** - * Rounds a layout size (dp) to the nearest layout size that - * corresponds to an integer number of pixels. For example, - * on a device with a PixelRatio of 3, - * PixelRatio.roundToNearestPixel(8.4) = 8.33, - * which corresponds to exactly (8.33 * 3) = 25 pixels. - * @param layoutSize - */ - roundToNearestPixel(layoutSize: number): number - - /** - * No-op for iOS, but used on the web. Should not be documented. [sic] - */ - startDetecting(): void - } - - /** - * @see https://facebook.github.io/react-native/docs/platform-specific-code.html#content - */ - export type PlatformOSType = 'ios' | 'android' - - interface PlatformStatic { - OS: PlatformOSType - Version?: number - - /** - * @see https://facebook.github.io/react-native/docs/platform-specific-code.html#content - */ - select( specifics: { ios?: T, android?: T} ): T; - } - - /** - * Deprecated - subclass NativeEventEmitter to create granular event modules instead of - * adding all event listeners directly to RCTDeviceEventEmitter. - */ - interface DeviceEventEmitterStatic extends EventEmitter { - sharedSubscriber: EventSubscriptionVendor - new(): DeviceEventEmitterStatic; - addListener( type: string, listener: ( data: T ) => void, context?: any ): EmitterSubscription; - } - - // Used by Dimensions below - export interface ScaledSize { - width: number; - height: number; - scale: number; - fontScale: number; - } - - /** - * Initial dimensions are set before `runApplication` is called so they should - * be available before any other require's are run, but may be updated later. - * - * Note: Although dimensions are available immediately, they may change (e.g - * due to device rotation) so any rendering logic or styles that depend on - * these constants should try to call this function on every render, rather - * than caching the value (for example, using inline styles rather than - * setting a value in a `StyleSheet`). - * - * Example: `var {height, width} = Dimensions.get('window');` - * - * @param {string} dim Name of dimension as defined when calling `set`. - * @returns {Object?} Value for the dimension. - * @see https://facebook.github.io/react-native/docs/dimensions.html#content - */ - export interface Dimensions { - /** - * Initial dimensions are set before runApplication is called so they - * should be available before any other require's are run, but may be - * updated later. - * Note: Although dimensions are available immediately, they may - * change (e.g due to device rotation) so any rendering logic or - * styles that depend on these constants should try to call this - * function on every render, rather than caching the value (for - * example, using inline styles rather than setting a value in a - * StyleSheet). - * Example: var {height, width} = Dimensions.get('window'); - @param {string} dim Name of dimension as defined when calling set. - @returns {Object?} Value for the dimension. - */ - get(dim: "window" | "screen"): ScaledSize; - - /** - * This should only be called from native code by sending the didUpdateDimensions event. - * @param {object} dims Simple string-keyed object of dimensions to set - */ - set( dims: {[key: string]: any} ): void - } - - export type SimpleTask = { - name: string - gen: () => void - } - export type PromiseTask = { - name: string - gen: () => Promise - } - - export type Handle = number - - export interface InteractionManagerStatic { - Events: { - interactionStart: string - interactionComplete: string - } - - addListener( - eventType: string, listener: Function, context?: Object): EmitterSubscription - - /** - * Schedule a function to run after all interactions have completed. - * Returns a cancellable - * @param fn - */ - runAfterInteractions( task: Function | SimpleTask | PromiseTask): - {then: Function, done: Function, cancel: Function} - - /** - * Notify manager that an interaction has started. - */ - createInteractionHandle(): Handle - - /** - * Notify manager that an interaction has completed. - */ - clearInteractionHandle(handle: Handle): void - - /** - * A positive number will use setTimeout to schedule any tasks after - * the eventLoopRunningTime hits the deadline value, otherwise all - * tasks will be executed in one setImmediate batch (default). - */ - setDeadline(deadline: number): void - } - - - export interface ScrollViewStyle extends FlexStyle, TransformsStyle { - - backfaceVisibility?: "visible" | "hidden" - backgroundColor?: string - borderColor?: string - borderTopColor?: string - borderRightColor?: string - borderBottomColor?: string - borderLeftColor?: string - borderRadius?: number - borderTopLeftRadius?: number - borderTopRightRadius?: number - borderBottomLeftRadius?: number - borderBottomRightRadius?: number - borderStyle?: "solid" | "dotted" | "dashed" - borderWidth?: number - borderTopWidth?: number - borderRightWidth?: number - borderBottomWidth?: number - borderLeftWidth?: number - opacity?: number - overflow?: "visible" | "hidden" - shadowColor?: string - shadowOffset?: { width: number; height: number } - shadowOpacity?: number - shadowRadius?: number - elevation?: number - } - - - interface ScrollResponderMixin extends SubscribableMixin { - /** - * Invoke this from an `onScroll` event. - */ - scrollResponderHandleScrollShouldSetResponder(): boolean - - /** - * Merely touch starting is not sufficient for a scroll view to become the - * responder. Being the "responder" means that the very next touch move/end - * event will result in an action/movement. - * - * Invoke this from an `onStartShouldSetResponder` event. - * - * `onStartShouldSetResponder` is used when the next move/end will trigger - * some UI movement/action, but when you want to yield priority to views - * nested inside of the view. - * - * There may be some cases where scroll views actually should return `true` - * from `onStartShouldSetResponder`: Any time we are detecting a standard tap - * that gives priority to nested views. - * - * - If a single tap on the scroll view triggers an action such as - * recentering a map style view yet wants to give priority to interaction - * views inside (such as dropped pins or labels), then we would return true - * from this method when there is a single touch. - * - * - Similar to the previous case, if a two finger "tap" should trigger a - * zoom, we would check the `touches` count, and if `>= 2`, we would return - * true. - * - */ - scrollResponderHandleStartShouldSetResponder(): boolean - - /** - * There are times when the scroll view wants to become the responder - * (meaning respond to the next immediate `touchStart/touchEnd`), in a way - * that *doesn't* give priority to nested views (hence the capture phase): - * - * - Currently animating. - * - Tapping anywhere that is not the focused input, while the keyboard is - * up (which should dismiss the keyboard). - * - * Invoke this from an `onStartShouldSetResponderCapture` event. - */ - scrollResponderHandleStartShouldSetResponderCapture(e: Event): boolean - - /** - * Invoke this from an `onResponderReject` event. - * - * Some other element is not yielding its role as responder. Normally, we'd - * just disable the `UIScrollView`, but a touch has already began on it, the - * `UIScrollView` will not accept being disabled after that. The easiest - * solution for now is to accept the limitation of disallowing this - * altogether. To improve this, find a way to disable the `UIScrollView` after - * a touch has already started. - */ - scrollResponderHandleResponderReject(): any - - /** - * We will allow the scroll view to give up its lock iff it acquired the lock - * during an animation. This is a very useful default that happens to satisfy - * many common user experiences. - * - * - Stop a scroll on the left edge, then turn that into an outer view's - * backswipe. - * - Stop a scroll mid-bounce at the top, continue pulling to have the outer - * view dismiss. - * - However, without catching the scroll view mid-bounce (while it is - * motionless), if you drag far enough for the scroll view to become - * responder (and therefore drag the scroll view a bit), any backswipe - * navigation of a swipe gesture higher in the view hierarchy, should be - * rejected. - */ - scrollResponderHandleTerminationRequest(): boolean - - /** - * Invoke this from an `onTouchEnd` event. - * - * @param {SyntheticEvent} e Event. - */ - scrollResponderHandleTouchEnd(e: Event): void - - /** - * Invoke this from an `onResponderRelease` event. - */ - scrollResponderHandleResponderRelease(e: Event): void - - scrollResponderHandleScroll(e: Event): void - - /** - * Invoke this from an `onResponderGrant` event. - */ - scrollResponderHandleResponderGrant(e: Event): void - - /** - * Unfortunately, `onScrollBeginDrag` also fires when *stopping* the scroll - * animation, and there's not an easy way to distinguish a drag vs. stopping - * momentum. - * - * Invoke this from an `onScrollBeginDrag` event. - */ - scrollResponderHandleScrollBeginDrag(e: Event): void - - /** - * Invoke this from an `onScrollEndDrag` event. - */ - scrollResponderHandleScrollEndDrag(e: Event): void - - /** - * Invoke this from an `onMomentumScrollBegin` event. - */ - scrollResponderHandleMomentumScrollBegin(e: Event): void - - /** - * Invoke this from an `onMomentumScrollEnd` event. - */ - scrollResponderHandleMomentumScrollEnd(e: Event): void - - /** - * Invoke this from an `onTouchStart` event. - * - * Since we know that the `SimpleEventPlugin` occurs later in the plugin - * order, after `ResponderEventPlugin`, we can detect that we were *not* - * permitted to be the responder (presumably because a contained view became - * responder). The `onResponderReject` won't fire in that case - it only - * fires when a *current* responder rejects our request. - * - * @param {SyntheticEvent} e Touch Start event. - */ - scrollResponderHandleTouchStart(e: Event): void - - /** - * Invoke this from an `onTouchMove` event. - * - * Since we know that the `SimpleEventPlugin` occurs later in the plugin - * order, after `ResponderEventPlugin`, we can detect that we were *not* - * permitted to be the responder (presumably because a contained view became - * responder). The `onResponderReject` won't fire in that case - it only - * fires when a *current* responder rejects our request. - * - * @param {SyntheticEvent} e Touch Start event. - */ - scrollResponderHandleTouchMove(e: Event): void - - /** - * A helper function for this class that lets us quickly determine if the - * view is currently animating. This is particularly useful to know when - * a touch has just started or ended. - */ - scrollResponderIsAnimating(): boolean - - /** - * Returns the node that represents native view that can be scrolled. - * Components can pass what node to use by defining a `getScrollableNode` - * function otherwise `this` is used. - */ - scrollResponderGetScrollableNode(): any - - /** - * A helper function to scroll to a specific point in the scrollview. - * This is currently used to help focus on child textviews, but can also - * be used to quickly scroll to any element we want to focus. Syntax: - * - * scrollResponderScrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true}) - * - * Note: The weird argument signature is due to the fact that, for historical reasons, - * the function also accepts separate arguments as as alternative to the options object. - * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. - */ - scrollResponderScrollTo( x?: number | { x?: number, y?: number, animated?: boolean }, y?: number, animated?: boolean ): void, - - /** - * A helper function to zoom to a specific rect in the scrollview. The argument has the shape - * {x: number; y: number; width: number; height: number; animated: boolean = true} - * - * @platform ios - */ - scrollResponderZoomTo( - rect: { x: number, y: number, width: number, height: number, animated?: boolean }, - animated?: boolean // deprecated, put this inside the rect argument instead - ): void - - /** - * This method should be used as the callback to onFocus in a TextInputs' - * parent view. Note that any module using this mixin needs to return - * the parent view's ref in getScrollViewRef() in order to use this method. - * @param {any} nodeHandle The TextInput node handle - * @param {number} additionalOffset The scroll view's top "contentInset". - * Default is 0. - * @param {bool} preventNegativeScrolling Whether to allow pulling the content - * down to make it meet the keyboard's top. Default is false. - */ - scrollResponderScrollNativeHandleToKeyboard(nodeHandle: any, additionalOffset?: number, preventNegativeScrollOffset?: boolean): void - - /** - * The calculations performed here assume the scroll view takes up the entire - * screen - even if has some content inset. We then measure the offsets of the - * keyboard, and compensate both for the scroll view's "contentInset". - * - * @param {number} left Position of input w.r.t. table view. - * @param {number} top Position of input w.r.t. table view. - * @param {number} width Width of the text input. - * @param {number} height Height of the text input. - */ - scrollResponderInputMeasureAndScrollToKeyboard(left: number, top: number, width: number, height: number): void - - scrollResponderTextInputFocusError(e: Event): void - - /** - * `componentWillMount` is the closest thing to a standard "constructor" for - * React components. - * - * The `keyboardWillShow` is called before input focus. - */ - componentWillMount(): void - - /** - * Warning, this may be called several times for a single keyboard opening. - * It's best to store the information in this method and then take any action - * at a later point (either in `keyboardDidShow` or other). - * - * Here's the order that events occur in: - * - focus - * - willShow {startCoordinates, endCoordinates} several times - * - didShow several times - * - blur - * - willHide {startCoordinates, endCoordinates} several times - * - didHide several times - * - * The `ScrollResponder` providesModule callbacks for each of these events. - * Even though any user could have easily listened to keyboard events - * themselves, using these `props` callbacks ensures that ordering of events - * is consistent - and not dependent on the order that the keyboard events are - * subscribed to. This matters when telling the scroll view to scroll to where - * the keyboard is headed - the scroll responder better have been notified of - * the keyboard destination before being instructed to scroll to where the - * keyboard will be. Stick to the `ScrollResponder` callbacks, and everything - * will work. - * - * WARNING: These callbacks will fire even if a keyboard is displayed in a - * different navigation pane. Filter out the events to determine if they are - * relevant to you. (For example, only if you receive these callbacks after - * you had explicitly focused a node etc). - */ - scrollResponderKeyboardWillShow(e: Event): void - - scrollResponderKeyboardWillHide(e: Event): void - - scrollResponderKeyboardDidShow(e: Event): void - - scrollResponderKeyboardDidHide(e: Event): void - } - - export interface ScrollViewPropertiesIOS { - - /** - * When true the scroll view bounces horizontally when it reaches the end - * even if the content is smaller than the scroll view itself. The default - * value is true when `horizontal={true}` and false otherwise. - */ - alwaysBounceHorizontal?: boolean - /** - * When true the scroll view bounces vertically when it reaches the end - * even if the content is smaller than the scroll view itself. The default - * value is false when `horizontal={true}` and true otherwise. - */ - alwaysBounceVertical?: boolean - - /** - * Controls whether iOS should automatically adjust the content inset for scroll views that are placed behind a navigation bar or tab bar/ toolbar. - * The default value is true. - */ - automaticallyAdjustContentInsets?: boolean // true - - /** - * When true the scroll view bounces when it reaches the end of the - * content if the content is larger then the scroll view along the axis of - * the scroll direction. When false it disables all bouncing even if - * the `alwaysBounce*` props are true. The default value is true. - */ - bounces?: boolean - /** - * When true gestures can drive zoom past min/max and the zoom will animate - * to the min/max value at gesture end otherwise the zoom will not exceed - * the limits. - */ - bouncesZoom?: boolean - - /** - * When false once tracking starts won't try to drag if the touch moves. - * The default value is true. - */ - canCancelContentTouches?: boolean - - /** - * When true the scroll view automatically centers the content when the - * content is smaller than the scroll view bounds; when the content is - * larger than the scroll view this property has no effect. The default - * value is false. - */ - centerContent?: boolean - - /** - * The amount by which the scroll view content is inset from the edges of the scroll view. - * Defaults to {0, 0, 0, 0}. - */ - contentInset?: Insets // zeros - - /** - * Used to manually set the starting scroll offset. - * The default value is {x: 0, y: 0} - */ - contentOffset?: PointProperties // zeros - - /** - * A floating-point number that determines how quickly the scroll view - * decelerates after the user lifts their finger. Reasonable choices include - * - Normal: 0.998 (the default) - * - Fast: 0.9 - */ - decelerationRate?: "fast" | "normal" | number - - /** - * When true the ScrollView will try to lock to only vertical or horizontal - * scrolling while dragging. The default value is false. - */ - directionalLockEnabled?: boolean - - /** - * The style of the scroll indicators. - * - default (the default), same as black. - * - black, scroll indicator is black. This style is good against - * a white content background. - * - white, scroll indicator is white. This style is good against - * a black content background. - */ - indicatorStyle?: "default" | "black" | "white" - - /** - * The maximum allowed zoom scale. The default value is 1.0. - */ - maximumZoomScale?: number - - /** - * The minimum allowed zoom scale. The default value is 1.0. - */ - minimumZoomScale?: number - - /** - * Called when a scrolling animation ends. - */ - onScrollAnimationEnd?: () => void - - /** - * This controls how often the scroll event will be fired while scrolling (in events per seconds). - * A higher number yields better accuracy for code that is tracking the scroll position, - * but can lead to scroll performance problems due to the volume of information being send over the bridge. - * The default value is zero, which means the scroll event will be sent only once each time the view is scrolled. - */ - scrollEventThrottle?: number // null - - /** - * The amount by which the scroll view indicators are inset from the edges of the scroll view. - * This should normally be set to the same value as the contentInset. - * Defaults to {0, 0, 0, 0}. - */ - scrollIndicatorInsets?: Insets //zeroes - - /** - * When true the scroll view scrolls to top when the status bar is tapped. - * The default value is true. - */ - scrollsToTop?: boolean - - /** - * When snapToInterval is set, snapToAlignment will define the relationship of the the snapping to the scroll view. - * - start (the default) will align the snap at the left (horizontal) or top (vertical) - * - center will align the snap in the center - * - end will align the snap at the right (horizontal) or bottom (vertical) - */ - snapToAlignment?: "start" | "center" | "end" - - /** - * When set, causes the scroll view to stop at multiples of the value of snapToInterval. - * This can be used for paginating through children that have lengths smaller than the scroll view. - * Used in combination with snapToAlignment. - */ - snapToInterval?: number[] - - /** - * An array of child indices determining which children get docked to the - * top of the screen when scrolling. For example passing - * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the - * top of the scroll view. This property is not supported in conjunction - * with `horizontal={true}`. - */ - stickyHeaderIndices?: number[] - - /** - * The current scale of the scroll view content. The default value is 1.0. - */ - zoomScale?: number - } - - export interface ScrollViewPropertiesAndroid { - - /** - * Sometimes a scrollview takes up more space than its content fills. - * When this is the case, this prop will fill the rest of the - * scrollview with a color to avoid setting a background and creating - * unnecessary overdraw. This is an advanced optimization that is not - * needed in the general case. - */ - endFillColor?: string - - /** - * Tag used to log scroll performance on this scroll view. Will force - * momentum events to be turned on (see sendMomentumEvents). This doesn't do - * anything out of the box and you need to implement a custom native - * FpsListener for it to be useful. - * @platform android - */ - scrollPerfTag?: string - - /** - * Used to override default value of overScroll mode. - - * Possible values: - * - 'auto' - Default value, allow a user to over-scroll this view only if the content is large enough to meaningfully scroll. - * - 'always' - Always allow a user to over-scroll this view. - * - 'never' - Never allow a user to over-scroll this view. - */ - overScrollMode?: 'auto' | 'always' | 'never' - } - - export interface ScrollViewProperties extends ViewProperties, ScrollViewPropertiesIOS, ScrollViewPropertiesAndroid, Touchable, React.Props { - - /** - * These styles will be applied to the scroll view content container which - * wraps all of the child views. Example: - * - * return ( - * - * - * ); - * ... - * var styles = StyleSheet.create({ - * contentContainer: { - * paddingVertical: 20 - * } - * }); - */ - contentContainerStyle?: ViewStyle - - /** - * When true the scroll view's children are arranged horizontally in a row - * instead of vertically in a column. The default value is false. - */ - horizontal?: boolean - - /** - * Determines whether the keyboard gets dismissed in response to a drag. - * - 'none' (the default) drags do not dismiss the keyboard. - * - 'onDrag' the keyboard is dismissed when a drag begins. - * - 'interactive' the keyboard is dismissed interactively with the drag - * and moves in synchrony with the touch; dragging upwards cancels the - * dismissal. - */ - keyboardDismissMode?: 'none' | 'interactive' | 'on-drag' - - /** - * When false tapping outside of the focused text input when the keyboard - * is up dismisses the keyboard. When true the scroll view will not catch - * taps and the keyboard will not dismiss automatically. The default value - * is false. - */ - keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled' - - /** - * Called when scrollable content view of the ScrollView changes. - * Handler function is passed the content width and content height as parameters: (contentWidth, contentHeight) - * It's implemented using onLayout handler attached to the content container which this ScrollView renders. - * - */ - onContentSizeChange?: (w: number, h: number) => void - - /** - * Fires at most once per frame during scrolling. - * The frequency of the events can be contolled using the scrollEventThrottle prop. - */ - onScroll?: (event?: NativeSyntheticEvent) => void - - /** - * Fires if a user initiates a scroll gesture. - */ - onScrollBeginDrag?: (event?: NativeSyntheticEvent) => void - - /** - * Fires when a user has finished scrolling. - */ - onScrollEndDrag?: (event?: NativeSyntheticEvent) => void - - /** - * Fires when scroll view has finished moving - */ - onMomentumScrollEnd?: (event?: NativeSyntheticEvent) => void - - /** - * Fires when scroll view has begun moving - */ - onMomentumScrollBegin?: (event?: NativeSyntheticEvent) => void - - /** - * When true the scroll view stops on multiples of the scroll view's size - * when scrolling. This can be used for horizontal pagination. The default - * value is false. - */ - pagingEnabled?: boolean - - /** - * When false, the content does not scroll. The default value is true - */ - scrollEnabled?: boolean // true - - /** - * Experimental: When true offscreen child views (whose `overflow` value is - * `hidden`) are removed from their native backing superview when offscreen. - * This canimprove scrolling performance on long lists. The default value is - * false. - */ - removeClippedSubviews?: boolean - - /** - * When true, shows a horizontal scroll indicator. - */ - showsHorizontalScrollIndicator?: boolean - - /** - * When true, shows a vertical scroll indicator. - */ - showsVerticalScrollIndicator?: boolean - - /** - * Style - */ - style?: ScrollViewStyle - - /** - * A RefreshControl component, used to provide pull-to-refresh - * functionality for the ScrollView. - */ - refreshControl?: React.ReactElement - - ref?: Ref - } - - export interface ScrollViewProps extends ScrollViewProperties, React.Props { - ref?: Ref - } - - interface ScrollViewStatic extends ScrollResponderMixin, React.ComponentClass { - - /** - * Scrolls to a given x, y offset, either immediately or with a smooth animation. - * Syntax: - * - * scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true}) - * - * Note: The weird argument signature is due to the fact that, for historical reasons, - * the function also accepts separate arguments as as alternative to the options object. - * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. - */ - scrollTo( - y?: number | { x?: number, y?: number, animated?: boolean }, - x?: number, - animated?: boolean - ): void; - - /** - * Returns a reference to the underlying scroll responder, which supports - * operations like `scrollTo`. All ScrollView-like components should - * implement this method so that they can be composed while providing access - * to the underlying scroll responder's methods. - */ - getScrollResponder(): JSX.Element; - - getScrollableNode(): any; - - // Undocumented - getInnerViewNode(): any; - - // Deprecated, do not use. - scrollWithoutAnimationTo?: (y: number, x: number) => void - } - - - export interface NativeScrollRectangle { - left: number; - top: number; - bottom: number; - right: number; - } - - export interface NativeScrollPoint { - x: number; - y: number; - } - - export interface NativeScrollSize { - height: number; - width: number; - } - - export interface NativeScrollEvent { - contentInset: NativeScrollRectangle; - contentOffset: NativeScrollPoint; - contentSize: NativeScrollSize; - layoutMeasurement: NativeScrollSize; - zoomScale: number; - } - - export interface SnapshotViewIOSProperties extends ViewProperties, React.Props { - - // A callback when the Snapshot view is ready to be compared - onSnapshotReady(): any, - - // A name to identify the individual instance to the SnapshotView - testIdentifier : string, - - ref?: Ref - } - - export interface SnapshotViewIOSStatic extends NativeMethodsMixin, React.ComponentClass {} - - // Deduced from - // https://github.com/facebook/react-native/commit/052cd7eb8afa7a805ef13e940251be080499919c - - /** - * Data source wrapper around ListViewDataSource to allow for tracking of - * which row is swiped open and close opened row(s) when another row is swiped - * open. - * - * See https://github.com/facebook/react-native/pull/5602 for why - * ListViewDataSource is not subclassed. - */ - export interface SwipeableListViewDataSource { - cloneWithRowsAndSections(dataBlob: any, - sectionIdentities?: Array, - rowIdentities?: Array>): SwipeableListViewDataSource - getDataSource(): ListViewDataSource - getOpenRowID(): string - getFirstRowID(): string - setOpenRowID(rowID: string): SwipeableListViewDataSource - } - - export interface SwipeableListViewProps extends React.Props { - - /** - * To alert the user that swiping is possible, the first row can bounce - * on component mount. - */ - bounceFirstRowOnMount: boolean - - /** - * Use `SwipeableListView.getNewDataSource()` to get a data source to use, - * then use it just like you would a normal ListView data source - */ - dataSource: SwipeableListViewDataSource - - // Maximum distance to open to after a swipe - maxSwipeDistance: number - - // Callback method to render the swipeable view - renderRow: (rowData: any, sectionID: string | number, rowID: string | number, highlightRow?: boolean) => React.ReactElement - - // Callback method to render the view that will be unveiled on swipe - renderQuickActions(rowData: any, sectionID: string | number, rowID: string | number): React.ReactElement - } - - /** - * A container component that renders multiple SwipeableRow's in a ListView - * implementation. This is designed to be a drop-in replacement for the - * standard React Native `ListView`, so use it as if it were a ListView, but - * with extra props, i.e. - * - * let ds = SwipeableListView.getNewDataSource(); - * ds.cloneWithRowsAndSections(dataBlob, ?sectionIDs, ?rowIDs); - * // .. - * - * - * SwipeableRow can be used independently of this component, but the main - * benefit of using this component is - * - * - It ensures that at most 1 row is swiped open (auto closes others) - * - It can bounce the 1st row of the list so users know it's swipeable - * - More to come - */ - export interface SwipeableListViewStatic extends React.ComponentClass { - getNewDataSource(): SwipeableListViewDataSource - } - - - ////////////////////////////////////////////////////////////////////////// - // - // A P I s - // - ////////////////////////////////////////////////////////////////////////// - - /** - * @see: http://facebook.github.io/react-native/docs/actionsheetios.html#content - */ - export interface ActionSheetIOSOptions { - title?: string - options: string[] - cancelButtonIndex?: number - destructiveButtonIndex?: number - message?: string - } - - export interface ShareActionSheetIOSOptions { - message?: string - url?: string - subject?: string - /** The activities to exclude from the ActionSheet. - * For example: ['com.apple.UIKit.activity.PostToTwitter'] - */ - excludedActivityTypes?: string[] - } - - /** - * @see https://facebook.github.io/react-native/docs/actionsheetios.html#content - */ - export interface ActionSheetIOSStatic { - /** - * Display an iOS action sheet. The `options` object must contain one or more - * of: - * - `options` (array of strings) - a list of button titles (required) - * - `cancelButtonIndex` (int) - index of cancel button in `options` - * - `destructiveButtonIndex` (int) - index of destructive button in `options` - * - `title` (string) - a title to show above the action sheet - * - `message` (string) - a message to show below the title - */ - showActionSheetWithOptions: (options: ActionSheetIOSOptions, callback: (buttonIndex: number) => void) => void - - /** - * Display the iOS share sheet. The `options` object should contain - * one or both of `message` and `url` and can additionally have - * a `subject` or `excludedActivityTypes`: - * - * - `url` (string) - a URL to share - * - `message` (string) - a message to share - * - `subject` (string) - a subject for the message - * - `excludedActivityTypes` (array) - the activities to exclude from the ActionSheet - * - * NOTE: if `url` points to a local file, or is a base64-encoded - * uri, the file it points to will be loaded and shared directly. - * In this way, you can share images, videos, PDF files, etc. - */ - showShareActionSheetWithOptions: (options: ShareActionSheetIOSOptions, failureCallback: (error: Error) => void, successCallback: (success: boolean, method: string) => void) => void - } - - export type ShareContent = { - title?: string - message: string - } | { - title?: string - url: string - } - - export type ShareOptions = { - dialogTitle?: string - excludeActivityTypes?: Array - tintColor?: string - } - - export interface ShareStatic { - /** - * Open a dialog to share text content. - * - * In iOS, Returns a Promise which will be invoked an object containing `action`, `activityType`. - * If the user dismissed the dialog, the Promise will still be resolved with action being `Share.dismissedAction` - * and all the other keys being undefined. - * - * In Android, Returns a Promise which always be resolved with action being `Share.sharedAction`. - * - * ### Content - * - * - `message` - a message to share - * - `title` - title of the message - * - * #### iOS - * - * - `url` - an URL to share - * - * At least one of URL and message is required. - * - * ### Options - * - * #### iOS - * - * - `excludedActivityTypes` - * - `tintColor` - * - * #### Android - * - * - `dialogTitle` - * - */ - share(content: ShareContent, options: ShareOptions): Promise - sharedAction: string - dismissedAction: string - } - - /** - * @see https://facebook.github.io/react-native/docs/alert.html#content - */ - export interface AlertButton { - text?: string - onPress?: () => void - style?: "default" | "cancel" | "destructive" - } - - interface AlertOptions { - /** @platform android */ - cancelable?: boolean; - } - - /** - * Launches an alert dialog with the specified title and message. - * - * Optionally provide a list of buttons. Tapping any button will fire the - * respective onPress callback and dismiss the alert. By default, the only - * button will be an 'OK' button. - * - * This is an API that works both on iOS and Android and can show static - * alerts. To show an alert that prompts the user to enter some information, - * see `AlertIOS`; entering text in an alert is common on iOS only. - * - * ## iOS - * - * On iOS you can specify any number of buttons. Each button can optionally - * specify a style, which is one of 'default', 'cancel' or 'destructive'. - * - * ## Android - * - * On Android at most three buttons can be specified. Android has a concept - * of a neutral, negative and a positive button: - * - * - If you specify one button, it will be the 'positive' one (such as 'OK') - * - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK') - * - Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK') - * - * ``` - * // Works on both iOS and Android - * Alert.alert( - * 'Alert Title', - * 'My Alert Msg', - * [ - * {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, - * {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, - * {text: 'OK', onPress: () => console.log('OK Pressed')}, - * ] - * ) - * ``` - */ - export interface AlertStatic { - alert: (title: string, message?: string, buttons?: AlertButton[], options?: AlertOptions, type?: string) => void - } - - /** - * Wrapper around the Android native module. - */ - export interface AlertAndroidStatic { - alert: (title: string, message?: string, buttons?: AlertButton[], options?: AlertOptions) => void - } - - /** - * //FIXME: No documentation - inferred from RCTAdSupport.m - */ - export interface AdSupportIOSStatic { - getAdvertisingId: (onSuccess: (deviceId: string) => void, onFailure: (err: Error) => void) => void - getAdvertisingTrackingEnabled: (onSuccess: (hasTracking: boolean) => void, onFailure: (err: Error) => void) => void - } - - interface AlertIOSButton { - text: string - onPress?: () => void - style?: "default" | "cancel" | "destructive" - } - - export type AlertType = "default" | "plain-text" | "secure-text" | "login-password" - - /** - * @description - * `AlertIOS` provides functionality to create an iOS alert dialog with a - * message or create a prompt for user input. - * - * We recommend using the [`Alert.alert`](/docs/alert.html) method for - * cross-platform support if you don't need to create iOS-only prompts. - * - * @see https://facebook.github.io/react-native/docs/alertios.html#content - */ - export interface AlertIOSStatic { - - /** - * Create and display a popup alert. - * @static - * @method alert - * @param title The dialog's title. - * @param message An optional message that appears below - * the dialog's title. - * @param callbackOrButtons This optional argument should - * be either a single-argument function or an array of buttons. If passed - * a function, it will be called when the user taps 'OK'. - * - * If passed an array of button configurations, each button should include - * a `text` key, as well as optional `onPress` and `style` keys. `style` - * should be one of 'default', 'cancel' or 'destructive'. - * @param type Deprecated, do not use. - */ - alert: ( title: string, message?: string, callbackOrButtons?: (() => void) | Array, type?: AlertType ) => void - - /** - * Create and display a prompt to enter some text. - * @static - * @method prompt - * @param title The dialog's title. - * @param message An optional message that appears above the text - * input. - * @param callbackOrButtons This optional argument should - * be either a single-argument function or an array of buttons. If passed - * a function, it will be called with the prompt's value when the user - * taps 'OK'. - * - * If passed an array of button configurations, each button should include - * a `text` key, as well as optional `onPress` and `style` keys (see - * example). `style` should be one of 'default', 'cancel' or 'destructive'. - * @param type This configures the text input. One of 'plain-text', - * 'secure-text' or 'login-password'. - * @param defaultValue The default text in text input. - */ - prompt: ( title: string, message?: string, callbackOrButtons?: ((value: string) => void) | Array, type?: AlertType, defaultValue?: string ) => void - } - - /** - * AppStateIOS can tell you if the app is in the foreground or background, - * and notify you when the state changes. - * - * AppStateIOS is frequently used to determine the intent and proper behavior - * when handling push notifications. - * - * iOS App States - * active - The app is running in the foreground - * background - The app is running in the background. The user is either in another app or on the home screen - * inactive - This is a transition state that currently never happens for typical React Native apps. - * - * For more information, see Apple's documentation: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html - * - * @see https://facebook.github.io/react-native/docs/appstateios.html#content - */ - export type AppStateEvent = "change" | "memoryWarning" - export type AppStateStatus = "active" | "background" | "inactive" - - export interface AppStateStatic { - - currentState: string - - /** - * Add a handler to AppState changes by listening to the change event - * type and providing the handler - */ - addEventListener(type: AppStateEvent, listener: (state: AppStateStatus) => void): void - - /** - * Remove a handler by passing the change event type and the handler - */ - removeEventListener(type: AppStateEvent, listener: (state: AppStateStatus) => void): void - } - - /** - * AsyncStorage is a simple, unencrypted, asynchronous, persistent, key-value storage - * system that is global to the app. It should be used instead of LocalStorage. - * - * It is recommended that you use an abstraction on top of `AsyncStorage` - * instead of `AsyncStorage` directly for anything more than light usage since - * it operates globally. - * - * On iOS, `AsyncStorage` is backed by native code that stores small values in a - * serialized dictionary and larger values in separate files. On Android, - * `AsyncStorage` will use either [RocksDB](http://rocksdb.org/) or SQLite - * based on what is available. - * - * @see https://facebook.github.io/react-native/docs/asyncstorage.html#content - */ - export interface AsyncStorageStatic { - - /** - * Fetches key and passes the result to callback, along with an Error if there is any. - */ - getItem(key: string, callback?: (error?: Error, result?: string) => void): Promise - - /** - * Sets value for key and calls callback on completion, along with an Error if there is any - */ - setItem(key: string, value: string, callback?: (error?: Error) => void): Promise - - removeItem(key: string, callback?: (error?: Error) => void): Promise - - /** - * Merges existing value with input value, assuming they are stringified json. Returns a Promise object. - * Not supported by all native implementation - */ - mergeItem(key: string, value: string, callback?: (error?: Error) => void): Promise - - /** - * Erases all AsyncStorage for all clients, libraries, etc. You probably don't want to call this. - * Use removeItem or multiRemove to clear only your own keys instead. - */ - clear(callback?: (error?: Error) => void): Promise - - /** - * Gets all keys known to the app, for all callers, libraries, etc - */ - getAllKeys(callback?: (error?: Error, keys?: string[]) => void): Promise - - /** - * multiGet invokes callback with an array of key-value pair arrays that matches the input format of multiSet - */ - multiGet(keys: string[], callback?: (errors?: Error[], result?: [string, string][]) => void): Promise<[string, string][]> - - /** - * multiSet and multiMerge take arrays of key-value array pairs that match the output of multiGet, - * - * multiSet([['k1', 'val1'], ['k2', 'val2']], cb); - */ - multiSet(keyValuePairs: string[][], callback?: (errors?: Error[]) => void): Promise - - /** - * Delete all the keys in the keys array. - */ - multiRemove(keys: string[], callback?: (errors?: Error[]) => void): Promise - - /** - * Merges existing values with input values, assuming they are stringified json. - * Returns a Promise object. - * - * Not supported by all native implementations. - */ - multiMerge(keyValuePairs: string[][], callback?: (errors?: Error[]) => void): Promise - } - - export type BackPressEventName = "hardwareBackPress" - - /** - * Detect hardware back button presses, and programmatically invoke the - * default back button functionality to exit the app if there are no - * listeners or if none of the listeners return true. - * Methods don't have more detailed documentation as of 0.25. - */ - export interface BackAndroidStatic { - exitApp(): void; - addEventListener(eventName: BackPressEventName, handler: () => void): void; - removeEventListener(eventName: BackPressEventName, handler: () => void): void; - } - - export interface ButtonProperties { - title: string; - onPress: () => any; - color?: string; - accessibilityLabel?: string; - disabled?: boolean; - } - - export interface ButtonStatic extends ComponentClass { - } - - export type CameraRollGroupType = "Album" | "All" | "Event" | "Faces" | "Library" | "PhotoStream" | "SavedPhotos"; - export type CameraRollAssetType = "All" | "Videos" | "Photos"; - - export interface CameraRollFetchParams { - first: number; - after?: string; - groupTypes?: CameraRollGroupType - groupName?: string - assetType?: CameraRollAssetType - } - - export interface CameraRollNodeInfo { - image: Image; - group_name: string; - timestamp: number; - location: any; - } - - export interface CameraRollEdgeInfo { - node: CameraRollNodeInfo; - } - - export interface CameraRollAssetInfo { - edges: CameraRollEdgeInfo[]; - page_info: { - has_next_page: boolean; - end_cursor: string; - }; - } - - export interface GetPhotosParamType { - first: number - after?: string - groupTypes?: CameraRollGroupType - groupName?: string - assetType?: CameraRollAssetType - mimeTypes?: string[] - } - - export interface GetPhotosReturnType { - edges: { - node: { - type: string - group_name: string - image: { - uri: string - height: number - width: number - isStored?: boolean - } - timestamp: number - location: { - latitude: number - longitude: number - altitude: number - heading: number - speed: number - } - } - }[] - - page_info: { - has_next_page: boolean - start_cursor?: string - end_cursor?: string - } - } - - /** - * CameraRoll provides access to the local camera roll / gallery. - * Before using this you must link the RCTCameraRoll library. - * You can refer to (Linking)[https://facebook.github.io/react-native/docs/linking-libraries-ios.html] for help. - */ - export interface CameraRollStatic { - - GroupTypesOptions: CameraRollGroupType[] //'Album','All','Event','Faces','Library','PhotoStream','SavedPhotos' - AssetTypeOptions: CameraRollAssetType[] // "All", "Videos", "Photos" - - /** - * Saves the image to the camera roll / gallery. - * - * @tag On Android, this is a local URI, such as "file:///sdcard/img.png". - * On iOS, the tag can be one of the following: - * local URI - * assets-library tag - * a tag not maching any of the above, which means the image data will be stored in memory (and consume memory as long as the process is alive) - * - * @deprecated use saveToCameraRoll instead - */ - saveImageWithTag(tag: string): Promise - - /** - * Saves the photo or video to the camera roll / gallery. - * - * On Android, the tag must be a local image or video URI, such as `"file:///sdcard/img.png"`. - * - * On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs) - * or a local video file URI (remote or data URIs are not supported for saving video at this time). - * - * If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise - * it will be treated as a photo. To override the automatic choice, you can pass an optional - * `type` parameter that must be one of 'photo' or 'video'. - * - * Returns a Promise which will resolve with the new URI. - */ - saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise - - /** - * Saves the photo or video to the camera roll / gallery. - * - * On Android, the tag must be a local image or video URI, such as `"file:///sdcard/img.png"`. - * - * On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs) - * or a local video file URI (remote or data URIs are not supported for saving video at this time). - * - * If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise - * it will be treated as a photo. To override the automatic choice, you can pass an optional - * `type` parameter that must be one of 'photo' or 'video'. - * - * Returns a Promise which will resolve with the new URI. - */ - saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise - - /** - * Invokes callback with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker. - * - * @param {object} params See getPhotosParamChecker. - */ - getPhotos(params: GetPhotosParamType): Promise; - } - - /** Clipboard gives you an interface for setting and getting content from Clipboard on both iOS and Android */ - export interface ClipboardStatic { - getString(): Promise; - setString(content: string): void; - } - - export interface DatePickerAndroidOpenOption { - date?: Date | number - minDate?: Date | number - maxDate?: Date | number - } - - // Deduced from DatePickerAndroid.android.js - export interface DatePickerAndroidOpenReturn { - action: string // "dateSetAction" | "dismissedAction" - year?: number - month?: number - day?: number - } - - export interface DatePickerAndroidStatic { - /* - Opens the standard Android date picker dialog. - - The available keys for the options object are: - * date (Date object or timestamp in milliseconds) - date to show by default - * minDate (Date object or timestamp in milliseconds) - minimum date that can be selected - * maxDate (Date object or timestamp in milliseconds) - maximum date that can be selected - - Returns a Promise which will be invoked an object containing action, year, month (0-11), day if the user picked a date. If the user dismissed the dialog, the Promise will still be resolved with action being DatePickerAndroid.dismissedAction and all the other keys being undefined. Always check whether the action before reading the values. - - Note the native date picker dialog has some UI glitches on Android 4 and lower when using the minDate and maxDate options. - */ - open(options?: DatePickerAndroidOpenOption): Promise - - /** - * A date has been selected. - */ - dateSetAction: string - - /** - * The dialog has been dismissed. - */ - dismissedAction: string - } - - export interface FetchableListenable { - fetch: () => Promise - - /** - * eventName is expected to be `change` - * //FIXME: No doc - inferred from NetInfo.js - */ - addEventListener: (eventName: string, listener: (result: T) => void) => void - - /** - * eventName is expected to be `change` - * //FIXME: No doc - inferred from NetInfo.js - */ - removeEventListener: (eventName: string, listener: (result: T) => void) => void - } - - export interface IntentAndroidStatic { - /** - * Starts a corresponding external activity for the given URL. - - For example, if the URL is "https://www.facebook.com", the system browser will be opened, or the "choose application" dialog will be shown. - - You can use other URLs, like a location (e.g. "geo:37.484847,-122.148386"), a contact, or any other URL that can be opened with {@code Intent.ACTION_VIEW}. - - NOTE: This method will fail if the system doesn't know how to open the specified URL. If you're passing in a non-http(s) URL, it's best to check {@code canOpenURL} first. - - NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly! - - @deprecated - */ - openURL(url: string): void - - /** - * Determine whether or not an installed app can handle a given URL. - - You can use other URLs, like a location (e.g. "geo:37.484847,-122.148386"), a contact, or any other URL that can be opened with {@code Intent.ACTION_VIEW}. - - NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly! - - @param URL the URL to open - - @deprecated - */ - canOpenURL(url: string, callback: (supported: boolean) => void): void - - /** - * If the app launch was triggered by an app link with {@code Intent.ACTION_VIEW}, it will give the link url, otherwise it will give null - - Refer http://developer.android.com/training/app-indexing/deep-linking.html#handling-intents - - @deprecated - */ - getInitialURL(callback: (url: string) => void): void - } - - export interface LinkingStatic extends NativeEventEmitter { - /** - * Add a handler to Linking changes by listening to the `url` event type - * and providing the handler - */ - addEventListener(type: string, handler: (event: { url: string }) => void): void - - /** - * Remove a handler by passing the `url` event type and the handler - */ - removeEventListener(type: string, handler: (event: { url: string }) => void): void - - /** - * Try to open the given url with any of the installed apps. - * You can use other URLs, like a location (e.g. "geo:37.484847,-122.148386"), a contact, or any other URL that can be opened with the installed apps. - * NOTE: This method will fail if the system doesn't know how to open the specified URL. If you're passing in a non-http(s) URL, it's best to check {@code canOpenURL} first. - * NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly! - */ - openURL(url: string): Promise - - /** - * Determine whether or not an installed app can handle a given URL. - * NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly! - * NOTE: As of iOS 9, your app needs to provide the LSApplicationQueriesSchemes key inside Info.plist. - * @param URL the URL to open - */ - canOpenURL(url: string): Promise - - /** - * If the app launch was triggered by an app link with, it will give the link url, otherwise it will give null - * NOTE: To support deep linking on Android, refer http://developer.android.com/training/app-indexing/deep-linking.html#handling-intents - */ - getInitialURL(): Promise - } - - export interface LinkingIOSStatic { - /** - * Add a handler to LinkingIOS changes by listening to the url event type and providing the handler - @deprecated - */ - addEventListener(type: string, handler: (event: { url: string }) => void): void - - /** - * Remove a handler by passing the url event type and the handler - @deprecated - */ - removeEventListener(type: string, handler: (event: { url: string }) => void): void - - /** - * Try to open the given url with any of the installed apps. - @deprecated - */ - openURL(url: string): void - - /** - * Determine whether or not an installed app can handle a given URL. The callback function will be called with bool supported as the only argument - NOTE: As of iOS 9, your app needs to provide the LSApplicationQueriesSchemes key inside Info.plist. - @deprecated - */ - canOpenURL(url: string, callback: (supported: boolean) => void): void - - /** - * If the app launch was triggered by an app link, it will pop the link url, otherwise it will return null - @deprecated - */ - popInitialURL(): string; - } - - - /** - * NetInfo exposes info about online/offline status - * - * Asynchronously determine if the device is online and on a cellular network. - * - * - `none` - device is offline - * - `wifi` - device is online and connected via wifi, or is the iOS simulator - * - `cell` - device is connected via Edge, 3G, WiMax, or LTE - * - `unknown` - error case and the network status is unknown - * @see https://facebook.github.io/react-native/docs/netinfo.html#content - */ - - // This is from code, a few items more than documentation@0.25 - export type NetInfoReturnType = "none" | "wifi" | "cell" | "unknown" | - "NONE" | "MOBILE" | "WIFI" | "MOBILE_MMS" | "MOBILE_SUPL" | "MOBILE_DUN" | - "MOBILE_HIPRI" | "WIMAX" | "BLUETOOTH" | "DUMMY" | "ETHERNET" | "MOBILE_FOTA" | - "MOBILE_IMS" | "MOBILE_CBS" | "WIFI_P2P" | "MOBILE_IA" | "MOBILE_EMERGENCY" | - "PROXY" | "VPN" | "UNKNOWN" - - export interface NetInfoStatic extends FetchableListenable { - - /** - * - * Available on all platforms. - * Asynchronously fetch a boolean to determine internet connectivity. - */ - isConnected: FetchableListenable - - /** - * Available on Android. Detect if the current active connection is - * metered or not. A network is classified as metered when the user is - * sensitive to heavy data usage on that connection due to monetary - * costs, data limitations or battery/performance issues. - */ - isConnectionExpensive: Promise - } - - - export interface PanResponderGestureState { - - /** - * ID of the gestureState- persisted as long as there at least one touch on - */ - stateID: number - - /** - * the latest screen coordinates of the recently-moved touch - */ - moveX: number - - /** - * the latest screen coordinates of the recently-moved touch - */ - moveY: number - - /** - * the screen coordinates of the responder grant - */ - x0: number - - /** - * the screen coordinates of the responder grant - */ - y0: number - - /** - * accumulated distance of the gesture since the touch started - */ - dx: number - - /** - * accumulated distance of the gesture since the touch started - */ - dy: number - - /** - * current velocity of the gesture - */ - vx: number - - /** - * current velocity of the gesture - */ - vy: number - - /** - * Number of touches currently on screen - */ - numberActiveTouches: number - - - // All `gestureState` accounts for timeStamps up until: - _accountsForMovesUpTo: number - } - - - /** - * @see documentation of GestureResponderHandlers - */ - export interface PanResponderCallbacks { - onMoveShouldSetPanResponder?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean - onStartShouldSetPanResponder?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - onPanResponderGrant?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - onPanResponderMove?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - onPanResponderRelease?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - onPanResponderTerminate?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - - onMoveShouldSetPanResponderCapture?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean - onStartShouldSetPanResponderCapture?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean - onPanResponderReject?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - onPanResponderStart?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - onPanResponderEnd?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => void - onPanResponderTerminationRequest?: (e: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean - } - - export interface PanResponderInstance { - panHandlers: GestureResponderHandlers - } - - /** - * PanResponder reconciles several touches into a single gesture. - * It makes single-touch gestures resilient to extra touches, - * and can be used to recognize simple multi-touch gestures. - * - * It provides a predictable wrapper of the responder handlers provided by the gesture responder system. - * For each handler, it provides a new gestureState object alongside the normal event. - */ - export interface PanResponderStatic { - /** - * @param config Enhanced versions of all of the responder callbacks - * that provide not only the typical `ResponderSyntheticEvent`, but also the - * `PanResponder` gesture state. Simply replace the word `Responder` with - * `PanResponder` in each of the typical `onResponder*` callbacks. For - * example, the `config` object would look like: - * - * - `onMoveShouldSetPanResponder: (e, gestureState) => {...}` - * - `onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}` - * - `onStartShouldSetPanResponder: (e, gestureState) => {...}` - * - `onStartShouldSetPanResponderCapture: (e, gestureState) => {...}` - * - `onPanResponderReject: (e, gestureState) => {...}` - * - `onPanResponderGrant: (e, gestureState) => {...}` - * - `onPanResponderStart: (e, gestureState) => {...}` - * - `onPanResponderEnd: (e, gestureState) => {...}` - * - `onPanResponderRelease: (e, gestureState) => {...}` - * - `onPanResponderMove: (e, gestureState) => {...}` - * - `onPanResponderTerminate: (e, gestureState) => {...}` - * - `onPanResponderTerminationRequest: (e, gestureState) => {...}` - * - * In general, for events that have capture equivalents, we update the - * gestureState once in the capture phase and can use it in the bubble phase - * as well. - * - * Be careful with onStartShould* callbacks. They only reflect updated - * `gestureState` for start/end events that bubble/capture to the Node. - * Once the node is the responder, you can rely on every start/end event - * being processed by the gesture and `gestureState` being updated - * accordingly. (numberActiveTouches) may not be totally accurate unless you - * are the responder. - */ - create(config: PanResponderCallbacks): PanResponderInstance - } - - export interface Rationale { - title: string - message: string - } - - export type Permission = "android.permission.READ_CALENDAR" | "android.permission.WRITE_CALENDAR" | "android.permission.CAMERA" | "android.permission.READ_CONTACTS" | "android.permission.WRITE_CONTACTS" | "android.permission.GET_ACCOUNTS" | "android.permission.ACCESS_FINE_LOCATION" | "android.permission.ACCESS_COARSE_LOCATION" | "android.permission.RECORD_AUDIO" | "android.permission.READ_PHONE_STATE" | "android.permission.CALL_PHONE" | "android.permission.READ_CALL_LOG" | "android.permission.WRITE_CALL_LOG" | "com.android.voicemail.permission.ADD_VOICEMAIL" | "android.permission.USE_SIP" | "android.permission.PROCESS_OUTGOING_CALLS" | "android.permission.BODY_SENSORS" | "android.permission.SEND_SMS" | "android.permission.RECEIVE_SMS" | "android.permission.READ_SMS" | "android.permission.RECEIVE_WAP_PUSH" | "android.permission.RECEIVE_MMS" | "android.permission.READ_EXTERNAL_STORAGE" | "android.permission.WRITE_EXTERNAL_STORAGE" - - export interface PermissionsAndroidStatic { - /** - * A list of specified "dangerous" permissions that require prompting the user - */ - PERMISSIONS: {[key: string]: Permission} - new(): PermissionsAndroidStatic - /** - * Returns a promise resolving to a boolean value as to whether the specified - * permissions has been granted - */ - checkPermission(permission: Permission): Promise - /** - * Prompts the user to enable a permission and returns a promise resolving to a - * boolean value indicating whether the user allowed or denied the request - * - * If the optional rationale argument is included (which is an object with a - * `title` and `message`), this function checks with the OS whether it is - * necessary to show a dialog explaining why the permission is needed - * (https://developer.android.com/training/permissions/requesting.html#explain) - * and then shows the system permission dialog - */ - requestPermission(permission: Permission, rationale?: Rationale): Promise - } - - export interface PushNotificationPermissions { - alert?: boolean - badge?: boolean - sound?: boolean - } - - export interface PushNotification { - - - /** - * An alias for `getAlert` to get the notification's main message string - */ - getMessage(): string | Object - - /** - * Gets the sound string from the `aps` object - */ - getSound(): string - - /** - * Gets the notification's main message from the `aps` object - */ - getAlert(): string | Object - - /** - * Gets the badge count number from the `aps` object - */ - getBadgeCount(): number - - /** - * Gets the data object on the notif - */ - getData(): Object - - } - - - type PresentLocalNotificationDetails = { - alertBody: string - alertAction: string - soundName?: string - category?: string - userInfo?: Object - applicationIconBadgeNumber?: number - } - - type ScheduleLocalNotificationDetails = { - fireDate: Date - alertBody: string - alertAction: string - soundName?: string - category?: string - userInfo?: Object - applicationIconBadgeNumber?: number - } - - export type PushNotificationEventName = "notification" | "localNotification" | "register" | "registrationError" - - /** - * Handle push notifications for your app, including permission handling and icon badge number. - * @see https://facebook.github.io/react-native/docs/pushnotificationios.html#content - * - * //FIXME: BGR: The documentation seems completely off compared to the actual js implementation. I could never get the example to run - */ - export interface PushNotificationIOSStatic { - - /** - * Schedules the localNotification for immediate presentation. - * details is an object containing: - * alertBody : The message displayed in the notification alert. - * alertAction : The "action" displayed beneath an actionable notification. Defaults to "view"; - * soundName : The sound played when the notification is fired (optional). - * category : The category of this notification, required for actionable notifications (optional). - * userInfo : An optional object containing additional notification data. - * applicationIconBadgeNumber (optional) : The number to display as the app's icon badge. The default value of this property is 0, which means that no badge is displayed. - */ - presentLocalNotification(details: PresentLocalNotificationDetails): void - - /** - * Schedules the localNotification for future presentation. - * details is an object containing: - * fireDate : The date and time when the system should deliver the notification. - * alertBody : The message displayed in the notification alert. - * alertAction : The "action" displayed beneath an actionable notification. Defaults to "view"; - * soundName : The sound played when the notification is fired (optional). - * category : The category of this notification, required for actionable notifications (optional). - * userInfo : An optional object containing additional notification data. - * applicationIconBadgeNumber (optional) : The number to display as the app's icon badge. Setting the number to 0 removes the icon badge. - */ - scheduleLocalNotification(details: ScheduleLocalNotificationDetails): void - - /** - * Cancels all scheduled localNotifications - */ - cancelAllLocalNotifications(): void - - /** - * Cancel local notifications. - * Optionally restricts the set of canceled notifications to those notifications whose userInfo fields match the corresponding fields in the userInfo argument. - */ - cancelLocalNotifications(userInfo: Object): void - - /** - * Sets the badge number for the app icon on the home screen - */ - setApplicationIconBadgeNumber(number: number): void - - /** - * Gets the current badge number for the app icon on the home screen - */ - getApplicationIconBadgeNumber(callback: (badge: number) => void): void - - /** - * Gets the local notifications that are currently scheduled. - */ - getScheduledLocalNotifications(callback: (notifications: ScheduleLocalNotificationDetails[]) => void): void - - /** - * Attaches a listener to remote notifications while the app is running in the - * foreground or the background. - * - * The handler will get be invoked with an instance of `PushNotificationIOS` - * - * The type MUST be 'notification' - */ - addEventListener( type: PushNotificationEventName, handler: ( notification: PushNotification ) => void ):void - - /** - * Removes the event listener. Do this in `componentWillUnmount` to prevent - * memory leaks - */ - removeEventListener( type: PushNotificationEventName, handler: ( notification: PushNotification ) => void ): void - - /** - * Requests all notification permissions from iOS, prompting the user's - * dialog box. - */ - requestPermissions(permissions?: PushNotificationPermissions[]): void - - /** - * Requests all notification permissions from iOS, prompting the user's - * dialog box. - */ - requestPermissions( permissions?: PushNotificationPermissions ): Promise - - /** - * Unregister for all remote notifications received via Apple Push - * Notification service. - * You should call this method in rare circumstances only, such as when - * a new version of the app removes support for all types of remote - * notifications. Users can temporarily prevent apps from receiving - * remote notifications through the Notifications section of the - * Settings app. Apps unregistered through this method can always - * re-register. - */ - abandonPermissions(): void - - /** - * See what push permissions are currently enabled. `callback` will be - * invoked with a `permissions` object: - * - * - `alert` :boolean - * - `badge` :boolean - * - `sound` :boolean - */ - checkPermissions(callback: (permissions: PushNotificationPermissions) => void): void - - /** - * This method returns a promise that resolves to either the notification - * object if the app was launched by a push notification, or `null` otherwise. - */ - getInitialNotification(): PushNotification - } - - export interface SettingsStatic { - get(key: string): any - set(settings: Object): void - watchKeys(keys: string | Array, callback: (() => void)): number - clearWatch(watchId: number): void - } - - - /** - * @enum('default', 'light-content') - */ - export type StatusBarStyle = "default" | "light-content" - - /** - * @enum('fade', 'slide') - */ - export type StatusBarAnimation = "none" | "fade" | "slide" - - export interface StatusBarPropertiesIOS extends React.Props { - /** - * Sets the color of the status bar text. - */ - barStyle?: StatusBarStyle - - /** - * If the network activity indicator should be visible. - */ - networkActivityIndicatorVisible?: boolean - - /** - * The transition effect when showing and hiding the status bar using - * the hidden prop. Defaults to 'fade'. - */ - showHideTransition?: "fade" | "slide" - } - - export interface StatusBarPropertiesAndroid extends React.Props { - /** - * The background color of the status bar. - */ - backgroundColor?: string - - /** - * If the status bar is translucent. When translucent is set to true, - * the app will draw under the status bar. This is useful when using a - * semi transparent status bar color. - */ - translucent?: boolean - } - - export interface StatusBarProperties extends StatusBarPropertiesIOS, StatusBarPropertiesAndroid, React.Props { - - /** - * If the transition between status bar property changes should be - * animated. Supported for backgroundColor, barStyle and hidden. - */ - animated?: boolean - - /** - * If the status bar is hidden. - */ - hidden?: boolean - } - - export interface StatusBarStatic extends React.ComponentClass { - - /** - * The current height of the status bar on the device. - * @platform android - */ - currentHeight?: number - - /** - * Show or hide the status bar - * @param hidden The dialog's title. - * @param animation Optional animation when - * changing the status bar hidden property. - */ - setHidden: (hidden: boolean, animation?: StatusBarAnimation) => void - - /** - * Set the status bar style - * @param style Status bar style to set - * @param animated Animate the style change. - */ - setBarStyle: (style: StatusBarStyle, animated?: boolean) => void - - /** - * Control the visibility of the network activity indicator - * @param visible Show the indicator. - */ - setNetworkActivityIndicatorVisible: (visible: boolean) => void - - /** - * Set the background color for the status bar - * @param color Background color. - * @param animated Animate the style change. - */ - setBackgroundColor: (color: string, animated?: boolean) => void - - /** - * Control the translucency of the status bar - * @param translucent Set as translucent. - */ - setTranslucent: (translucent: boolean) => void - } - - /** - * StatusBarIOS is deprecated. - * Use `StatusBar` for mutating the status bar. - */ - export interface StatusBarIOSStatic extends NativeEventEmitter { - } - - type TimePickerAndroidOpenOptions = { - hour?: number - minute?: number - is24Hour?: boolean - } - - /** - * Opens the standard Android time picker dialog. - * - * ### Example - * - * ``` - * try { - * const {action, hour, minute} = await TimePickerAndroid.open({ - * hour: 14, - * minute: 0, - * is24Hour: false, // Will display '2 PM' - * }); - * if (action !== TimePickerAndroid.dismissedAction) { - * // Selected hour (0-23), minute (0-59) - * } - * } catch ({code, message}) { - * console.warn('Cannot open time picker', message); - * } - * ``` - */ - export interface TimePickerAndroidStatic { - - /** - * Opens the standard Android time picker dialog. - * - * The available keys for the `options` object are: - * * `hour` (0-23) - the hour to show, defaults to the current time - * * `minute` (0-59) - the minute to show, defaults to the current time - * * `is24Hour` (boolean) - If `true`, the picker uses the 24-hour format. If `false`, - * the picker shows an AM/PM chooser. If undefined, the default for the current locale - * is used. - * - * Returns a Promise which will be invoked an object containing `action`, `hour` (0-23), - * `minute` (0-59) if the user picked a time. If the user dismissed the dialog, the Promise will - * still be resolved with action being `TimePickerAndroid.dismissedAction` and all the other keys - * being undefined. **Always** check whether the `action` before reading the values. - */ - open(options: TimePickerAndroidOpenOptions): Promise<{ action: string, hour: number, minute: number }> - - /** - * A time has been selected. - */ - timeSetAction: string - - /** - * The dialog has been dismissed. - */ - dismissedAction: string - } - - /** - * This exposes the native ToastAndroid module as a JS module. This has a function 'show' - * which takes the following parameters: - * - * 1. String message: A string with the text to toast - * 2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG - * - * There is also a function `showWithGravity` to specify the layout gravity. May be - * ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER - */ - export interface ToastAndroidStatic { - /** - * String message: A string with the text to toast - * int duration: The duration of the toast. - * May be ToastAndroid.SHORT or ToastAndroid.LONG - */ - show(message: string, duration: number): void - /** `gravity` may be ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER */ - showWithGravity( - message: string, - duration: number, - gravity: number - ): void - // Toast duration constants - SHORT: number - LONG: number - // Toast gravity constants - TOP: number - BOTTOM: number - CENTER: number - } - - export interface UIManagerStatic { - /** - * Capture an image of the screen, window or an individual view. The image - * will be stored in a temporary file that will only exist for as long as the - * app is running. - * - * The `view` argument can be the literal string `window` if you want to - * capture the entire window, or it can be a reference to a specific - * React Native component. - * - * The `options` argument may include: - * - width/height (number) - the width and height of the image to capture. - * - format (string) - either 'png' or 'jpeg'. Defaults to 'png'. - * - quality (number) - the quality when using jpeg. 0.0 - 1.0 (default). - * - * Returns a Promise (tempFilePath) - * @platform ios - */ - takeSnapshot: ( - view ?: 'window' | ReactElement | number, - options ?: { - width ?: number, - height ?: number, - format ?: 'png' | 'jpeg', - quality ?: number, - } - ) => Promise - } - - export interface SwitchPropertiesIOS extends ViewProperties, React.Props { - - /** - * Background color when the switch is turned on. - */ - onTintColor?: string - - /** - * Color of the foreground switch grip. - */ - thumbTintColor?: string - - /** - * Background color when the switch is turned off. - */ - tintColor?: string - - ref?: Ref - } - - export interface SwitchProperties extends SwitchPropertiesIOS, React.Props { - - /** - * If true the user won't be able to toggle the switch. - * Default value is false. - */ - disabled?: boolean - - /** - * Invoked with the new value when the value changes. - */ - onValueChange?: (value: boolean) => void - - /** - * Used to locate this view in end-to-end tests. - */ - testID?: string - - /** - * The value of the switch. If true the switch will be turned on. - * Default value is false. - */ - value?: boolean - style?: ViewStyle - } - - /** - * Renders a boolean input. - * - * This is a controlled component that requires an `onValueChange` callback that - * updates the `value` prop in order for the component to reflect user actions. - * If the `value` prop is not updated, the component will continue to render - * the supplied `value` prop instead of the expected result of any user actions. - */ - export interface SwitchStatic extends NativeMethodsMixin, React.ClassicComponentClass { - - } - - /** - * NOTE: `VibrationIOS` is being deprecated. Use `Vibration` instead. - * - * The Vibration API is exposed at VibrationIOS.vibrate(). - * On iOS, calling this function will trigger a one second vibration. - * The vibration is asynchronous so this method will return immediately. - * - * There will be no effect on devices that do not support Vibration, eg. the iOS simulator. - * - * Vibration patterns are currently unsupported. - * - * @see https://facebook.github.io/react-native/docs/vibrationios.html#content - */ - export interface VibrationIOSStatic { - /** - * @deprecated - */ - vibrate(): void - } - - /** - * The Vibration API is exposed at `Vibration.vibrate()`. - * The vibration is asynchronous so this method will return immediately. - * - * There will be no effect on devices that do not support Vibration, eg. the simulator. - * - * **Note for android** - * add `` to `AndroidManifest.xml` - * - * **Android Usage:** - * - * [0, 500, 200, 500] - * V(0.5s) --wait(0.2s)--> V(0.5s) - * - * [300, 500, 200, 500] - * --wait(0.3s)--> V(0.5s) --wait(0.2s)--> V(0.5s) - * - * **iOS Usage:** - * if first argument is 0, it will not be included in pattern array. - * - * [0, 1000, 2000, 3000] - * V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed) - */ - export interface VibrationStatic { - vibrate(pattern: number | number[], repeat: boolean): void - - /** - * Stop vibration - */ - cancel(): void - } - - /** - * This class implements common easing functions. The math is pretty obscure, - * but this cool website has nice visual illustrations of what they represent: - * http://xaedes.de/dev/transitions/ - */ - export type EasingFunction = (value: number) => number; - export interface EasingStatic { - step0: EasingFunction; - step1: EasingFunction; - linear: EasingFunction; - ease: EasingFunction; - quad: EasingFunction; - cubic: EasingFunction; - poly: EasingFunction; - sin: EasingFunction; - circle: EasingFunction; - exp: EasingFunction; - elastic: EasingFunction; - back(s: number): EasingFunction; - bounce: EasingFunction; - bezier(x1: number, - y1: number, - x2: number, - y2: number): EasingFunction; - in(easing: EasingFunction): EasingFunction; - out(easing: EasingFunction): EasingFunction; - inOut(easing: EasingFunction): EasingFunction; - } - - export module Animated { - // Most (all?) functions where AnimatedValue is used any subclass of Animated can be used as well. - type AnimatedValue = Animated; - type AnimatedValueXY = ValueXY; - - type Base = Animated; - - class Animated { - // Internal class, no public API. - } - - class AnimatedWithChildren extends Animated { - // Internal class, no public API. - } - - class AnimatedInterpolation extends AnimatedWithChildren { - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - } - - type ExtrapolateType = 'extend' | 'identity' | 'clamp'; - - type InterpolationConfigType = { - inputRange: number[]; - outputRange: (number[] | string[]); - easing?: ((input: number) => number); - extrapolate?: ExtrapolateType; - extrapolateLeft?: ExtrapolateType; - extrapolateRight?: ExtrapolateType; - }; - - type ValueListenerCallback = (state: { value: number }) => void; - - /** - * Standard value for driving animations. One `Animated.Value` can drive - * multiple properties in a synchronized fashion, but can only be driven by one - * mechanism at a time. Using a new mechanism (e.g. starting a new animation, - * or calling `setValue`) will stop any previous ones. - */ - export class Value extends AnimatedWithChildren { - constructor(value: number); - - /** - * Directly set the value. This will stop any animations running on the value - * and update all the bound properties. - */ - setValue(value: number): void; - - /** - * Sets an offset that is applied on top of whatever value is set, whether via - * `setValue`, an animation, or `Animated.event`. Useful for compensating - * things like the start of a pan gesture. - */ - setOffset(offset: number): void; - - /** - * Merges the offset value into the base value and resets the offset to zero. - * The final output of the value is unchanged. - */ - flattenOffset(): void; - - /** - * Adds an asynchronous listener to the value so you can observe updates from - * animations. This is useful because there is no way to - * synchronously read the value because it might be driven natively. - */ - addListener(callback: ValueListenerCallback): string; - - removeListener(id: string): void; - - removeAllListeners(): void; - - /** - * Stops any running animation or tracking. `callback` is invoked with the - * final value after stopping the animation, which is useful for updating - * state to match the animation position with layout. - */ - stopAnimation(callback?: (value: number) => void): void; - - /** - * Interpolates the value before updating the property, e.g. mapping 0-1 to - * 0-10. - */ - interpolate(config: InterpolationConfigType): AnimatedInterpolation; - } - - type ValueXYListenerCallback = (value: { x: number; y: number }) => void; - - /** - * 2D Value for driving 2D animations, such as pan gestures. Almost identical - * API to normal `Animated.Value`, but multiplexed. Contains two regular - * `Animated.Value`s under the hood. - */ - export class ValueXY extends AnimatedWithChildren { - x: AnimatedValue; - y: AnimatedValue; - - constructor(valueIn?: { x: number | AnimatedValue; y: number | AnimatedValue }); - - setValue(value: { x: number; y: number }): void; - - setOffset(offset: { x: number; y: number }): void; - - flattenOffset(): void - - stopAnimation(callback?: (value: {x: number, y: number}) => void): void; - - addListener(callback: ValueXYListenerCallback): string; - - removeListener(id: string): void; - - /** - * Converts `{x, y}` into `{left, top}` for use in style, e.g. - * - *```javascript - * style={this.state.anim.getLayout()} - *``` - */ - getLayout(): { [key: string]: AnimatedValue }; - - /** - * Converts `{x, y}` into a useable translation transform, e.g. - * - *```javascript - * style={{ - * transform: this.state.anim.getTranslateTransform() - * }} - *``` - */ - getTranslateTransform(): { [key: string]: AnimatedValue }[]; - - } - - type EndResult = { finished: boolean }; - type EndCallback = (result: EndResult) => void; - - interface CompositeAnimation { - start: (callback?: EndCallback) => void; - stop: () => void; - } - - interface AnimationConfig { - isInteraction?: boolean; - useNativeDriver?: boolean; - } - - /** - * Animates a value from an initial velocity to zero based on a decay - * coefficient. - */ - export function decay( - value: AnimatedValue | AnimatedValueXY, - config: DecayAnimationConfig - ): CompositeAnimation; - - interface DecayAnimationConfig extends AnimationConfig { - velocity: number | { x: number, y: number }; - deceleration?: number; - } - - /** - * Animates a value along a timed easing curve. The `Easing` module has tons - * of pre-defined curves, or you can use your own function. - */ - export var timing: ( - value: AnimatedValue | AnimatedValueXY, - config: TimingAnimationConfig - ) => CompositeAnimation; - - interface TimingAnimationConfig extends AnimationConfig { - toValue: number | AnimatedValue | { x: number, y: number } | AnimatedValueXY; - easing?: (value: number) => number; - duration?: number; - delay?: number; - } - - interface SpringAnimationConfig extends AnimationConfig { - toValue: number | AnimatedValue | { x: number, y: number } | AnimatedValueXY; - overshootClamping?: boolean; - restDisplacementThreshold?: number; - restSpeedThreshold?: number; - velocity?: number | { x: number, y: number }; - bounciness?: number; - speed?: number; - tension?: number; - friction?: number; - } - - /** - * Creates a new Animated value composed from two Animated values added - * together. - */ - export function add( - a: Animated, - b: Animated - ): AnimatedAddition; - - class AnimatedAddition extends AnimatedInterpolation { } - - /** - * Creates a new Animated value composed from two Animated values multiplied - * together. - */ - export function multiply( - a: Animated, - b: Animated - ): AnimatedMultiplication; - - class AnimatedMultiplication extends AnimatedInterpolation { } - - /** - * Creates a new Animated value that is the (non-negative) modulo of the - * provided Animated value - */ - export function modulo( - a: Animated, - modulus: number - ): AnimatedModulo; - - class AnimatedModulo extends AnimatedInterpolation { } - - /** - * Create a new Animated value that is limited between 2 values. It uses the - * difference between the last value so even if the value is far from the bounds - * it will start changing when the value starts getting closer again. - * (`value = clamp(value + diff, min, max)`). - * - * This is useful with scroll events, for example, to show the navbar when - * scrolling up and to hide it when scrolling down. - */ - export function diffClamp(a: Animated, min: number, max: number): AnimatedDiffClamp; - - class AnimatedDiffClamp extends AnimatedInterpolation {} - - /** - * Starts an animation after the given delay. - */ - export function delay(time: number): CompositeAnimation; - - /** - * Starts an array of animations in order, waiting for each to complete - * before starting the next. If the current running animation is stopped, no - * following animations will be started. - */ - export function sequence( - animations: Array - ): CompositeAnimation; - - /** - * Array of animations may run in parallel (overlap), but are started in - * sequence with successive delays. Nice for doing trailing effects. - */ - - export function stagger( - time: number, - animations: Array - ): CompositeAnimation - - /** - * Spring animation based on Rebound and Origami. Tracks velocity state to - * create fluid motions as the `toValue` updates, and can be chained together. - */ - export function spring ( - value: AnimatedValue | AnimatedValueXY, - config: SpringAnimationConfig - ): CompositeAnimation; - - type ParallelConfig = { - stopTogether?: boolean; // If one is stopped, stop all. default: true - } - - /** - * Starts an array of animations all at the same time. By default, if one - * of the animations is stopped, they will all be stopped. You can override - * this with the `stopTogether` flag. - */ - export function parallel ( - animations: Array, - config?: ParallelConfig - ): CompositeAnimation; - - type Mapping = { [key: string]: Mapping } | AnimatedValue; - interface EventConfig { - listener?: Function - } - - /** - * Takes an array of mappings and extracts values from each arg accordingly, - * then calls `setValue` on the mapped outputs. e.g. - * - *```javascript - * onScroll={Animated.event( - * [{nativeEvent: {contentOffset: {x: this._scrollX}}}] - * {listener}, // Optional async listener - * ) - * ... - * onPanResponderMove: Animated.event([ - * null, // raw event arg ignored - * {dx: this._panX}, // gestureState arg - * ]), - *``` - */ - export function event ( - argMapping: Mapping[], - config?: EventConfig - ): (...args: any[]) => void; - - /** - * Make any React component Animatable. Used to create `Animated.View`, etc. - */ - export function createAnimatedComponent (component: any) : any; - - /** - * Animated variants of the basic native views. Accepts Animated.Value for - * props and style. - */ - export var View: any; - export var Image: any; - export var Text: any; - } - - export interface I18nManagerStatic { - isRTL: boolean - allowRTL: (allowRTL: boolean) => {} - forceRTL: (forceRTL: boolean) => {} - } - - export interface GeolocationStatic { - /* - * Invokes the success callback once with the latest location info. Supported - * options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool) - * On Android, this can return almost immediately if the location is cached or - * request an update, which might take a while. - */ - getCurrentPosition(geo_success: (position: GeolocationReturnType) => void, geo_error?: (error: Error) => void, geo_options?: GetCurrentPositionOptions): void - - /* - * Invokes the success callback whenever the location changes. Supported - * options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool), distanceFilter(m) - */ - watchPosition(success: (position: Geolocation) => void, error?: (error: Error) => void, options?: WatchPositionOptions): void - - clearWatch(watchID: number): void - - stopObserving(): void - } - - export interface OpenCameraDialogOptions { - /** Defaults to false */ - videoMode?: boolean - } - - export interface OpenSelectDialogOptions { - /** Defaults to true */ - showImages?: boolean - /** Defaults to false */ - showVideos?: boolean - } - - /** [imageURL|tempImageTag, height, width] */ - export type ImagePickerResult = [string, number, number] - - export interface ImagePickerIOSStatic { - canRecordVideos(callback: (value: boolean) => void): void - canUseCamera(callback: (value: boolean) => void): void - openCameraDialog(config: OpenCameraDialogOptions, successCallback: (args:ImagePickerResult) => void, cancelCallback: (args:any[]) => void): void - openSelectDialog(config: OpenSelectDialogOptions, successCallback: (args:ImagePickerResult) => void, cancelCallback: (args:any[]) => void): void - } - - export interface ImageStoreStatic { - /** - * Check if the ImageStore contains image data for the specified URI. - * @platform ios - */ - hasImageForTag(uri: string, callback: (hasImage: boolean) => void): void - /** - * Delete an image from the ImageStore. Images are stored in memory and - * must be manually removed when you are finished with them, otherwise they - * will continue to use up RAM until the app is terminated. It is safe to - * call `removeImageForTag()` without first calling `hasImageForTag()`, it - * will simply fail silently. - * @platform ios - */ - removeImageForTag(uri: string): void - /** - * Stores a base64-encoded image in the ImageStore, and returns a URI that - * can be used to access or display the image later. Images are stored in - * memory only, and must be manually deleted when you are finished with - * them by calling `removeImageForTag()`. - * - * Note that it is very inefficient to transfer large quantities of binary - * data between JS and native code, so you should avoid calling this more - * than necessary. - * @platform ios - */ - addImageFromBase64( - base64ImageData: string, - success: (uri: string) => void, - failure: (error: any) => void - ): void - /** - * Retrieves the base64-encoded data for an image in the ImageStore. If the - * specified URI does not match an image in the store, the failure callback - * will be called. - * - * Note that it is very inefficient to transfer large quantities of binary - * data between JS and native code, so you should avoid calling this more - * than necessary. To display an image in the ImageStore, you can just pass - * the URI to an `` component; there is no need to retrieve the - * base64 data. - */ - getBase64ForTag( - uri: string, - success: (base64ImageData: string) => void, - failure: (error: any) => void - ): void - } - - // Network Polyfill - // TODO: Add proper support for fetch - export type fetch = (url: string, options?: Object) => Promise - export const fetch: fetch; - - // Timers polyfill - export type timedScheduler = (fn: string | Function, time: number) => number - export type untimedScheduler = (fn: string | Function) => number - export type setTimeout = timedScheduler - export type setInterval = timedScheduler - export type setImmediate = untimedScheduler - export type requestAnimationFrame = untimedScheduler - - export type schedulerCanceller = (id: number) => void - export type clearTimeout = schedulerCanceller - export type clearInterval = schedulerCanceller - export type clearImmediate = schedulerCanceller - export type cancelAnimationFrame = schedulerCanceller - - - export interface TabsReducerStatic { - JumpToAction(index: number): any; - } - - export type TabsReducerFunction = (params: any) => any; - - export interface NavigationTab { - key: string; - } - - export interface NavigationAction { - type: string; - } - - export interface NavigationRoute { - key: string; - title?: string; - } - - export interface NavigationState extends NavigationRoute { - index: number; - routes: NavigationRoute[]; - } - - export type NavigationRenderer = ( - route: NavigationState, - onNavigate: (action: NavigationAction) => boolean - ) => JSX.Element; - - interface SubViewProps extends NavigationSceneRendererProps { - onNavigateBack?(): void; - } - - type SubViewRenderer = (subViewProps: SubViewProps) => JSX.Element; - - export interface NavigationHeaderProps extends NavigationSceneRendererProps { - onNavigateBack?(): void, - renderLeftComponent?: SubViewRenderer, - renderRightComponent?: SubViewRenderer, - renderTitleComponent?: SubViewRenderer, - style?: ViewStyle, - viewProps?: any, - statusBarHeight?: number | NavigationAnimatedValue - } - - export interface NavigationHeaderStatic extends React.ComponentClass { - Title: NavigationHeaderTitleStatic - HEIGHT: number - } - - export interface NavigationHeaderTitleProps { - children?: JSX.Element, - style?: ViewStyle, - textStyle?: TextStyle, - viewProps?: any - } - - export interface NavigationHeaderTitleStatic extends React.ComponentClass { - } - - export interface NavigationCardStackProps { - /** - * Custom style applied to the card. - */ - cardStyle?: ViewStyle - /** - * Custom style interpolator for the card. - */ - cardStyleInterpolator?: (props: NavigationSceneRendererProps) => ViewStyle; - /** - * Direction of the cards movement. Value could be `horizontal` or - * `vertical`. Default value is `horizontal`. - */ - direction?: 'horizontal' | 'vertical' - /** - * The distance from the edge of the card which gesture response can start - * for. Defaults value is `30`. - */ - gestureResponseDistance?: number - /** - * Enable gestures. Default value is true - */ - enableGestures?: boolean, - /** - * The controlled navigation state. Typically, the navigation state - * look like this: - * - * ```js - * const navigationState = { - * index: 0, // the index of the selected route. - * routes: [ // A list of routes. - * {key: 'page 1'}, // The 1st route. - * {key: 'page 2'}, // The second route. - * ], - * }; - * ``` - */ - navigationState: NavigationState, - /** - * Callback that is called when the "back" action is performed. - * This happens when the back button is pressed or the back gesture is - * performed. - */ - onNavigateBack?: Function, - /** - * Function that renders the header. - */ - renderHeader?: NavigationSceneRenderer, - /** - * Function that renders the a scene for a route. - */ - renderScene: NavigationSceneRenderer, - /** - * Custom style applied to the cards stack. - */ - style?: ViewStyle, - } - - // Object Instances - - export type NavigationAnimatedValue = Animated.Value; - - // Value & Structs. - - export type NavigationGestureDirection = 'horizontal' | 'vertical'; - - export type NavigationLayout = { - height: NavigationAnimatedValue, - initHeight: number, - initWidth: number, - isMeasured: boolean, - width: NavigationAnimatedValue, - }; - - export type NavigationScene = { - index: number, - isActive: boolean, - isStale: boolean, - key: string, - route: NavigationRoute, - }; - - // Similar to `NavigationTransitionProps`, except that the prop `scene` - // represents the scene for the renderer to render. - export interface NavigationSceneRendererProps { - layout: NavigationLayout, - navigationState: NavigationState, - position: NavigationAnimatedValue, - progress: NavigationAnimatedValue, - scenes: Array, - scene: NavigationScene, - gestureResponseDistance?: number, - } - - export interface NavigationSceneRenderer extends React.StatelessComponent { - } - - export interface NavigationPropTypes { - // helpers - extractSceneRendererProps(props: NavigationSceneRendererProps): NavigationSceneRendererProps - - // Bundled propTypes. - SceneRendererProps: { - layout: string, - navigationState: string, - position: string, - progress: string, - scene: string, - scenes: NavigationScene[], - } - - // propTypes - SceneRenderer: any, // TODO: fix this - action: NavigationAction, - navigationState: NavigationState, - navigationRoute: NavigationRoute, - panHandlers: GestureResponderHandlers, - } - - export interface NavigationCardProps extends React.ComponentClass { - onComponentRef: (ref: any) => void, - onNavigateBack?: Function, - panHandlers?: GestureResponderHandlers, - pointerEvents: string, - renderScene: NavigationSceneRenderer, - style?: ViewStyle, - } - - export interface NavigationCardStackStatic extends React.ComponentClass { - } - - export interface NavigationCardStatic extends React.ComponentClass { - } - - /** - * Utilities to perform atomic operation with navigate state and routes. - * - * ```javascript - * const state1 = {key: 'page 1'}; - * const state2 = NavigationStateUtils.push(state1, {key: 'page 2'}); - * ``` - */ - export interface NavigationStateUtils { - get(state: NavigationState, key: string): NavigationRoute - indexOf(state: NavigationState, key: string): number - has(state: NavigationState, key: string): boolean - push(state: NavigationState, route: NavigationRoute): NavigationState - pop(state: NavigationState): NavigationState - jumpToIndex(state: NavigationState, index: number): NavigationState - jumpTo(state: NavigationState, key: string): NavigationState - back(state: NavigationState): NavigationState - forward(state: NavigationState): NavigationState - replaceAt( - state: NavigationState, - key: string, - route: NavigationRoute - ): NavigationState - replaceAtIndex( - state: NavigationState, - index: number, - route: NavigationRoute - ): NavigationState - reset( - state: NavigationState, - routes: Array, - index?: number - ): NavigationState - } - - export type NavigationTransitionProps = { - // The layout of the transitioner of the scenes. - layout: NavigationLayout, - - // The navigation state of the transitioner. - navigationState: NavigationState, - - // The progressive index of the transitioner's navigation state. - position: NavigationAnimatedValue, - - // The value that represents the progress of the transition when navigation - // state changes from one to another. Its numberic value will range from 0 - // to 1. - // progress.__getAnimatedValue() < 1 : transtion is happening. - // progress.__getAnimatedValue() == 1 : transtion completes. - progress: NavigationAnimatedValue, - - // All the scenes of the transitioner. - scenes: Array, - - // The active scene, corresponding to the route at - // `navigationState.routes[navigationState.index]`. - scene: NavigationScene, - - // The gesture distance for `horizontal` and `vertical` transitions - gestureResponseDistance?: number, - } - export type NavigationTransitionSpec = { - duration?: number, - // An easing function from `Easing`. - easing?: EasingFunction, - // A timing function such as `Animated.timing`. - timing?: (value: NavigationAnimatedValue, config: any) => any, - } - export interface NavigationTransitionerProps { - configureTransition?: ( - a: NavigationTransitionProps, - b?: NavigationTransitionProps - ) => NavigationTransitionSpec, - navigationState: NavigationState, - onTransitionEnd?: () => void, - onTransitionStart?: () => void, - render: (a: NavigationTransitionProps, b?: NavigationTransitionProps) => any, - style: any, - } - - export interface NavigationTransitioner extends React.ComponentClass { - } - - export interface NavigationCard extends React.ComponentClass { - } - - export interface NavigationExperimentalStatic { - // Core - StateUtils: NavigationStateUtils - - // Views - Transitioner: NavigationTransitioner, - - //AnimatedView: NavigationAnimatedViewStatic; - // CustomComponents: - Card: NavigationCard, - CardStack: NavigationCardStackStatic; - Header: NavigationHeaderStatic; - - PropTypes: NavigationPropTypes, - } - - // - // Interfacing with Native Modules - // https://facebook.github.io/react-native/docs/native-modules-ios.html - // - - export interface NativeEventSubscription { - /** - * Call this method to un-subscribe from a native-event - */ - remove(): void; - } - - /** - * Receive events from native-code - * Deprecated - subclass NativeEventEmitter to create granular event modules instead of - * adding all event listeners directly to RCTNativeAppEventEmitter. - * @see https://github.com/facebook/react-native/blob/0.34-stable\Libraries\EventEmitter\RCTNativeAppEventEmitter.js - * @see https://facebook.github.io/react-native/docs/native-modules-ios.html#sending-events-to-javascript - */ - type RCTNativeAppEventEmitter = DeviceEventEmitterStatic - - interface ImageCropData { - /** - * The top-left corner of the cropped image, specified in the original - * image's coordinate space. - */ - offset: { - x: number; - y: number; - } - - /** - * The size (dimensions) of the cropped image, specified in the original - * image's coordinate space. - */ - size: { - width: number; - height: number; - } - - /** - * (Optional) size to scale the cropped image to. - */ - displaySize?: { width: number, height: number } - - /** - * (Optional) the resizing mode to use when scaling the image. If the - * `displaySize` param is not specified, this has no effect. - */ - resizeMode?: 'contain' | 'cover' | 'stretch' - } - - interface ImageEditorStatic { - /** - * Crop the image specified by the URI param. If URI points to a remote - * image, it will be downloaded automatically. If the image cannot be - * loaded/downloaded, the failure callback will be called. - * - * If the cropping process is successful, the resultant cropped image - * will be stored in the ImageStore, and the URI returned in the success - * callback will point to the image in the store. Remember to delete the - * cropped image from the ImageStore when you are done with it. - */ - cropImage( uri: string, cropData: ImageCropData, success: (uri: string) => void, failure: (error: Object) => void ): void - } - - ////////////////////////////////////////////////////////////////////////// - // - // R E - E X P O R T S - // - ////////////////////////////////////////////////////////////////////////// - - // TODO: The following components need to be added - // - [ ] ART - - export var ActivityIndicator: ActivityIndicatorStatic - export type ActivityIndicator = ActivityIndicatorStatic - - export var ActivityIndicatorIOS: ActivityIndicatorIOSStatic - export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic - - export var DatePickerIOS: DatePickerIOSStatic - export type DatePickerIOS = DatePickerIOSStatic - - export var DrawerLayoutAndroid: DrawerLayoutAndroidStatic - export type DrawerLayoutAndroid = DrawerLayoutAndroidStatic - - export var Image: ImageStatic - export type Image = ImageStatic - - export var ImagePickerIOS: ImagePickerIOSStatic - export type ImagePickerIOS = ImagePickerIOSStatic - - export var LayoutAnimation: LayoutAnimationStatic - export type LayoutAnimation = LayoutAnimationStatic - - export var ListView: ListViewStatic - export type ListView = ListViewStatic - - export var MapView: MapViewStatic - export type MapView = MapViewStatic - - export var Modal: ModalStatic - export type Modal = ModalStatic - - export var Navigator: NavigatorStatic - export type Navigator = NavigatorStatic - - export var NavigatorIOS: NavigatorIOSStatic - export type NavigatorIOS = NavigatorIOSStatic - - export var Picker: PickerStatic - export type Picker = PickerStatic - - export var PickerIOS: PickerIOSStatic - export type PickerIOS = PickerIOSStatic - - export var ProgressBarAndroid: ProgressBarAndroidStatic - export type ProgressBarAndroid = ProgressBarAndroidStatic - - export var ProgressViewIOS: ProgressViewIOSStatic - export type ProgressViewIOS = ProgressViewIOSStatic - - export var RefreshControl: RefreshControlStatic - export type RefreshControl = RefreshControlStatic - - export var RecyclerViewBackedScrollView: RecyclerViewBackedScrollViewStatic - export type RecyclerViewBackedScrollView = RecyclerViewBackedScrollViewStatic - - export var SegmentedControlIOS: SegmentedControlIOSStatic - export type SegmentedControlIOS = SegmentedControlIOSStatic - - export var Slider: SliderStatic - export type Slider = SliderStatic - - export var SliderIOS: SliderStatic - export type SliderIOS = SliderStatic - - export var StatusBar: StatusBarStatic - export type StatusBar = StatusBarStatic - - export var ScrollView: ScrollViewStatic - export type ScrollView = ScrollViewStatic - - export var SnapshotViewIOS: SnapshotViewIOSStatic - export type SnapshotViewIOS = SnapshotViewIOSStatic - - export var Systrace: SystraceStatic - export type Systrace = SystraceStatic - - export var SwipeableListView: SwipeableListViewStatic - export type SwipeableListView = SwipeableListViewStatic - - export var Switch: SwitchStatic - export type Switch = SwitchStatic - - export var SwitchIOS: SwitchIOSStatic - export type SwitchIOS = SwitchIOSStatic - - export var TabBarIOS: TabBarIOSStatic - export type TabBarIOS = TabBarIOSStatic - - export var Text: TextStatic - export type Text = TextStatic - - export var TextInput: TextInputStatic - export type TextInput = TextInputStatic - - export var ToolbarAndroid: ToolbarAndroidStatic - export type ToolbarAndroid = ToolbarAndroidStatic - - export var TouchableHighlight: TouchableHighlightStatic - export type TouchableHighlight = TouchableHighlightStatic - - export var TouchableNativeFeedback: TouchableNativeFeedbackStatic - export type TouchableNativeFeedback = TouchableNativeFeedbackStatic - - export var TouchableOpacity: TouchableOpacityStatic - export type TouchableOpacity = TouchableOpacityStatic - - export var TouchableWithoutFeedback: TouchableWithoutFeedbackStatic - export type TouchableWithoutFeedback = TouchableWithoutFeedbackStatic - - export var View: ViewStatic - export type View = ViewStatic - - export var ViewPagerAndroid: ViewPagerAndroidStatic - export type ViewPagerAndroid = ViewPagerAndroidStatic - - export var WebView: WebViewStatic - export type WebView = WebViewStatic - - - //////////// APIS ////////////// - export var ActionSheetIOS: ActionSheetIOSStatic - export type ActionSheetIOS = ActionSheetIOSStatic - - export var Share: ShareStatic - export type Share = ShareStatic - - export var AdSupportIOS: AdSupportIOSStatic - export type AdSupportIOS = AdSupportIOSStatic - - export var Alert: AlertStatic - export type Alert = AlertStatic - - export var AlertAndroid: AlertAndroidStatic - export type AlertAndroid = AlertAndroidStatic - - export var AlertIOS: AlertIOSStatic - export type AlertIOS = AlertIOSStatic - - export var AppState: AppStateStatic; - export type AppState = AppStateStatic; - - export var AppStateIOS: AppStateStatic - export type AppStateIOS = AppStateStatic - - export var AsyncStorage: AsyncStorageStatic - export type AsyncStorage = AsyncStorageStatic - - export var BackAndroid: BackAndroidStatic - export type BackAndroid = BackAndroidStatic - - export var Button: ButtonStatic - export type Button = ButtonStatic - - export var CameraRoll: CameraRollStatic - export type CameraRoll = CameraRollStatic - - export var Clipboard: ClipboardStatic - export type Clipboard = ClipboardStatic - - export var DatePickerAndroid: DatePickerAndroidStatic - export type DatePickerAndroid = DatePickerAndroidStatic - - export var Geolocation: GeolocationStatic - export type Geolocation = GeolocationStatic - - /** http://facebook.github.io/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps.html */ - export var I18nManager: I18nManagerStatic - export type I18nManager = I18nManagerStatic - - export var ImageEditor: ImageEditorStatic - export type ImageEditor = ImageEditorStatic - - export var ImageStore: ImageStoreStatic - export type ImageStore = ImageStoreStatic - - export var InteractionManager: InteractionManagerStatic - - export var IntentAndroid: IntentAndroidStatic - export type IntentAndroid = IntentAndroidStatic - - export var Keyboard: NativeEventEmitter - - export var KeyboardAvoidingView: KeyboardAvoidingViewStatic - export type KeyboardAvoidingView = KeyboardAvoidingViewStatic - - export var Linking: LinkingStatic - export type Linking = LinkingStatic - - export var LinkingIOS: LinkingIOSStatic - export type LinkingIOS = LinkingIOSStatic - - export var NativeMethodsMixin: NativeMethodsMixinStatic - export type NativeMethodsMixin = NativeMethodsMixinStatic - - export var NativeComponent: NativeMethodsMixinStatic - export type NativeComponent = NativeMethodsMixinStatic - - export var NetInfo: NetInfoStatic - export type NetInfo = NetInfoStatic - - export var PanResponder: PanResponderStatic - export type PanResponder = PanResponderStatic - - export var PermissionsAndroid: PermissionsAndroidStatic - export type PermissionsAndroid = PermissionsAndroidStatic - - export var PushNotificationIOS: PushNotificationIOSStatic - export type PushNotificationIOS = PushNotificationIOSStatic - - export var Settings: SettingsStatic - export type Settings = SettingsStatic - - export var StatusBarIOS: StatusBarIOSStatic - export type StatusBarIOS = StatusBarIOSStatic - - export var TimePickerAndroid: TimePickerAndroidStatic - export type TimePickerAndroid = TimePickerAndroidStatic - - export var ToastAndroid: ToastAndroidStatic - export type ToastAndroid = ToastAndroidStatic - - export var UIManager: UIManagerStatic - export type UIManager = UIManagerStatic - - export var VibrationIOS: VibrationIOSStatic - export type VibrationIOS = VibrationIOSStatic - - export var Vibration: VibrationStatic - export type Vibration = VibrationStatic - - export var Dimensions: Dimensions; - export var ShadowPropTypesIOS: ShadowPropTypesIOSStatic; - - export type NavigationExperimental = NavigationExperimentalStatic; - export var NavigationExperimental: NavigationExperimentalStatic; - - export type Easing = EasingStatic; - export var Easing: EasingStatic; - - //////////// Plugins ////////////// - - export var DeviceEventEmitter: DeviceEventEmitterStatic - /** - * Abstract base class for implementing event-emitting modules. This implements - * a subset of the standard EventEmitter node module API. - */ - export interface NativeEventEmitter extends EventEmitter {} - export var NativeEventEmitter: NativeEventEmitter - /** - * Deprecated - subclass NativeEventEmitter to create granular event modules instead of - * adding all event listeners directly to RCTNativeAppEventEmitter. - */ - export var NativeAppEventEmitter: RCTNativeAppEventEmitter - /** - * Native Modules written in ObjectiveC/Swift/Java exposed via the RCTBridge - * Define lazy getters for each module. These will return the module if already loaded, or load it if not. - * See https://facebook.github.io/react-native/docs/native-modules-ios.html - * Use: - * const MyModule = NativeModules.ModuleName - */ - export var NativeModules: any - export var Platform: PlatformStatic - export var PixelRatio: PixelRatioStatic - - export interface ComponentInterface

{ - name?: string; - displayName?: string; - propTypes: P - } - - /** - * Used to create React components that directly wrap native component - * implementations. Config information is extracted from data exported from the - * UIManager module. You should also wrap the native component in a - * hand-written component with full propTypes definitions and other - * documentation - pass the hand-written component in as `componentInterface` to - * verify all the native props are documented via `propTypes`. - * - * If some native props shouldn't be exposed in the wrapper interface, you can - * pass null for `componentInterface` and call `verifyPropTypes` directly - * with `nativePropsToIgnore`; - * - * Common types are lined up with the appropriate prop differs with - * `TypeToDifferMap`. Non-scalar types not in the map default to `deepDiffer`. - */ - export function requireNativeComponent

( - viewName: string, - componentInterface?: ComponentInterface

, - extraConfig?: {nativeOnly?: any} - ): React.ComponentClass

; - - export function processColor(color: any): number; - - ////////////////////////////////////////////////////////////////////////// - // - // Additional ( and controversial) - // - ////////////////////////////////////////////////////////////////////////// - - export function __spread(target: any, ...sources: any[]): any; - - export interface GlobalStatic { - - /** - * Accepts a function as its only argument and calls that function before the next repaint. - * It is an essential building block for animations that underlies all of the JavaScript-based animation APIs. - * In general, you shouldn't need to call this yourself - the animation API's will manage frame updates for you. - * @see https://facebook.github.io/react-native/docs/animations.html#requestanimationframe - */ - requestAnimationFrame(fn: () => void): void; - - } - - // - // Add-Ons - // - namespace addons { - - //FIXME: Documentation ? - export interface TestModuleStatic { - - verifySnapshot: (done: (indicator?: any) => void) => void - markTestPassed: (indicator: any) => void - markTestCompleted: () => void - } - - export var TestModule: TestModuleStatic - export type TestModule = TestModuleStatic - } - - // - // Prop Types - // - export var ColorPropType: Requireable - export var EdgeInsetsPropType: Requireable - export var PointPropType: Requireable -} - -declare global { - const global: React.GlobalStatic; - function require(name: string): any; - - /** - * This variable is set to true when react-native is running in Dev mode - * Typical usage: - * if (__DEV__) console.log('Running in dev mode') - */ - var __DEV__: boolean -} diff --git a/react-paginate/react-paginate-tests.tsx b/react-paginate/react-paginate-tests.tsx deleted file mode 100644 index 2ae495eacf..0000000000 --- a/react-paginate/react-paginate-tests.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from "react"; -import ReactPaginate = require("react-paginate"); - -class Test extends React.Component<{}, {}> { - public render() { - return ( - - ); - } -} diff --git a/react-router/lib/withRouter.d.ts b/react-router/lib/withRouter.d.ts deleted file mode 100644 index 25f9d357c7..0000000000 --- a/react-router/lib/withRouter.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ComponentClass, StatelessComponent } from "react"; - -interface Options { - withRef?: boolean; -} - -type ComponentConstructor

= ComponentClass

| StatelessComponent

; - -export default function withRouter

(component: ComponentConstructor

, options?: Options): ComponentClass

; diff --git a/react-spinkit/index.d.ts b/react-spinkit/index.d.ts deleted file mode 100644 index 05955e3f53..0000000000 --- a/react-spinkit/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for react-spinkit 1.1.4 -// Project: https://github.com/KyleAMathews/react-spinkit -// Definitions by: Qubo , Mleko -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare namespace spinner { - export interface SpinnerProps { - spinnerName?: string; - } - - export interface Spinner extends React.ComponentClass { - } -} - -declare const spinner: spinner.Spinner; -export = spinner; diff --git a/react-spinkit/react-spinkit-tests.tsx b/react-spinkit/react-spinkit-tests.tsx deleted file mode 100644 index a163400601..0000000000 --- a/react-spinkit/react-spinkit-tests.tsx +++ /dev/null @@ -1,7 +0,0 @@ - -/// - -import * as Spinner from 'react-spinkit'; -import * as React from 'react'; - -let spinner = ; diff --git a/redux-logger/index.d.ts b/redux-logger/index.d.ts deleted file mode 100644 index 257f070d44..0000000000 --- a/redux-logger/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for redux-logger v2.6.0 -// Project: https://github.com/fcomb/redux-logger -// Definitions by: Alexander Rusakov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as Redux from "redux"; - -// Trickery to get TypeScript to accept that our anonymous, non-default export is a function. -// see https://github.com/Microsoft/TypeScript/issues/3612 for more -declare namespace createLogger { - export type LoggerPredicate = (getState: () => any, action: any) => boolean; - - export type StateToString = (state: any) => string; - export type ActionToString = (action: any) => string; - export type ErrorToString = (error: any, prevState: any) => string; - - export interface ColorsObject { - title?: boolean | ActionToString; - prevState?: boolean | StateToString; - action?: boolean | ActionToString; - nextState?: boolean | StateToString; - error?: boolean | ErrorToString; - } - - export interface LevelObject { - prevState?: string | boolean | StateToString; - action?: string | boolean | ActionToString; - nextState?: string | boolean | StateToString; - error?: string | boolean | ErrorToString; - } - - export interface ReduxLoggerOptions { - level?: string | ActionToString | LevelObject; - duration?: boolean; - timestamp?: boolean; - colors?: ColorsObject; - logger?: any; - logErrors?: boolean; - collapsed?: boolean | LoggerPredicate; - predicate?: LoggerPredicate; - stateTransformer?: (state: any) => any; - actionTransformer?: (action: any) => any; - errorTransformer?: (error: any) => any; - diff?: boolean; - diffPredicate?: LoggerPredicate; - } -} -declare function createLogger(options?: createLogger.ReduxLoggerOptions): Redux.Middleware; -export = createLogger; diff --git a/redux-persist-transform-compress/index.d.ts b/redux-persist-transform-compress/index.d.ts deleted file mode 100644 index 2f8fb7f366..0000000000 --- a/redux-persist-transform-compress/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for redux-persist-transform-compress 4.1 -// Project: https://github.com/rt2zz/redux-persist-transform-compress -// Definitions by: Karol Janyst -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { PersistConfig, PersistTransformer } from "redux-persist"; - -export = createCompressor; -declare function createCompressor (config?: PersistConfig): PersistTransformer; diff --git a/redux-persist-transform-compress/redux-persist-transform-compress-tests.ts b/redux-persist-transform-compress/redux-persist-transform-compress-tests.ts deleted file mode 100644 index b445171cb9..0000000000 --- a/redux-persist-transform-compress/redux-persist-transform-compress-tests.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { createStore, Reducer, Store } from "redux" -import { createPersistor, Persistor, PersistTransformer } from "redux-persist" -import createCompressor = require("redux-persist-transform-compress") - -const reducer: Reducer = (state: any, action: any) => ({}) - -const compressor: PersistTransformer = createCompressor({ whitelist : ["foo"] }) - -const store: Store = createStore(reducer) - -const persistor: Persistor = createPersistor(store, { transforms : [compressor] }) diff --git a/redux-persist-transform-compress/tsconfig.json b/redux-persist-transform-compress/tsconfig.json deleted file mode 100644 index 5e33f4960f..0000000000 --- a/redux-persist-transform-compress/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", - "redux-persist-transform-compress-tests.ts" - ] -} \ No newline at end of file diff --git a/redux-persist-transform-encrypt/index.d.ts b/redux-persist-transform-encrypt/index.d.ts deleted file mode 100644 index 048f02221f..0000000000 --- a/redux-persist-transform-encrypt/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for redux-persist-transform-encrypt 0.1 -// Project: https://github.com/maxdeviant/redux-persist-transform-encrypt#readme -// Definitions by: Karol Janyst -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { PersistTransformer } from "redux-persist"; - -export as namespace ReduxPersistEncryptor; - -export = createEncryptor; - -declare function createEncryptor (config: createEncryptor.EncryptorConfig): PersistTransformer; - -declare namespace createEncryptor { - export interface EncryptorConfig { - secretKey: string; - } -} diff --git a/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts b/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts deleted file mode 100644 index b3a70dc776..0000000000 --- a/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { createStore, Reducer, Store } from "redux" -import { createPersistor, Persistor, PersistTransformer } from "redux-persist" -import { EncryptorConfig } from "redux-persist-transform-encrypt" -import * as createEncryptor from "redux-persist-transform-encrypt" - -const reducer: Reducer = (state: any, action: any) => ({}) - -const config: EncryptorConfig = { secretKey : "foo" } -const encryptor: PersistTransformer = createEncryptor(config) - -const store: Store = createStore(reducer) - -const persistor: Persistor = createPersistor(store, { transforms : [encryptor] }) diff --git a/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts b/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts deleted file mode 100644 index a19f7610e4..0000000000 --- a/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { createStore, Reducer, Store } from "redux" -import { createPersistor, Persistor, PersistTransformer } from "redux-persist" -import createFilter from "redux-persist-transform-filter" - -const reducer: Reducer = (state: any, action: any) => ({}) - -const filter: PersistTransformer = createFilter( - "foo", - ["foo.bar"], - ["fizz.buzz"] -) - -const store: Store = createStore(reducer) - -const persistor: Persistor = createPersistor(store, { transforms : [filter] }) diff --git a/redux-persist/constants.d.ts b/redux-persist/constants.d.ts deleted file mode 100644 index 93d3249dda..0000000000 --- a/redux-persist/constants.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const KEY_PREFIX: string; -export const REHYDRATE: string; diff --git a/redux-persist/index.d.ts b/redux-persist/index.d.ts deleted file mode 100644 index c8d099d5e6..0000000000 --- a/redux-persist/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for redux-persist 4.0 -// Project: https://github.com/rt2zz/redux-persist -// Definitions by: Karol Janyst -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { Action, GenericStoreEnhancer, Store } from "redux"; - -export interface PersistAction extends Action { - payload?: S; - error?: any; -} - -export interface PersistorRehydrateOptions { - serial?: boolean; -} - -export interface Persistor { - purge(keys?: string[]): void; - rehydrate(incoming: A, options?: PersistorRehydrateOptions): A; - pause(): void; - resume(): void; -} - -export type PersistCallback = (err: any, response?: A) => void; - -export interface PersistTransformer { - in(state: any, key: string): any; - out(state: any, key: string): any; -} - -export interface PersistStorage { - setItem(key: string, value: any, callback?: PersistCallback): Promise; - getItem(key: string, callback?: PersistCallback): Promise; - removeItem(key: string, callback?: PersistCallback): Promise; - getAllKeys(callback?: PersistCallback): Promise; - [key: string]: any; -} - -export type PersistStateReconciler = (state: A, inboundState: B, reducedState: C, log?: boolean) => C; - -export interface PersistAutoRehydrateConfig { - stateReconcile?: PersistStateReconciler; -} - -export interface PersistConfig { - whitelist?: string[]; - blacklist?: string[]; - transforms?: PersistTransformer[]; - storage?: PersistStorage; - debounce?: number; - keyPrefix?: string; - serialize?: (data: any) => string; - deserialize?: (data: string) => any; -} - -export function autoRehydrate (config?: PersistAutoRehydrateConfig): GenericStoreEnhancer; - -export function createPersistor (store: Store, config?: PersistConfig): Persistor; - -export function createTransform (inbound: any, outbound: any, config?: PersistConfig): PersistTransformer; - -export function getStoredState(config?: PersistConfig, callback?: PersistCallback): Promise; - -export function persistStore (store: Store, config?: PersistConfig, callback?: PersistCallback): Persistor; - -export function purgeStoredState (config?: PersistConfig, keys?: string[]): Promise; diff --git a/redux-persist/redux-persist-tests.ts b/redux-persist/redux-persist-tests.ts deleted file mode 100644 index 59885a292a..0000000000 --- a/redux-persist/redux-persist-tests.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { createStore, Store, Reducer } from "redux" -import { - autoRehydrate, - createPersistor, - createTransform, - getStoredState, - persistStore, - purgeStoredState, - PersistConfig, - PersistAutoRehydrateConfig, - PersistCallback, - Persistor, - PersistorRehydrateOptions, - PersistTransformer -} from "redux-persist" -import { KEY_PREFIX, REHYDRATE } from "redux-persist/constants" -import { asyncLocalStorage, asyncSessionStorage } from "redux-persist/storages" - -const reducer: Reducer = (state: any, action: any) => ({}) - -const persistCallback: PersistCallback = (err: any, response: any) => {} - -const transform: PersistTransformer = createTransform({}, {}, { whitelist : ["foo"] }) - -const persistConfig: PersistConfig = { - blacklist : ["foo"], - whitelist : ["bar"], - storage : asyncLocalStorage, - transforms : [transform], - debounce : 1000, - keyPrefix : KEY_PREFIX -} - -const rehydrateOptions: PersistorRehydrateOptions = { serial : true } - -const autoRehydrateConfig: PersistAutoRehydrateConfig = { - stateReconcile: (state: any, inboundState: any, reducedState: any, log: boolean) => ({}) -} - -const store: Store = createStore(reducer, autoRehydrate(autoRehydrateConfig)) -const persistor: Persistor = persistStore(store, persistConfig, persistCallback) - -purgeStoredState({ whitelist : ["foo"] }, ["bar"]) - -getStoredState(persistConfig, (err: any, restoredState: any) => { - const store: Store = createStore(reducer, restoredState) - const persistor: Persistor = createPersistor(store, persistConfig) - const secondaryPersistor: Persistor = createPersistor(store, { storage : asyncSessionStorage }) - persistor.pause() - persistor.resume() - persistor.purge(["foo", "bar"]) - persistor.rehydrate(restoredState, rehydrateOptions) -}) diff --git a/redux-persist/storages.d.ts b/redux-persist/storages.d.ts deleted file mode 100644 index b798ed2664..0000000000 --- a/redux-persist/storages.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { PersistStorage } from "redux-persist"; - -export const asyncLocalStorage: PersistStorage; -export const asyncSessionStorage: PersistStorage; diff --git a/redux-persist/tsconfig.json b/redux-persist/tsconfig.json deleted file mode 100644 index 53bbe4f198..0000000000 --- a/redux-persist/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "constants.d.ts", - "storages.d.ts", - "redux-persist-tests.ts" - ] -} \ No newline at end of file diff --git a/redux-promise-middleware/package.json b/redux-promise-middleware/package.json deleted file mode 100644 index 36ce503807..0000000000 --- a/redux-promise-middleware/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "redux": "^3.6.0" - } -} diff --git a/redux-router/package.json b/redux-router/package.json deleted file mode 100644 index 36ce503807..0000000000 --- a/redux-router/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "redux": "^3.6.0" - } -} diff --git a/scripts/fix-tslint.ts b/scripts/fix-tslint.ts index 940257e945..a54f4c7386 100644 --- a/scripts/fix-tslint.ts +++ b/scripts/fix-tslint.ts @@ -2,16 +2,11 @@ /// -import assert = require("assert"); -import * as fs from 'fs'; -import * as path from 'path'; +import * as fs from "fs"; +import * as path from "path"; import JSON = require("comment-json"); -function repeat(s: string, count: number) { - return Array(count + 1).join(s); -} - -const home = path.join(__dirname, '..'); +const home = path.join(__dirname, "..", "types"); for (const dirName of fs.readdirSync(home)) { if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") { diff --git a/scripts/lint.js b/scripts/lint.js index 4d47ce3406..84ef71259d 100644 --- a/scripts/lint.js +++ b/scripts/lint.js @@ -4,9 +4,11 @@ const execSync = require("child_process").execSync; const existsSync = require("fs").existsSync; const path = require("path"); +const pkgPath = path.join("types", pkg); + // Path of tslint when `types-publisher` is symlinked -const symlinkedTslintPath = "../node_modules/types-publisher/node_modules/tslint" -let tslintPath = existsSync(path.join(pkg, symlinkedTslintPath)) ? symlinkedTslintPath : "../node_modules/tslint"; +const symlinkedTslintPath = "../../node_modules/types-publisher/node_modules/tslint" +let tslintPath = existsSync(path.join(pkgPath, symlinkedTslintPath)) ? symlinkedTslintPath : "../node_modules/tslint"; // An older version (e.g. abs/v0) is in a nested directory, so needs to look one more level up for tslint. if (pkg.includes("/") && pkg[pkg.length - 1] !== "/") { tslintPath = path.join("..", tslintPath); @@ -17,7 +19,7 @@ console.log(cmd); try { // Child process writes directly to our own stdout - execSync(cmd, { cwd: pkg, stdio: "inherit" }); + execSync(cmd, { cwd: pkgPath, stdio: "inherit" }); } catch (_) { // Process should have printed out error info } diff --git a/scripts/not-needed.js b/scripts/not-needed.js index f5b5cc8e6a..e17b3ac6ce 100644 --- a/scripts/not-needed.js +++ b/scripts/not-needed.js @@ -13,9 +13,10 @@ if (process.argv.length !== 5 && process.argv.length !== 6) { process.exit(1); } -rmdirRecursive(typingsPackageName); +rmdirRecursive(path.join("types", typingsPackageName)); const notNeededPackages = JSON.parse(fs.readFileSync("notNeededPackages.json", "utf-8")); notNeededPackages.packages.push({ libraryName, typingsPackageName, sourceRepoURL, asOfVersion }); +notNeededPackages.packages.sort((x, y) => x.typingsPackageName < y.typingsPackageName ? -1 : 1); fs.writeFileSync("notNeededPackages.json", JSON.stringify(notNeededPackages, undefined, 4), "utf-8"); function rmdirRecursive(dir) { diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index f0f0258c77..899f96af64 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -4,9 +4,13 @@ "target": "es6", "noImplicitAny": true, "strictNullChecks": true, - "baseUrl": "../", + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "baseUrl": "../types", "typeRoots": [ - "../" + "../types" ], "types": [], "forceConsistentCasingInFileNames": true diff --git a/semver/index.d.ts b/semver/index.d.ts deleted file mode 100644 index a1ace1a134..0000000000 --- a/semver/index.d.ts +++ /dev/null @@ -1,186 +0,0 @@ -// Type definitions for semver v5.3.0 -// Project: https://github.com/npm/node-semver -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver - -declare namespace SemVerModule { - /** - * Return the parsed version, or null if it's not valid. - */ - function valid(v: string, loose?: boolean): string; - /** - * Returns cleaned (removed leading/trailing whitespace, remove '=v' prefix) and parsed version, or null if version is invalid. - */ - function clean(version: string, loose?: boolean): string; - /** - * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. - */ - function inc(v: string, release: string, loose?: boolean): string; - /** - * Return the major version number. - */ - function major(v: string, loose?: boolean): number; - /** - * Return the minor version number. - */ - function minor(v: string, loose?: boolean): number; - /** - * Return the patch version number. - */ - function patch(v: string, loose?: boolean): number; - /** - * Returns an array of prerelease components, or null if none exist. - */ - function prerelease(v: string, loose?: boolean): string[]; - - // Comparison - /** - * v1 > v2 - */ - function gt(v1: string, v2: string, loose?: boolean): boolean; - /** - * v1 >= v2 - */ - function gte(v1: string, v2: string, loose?: boolean): boolean; - /** - * v1 < v2 - */ - function lt(v1: string, v2: string, loose?: boolean): boolean; - /** - * v1 <= v2 - */ - function lte(v1: string, v2: string, loose?: boolean): boolean; - /** - * v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. - */ - function eq(v1: string, v2: string, loose?: boolean): boolean; - /** - * v1 != v2 The opposite of eq. - */ - function neq(v1: string, v2: string, loose?: boolean): boolean; - /** - * Pass in a comparison string, and it'll call the corresponding semver comparison function. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. - */ - function cmp(v1: string, comparator: any, v2: string, loose?: boolean): boolean; - /** - * Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). - */ - function compare(v1: string, v2: string, loose?: boolean): number; - /** - * The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). - */ - function rcompare(v1: string, v2: string, loose?: boolean): number; - /** - * Returns difference between two versions by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if the versions are the same. - */ - function diff(v1: string, v2: string, loose?: boolean): string; - - // Ranges - /** - * Return the valid range or null if it's not valid - */ - function validRange(range: string, loose?: boolean): string; - /** - * Return true if the version satisfies the range. - */ - function satisfies(version: string, range: string, loose?: boolean): boolean; - /** - * Return the highest version in the list that satisfies the range, or null if none of them do. - */ - function maxSatisfying(versions: string[], range: string, loose?: boolean): string; - /** - * Return the lowest version in the list that satisfies the range, or null if none of them do. - */ - function minSatisfying(versions: string[], range: string, loose?: boolean): string; - /** - * Return true if version is greater than all the versions possible in the range. - */ - function gtr(version: string, range: string, loose?: boolean): boolean; - /** - * Return true if version is less than all the versions possible in the range. - */ - function ltr(version: string, range: string, loose?: boolean): boolean; - /** - * Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) - */ - function outside(version: string, range: string, hilo: string, loose?: boolean): boolean; - - class SemVerBase { - raw: string; - loose: boolean; - format(): string; - inspect(): string; - toString(): string; - } - - class SemVer extends SemVerBase { - constructor(version: string, loose?: boolean); - - major: number; - minor: number; - patch: number; - version: string; - build: string[]; - prerelease: string[]; - - compare(other:SemVer): number; - compareMain(other:SemVer): number; - comparePre(other:SemVer): number; - inc(release: string): SemVer; - } - - class Comparator extends SemVerBase { - constructor(comp: string, loose?: boolean); - - semver: SemVer; - operator: string; - value: boolean; - parse(comp: string): void; - test(version:SemVer): boolean; - } - - class Range extends SemVerBase { - constructor(range: string, loose?: boolean); - - set: Comparator[][]; - parseRange(range: string): Comparator[]; - test(version: SemVer): boolean; - } -} - -interface SemVerStatic { - SemVer(version: string, loose?: boolean): SemVerModule.SemVer; - Comparator(comp: string, loose?: boolean): SemVerModule.Comparator; - Range(range: string, loose?: boolean): SemVerModule.Range; - clean(version: string, loose?: boolean): string; - - SEMVER_SPEC_VERSION: string; - - valid(v: string, loose?: boolean): string; - inc(v: string, release: string, loose?: boolean): string; - major(v: string, loose?: boolean): number; - minor(v: string, loose?: boolean): number; - patch(v: string, loose?: boolean): number; - gt(v1: string, v2: string, loose?: boolean): boolean; - gte(v1: string, v2: string, loose?: boolean): boolean; - lt(v1: string, v2: string, loose?: boolean): boolean; - lte(v1: string, v2: string, loose?: boolean): boolean; - eq(v1: string, v2: string, loose?: boolean): boolean; - neq(v1: string, v2: string, loose?: boolean): boolean; - cmp(v1: string, comparator: any, v2: string, loose?: boolean): boolean; - compare(v1: string, v2: string, loose?: boolean): number; - rcompare(v1: string, v2: string, loose?: boolean): number; - diff(v1: string, v2: string, loose?: boolean): string; - validRange(range: string, loose?: boolean): string; - satisfies(version: string, range: string, loose?: boolean): boolean; - maxSatisfying(versions: string[], range: string, loose?: boolean): string; - gtr(version: string, range: string, loose?: boolean): boolean; - ltr(version: string, range: string, loose?: boolean): boolean; - outside(version: string, range: string, hilo: string, loose?: boolean): boolean; -} - -declare var semver: SemVerStatic; - -declare module "semver" { - export = SemVerModule; -} diff --git a/semver/semver-tests.ts b/semver/semver-tests.ts deleted file mode 100644 index 62511ef425..0000000000 --- a/semver/semver-tests.ts +++ /dev/null @@ -1,157 +0,0 @@ - - -var obj:Object; -var bool:boolean; -var num:number; -var str:string; -var diff:string; -var x:any = null; -var arr:any[]; -var exp:RegExp; -var strArr:string[]; -var numArr:string[]; - -var mod:typeof SemVerModule; - -var v1:string, v2:string; -var version:string; -var versions:string[]; -var loose:boolean; - -str = mod.valid(str); -str = mod.clean(str); - -str = mod.valid(str, loose); -str = mod.clean(str, loose); -str = mod.inc(str, str, loose); -num = mod.major(str, loose); -num = mod.minor(str, loose); -num = mod.patch(str, loose); -strArr = mod.prerelease(str, loose); - -// Comparison -bool = mod.gt(v1, v2, loose); -bool = mod.gte(v1, v2, loose); -bool = mod.lt(v1, v2, loose); -bool = mod.lte(v1, v2, loose); -bool = mod.eq(v1, v2, loose); -bool = mod.neq(v1, v2, loose); -bool = mod.cmp(v1, x, v2, loose); -num = mod.compare(v1, v2, loose); -num = mod.rcompare(v1, v2, loose); -diff = mod.diff(v1, v2, loose); - -// Ranges -str = mod.validRange(str, loose); -bool = mod.satisfies(version, str, loose); -str = mod.maxSatisfying(versions, str, loose); -str = mod.minSatisfying(versions, str, loose); -bool = mod.gtr(version, str, loose); -bool = mod.ltr(version, str, loose); -bool = mod.outside(version, str, str, loose); - -var ver = new mod.SemVer(str, bool); -str = ver.raw; -bool = ver.loose; -str = ver.format(); -str = ver.inspect(); -str = ver.toString(); - -num = ver.major; -num = ver.minor; -num = ver.patch; -str = ver.version; -strArr = ver.build; -strArr = ver.prerelease; - -num = ver.compare(ver); -num = ver.compareMain(ver); -num = ver.comparePre(ver); -ver = ver.inc(str); - - -var comp = new SemVerModule.Comparator(str, bool); -str = comp.raw; -bool = comp.loose; -str = comp.format(); -str = comp.inspect(); -str = comp.toString(); - -ver = comp.semver; -str = comp.operator; -bool = comp.value; -comp.parse(str); -bool = comp.test(ver); - - -var range = new SemVerModule.Range(str, bool); -str = range.raw; -bool = range.loose; -str = range.format(); -str = range.inspect(); -str = range.toString(); - -bool = range.test(ver); - -var sets:SemVerModule.Comparator[][]; -sets = range.set; - -var lims:SemVerModule.Comparator[]; -lims = range.parseRange(str); - -/** - * Test Static version - */ -var semver: SemVerStatic = semver; -var testString: string; -var testNumber: number; -var testBoolean: boolean; - -testString = semver.SEMVER_SPEC_VERSION; - -testString = semver.valid('v1.0.0'); -testString = semver.clean(' =v1.0.0 '); -testString = semver.valid('v1.0.0', true); -testString = semver.clean(' =v1.0.0 ', true); -testString = semver.inc('v1.0.0', 'major'); -testString = semver.inc('v1.0.0', 'major', true); -testNumber = semver.major('v1.0.0'); -testNumber = semver.major('v1.0.0', true); -testNumber = semver.minor('v1.0.0'); -testNumber = semver.minor('v1.0.0', true); -testNumber = semver.patch('v1.0.0'); -testNumber = semver.patch('v1.0.0', true); - -testBoolean = semver.gt('v1.0.0', 'v2.0.0'); -testBoolean = semver.gt('v1.0.0', 'v2.0.0', true); -testBoolean = semver.gte('v1.0.0', 'v2.0.0'); -testBoolean = semver.gte('v1.0.0', 'v2.0.0', true); -testBoolean = semver.lt('v1.0.0', 'v2.0.0'); -testBoolean = semver.lt('v1.0.0', 'v2.0.0', true); -testBoolean = semver.lte('v1.0.0', 'v2.0.0'); -testBoolean = semver.lte('v1.0.0', 'v2.0.0', true); -testBoolean = semver.eq('v1.0.0', 'v2.0.0'); -testBoolean = semver.eq('v1.0.0', 'v2.0.0', true); -testBoolean = semver.neq('v1.0.0', 'v2.0.0'); -testBoolean = semver.neq('v1.0.0', 'v2.0.0', true); -testBoolean = semver.cmp('v1.0.0', '===', 'v2.0.0'); -testBoolean = semver.cmp('v1.0.0', '!==', 'v2.0.0', true); -testNumber = semver.compare('v1.0.0', 'v2.0.0'); -testNumber = semver.compare('v1.0.0', 'v2.0.0', true); -testNumber = semver.rcompare('v1.0.0', 'v2.0.0'); -testNumber = semver.rcompare('v1.0.0', 'v2.0.0', true); -testString = semver.diff('v1.0.0', 'v2.0.0'); -testString = semver.diff('v1.0.0', 'v2.0.0', true); - -testString = semver.validRange('^1.0.0'); -testString = semver.validRange('^1.0.0', true); -testBoolean = semver.satisfies('v1.0.0', '^1.0.0'); -testBoolean = semver.satisfies('v1.0.0', '^1.0.0', true); -testString = semver.maxSatisfying(['v1.0.0', 'v2.0.0'], '^1.0.0'); -testString = semver.maxSatisfying(['v1.0.0', 'v2.0.0'], '^1.0.0', true); -testBoolean = semver.gtr('v1.0.0', '^1.0.0'); -testBoolean = semver.gtr('v1.0.0', '^1.0.0', true); -testBoolean = semver.ltr('v1.0.0', '^1.0.0'); -testBoolean = semver.ltr('v1.0.0', '^1.0.0', true); -testBoolean = semver.outside('v1.0.0', '^1.0.0', '<'); -testBoolean = semver.outside('v1.0.0', '^1.0.0', '>', true); diff --git a/service_worker_api/index.d.ts b/service_worker_api/index.d.ts deleted file mode 100644 index 3f7e07acaa..0000000000 --- a/service_worker_api/index.d.ts +++ /dev/null @@ -1,831 +0,0 @@ -// Type definitions for service_worker_api 0.0 -// Project: https://developer.mozilla.org/fr/docs/Web/API/ServiceWorker_API -// Definitions by: Tristan Caron -// Definitions: https://github.com/borisyankov/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -/** - * An CacheOptions object allowing you to set specific control options for the - * matching done in the match operation. - * - * @property [ignoreSearch] A Boolean that specifies whether the matching - * process should ignore the query string in the url. If set to true, - * the ?value=bar part of http://foo.com/?value=bar would be ignored when - * performing a match. It defaults to false. - * - * @property [ignoreMethod] A Boolean that, when set to true, prevents matching - * operations from validating the Request http method (normally only GET - * and HEAD are allowed.) It defaults to false. - * - * @property [ignoreVary] A Boolean that when set to true tells the matching - * operation not to perform VARY header matching — i.e. if the URL matches you - * will get a match regardless of the Response object having a VARY header or - * not. It defaults to false. - * - * @property [cacheName] A DOMString that represents a specific cache to search - * within. Note that this option is ignored by Cache.match(). - */ -interface CacheOptions { - ignoreSearch?: boolean; - ignoreMethod?: boolean; - ignoreVary?: boolean; - cacheName?: string; -} - -/** - * Represents the storage for Request / Response object pairs that are cached as - * part of the ServiceWorker life cycle. - */ -interface Cache { - /** - * Returns a Promise that resolves to the response associated with the first - * matching request in the Cache object. - * - * @param request The Request you are attempting to find in the Cache. - * @param [options] An object that sets options for the match operation. - */ - match(request: Request | string, options?: CacheOptions): Promise; - - /** - * Returns a Promise that resolves to an array of all matching responses in - * the Cache object. - * - * @param request The Request you are attempting to find in the Cache. - * @param [options] An object that sets options for the match operation. - */ - matchAll(request: Request | string, options?: CacheOptions): Promise; - - /** - * Returns a Promise that resolves to a new Cache entry whose key - * is the request. - * - * @param request The Request you want to add to the cache. - */ - add(request: Request | string): Promise; - - /** - * Returns a Promise that resolves to a new array of Cache entries whose - * keys are the requests. - * - * @param request An array of Request objects you want to add to the cache. - */ - addAll(requests: Array): Promise; - - /** - * Adds additional key/value pairs to the current Cache object. - * - * @param request The Request you want to add to the cache. - * @param response The response you want to match up to the request. - */ - put(request: Request, response: Response): Promise; - - /** - * Finds the Cache entry whose key is the request, and if found, deletes the - * Cache entry and returns a Promise that resolves to true. If no Cache - * entry is found, it returns false. - * - * @param request The Request you are looking to delete. - * @param [options] An object that sets options for the match operation. - */ - delete(request: Request | string, options?: CacheOptions): Promise; - - /** - * Returns a Promise that resolves to an array of Cache keys. - * - * @param request The Request want to return, if a specific key is desired. - * @param [options] An object that sets options for the match operation. - */ - keys(request?: Request, options?: CacheOptions): Promise; -} - -/** - * Represents the storage for Cache objects. It provides a master directory of - * all the named caches that a ServiceWorker can access and maintains a mapping - * of string names to corresponding Cache objects. - */ -interface CacheStorage { - /** - * Checks if a given Request is a key in any of the Cache objects that the - * CacheStorage object tracks and returns a Promise that resolves - * to that match. - * - * @param request The Request you are looking for a match for in the CacheStorage. - * @param [options] An object that sets options for the match operation. - */ - match(request: Request | string, options?: CacheOptions): Promise; - - /** - * Returns a Promise that resolves to true if a Cache object matching - * the cacheName exists. - * - * @param cacheName The Request you are looking for a match for in the - * CacheStorage. - */ - has(cacheName: string): Promise; - - /** - * Returns a Promise that resolves to the Cache object matching - * the cacheName. - * - * @param cacheName The name of the cache you want to open. - */ - open(cacheName: string): Promise; - - /** - * Finds the Cache object matching the cacheName, and if found, deletes the - * Cache object and returns a Promise that resolves to true. If no - * Cache object is found, it returns false. - * - * @param cacheName The name of the cache you want to delete. - */ - delete(cacheName: string): Promise; - - /** - * Returns a Promise that will resolve with an array containing strings - * corresponding to all of the named Cache objects tracked by the - * CacheStorage. Use this method to iterate over a list of all the - * Cache objects. - */ - keys(): Promise; -} - -/** - * Represents the scope of a service worker client. A service worker client is - * either a document in a browser context or a SharedWorker, which is controlled - * by an active worker. - */ -interface ServiceWorkerClient { - /** - * Allows a service worker client to send a message to a ServiceWorker. - * - * @param message The message to send to the service worker. - * @param [transfer] A transferable object such as, for example, a reference - * to a port. - */ - postMessage(message: any, transfer?: any): void; - - /** - * Indicates the type of browsing context of the current client. - * This value can be one of auxiliary, top-level, nested, or none. - */ - readonly frameType: string; - - /** - * Returns the id of the Client object. - */ - readonly id: string; - - /** - * The URL of the current service worker client. - */ - readonly url: string; -} - -interface WindowClient extends ServiceWorkerClient { - /** - * Gives user input focus to the current client. - */ - focus(): Promise; - - /** - * A boolean that indicates whether the current client has focus. - */ - readonly focused: boolean; - - /** - * Indicates the visibility of the current client. This value can be one of - * hidden, visible, prerender, or unloaded. - */ - readonly visibilityState: string; -} - -interface ServiceWorkerClientsMatchOptions { - includeUncontrolled?: boolean; - type?: string; -} - -/** - * Represents a container for a list of Client objects; the main way to access - * the active service worker clients at the current origin. - */ -interface ServiceWorkerClients { - /** - * Gets a service worker client matching a given id and returns it in a Promise. - * @param clientId The ID of the client you want to get. - */ - get(clientId: string): Promise; - - /** - * Gets a list of service worker clients and returns them in a Promise. - * Include the options parameter to return all service worker clients whose - * origin is the same as the associated service worker's origin. If options - * are not included, the method returns only the service worker clients - * controlled by the service worker. - * - * @param [options] An options object allowing you to set options for the matching operation. - */ - matchAll(options?: ServiceWorkerClientsMatchOptions): Promise; - - /** - * Opens a service worker Client in a new browser window. - * - * @param url A string representing the URL of the client you want to open - * in the window. - */ - openWindow(url: string): Promise; - - /** - * Allows an active Service Worker to set itself as the active worker for a - * client page when the worker and the page are in the same scope. - */ - claim(): Promise; -} - -/** - * Represents a service worker. Multiple browsing contexts (e.g. pages, workers, - * etc.) can be associated with the same ServiceWorker object. - */ -interface ServiceWorker extends Worker { - /** - * Returns the ServiceWorker serialized script URL defined as part of - * ServiceWorkerRegistration. The URL must be on the same origin as the - * document that registers the ServiceWorker. - */ - readonly scriptURL: string; - - /** - * Returns the state of the service worker. It returns one of the following - * values: installing, installed, activating, activated, or redundant. - */ - readonly state: string; - - /** - * An EventListener property called whenever an event of type statechange - * is fired; it is basically fired anytime the ServiceWorker.state changes. - */ - onstatechange: (statechangeevent: Event) => void; -} - -/** - * The PushMessageData interface of the Push API provides - * methods which let you retrieve the push data sent by a server in various formats. - */ -interface PushMessageData { - /** - * Extracts the data as an ArrayBuffer object. - */ - arrayBuffer(): ArrayBuffer; - - /** - * Extracts the data as a Blob object. - */ - blob(): Blob; - - /** - * Extracts the data as a JSON object. - */ - json(): any; - json(): T; - - /** - * Extracts the data as a plain text string. - */ - text(): string; -} - -/** - * The PushSubscription interface provides a subcription's URL endpoint and - * subscription ID. - */ -interface PushSubscription { - /** - * The endpoint associated with the push subscription. - */ - readonly endpoint: any; - - /** - * The subscription ID associated with the push subscription. - */ - readonly subscriptionId: any; -} - -/** - * Object containing optional subscribe parameters. - */ -interface PushSubscriptionOptions { - /** - * A boolean indicating that the returned push subscription will only be used for - * messages whose effect is made visible to the user. - */ - readonly userVisibleOnly: boolean; - - /** - * A public key your push server will use to send messages to client apps via a push server. - * This value is part of a signing key pair generated by your application server and usable - * with elliptic curve digital signature (ECDSA) over the P-256 curve. - */ - readonly applicationServerKey?: Uint8Array; -} - -/** - * The PushManager interface provides a way to receive notifications from - * third-party servers as well as request URLs for push notifications. - * This interface has replaced functionality offered by the obsolete - * PushRegistrationManager. - */ -interface PushManager { - /** - * Returns a promise that resolves to a PushSubscription with details of a - * new push subscription. - * - * @param [options] An object containing optional configuration parameters. - */ - subscribe(options?: PushSubscriptionOptions): Promise; - - /** - * Returns a promise that resolves to a PushSubscription details of - * the retrieved push subscription. - */ - getSubscription(): Promise; - - /** - * Returns a promise that resolves to the PushPermissionStatus of the - * requesting webapp, which will be one of granted, denied, or default. - */ - hasPermission(): Promise; -} - -/////// Service Worker Events /////// - -/** - * Extends the lifetime of the install and activate events dispatched on the - * ServiceWorkerGlobalScope as part of the service worker lifecycle. This - * ensures that any functional events (like FetchEvent) are not dispatched to - * the ServiceWorker until it upgrades database schemas, deletes outdated cache - * entries, etc. - */ -interface ExtendableEvent extends Event { - /** - * Extends the lifetime of the event. - * It is intended to be called in the install EventHandler for the - * installing worker and on the active EventHandler for the active worker. - * - * @param promise - */ - waitUntil(promise: Promise): void; -} - -/** - * The parameter passed into the ServiceWorkerGlobalScope.onfetch handler, - * FetchEvent represents a fetch action that is dispatched on the - * ServiceWorkerGlobalScope of a ServiceWorker. It contains information about - * the request and resulting response, and provides the FetchEvent.respondWith() - * method, which allows us to provide an arbitrary response back to the - * controlled page. - */ -interface FetchEvent extends Event { - /** - * Returns a Boolean that is true if the event was dispatched with the - * user's intention for the page to reload, and false otherwise. Typically, - * pressing the refresh button in a browser is a reload, while clicking a - * link and pressing the back button is not. - */ - readonly isReload: boolean; - - /** - * Returns the Request that triggered the event handler. - */ - readonly request: Request; - - /** - * Returns the Client that the current service worker is controlling. - */ - readonly client: ServiceWorkerClient; - - /** - * Returns the id of the client that the current service worker is controlling. - */ - readonly clientId: string; - - /** - * Resolves by returning a Response or a network error to Fetch. - * - * @param all Any custom response-generating code. - */ - respondWith(all: any): Response; -} - -/** - * The ExtendableMessageEvent interface of the ServiceWorker API represents - * the event object of a message event fired on - * a service worker (when a channel message is received on - * the ServiceWorkerGlobalScope from another context) - * — extends the lifetime of such events. - */ -interface ExtendableMessageEvent extends ExtendableEvent { - /** - * Returns the event's data. It can be any data type. - */ - readonly data: any; - - /** - * Returns the origin of the ServiceWorkerClient that sent the message - */ - readonly origin: string; - - /** - * Represents, in server-sent events, the last event ID of the event source. - */ - readonly lastEventId: string; - - /** - * Returns a reference to the service worker that sent the message. - */ - readonly source: ServiceWorkerClient; - - /** - * Returns the array containing the MessagePort objects - * representing the ports of the associated message channel. - */ - readonly ports: MessagePort[]; -} - -/** - * The parameter passed into the oninstall handler, the InstallEvent interface - * represents an install action that is dispatched on the - * ServiceWorkerGlobalScope of a ServiceWorker. As a child of ExtendableEvent, - * it ensures that functional events such as FetchEvent are not dispatched - * during installation. - */ -interface InstallEvent extends ExtendableEvent { - /** - * Returns the ServiceWorker that is currently actively controlling the page. - */ - readonly activeWorker: ServiceWorker; -} - -/** - * The parameter passed into the onnotificationclick handler, - * the NotificationEvent interface represents - * a notification click event that is dispatched on - * the ServiceWorkerGlobalScope of a ServiceWorker. - */ -interface NotificationEvent extends ExtendableEvent { - /** - * Returns a Notification object representing - * the notification that was clicked to fire the event. - */ - notification: any; // need to be replaced with `Notification` when possible - - /** - * Returns the string ID of the notification button the user clicked. - * This value returns undefined if the user clicked - * the notification somewhere other than an action button, - * or the notification does not have a button. - */ - action: string; -} - -/** - * The PushEvent interface of the Push API represents - * a push message that has been received. - * This event is sent to the global scope of a ServiceWorker. - * It contains the information sent from an application server to a PushSubscription. - */ -interface PushEvent extends ExtendableEvent { - /** - * Returns a reference to a PushMessageData object containing - * data sent to the PushSubscription. - */ - readonly data: PushMessageData; -} - -interface ServiceWorkerContainerEventMap { - "message": MessageEvent; - "error": ErrorEvent; - "controllerchange": Event; -} - -interface ServiceWorkerEventMap { - "activate": ExtendableEvent; - "fetch": FetchEvent; - "install": InstallEvent; - // "message": ExtendableMessageEvent; - "message": MessageEvent; - "notificationclick": NotificationEvent; - "push": PushEvent; - "pushsubscriptionchang": PushEvent; -} - -/** - * Represents a service worker registration. - */ -interface ServiceWorkerRegistration extends EventTarget { - /** - * Returns a unique identifier for a service worker registration. - * This must be on the same origin as the document that registers - * the ServiceWorker. - */ - readonly scope: any; - - /** - * Returns a service worker whose state is installing. This is initially - * set to null. - */ - readonly installing: ServiceWorker; - - /** - * Returns a service worker whose state is installed. This is initially - * set to null. - */ - readonly waiting: ServiceWorker; - - /** - * Returns a service worker whose state is either activating or activated. - * This is initially set to null. An active worker will control a - * ServiceWorkerClient if the client's URL falls within the scope of the - * registration (the scope option set when ServiceWorkerContainer.register - * is first called). - */ - readonly active: ServiceWorker; - - /** - * Returns an interface to for managing push subscriptions, including - * subcribing, getting an anctive subscription, and accessing push - * permission status. - */ - readonly pushManager: PushManager; - - /** - * An EventListener property called whenever an event of type updatefound - * is fired; it is fired any time the ServiceWorkerRegistration.installing - * property acquires a new service worker. - */ - onupdatefound: () => void; - - /** - * Allows you to update a service worker. - */ - update(): void; - - /** - * Unregisters the service worker registration and returns a promise - * (see Promise). The service worker will finish any ongoing operations - * before it is unregistered. - */ - unregister(): Promise; - - /** - * Returns a Promise that resolves to an array of Notification objects. - * @param [options] An options object that can contain options to filter the notifications returned. - */ - getNotifications(options?: ServiceWorkerGetNotificationOptions): Promise; // need to be replaced with `Notification[]` when possible - - /** - * Displays the notification with the requested title. - * @param [title] The title that must be shown within the notification - * @param [options] An object that allows to configure the notification. - */ - showNotification(title: string, options?: ServiceWorkerNotificationOptions): Promise; -} - -/** - * An options object to provide options upon a ServiceWorkerRegistration. - * @param [scope] A USVString representing a URL that defines a service worker's registration scope; what range of - * URLs a service worker can control. This is usually a relative URL, and it defaults to '/' when not specified. - */ -interface ServiceWorkerRegisterOptions { - scope: string; -} - -/** - * Action to display in a notification. - * @param [action] A DOMString identifying a user action to be displayed on the notification. - * @param [title] A DOMString containing action text to be shown to the user. - * @param [icon] A USVString containg the URL of an icon to display with the action. - */ -interface NotificationAction { // TODO: Maybe need to moved if NotificationApi types are defined - action: string; - title: string; - icon?: string; -} - -/** - * Object that allows to configure a notification. - * @param [actions] An array of actions to display in the notification. - * Appropriate responses are built using event.action within the notificationclick event. - * @param [badge] The URL of an image to represent the notification when there is not enough space to display the - * notification itself such as, for example, the Android Notification Bar. On Android devices, the badge should - * accommodate devices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked. - * @param [body] A string representing an extra content to display within the notification. - * @param [dir] The direction of the notification; it can be auto, ltr, or rtl. - * @param [icon] The URL of an image to be used as an icon by the notification. - * @param [image] A USVSTring containing the URL of an image to be displayed in the notification. - * @param [lang] Specify the lang used within the notification. This string must be a valid BCP 47 language tag. - * @param [renotify] A boolean that indicates whether to supress vibrations and audible alerts when resusing a tag - * value. The default is false. - * @param [requireInteraction] Indicates that on devices with sufficiently large screens, a notification should remain - * active until the user clicks or dismisses it. If this value is absent or false, the desktop version of Chrome - * will auto-minimize notifications after approximately twenty seconds. The default value is false. - * @param [tag] An ID for a given notification that allows you to find, replace, or remove the notification using - * script if necessary. - * @param [vibrate] A vibration pattern to run with the display of the notification. A vibration pattern can be an - * array with as few as one member. The values are times in milliseconds where the even indices (0, 2, 4, etc.) indicate - * how long to vibrate and the odd indices indicate how long to pause. For example [300, 100, 400] would vibrate - * 300ms, pause 100ms, then vibrate 400ms. - * @param [data] Arbitrary data that you want associated with the notification. This can be of any data type. - */ -interface ServiceWorkerNotificationOptions { - actions?: NotificationAction[]; - badge?: string; - body?: string; - dir?: 'auto' | 'ltr' | 'rtl'; - icon?: string; - lang?: string; - renotify?: boolean; - requireInteraction?: boolean; - tag?: string; - vibrate?: number[]; - data?: any; -} - -/** - * An options object that can contain options to filter notifications. - * @param [tag] A DOMString representing a notification tag. If specified, only notifications that have this tag - * will be returned. - */ -interface ServiceWorkerGetNotificationOptions { - tag: string; -} - -/** - * Provides an object representing the service worker as an overall unit in the - * network ecosystem, including facilities to register, unregister and update - * service workers, and access the state of service workers - * and their registrations. - */ -interface ServiceWorkerContainer extends EventTarget { - /** - * Returns a ServiceWorker object if its state is activated (the same object - * returned by ServiceWorkerRegistration.active). This property returns null - * if the request is a force refresh (Shift + refresh) or if there is no - * active worker. - */ - readonly controller: ServiceWorker; - - /** - * Defines whether a service worker is ready to control a page or not. - * It returns a Promise that will never reject, which resolves to a - * ServiceWorkerRegistration with an ServiceWorkerRegistration.active worker. - */ - readonly ready: Promise; - - /** - * An event handler fired whenever a controllerchange event occurs — when - * the document's associated ServiceWorkerRegistration acquires a new - * ServiceWorkerRegistration.active worker. - */ - oncontrollerchange: (controllerchangeevent: Event) => void; - - /** - * An event handler fired whenever an error event occurs in the associated - * service workers. - */ - onerror: (errorevent: ErrorEvent) => void; - - /** - * An event handler fired whenever a message event occurs — when incoming - * messages are received to the ServiceWorkerContainer object (e.g. via a - * MessagePort.postMessage() call.) - */ - onmessage: (messageevent: MessageEvent) => void; - - /** - * Creates or updates a ServiceWorkerRegistration for the given scriptURL. - * - * @param scriptURL The URL of the service worker script. - * @param [options] An options object to provide options upon registration. - */ - register(scriptURL: string, options?: ServiceWorkerRegisterOptions): Promise; - - /** - * Gets a ServiceWorkerRegistration object whose scope URL matches the - * provided document URL. If the method can't return a - * ServiceWorkerRegistration, it returns a Promise. - * - * @param [scope] A unique identifier for a service worker registration — the - * scope URL of the registration object you want to return. This is usually - * a relative URL. - */ - getRegistration(scope?: string): Promise; - - /** - * Returns all ServiceWorkerRegistrations associated with a - * ServiceWorkerContainer in an array. If the method can't return - * ServiceWorkerRegistrations, it returns a Promise. - */ - getRegistrations(): Promise; - - addEventListener( - type: K, - listener: (event: ServiceWorkerContainerEventMap[K]) => any, - useCapture?: boolean - ): void; -} - -interface ServiceWorkerGlobalScope extends EventTarget { - /** - * Contains the CacheStorage object associated with the service worker. - */ - readonly caches: CacheStorage; - /** - * Contains the Clients object associated with the service worker. - */ - readonly clients: ServiceWorkerClients; - - /** - * Contains the ServiceWorkerRegistration object that represents the - * service worker's registration. - */ - readonly registration: ServiceWorkerRegistration; - - /** - * An event handler fired whenever an activate event occurs — when a - * ServiceWorkerRegistration acquires a new ServiceWorkerRegistration.active - * worker. - */ - onactivate: (activateevent: ExtendableEvent) => void; - - /** - * An event handler fired whenever a fetch event occurs — when a fetch() - * is called. - */ - onfetch: (fetchevent: FetchEvent) => void; - - /** - * An event handler fired whenever an install event occurs — when a - * ServiceWorkerRegistration acquires a new - * ServiceWorkerRegistration.installing worker. - */ - oninstall: (installevent: InstallEvent) => void; - - /** - * An event handler fired whenever a message event occurs — when incoming - * messages are received. Controlled pages can use the - * MessagePort.postMessage() method to send messages to service workers. - * The service worker can optionally send a response back via the - * MessagePort exposed in event.data.port, corresponding to the controlled - * page. - * - * `onmessage` is actually fired with `ExtendableMessageEvent`, but - * since we are merging the interface into `Window`, we should - * make sure it's compatible with `window.onmessage` - */ - // onmessage: (messageevent: ExtendableMessageEvent) => void; - onmessage: (messageevent: MessageEvent) => void; - - /** - * An event handler fired whenever a notificationclick event occurs — when - * a user clicks on a displayed notification. - */ - onnotificationclick: (notificationclickevent: NotificationEvent) => void; - - /** - * An event handler fired whenever a push event occurs — when a server - * push notification is received. - */ - onpush: (onpushevent: PushEvent) => void; - - /** - * An event handler fired whenever a pushsubscriptionchange event occurs — - * when a push subscription has been invalidated, or is about to be - * invalidated (e.g. when a push service sets an expiration time). - */ - onpushsubscriptionchange: (pushsubscriptionchangeevent: PushEvent) => void; - - /** - * Allows the current service worker registration to progress from waiting - * to active state while service worker clients are using it. - */ - skipWaiting(): Promise; - - addEventListener( - type: K, - listener: (event: ServiceWorkerEventMap[K]) => any, - useCapture?: boolean - ): void; -} - -interface Navigator { - /** - * Returns a ServiceWorkerContainer object, which provides access to - * registration, removal, upgrade, and communication with the ServiceWorker - * objects for the associated document. - */ - serviceWorker: ServiceWorkerContainer; -} - -// tslint:disable-next-line no-empty-interface -interface Window extends ServiceWorkerGlobalScope {} diff --git a/service_worker_api/service_worker_api-tests.ts b/service_worker_api/service_worker_api-tests.ts deleted file mode 100644 index 27c2b85c20..0000000000 --- a/service_worker_api/service_worker_api-tests.ts +++ /dev/null @@ -1,206 +0,0 @@ -var OFFLINE_CACHE = "cache_test"; -var OFFLINE_URL = "localhost"; - -self.addEventListener('fetch', (event: FetchEvent) => { - if (event.request.method === 'GET' && - event.request.headers.get('accept').indexOf('text/html') !== -1) { - console.log('Handling fetch event for', event.request.url); - event.respondWith( - self.fetch(event.request).catch(e => { - console.error('Fetch failed; returning offline page instead.', e); - return self.caches.open(OFFLINE_CACHE).then((cache: Cache) => { - return cache.match(OFFLINE_URL); - }); - }) - ); - } -}); - -self.caches.open('v1').then((cache: Cache) => { - cache.matchAll('/images/').then((response: Response[]) => { - response.forEach((element, index, array) => { - cache.delete(element.url); - }); - }); -}); - -self.addEventListener('install', (event: InstallEvent) => { - event.waitUntil( - self.caches.open('v1').then((cache: Cache) => { - return cache.add('/sw-test/index.html'); - }) - ); -}); - -self.addEventListener('install', (event: InstallEvent) => { - event.waitUntil( - self.caches.open('v1').then(cache => { - return cache.addAll([ - '/sw-test/', - '/sw-test/index.html', - '/sw-test/style.css', - '/sw-test/app.js', - '/sw-test/image-list.js', - '/sw-test/star-wars-logo.jpg', - '/sw-test/gallery/', - '/sw-test/gallery/bountyHunters.jpg', - '/sw-test/gallery/myLittleVader.jpg', - '/sw-test/gallery/snowTroopers.jpg' - ]); - }) - ); -}); - -self.addEventListener('fetch', (event: FetchEvent) => { - var cachedResponse = self.caches.match(event.request).then(response => { - if (response) { - return response; - } - }).catch(() => { - return self.fetch(event.request).then(response => { - return self.caches.open('v1').then(cache => { - cache.put(event.request, response.clone()); - return response; - }); - }); - }).catch(() => { - return self.caches.match('/sw-test/gallery/myLittleVader.jpg'); - }); - - event.respondWith(cachedResponse); -}); - -self.caches.open('v1').then(cache => { - cache.match('/images/image.png').then(response => { - cache.delete(response.url); - }); -}); - -self.caches.open('v1').then(cache => { - cache.keys().then(response => { - response.forEach((element, index, array) => { - cache.delete(element); - }); - }); -}); - -self.caches.has('v1').then(() => { - self.caches.delete('v1').then(() => { - console.log('done'); - }); -}); - -self.addEventListener('activate', (event: ExtendableEvent) => { - var cacheWhitelist = ['v2']; - - event.waitUntil( - self.caches.keys().then(keyList => { - for (var item of keyList) { - if (cacheWhitelist.indexOf(item) === -1) { - return self.caches.delete(item); - } - } - }) - ); -}); - -function sendMessage(message: any) { - return new Promise((resolve, reject) => { - var messageChannel = new MessageChannel(); - messageChannel.port1.onmessage = event => { - if (event.data.error) { - reject(event.data.error); - } else { - resolve(event.data); - } - }; - navigator.serviceWorker.controller.postMessage(message, [messageChannel.port2]); - }); -} - -self.addEventListener('message', (evt: ExtendableMessageEvent) => { - evt.ports[0].postMessage(evt.source.id); -}); - -sendMessage('test').then((clientId: string) => { - console.log(clientId); -}); - -self.clients.matchAll({type: "test"}).then(clients => { - for (var cli of clients) { - if (cli.url === 'index.html') { - self.clients.openWindow(cli.url); - // or do something else involving the matching client - } - } -}); - -self.addEventListener('activate', (e: ExtendableEvent) => { - e.waitUntil(self.clients.claim()); -}); - -navigator.serviceWorker.register('service-worker.js', {scope: './'}).then(registration => { - // At this point, registration has taken place. - // The service worker will not handle requests until this page and any - // other instances of this page (in other tabs, etc.) have been - // closed/reloaded. - var serviceWorker: ServiceWorker; - if (registration.installing) { - serviceWorker = registration.installing; - } else if (registration.waiting) { - serviceWorker = registration.waiting; - } else if (registration.active) { - serviceWorker = registration.active; - } - if (serviceWorker) { - console.log(serviceWorker.state); - serviceWorker.addEventListener('statechange', (e: any) => { - console.log(e.target.state); - }); - } -}).catch(error => { - // Something went wrong during registration. The service-worker.js file - // might be unavailable or contain a syntax error. - -}); - -navigator.serviceWorker.getRegistration('/app').then((registration: ServiceWorkerRegistration) => { - console.log(registration); -}); - -navigator.serviceWorker.getRegistrations().then((registrations: ServiceWorkerRegistration[]) => { - console.log(registrations); -}); - -self.registration.unregister(); - -self.addEventListener('install', (event: ExtendableEvent) => { - event.waitUntil(self.skipWaiting()); -}); - -self.addEventListener('notificationclick', (event: NotificationEvent) => { - console.log('On notification click: ', event.notification.tag); - event.notification.close(); - - // This looks to see if the current is already open and - // focuses if it is - event.waitUntil(self.clients.matchAll({ - type: "window" - }).then(clientList => { - if (self.clients.openWindow) - return self.clients.openWindow('/'); - })); -}); - -navigator.serviceWorker.ready.then(function(registration) { - registration.showNotification('Notification Sample', { - body: 'This is a sample notification!', - icon: '/sw-test/star-wars-logo.jpg', - tag: 'notification-sample' - }); -}); - -self.registration.getNotifications({tag: 'notification-sample'}) - .then(function(notifications) { - console.log(notifications); - }); diff --git a/service_worker_api/tsconfig.json b/service_worker_api/tsconfig.json deleted file mode 100644 index 0c7c7ed734..0000000000 --- a/service_worker_api/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", - "service_worker_api-tests.ts" - ] -} \ No newline at end of file diff --git a/stamplay-js-sdk/index.d.ts b/stamplay-js-sdk/index.d.ts deleted file mode 100644 index 53f57ad86c..0000000000 --- a/stamplay-js-sdk/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for stamplay-js-sdk 1.2.9 -// Project: https://github.com/Stamplay/stamplay-js-sdk -// Definitions by: Riderman de Sousa Barbosa -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace Stamplay { - - export interface IStamplayModel { - signup({}) : PromisesAPlus.Thenable - new() : IStamplayModel - get(property : string) : any - set(property : string, value: any) : void - unset(property : string) : void - fetch(id : any) : PromisesAPlus.Thenable - destroy() : PromisesAPlus.Thenable - save({}?) : PromisesAPlus.Thenable - upVote() : PromisesAPlus.Thenable - } - - export interface IStamplayObject { - Model : IStamplayModel - Collection : any - - } - - export interface StamplayStatic { - init(appId : string) : void; - User() : IStamplayObject - Cobject(object : string) : IStamplayObject - } -} - -declare var Stamplay: Stamplay.StamplayStatic; diff --git a/toastr/index.d.ts b/toastr/index.d.ts deleted file mode 100644 index 5cd8b30c82..0000000000 --- a/toastr/index.d.ts +++ /dev/null @@ -1,226 +0,0 @@ -// Type definitions for Toastr 2.1.3 -// Project: https://github.com/CodeSeven/toastr -// Definitions by: Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// - -interface ToastrOptions { - /** - * Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery. - */ - showEasing?: string; - /** - * Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery. - */ - hideEasing?: string; - /** - * Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery. - */ - showMethod?: string; - /** - * Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery. - */ - hideMethod?: string; - /** - * Should a close button be shown - */ - closeButton?: boolean; - /** - * Html for the close button - */ - closeHtml?: string; - /** - * Should clicking on toast dismiss it? - */ - tapToDismiss?: boolean; - /** - * CSS class the toast element will be given - */ - toastClass?: string; - /** - * Id toast container will be given - */ - containerId?: string; - /** - * Should debug details be outputted to the console - */ - debug?: boolean; - /** - * Time in milliseconds the toast should take to show - */ - showDuration?: number; - /** - * onShown function callback - **/ - onShown?: () => void; - /** - * Time in milliseconds the toast should take to hide - */ - hideDuration?: number; - /** - * onHidden function callback - **/ - onHidden?: () => void; - /** - * Time in milliseconds the toast should be displayed after mouse over - */ - extendedTimeOut?: number; - iconClasses?: { - /** - * Icon to use on error toasts - */ - error: string; - /** - * Icon to use on info toasts - */ - info: string; - /** - * Icon to use on success toasts - */ - success: string; - /** - * Icon to use on warning toasts - */ - warning: string; - }; - /** - * Icon to use for toast - */ - iconClass?: string; - /** - * Where toast should be displayed - */ - positionClass?: string; - /** - * Where toast should be displayed - background - */ - backgroundpositionClass?: string; - /** - * Time in milliseconds that the toast should be displayed - */ - timeOut?: number; - /** - * CSS class the title element will be given - */ - titleClass?: string; - /** - * CSS class the message element will be given - */ - messageClass?: string; - /** - * Set newest toast to appear on top - **/ - newestOnTop?: boolean; - /** - * The element to put the toastr container - **/ - target?: string; - /** - * Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content. - */ - preventDuplicates?: boolean; - /** - * Visually indicates how long before a toast expires. - */ - progressBar?: boolean; - /** - * Function to execute on toast click - */ - onclick?: () => void; - /** - * Set if toastr should parse containing html - **/ - allowHtml?: boolean; - /** - * Set if toastr should escape html - **/ - escapeHtml?: boolean; -} - -interface ToastrDisplayMethod { - /** - * Create a toast - * - * @param message Message to display in toast - */ - (message: string): JQuery; - /** - * Create a toast - * - * @param message Message to display in toast - * @param title Title to display on toast - */ - (message: string, title: string): JQuery; - /** - * Create a toast - * - * @param message Message to display in toast - * @param title Title to display on toast - * @param overrides Option values for toast - */ - (message: string, title: string, overrides: ToastrOptions): JQuery; -} - -interface Toastr { - /** - * Clear toasts - */ - clear: { - /** - * Clear all toasts - */ - (): void; - /** - * Clear specific toast - * - * @param toast Toast to clear - */ - (toast: JQuery): void; - /** - * Clear specific toast - * - * @param toast Toast to clear - * @param clearOptions force clearing a toast, ignoring focus - */ - (toast: JQuery, clearOptions: { force: boolean }): void; - }; - /** - * Removes all toasts (without animation) - */ - remove: { - (): void; - }; - /** - * Create an error toast - */ - error: ToastrDisplayMethod; - /** - * Create an info toast - */ - info: ToastrDisplayMethod; - /** - * Create an options object - */ - options: ToastrOptions; - /** - * Create a success toast - */ - success: ToastrDisplayMethod; - /** - * Create a warning toast - */ - warning: ToastrDisplayMethod; - /** - * Get toastr version - */ - version: string; - - [key: string]: any; -} - -declare var toastr: Toastr; -declare module "toastr" { - export = toastr; -} diff --git a/transducers-js/package.json b/transducers-js/package.json deleted file mode 100644 index 84d23a146b..0000000000 --- a/transducers-js/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "immutable": "^3.8.1" - } -} \ No newline at end of file diff --git a/transducers-js/tsconfig.json b/transducers-js/tsconfig.json deleted file mode 100644 index 02a9f8b69d..0000000000 --- a/transducers-js/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", - "transducers-js-tests.ts" - ] -} \ No newline at end of file diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 6b04ae7f36..0000000000 --- a/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "./node_modules/types-publisher/tslint-definitions.json" } \ No newline at end of file diff --git a/3d-bin-packing/3d-bin-packing-tests.ts b/types/3d-bin-packing/3d-bin-packing-tests.ts similarity index 100% rename from 3d-bin-packing/3d-bin-packing-tests.ts rename to types/3d-bin-packing/3d-bin-packing-tests.ts diff --git a/3d-bin-packing/index.d.ts b/types/3d-bin-packing/index.d.ts similarity index 100% rename from 3d-bin-packing/index.d.ts rename to types/3d-bin-packing/index.d.ts diff --git a/3d-bin-packing/tsconfig.json b/types/3d-bin-packing/tsconfig.json similarity index 100% rename from 3d-bin-packing/tsconfig.json rename to types/3d-bin-packing/tsconfig.json diff --git a/ably/ably-tests.ts b/types/ably/ably-tests.ts similarity index 100% rename from ably/ably-tests.ts rename to types/ably/ably-tests.ts diff --git a/ably/index.d.ts b/types/ably/index.d.ts similarity index 99% rename from ably/index.d.ts rename to types/ably/index.d.ts index a6ea5785ac..b8d1eb9bfe 100644 --- a/ably/index.d.ts +++ b/types/ably/index.d.ts @@ -444,7 +444,7 @@ declare namespace ablyLib { } } -export declare class Rest { +export class Rest { constructor(options: ablyLib.ClientOptions | string); static Crypto: ablyLib.Crypto; static Message: ablyLib.MessageStatic; @@ -456,7 +456,7 @@ export declare class Rest { time: (paramsOrCallback?: ablyLib.timeCallback | any, callback?: ablyLib.timeCallback) => void; } -export declare class Realtime { +export class Realtime { constructor(options: ablyLib.ClientOptions | string); static Crypto: ablyLib.Crypto; static Message: ablyLib.MessageStatic; diff --git a/ably/tsconfig.json b/types/ably/tsconfig.json similarity index 100% rename from ably/tsconfig.json rename to types/ably/tsconfig.json diff --git a/ably/tslint.json b/types/ably/tslint.json similarity index 100% rename from ably/tslint.json rename to types/ably/tslint.json diff --git a/abs/abs-tests.ts b/types/abs/abs-tests.ts similarity index 100% rename from abs/abs-tests.ts rename to types/abs/abs-tests.ts diff --git a/abs/index.d.ts b/types/abs/index.d.ts similarity index 100% rename from abs/index.d.ts rename to types/abs/index.d.ts diff --git a/abs/tsconfig.json b/types/abs/tsconfig.json similarity index 100% rename from abs/tsconfig.json rename to types/abs/tsconfig.json diff --git a/abs/tslint.json b/types/abs/tslint.json similarity index 100% rename from abs/tslint.json rename to types/abs/tslint.json diff --git a/absolute/absolute-tests.ts b/types/absolute/absolute-tests.ts similarity index 100% rename from absolute/absolute-tests.ts rename to types/absolute/absolute-tests.ts diff --git a/absolute/index.d.ts b/types/absolute/index.d.ts similarity index 100% rename from absolute/index.d.ts rename to types/absolute/index.d.ts diff --git a/absolute/tsconfig.json b/types/absolute/tsconfig.json similarity index 100% rename from absolute/tsconfig.json rename to types/absolute/tsconfig.json diff --git a/acc-wizard/acc-wizard-tests.ts b/types/acc-wizard/acc-wizard-tests.ts similarity index 100% rename from acc-wizard/acc-wizard-tests.ts rename to types/acc-wizard/acc-wizard-tests.ts diff --git a/acc-wizard/index.d.ts b/types/acc-wizard/index.d.ts similarity index 100% rename from acc-wizard/index.d.ts rename to types/acc-wizard/index.d.ts diff --git a/acc-wizard/tsconfig.json b/types/acc-wizard/tsconfig.json similarity index 100% rename from acc-wizard/tsconfig.json rename to types/acc-wizard/tsconfig.json diff --git a/accepts/accepts-tests.ts b/types/accepts/accepts-tests.ts similarity index 100% rename from accepts/accepts-tests.ts rename to types/accepts/accepts-tests.ts diff --git a/accepts/index.d.ts b/types/accepts/index.d.ts similarity index 97% rename from accepts/index.d.ts rename to types/accepts/index.d.ts index a12dcaf5c9..1fef801986 100644 --- a/accepts/index.d.ts +++ b/types/accepts/index.d.ts @@ -4,11 +4,11 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace accepts { - export interface Headers { + interface Headers { [key: string]: string | string[]; } - export interface Accepts { + interface Accepts { /** * Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned. */ diff --git a/accepts/tsconfig.json b/types/accepts/tsconfig.json similarity index 100% rename from accepts/tsconfig.json rename to types/accepts/tsconfig.json diff --git a/accepts/tslint.json b/types/accepts/tslint.json similarity index 100% rename from accepts/tslint.json rename to types/accepts/tslint.json diff --git a/accounting/accounting-tests.ts b/types/accounting/accounting-tests.ts similarity index 100% rename from accounting/accounting-tests.ts rename to types/accounting/accounting-tests.ts diff --git a/accounting/index.d.ts b/types/accounting/index.d.ts similarity index 100% rename from accounting/index.d.ts rename to types/accounting/index.d.ts diff --git a/accounting/tsconfig.json b/types/accounting/tsconfig.json similarity index 100% rename from accounting/tsconfig.json rename to types/accounting/tsconfig.json diff --git a/accounting/tslint.json b/types/accounting/tslint.json similarity index 100% rename from accounting/tslint.json rename to types/accounting/tslint.json diff --git a/ace/index.d.ts b/types/ace/index.d.ts similarity index 100% rename from ace/index.d.ts rename to types/ace/index.d.ts diff --git a/ace/test/anchor.ts b/types/ace/test/anchor.ts similarity index 100% rename from ace/test/anchor.ts rename to types/ace/test/anchor.ts diff --git a/ace/test/background_tokenizer.ts b/types/ace/test/background_tokenizer.ts similarity index 100% rename from ace/test/background_tokenizer.ts rename to types/ace/test/background_tokenizer.ts diff --git a/ace/test/default.ts b/types/ace/test/default.ts similarity index 100% rename from ace/test/default.ts rename to types/ace/test/default.ts diff --git a/ace/test/document.ts b/types/ace/test/document.ts similarity index 100% rename from ace/test/document.ts rename to types/ace/test/document.ts diff --git a/ace/test/edit_session.ts b/types/ace/test/edit_session.ts similarity index 100% rename from ace/test/edit_session.ts rename to types/ace/test/edit_session.ts diff --git a/ace/test/editor1.ts b/types/ace/test/editor1.ts similarity index 100% rename from ace/test/editor1.ts rename to types/ace/test/editor1.ts diff --git a/ace/test/editor_highlight_selected_word.ts b/types/ace/test/editor_highlight_selected_word.ts similarity index 100% rename from ace/test/editor_highlight_selected_word.ts rename to types/ace/test/editor_highlight_selected_word.ts diff --git a/ace/test/editor_navigation.ts b/types/ace/test/editor_navigation.ts similarity index 100% rename from ace/test/editor_navigation.ts rename to types/ace/test/editor_navigation.ts diff --git a/ace/test/editor_text_edit.ts b/types/ace/test/editor_text_edit.ts similarity index 100% rename from ace/test/editor_text_edit.ts rename to types/ace/test/editor_text_edit.ts diff --git a/ace/test/multi_select.ts b/types/ace/test/multi_select.ts similarity index 100% rename from ace/test/multi_select.ts rename to types/ace/test/multi_select.ts diff --git a/ace/test/placeholder.ts b/types/ace/test/placeholder.ts similarity index 100% rename from ace/test/placeholder.ts rename to types/ace/test/placeholder.ts diff --git a/ace/test/range.ts b/types/ace/test/range.ts similarity index 100% rename from ace/test/range.ts rename to types/ace/test/range.ts diff --git a/ace/test/range_list.ts b/types/ace/test/range_list.ts similarity index 100% rename from ace/test/range_list.ts rename to types/ace/test/range_list.ts diff --git a/ace/test/search.ts b/types/ace/test/search.ts similarity index 100% rename from ace/test/search.ts rename to types/ace/test/search.ts diff --git a/ace/test/selection.ts b/types/ace/test/selection.ts similarity index 100% rename from ace/test/selection.ts rename to types/ace/test/selection.ts diff --git a/ace/test/token_iterator.ts b/types/ace/test/token_iterator.ts similarity index 100% rename from ace/test/token_iterator.ts rename to types/ace/test/token_iterator.ts diff --git a/ace/test/virtual_renderer.ts b/types/ace/test/virtual_renderer.ts similarity index 100% rename from ace/test/virtual_renderer.ts rename to types/ace/test/virtual_renderer.ts diff --git a/ace/tsconfig.json b/types/ace/tsconfig.json similarity index 100% rename from ace/tsconfig.json rename to types/ace/tsconfig.json diff --git a/acl/index.d.ts b/types/acl/index.d.ts similarity index 100% rename from acl/index.d.ts rename to types/acl/index.d.ts diff --git a/acl/test/index.ts b/types/acl/test/index.ts similarity index 100% rename from acl/test/index.ts rename to types/acl/test/index.ts diff --git a/acl/test/mongodbBackend.ts b/types/acl/test/mongodbBackend.ts similarity index 100% rename from acl/test/mongodbBackend.ts rename to types/acl/test/mongodbBackend.ts diff --git a/acl/test/redisBackend.ts b/types/acl/test/redisBackend.ts similarity index 100% rename from acl/test/redisBackend.ts rename to types/acl/test/redisBackend.ts diff --git a/acl/tsconfig.json b/types/acl/tsconfig.json similarity index 100% rename from acl/tsconfig.json rename to types/acl/tsconfig.json diff --git a/acorn/README.md b/types/acorn/README.md similarity index 100% rename from acorn/README.md rename to types/acorn/README.md diff --git a/acorn/acorn-tests.ts b/types/acorn/acorn-tests.ts similarity index 97% rename from acorn/acorn-tests.ts rename to types/acorn/acorn-tests.ts index bda6844c84..72ca71d2f6 100644 --- a/acorn/acorn-tests.ts +++ b/types/acorn/acorn-tests.ts @@ -1,5 +1,3 @@ -/// - import acorn = require('acorn'); import * as ESTree from 'estree'; diff --git a/acorn/index.d.ts b/types/acorn/index.d.ts similarity index 100% rename from acorn/index.d.ts rename to types/acorn/index.d.ts diff --git a/acorn/tsconfig.json b/types/acorn/tsconfig.json similarity index 100% rename from acorn/tsconfig.json rename to types/acorn/tsconfig.json diff --git a/actioncable/actioncable-tests.ts b/types/actioncable/actioncable-tests.ts similarity index 100% rename from actioncable/actioncable-tests.ts rename to types/actioncable/actioncable-tests.ts diff --git a/actioncable/index.d.ts b/types/actioncable/index.d.ts similarity index 100% rename from actioncable/index.d.ts rename to types/actioncable/index.d.ts diff --git a/actioncable/tsconfig.json b/types/actioncable/tsconfig.json similarity index 100% rename from actioncable/tsconfig.json rename to types/actioncable/tsconfig.json diff --git a/activex-data-objects/activex-data-objects-tests.ts b/types/activex-data-objects/activex-data-objects-tests.ts similarity index 100% rename from activex-data-objects/activex-data-objects-tests.ts rename to types/activex-data-objects/activex-data-objects-tests.ts diff --git a/activex-data-objects/index.d.ts b/types/activex-data-objects/index.d.ts similarity index 100% rename from activex-data-objects/index.d.ts rename to types/activex-data-objects/index.d.ts diff --git a/activex-data-objects/tsconfig.json b/types/activex-data-objects/tsconfig.json similarity index 100% rename from activex-data-objects/tsconfig.json rename to types/activex-data-objects/tsconfig.json diff --git a/activex-scripting-runtime/activex-scripting-runtime-tests.ts b/types/activex-scripting-runtime/activex-scripting-runtime-tests.ts similarity index 100% rename from activex-scripting-runtime/activex-scripting-runtime-tests.ts rename to types/activex-scripting-runtime/activex-scripting-runtime-tests.ts diff --git a/activex-scripting-runtime/index.d.ts b/types/activex-scripting-runtime/index.d.ts similarity index 100% rename from activex-scripting-runtime/index.d.ts rename to types/activex-scripting-runtime/index.d.ts diff --git a/activex-scripting-runtime/tsconfig.json b/types/activex-scripting-runtime/tsconfig.json similarity index 100% rename from activex-scripting-runtime/tsconfig.json rename to types/activex-scripting-runtime/tsconfig.json diff --git a/activex-windows-image-acquisition/activex-windows-image-acquisition-tests.ts b/types/activex-windows-image-acquisition/activex-windows-image-acquisition-tests.ts similarity index 100% rename from activex-windows-image-acquisition/activex-windows-image-acquisition-tests.ts rename to types/activex-windows-image-acquisition/activex-windows-image-acquisition-tests.ts diff --git a/activex-windows-image-acquisition/index.d.ts b/types/activex-windows-image-acquisition/index.d.ts similarity index 100% rename from activex-windows-image-acquisition/index.d.ts rename to types/activex-windows-image-acquisition/index.d.ts diff --git a/activex-windows-image-acquisition/tsconfig.json b/types/activex-windows-image-acquisition/tsconfig.json similarity index 100% rename from activex-windows-image-acquisition/tsconfig.json rename to types/activex-windows-image-acquisition/tsconfig.json diff --git a/adal/adal-angular.d.ts b/types/adal/adal-angular.d.ts similarity index 100% rename from adal/adal-angular.d.ts rename to types/adal/adal-angular.d.ts diff --git a/adal/index.d.ts b/types/adal/index.d.ts similarity index 100% rename from adal/index.d.ts rename to types/adal/index.d.ts diff --git a/adal/test/angular.ts b/types/adal/test/angular.ts similarity index 100% rename from adal/test/angular.ts rename to types/adal/test/angular.ts diff --git a/adal/test/index.ts b/types/adal/test/index.ts similarity index 100% rename from adal/test/index.ts rename to types/adal/test/index.ts diff --git a/adal/tsconfig.json b/types/adal/tsconfig.json similarity index 100% rename from adal/tsconfig.json rename to types/adal/tsconfig.json diff --git a/add2home/add2home-tests.ts b/types/add2home/add2home-tests.ts similarity index 100% rename from add2home/add2home-tests.ts rename to types/add2home/add2home-tests.ts diff --git a/add2home/index.d.ts b/types/add2home/index.d.ts similarity index 100% rename from add2home/index.d.ts rename to types/add2home/index.d.ts diff --git a/add2home/tsconfig.json b/types/add2home/tsconfig.json similarity index 100% rename from add2home/tsconfig.json rename to types/add2home/tsconfig.json diff --git a/adm-zip/adm-zip-tests.ts b/types/adm-zip/adm-zip-tests.ts similarity index 100% rename from adm-zip/adm-zip-tests.ts rename to types/adm-zip/adm-zip-tests.ts diff --git a/adm-zip/index.d.ts b/types/adm-zip/index.d.ts similarity index 100% rename from adm-zip/index.d.ts rename to types/adm-zip/index.d.ts diff --git a/adm-zip/tsconfig.json b/types/adm-zip/tsconfig.json similarity index 100% rename from adm-zip/tsconfig.json rename to types/adm-zip/tsconfig.json diff --git a/ag-grid/ag-grid-tests.ts b/types/ag-grid/ag-grid-tests.ts similarity index 100% rename from ag-grid/ag-grid-tests.ts rename to types/ag-grid/ag-grid-tests.ts diff --git a/ag-grid/index.d.ts b/types/ag-grid/index.d.ts similarity index 100% rename from ag-grid/index.d.ts rename to types/ag-grid/index.d.ts diff --git a/ag-grid/tsconfig.json b/types/ag-grid/tsconfig.json similarity index 100% rename from ag-grid/tsconfig.json rename to types/ag-grid/tsconfig.json diff --git a/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts similarity index 100% rename from agenda/agenda-tests.ts rename to types/agenda/agenda-tests.ts diff --git a/agenda/index.d.ts b/types/agenda/index.d.ts similarity index 100% rename from agenda/index.d.ts rename to types/agenda/index.d.ts diff --git a/agenda/tsconfig.json b/types/agenda/tsconfig.json similarity index 100% rename from agenda/tsconfig.json rename to types/agenda/tsconfig.json diff --git a/alertify/alertify-tests.ts b/types/alertify/alertify-tests.ts similarity index 100% rename from alertify/alertify-tests.ts rename to types/alertify/alertify-tests.ts diff --git a/alertify/index.d.ts b/types/alertify/index.d.ts similarity index 100% rename from alertify/index.d.ts rename to types/alertify/index.d.ts diff --git a/alertify/tsconfig.json b/types/alertify/tsconfig.json similarity index 100% rename from alertify/tsconfig.json rename to types/alertify/tsconfig.json diff --git a/alexa-sdk/alexa-sdk-tests.ts b/types/alexa-sdk/alexa-sdk-tests.ts similarity index 100% rename from alexa-sdk/alexa-sdk-tests.ts rename to types/alexa-sdk/alexa-sdk-tests.ts diff --git a/alexa-sdk/index.d.ts b/types/alexa-sdk/index.d.ts similarity index 100% rename from alexa-sdk/index.d.ts rename to types/alexa-sdk/index.d.ts diff --git a/alexa-sdk/tsconfig.json b/types/alexa-sdk/tsconfig.json similarity index 100% rename from alexa-sdk/tsconfig.json rename to types/alexa-sdk/tsconfig.json diff --git a/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts similarity index 100% rename from algoliasearch/algoliasearch-tests.ts rename to types/algoliasearch/algoliasearch-tests.ts diff --git a/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts similarity index 100% rename from algoliasearch/index.d.ts rename to types/algoliasearch/index.d.ts diff --git a/algoliasearch/tsconfig.json b/types/algoliasearch/tsconfig.json similarity index 100% rename from algoliasearch/tsconfig.json rename to types/algoliasearch/tsconfig.json diff --git a/alt/alt-tests.ts b/types/alt/alt-tests.ts similarity index 100% rename from alt/alt-tests.ts rename to types/alt/alt-tests.ts diff --git a/alt/index.d.ts b/types/alt/index.d.ts similarity index 100% rename from alt/index.d.ts rename to types/alt/index.d.ts diff --git a/alt/tsconfig.json b/types/alt/tsconfig.json similarity index 100% rename from alt/tsconfig.json rename to types/alt/tsconfig.json diff --git a/amazon-product-api/amazon-product-api-tests.ts b/types/amazon-product-api/amazon-product-api-tests.ts similarity index 100% rename from amazon-product-api/amazon-product-api-tests.ts rename to types/amazon-product-api/amazon-product-api-tests.ts diff --git a/amazon-product-api/index.d.ts b/types/amazon-product-api/index.d.ts similarity index 100% rename from amazon-product-api/index.d.ts rename to types/amazon-product-api/index.d.ts diff --git a/amazon-product-api/tsconfig.json b/types/amazon-product-api/tsconfig.json similarity index 100% rename from amazon-product-api/tsconfig.json rename to types/amazon-product-api/tsconfig.json diff --git a/amcharts/index.d.ts b/types/amcharts/index.d.ts similarity index 100% rename from amcharts/index.d.ts rename to types/amcharts/index.d.ts diff --git a/amcharts/tsconfig.json b/types/amcharts/tsconfig.json similarity index 100% rename from amcharts/tsconfig.json rename to types/amcharts/tsconfig.json diff --git a/amplify-deferred/amplify-deferred-tests.ts b/types/amplify-deferred/amplify-deferred-tests.ts similarity index 100% rename from amplify-deferred/amplify-deferred-tests.ts rename to types/amplify-deferred/amplify-deferred-tests.ts diff --git a/amplify-deferred/index.d.ts b/types/amplify-deferred/index.d.ts similarity index 100% rename from amplify-deferred/index.d.ts rename to types/amplify-deferred/index.d.ts diff --git a/amplify-deferred/tsconfig.json b/types/amplify-deferred/tsconfig.json similarity index 100% rename from amplify-deferred/tsconfig.json rename to types/amplify-deferred/tsconfig.json diff --git a/amplify-deferred/tslint.json b/types/amplify-deferred/tslint.json similarity index 100% rename from amplify-deferred/tslint.json rename to types/amplify-deferred/tslint.json diff --git a/amplify/amplify-tests.ts b/types/amplify/amplify-tests.ts similarity index 99% rename from amplify/amplify-tests.ts rename to types/amplify/amplify-tests.ts index edf2988122..8cce567960 100644 --- a/amplify/amplify-tests.ts +++ b/types/amplify/amplify-tests.ts @@ -1,6 +1,3 @@ - -/// - import amplify = require("amplify"); // Copied examples directly from AmplifyJs site @@ -260,4 +257,3 @@ amplify.request({ error: (data, status) => { } }); - diff --git a/amplify/index.d.ts b/types/amplify/index.d.ts similarity index 99% rename from amplify/index.d.ts rename to types/amplify/index.d.ts index 1e62e57a01..5cb03e5b1d 100644 --- a/amplify/index.d.ts +++ b/types/amplify/index.d.ts @@ -34,7 +34,6 @@ declare namespace amplify { } interface Request { - /*** * Request a resource. * resourceId: Identifier string for the resource. @@ -118,7 +117,6 @@ declare namespace amplify { } interface Store extends StorageTypeStore { - /*** * IE 8+, Firefox 3.5+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ */ @@ -143,12 +141,9 @@ declare namespace amplify { * An in-memory store is provided as a fallback if none of the other storage types are available. */ memory: StorageTypeStore; - - } interface Static { - subscribe: Subscribe; /*** diff --git a/amplify/tsconfig.json b/types/amplify/tsconfig.json similarity index 100% rename from amplify/tsconfig.json rename to types/amplify/tsconfig.json diff --git a/amplify/tslint.json b/types/amplify/tslint.json similarity index 100% rename from amplify/tslint.json rename to types/amplify/tslint.json diff --git a/amplitude-js/amplitude-js-tests.ts b/types/amplitude-js/amplitude-js-tests.ts similarity index 100% rename from amplitude-js/amplitude-js-tests.ts rename to types/amplitude-js/amplitude-js-tests.ts diff --git a/amplitude-js/index.d.ts b/types/amplitude-js/index.d.ts similarity index 100% rename from amplitude-js/index.d.ts rename to types/amplitude-js/index.d.ts diff --git a/amplitude-js/tsconfig.json b/types/amplitude-js/tsconfig.json similarity index 100% rename from amplitude-js/tsconfig.json rename to types/amplitude-js/tsconfig.json diff --git a/amqp-rpc/amqp-rpc-tests.ts b/types/amqp-rpc/amqp-rpc-tests.ts similarity index 100% rename from amqp-rpc/amqp-rpc-tests.ts rename to types/amqp-rpc/amqp-rpc-tests.ts diff --git a/amqp-rpc/index.d.ts b/types/amqp-rpc/index.d.ts similarity index 100% rename from amqp-rpc/index.d.ts rename to types/amqp-rpc/index.d.ts diff --git a/amqp-rpc/tsconfig.json b/types/amqp-rpc/tsconfig.json similarity index 100% rename from amqp-rpc/tsconfig.json rename to types/amqp-rpc/tsconfig.json diff --git a/amqplib/amqplib-tests.ts b/types/amqplib/amqplib-tests.ts similarity index 100% rename from amqplib/amqplib-tests.ts rename to types/amqplib/amqplib-tests.ts diff --git a/amqplib/callback_api.d.ts b/types/amqplib/callback_api.d.ts similarity index 100% rename from amqplib/callback_api.d.ts rename to types/amqplib/callback_api.d.ts diff --git a/amqplib/index.d.ts b/types/amqplib/index.d.ts similarity index 100% rename from amqplib/index.d.ts rename to types/amqplib/index.d.ts diff --git a/amqplib/properties.d.ts b/types/amqplib/properties.d.ts similarity index 100% rename from amqplib/properties.d.ts rename to types/amqplib/properties.d.ts diff --git a/amqplib/tsconfig.json b/types/amqplib/tsconfig.json similarity index 100% rename from amqplib/tsconfig.json rename to types/amqplib/tsconfig.json diff --git a/amqplib/tslint.json b/types/amqplib/tslint.json similarity index 100% rename from amqplib/tslint.json rename to types/amqplib/tslint.json diff --git a/analytics-node/analytics-node-tests.ts b/types/analytics-node/analytics-node-tests.ts similarity index 100% rename from analytics-node/analytics-node-tests.ts rename to types/analytics-node/analytics-node-tests.ts diff --git a/analytics-node/index.d.ts b/types/analytics-node/index.d.ts similarity index 100% rename from analytics-node/index.d.ts rename to types/analytics-node/index.d.ts diff --git a/analytics-node/tsconfig.json b/types/analytics-node/tsconfig.json similarity index 100% rename from analytics-node/tsconfig.json rename to types/analytics-node/tsconfig.json diff --git a/angular-agility/angular-agility-tests.ts b/types/angular-agility/angular-agility-tests.ts similarity index 100% rename from angular-agility/angular-agility-tests.ts rename to types/angular-agility/angular-agility-tests.ts diff --git a/angular-agility/index.d.ts b/types/angular-agility/index.d.ts similarity index 100% rename from angular-agility/index.d.ts rename to types/angular-agility/index.d.ts diff --git a/angular-agility/tsconfig.json b/types/angular-agility/tsconfig.json similarity index 100% rename from angular-agility/tsconfig.json rename to types/angular-agility/tsconfig.json diff --git a/angular-animate/index.d.ts b/types/angular-animate/index.d.ts similarity index 100% rename from angular-animate/index.d.ts rename to types/angular-animate/index.d.ts diff --git a/angular-animate/tsconfig.json b/types/angular-animate/tsconfig.json similarity index 100% rename from angular-animate/tsconfig.json rename to types/angular-animate/tsconfig.json diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts b/types/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts similarity index 97% rename from angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts rename to types/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts index 4ff5b4cf19..1efc5d0391 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts +++ b/types/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts @@ -1,6 +1,3 @@ -/// -/// - var myApp = angular.module('testModule'); interface MyAppScope extends ng.IScope { diff --git a/angular-bootstrap-calendar/index.d.ts b/types/angular-bootstrap-calendar/index.d.ts similarity index 100% rename from angular-bootstrap-calendar/index.d.ts rename to types/angular-bootstrap-calendar/index.d.ts diff --git a/angular-bootstrap-calendar/package.json b/types/angular-bootstrap-calendar/package.json similarity index 100% rename from angular-bootstrap-calendar/package.json rename to types/angular-bootstrap-calendar/package.json diff --git a/angular-bootstrap-calendar/tsconfig.json b/types/angular-bootstrap-calendar/tsconfig.json similarity index 100% rename from angular-bootstrap-calendar/tsconfig.json rename to types/angular-bootstrap-calendar/tsconfig.json diff --git a/angular-bootstrap-lightbox/angular-bootstrap-lightbox-tests.ts b/types/angular-bootstrap-lightbox/angular-bootstrap-lightbox-tests.ts similarity index 100% rename from angular-bootstrap-lightbox/angular-bootstrap-lightbox-tests.ts rename to types/angular-bootstrap-lightbox/angular-bootstrap-lightbox-tests.ts diff --git a/angular-bootstrap-lightbox/index.d.ts b/types/angular-bootstrap-lightbox/index.d.ts similarity index 100% rename from angular-bootstrap-lightbox/index.d.ts rename to types/angular-bootstrap-lightbox/index.d.ts diff --git a/angular-bootstrap-lightbox/tsconfig.json b/types/angular-bootstrap-lightbox/tsconfig.json similarity index 100% rename from angular-bootstrap-lightbox/tsconfig.json rename to types/angular-bootstrap-lightbox/tsconfig.json diff --git a/angular-breadcrumb/index.d.ts b/types/angular-breadcrumb/index.d.ts similarity index 100% rename from angular-breadcrumb/index.d.ts rename to types/angular-breadcrumb/index.d.ts diff --git a/angular-breadcrumb/tsconfig.json b/types/angular-breadcrumb/tsconfig.json similarity index 100% rename from angular-breadcrumb/tsconfig.json rename to types/angular-breadcrumb/tsconfig.json diff --git a/angular-clipboard/angular-clipboard-tests.ts b/types/angular-clipboard/angular-clipboard-tests.ts similarity index 100% rename from angular-clipboard/angular-clipboard-tests.ts rename to types/angular-clipboard/angular-clipboard-tests.ts diff --git a/angular-clipboard/index.d.ts b/types/angular-clipboard/index.d.ts similarity index 100% rename from angular-clipboard/index.d.ts rename to types/angular-clipboard/index.d.ts diff --git a/angular-clipboard/tsconfig.json b/types/angular-clipboard/tsconfig.json similarity index 100% rename from angular-clipboard/tsconfig.json rename to types/angular-clipboard/tsconfig.json diff --git a/angular-cookie/angular-cookie-tests.ts b/types/angular-cookie/angular-cookie-tests.ts similarity index 100% rename from angular-cookie/angular-cookie-tests.ts rename to types/angular-cookie/angular-cookie-tests.ts diff --git a/angular-cookie/index.d.ts b/types/angular-cookie/index.d.ts similarity index 100% rename from angular-cookie/index.d.ts rename to types/angular-cookie/index.d.ts diff --git a/angular-cookie/tsconfig.json b/types/angular-cookie/tsconfig.json similarity index 100% rename from angular-cookie/tsconfig.json rename to types/angular-cookie/tsconfig.json diff --git a/angular-cookies/index.d.ts b/types/angular-cookies/index.d.ts similarity index 100% rename from angular-cookies/index.d.ts rename to types/angular-cookies/index.d.ts diff --git a/angular-cookies/tsconfig.json b/types/angular-cookies/tsconfig.json similarity index 100% rename from angular-cookies/tsconfig.json rename to types/angular-cookies/tsconfig.json diff --git a/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts b/types/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts similarity index 100% rename from angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts rename to types/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts diff --git a/angular-deferred-bootstrap/index.d.ts b/types/angular-deferred-bootstrap/index.d.ts similarity index 100% rename from angular-deferred-bootstrap/index.d.ts rename to types/angular-deferred-bootstrap/index.d.ts diff --git a/angular-deferred-bootstrap/tsconfig.json b/types/angular-deferred-bootstrap/tsconfig.json similarity index 100% rename from angular-deferred-bootstrap/tsconfig.json rename to types/angular-deferred-bootstrap/tsconfig.json diff --git a/angular-dialog-service/angular-dialog-service-tests.ts b/types/angular-dialog-service/angular-dialog-service-tests.ts similarity index 100% rename from angular-dialog-service/angular-dialog-service-tests.ts rename to types/angular-dialog-service/angular-dialog-service-tests.ts diff --git a/angular-dialog-service/index.d.ts b/types/angular-dialog-service/index.d.ts similarity index 100% rename from angular-dialog-service/index.d.ts rename to types/angular-dialog-service/index.d.ts diff --git a/angular-dialog-service/tsconfig.json b/types/angular-dialog-service/tsconfig.json similarity index 100% rename from angular-dialog-service/tsconfig.json rename to types/angular-dialog-service/tsconfig.json diff --git a/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/types/angular-dynamic-locale/angular-dynamic-locale-tests.ts similarity index 100% rename from angular-dynamic-locale/angular-dynamic-locale-tests.ts rename to types/angular-dynamic-locale/angular-dynamic-locale-tests.ts diff --git a/angular-dynamic-locale/index.d.ts b/types/angular-dynamic-locale/index.d.ts similarity index 100% rename from angular-dynamic-locale/index.d.ts rename to types/angular-dynamic-locale/index.d.ts diff --git a/angular-dynamic-locale/tsconfig.json b/types/angular-dynamic-locale/tsconfig.json similarity index 100% rename from angular-dynamic-locale/tsconfig.json rename to types/angular-dynamic-locale/tsconfig.json diff --git a/angular-environment/angular-environment-tests.ts b/types/angular-environment/angular-environment-tests.ts similarity index 100% rename from angular-environment/angular-environment-tests.ts rename to types/angular-environment/angular-environment-tests.ts diff --git a/angular-environment/index.d.ts b/types/angular-environment/index.d.ts similarity index 100% rename from angular-environment/index.d.ts rename to types/angular-environment/index.d.ts diff --git a/angular-environment/tsconfig.json b/types/angular-environment/tsconfig.json similarity index 100% rename from angular-environment/tsconfig.json rename to types/angular-environment/tsconfig.json diff --git a/angular-es/angular-es-tests.ts b/types/angular-es/angular-es-tests.ts similarity index 100% rename from angular-es/angular-es-tests.ts rename to types/angular-es/angular-es-tests.ts diff --git a/angular-es/index.d.ts b/types/angular-es/index.d.ts similarity index 100% rename from angular-es/index.d.ts rename to types/angular-es/index.d.ts diff --git a/angular-es/tsconfig.json b/types/angular-es/tsconfig.json similarity index 100% rename from angular-es/tsconfig.json rename to types/angular-es/tsconfig.json diff --git a/angular-feature-flags/angular-feature-flags-tests.ts b/types/angular-feature-flags/angular-feature-flags-tests.ts similarity index 96% rename from angular-feature-flags/angular-feature-flags-tests.ts rename to types/angular-feature-flags/angular-feature-flags-tests.ts index 8ca17e4962..ac956dd657 100644 --- a/angular-feature-flags/angular-feature-flags-tests.ts +++ b/types/angular-feature-flags/angular-feature-flags-tests.ts @@ -1,5 +1,3 @@ -/// - import * as angular from "angular"; let myApp = angular.module('myApp', ['feature-flags']); diff --git a/angular-feature-flags/index.d.ts b/types/angular-feature-flags/index.d.ts similarity index 100% rename from angular-feature-flags/index.d.ts rename to types/angular-feature-flags/index.d.ts diff --git a/angular-feature-flags/tsconfig.json b/types/angular-feature-flags/tsconfig.json similarity index 100% rename from angular-feature-flags/tsconfig.json rename to types/angular-feature-flags/tsconfig.json diff --git a/angular-file-saver/angular-file-saver-tests.ts b/types/angular-file-saver/angular-file-saver-tests.ts similarity index 100% rename from angular-file-saver/angular-file-saver-tests.ts rename to types/angular-file-saver/angular-file-saver-tests.ts diff --git a/angular-file-saver/index.d.ts b/types/angular-file-saver/index.d.ts similarity index 87% rename from angular-file-saver/index.d.ts rename to types/angular-file-saver/index.d.ts index 7e1fb90b16..2fb846eef4 100644 --- a/angular-file-saver/index.d.ts +++ b/types/angular-file-saver/index.d.ts @@ -3,13 +3,12 @@ // Definitions by: Donald Nairn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -declare namespace angular { +import * as angular from 'angular'; +declare module 'angular' { /** * A core Angular factory proving FileSaver functionality. */ - interface FileSaver { + export interface FileSaver { /** * Immediately starts saving a file * @param data: a Blob instance; @@ -18,4 +17,4 @@ declare namespace angular { */ saveAs(blob: Blob, fileName: string, disableBOM?: boolean): void; } -} \ No newline at end of file +} diff --git a/angular-file-saver/tsconfig.json b/types/angular-file-saver/tsconfig.json similarity index 100% rename from angular-file-saver/tsconfig.json rename to types/angular-file-saver/tsconfig.json diff --git a/angular-formly/angular-formly-tests.ts b/types/angular-formly/angular-formly-tests.ts similarity index 100% rename from angular-formly/angular-formly-tests.ts rename to types/angular-formly/angular-formly-tests.ts diff --git a/angular-formly/index.d.ts b/types/angular-formly/index.d.ts similarity index 100% rename from angular-formly/index.d.ts rename to types/angular-formly/index.d.ts diff --git a/angular-formly/tsconfig.json b/types/angular-formly/tsconfig.json similarity index 100% rename from angular-formly/tsconfig.json rename to types/angular-formly/tsconfig.json diff --git a/angular-fullscreen/angular-fullscreen-tests.ts b/types/angular-fullscreen/angular-fullscreen-tests.ts similarity index 100% rename from angular-fullscreen/angular-fullscreen-tests.ts rename to types/angular-fullscreen/angular-fullscreen-tests.ts diff --git a/angular-fullscreen/index.d.ts b/types/angular-fullscreen/index.d.ts similarity index 100% rename from angular-fullscreen/index.d.ts rename to types/angular-fullscreen/index.d.ts diff --git a/angular-fullscreen/tsconfig.json b/types/angular-fullscreen/tsconfig.json similarity index 100% rename from angular-fullscreen/tsconfig.json rename to types/angular-fullscreen/tsconfig.json diff --git a/angular-gettext/angular-gettext-tests.ts b/types/angular-gettext/angular-gettext-tests.ts similarity index 100% rename from angular-gettext/angular-gettext-tests.ts rename to types/angular-gettext/angular-gettext-tests.ts diff --git a/angular-gettext/index.d.ts b/types/angular-gettext/index.d.ts similarity index 100% rename from angular-gettext/index.d.ts rename to types/angular-gettext/index.d.ts diff --git a/angular-gettext/tsconfig.json b/types/angular-gettext/tsconfig.json similarity index 100% rename from angular-gettext/tsconfig.json rename to types/angular-gettext/tsconfig.json diff --git a/angular-google-analytics/angular-google-analytics-tests.ts b/types/angular-google-analytics/angular-google-analytics-tests.ts similarity index 100% rename from angular-google-analytics/angular-google-analytics-tests.ts rename to types/angular-google-analytics/angular-google-analytics-tests.ts diff --git a/angular-google-analytics/index.d.ts b/types/angular-google-analytics/index.d.ts similarity index 100% rename from angular-google-analytics/index.d.ts rename to types/angular-google-analytics/index.d.ts diff --git a/angular-google-analytics/tsconfig.json b/types/angular-google-analytics/tsconfig.json similarity index 100% rename from angular-google-analytics/tsconfig.json rename to types/angular-google-analytics/tsconfig.json diff --git a/angular-gridster/angular-gridster-tests.ts b/types/angular-gridster/angular-gridster-tests.ts similarity index 100% rename from angular-gridster/angular-gridster-tests.ts rename to types/angular-gridster/angular-gridster-tests.ts diff --git a/angular-gridster/index.d.ts b/types/angular-gridster/index.d.ts similarity index 99% rename from angular-gridster/index.d.ts rename to types/angular-gridster/index.d.ts index fc0e990d41..272470bc6f 100644 --- a/angular-gridster/index.d.ts +++ b/types/angular-gridster/index.d.ts @@ -8,11 +8,8 @@ import * as angular from "angular"; export default "gridster"; declare module "angular" { - - export namespace gridster { - + namespace gridster { interface GridsterConfig { - // number of columns in the grid columns?: number; // whether to push other items out of the way @@ -83,7 +80,6 @@ declare module "angular" { // options to pass to resizable handler resizable?: { - // whether the items are resizable enabled?: boolean; @@ -103,7 +99,6 @@ declare module "angular" { // options to pass to draggable handler draggable?: { - // whether the items are resizable enabled?: boolean; @@ -128,7 +123,6 @@ declare module "angular" { } interface StandardGridsterItem { - // width of the item expressed in terms of number of columns it will occupy sizeX: number; diff --git a/angular-gridster/tsconfig.json b/types/angular-gridster/tsconfig.json similarity index 100% rename from angular-gridster/tsconfig.json rename to types/angular-gridster/tsconfig.json diff --git a/angular-gridster/tslint.json b/types/angular-gridster/tslint.json similarity index 100% rename from angular-gridster/tslint.json rename to types/angular-gridster/tslint.json diff --git a/angular-growl-v2/angular-growl-v2-tests.ts b/types/angular-growl-v2/angular-growl-v2-tests.ts similarity index 100% rename from angular-growl-v2/angular-growl-v2-tests.ts rename to types/angular-growl-v2/angular-growl-v2-tests.ts diff --git a/angular-growl-v2/index.d.ts b/types/angular-growl-v2/index.d.ts similarity index 100% rename from angular-growl-v2/index.d.ts rename to types/angular-growl-v2/index.d.ts diff --git a/angular-growl-v2/tsconfig.json b/types/angular-growl-v2/tsconfig.json similarity index 100% rename from angular-growl-v2/tsconfig.json rename to types/angular-growl-v2/tsconfig.json diff --git a/angular-hotkeys/angular-hotkeys-tests.ts b/types/angular-hotkeys/angular-hotkeys-tests.ts similarity index 95% rename from angular-hotkeys/angular-hotkeys-tests.ts rename to types/angular-hotkeys/angular-hotkeys-tests.ts index 1f87ecefdf..c0bd9b974d 100644 --- a/angular-hotkeys/angular-hotkeys-tests.ts +++ b/types/angular-hotkeys/angular-hotkeys-tests.ts @@ -1,5 +1,3 @@ -/// - var scope: ng.IScope; var hotkeyProvider: ng.hotkeys.HotkeysProvider; var hotkeyObj: ng.hotkeys.Hotkey; diff --git a/angular-hotkeys/index.d.ts b/types/angular-hotkeys/index.d.ts similarity index 100% rename from angular-hotkeys/index.d.ts rename to types/angular-hotkeys/index.d.ts diff --git a/angular-hotkeys/tsconfig.json b/types/angular-hotkeys/tsconfig.json similarity index 100% rename from angular-hotkeys/tsconfig.json rename to types/angular-hotkeys/tsconfig.json diff --git a/angular-http-auth/angular-http-auth-tests.ts b/types/angular-http-auth/angular-http-auth-tests.ts similarity index 100% rename from angular-http-auth/angular-http-auth-tests.ts rename to types/angular-http-auth/angular-http-auth-tests.ts diff --git a/angular-http-auth/index.d.ts b/types/angular-http-auth/index.d.ts similarity index 100% rename from angular-http-auth/index.d.ts rename to types/angular-http-auth/index.d.ts diff --git a/angular-http-auth/tsconfig.json b/types/angular-http-auth/tsconfig.json similarity index 100% rename from angular-http-auth/tsconfig.json rename to types/angular-http-auth/tsconfig.json diff --git a/angular-httpi/angular-httpi-tests.ts b/types/angular-httpi/angular-httpi-tests.ts similarity index 100% rename from angular-httpi/angular-httpi-tests.ts rename to types/angular-httpi/angular-httpi-tests.ts diff --git a/angular-httpi/index.d.ts b/types/angular-httpi/index.d.ts similarity index 100% rename from angular-httpi/index.d.ts rename to types/angular-httpi/index.d.ts diff --git a/angular-httpi/tsconfig.json b/types/angular-httpi/tsconfig.json similarity index 100% rename from angular-httpi/tsconfig.json rename to types/angular-httpi/tsconfig.json diff --git a/angular-idle/angular-idle-tests.ts b/types/angular-idle/angular-idle-tests.ts similarity index 100% rename from angular-idle/angular-idle-tests.ts rename to types/angular-idle/angular-idle-tests.ts diff --git a/angular-idle/index.d.ts b/types/angular-idle/index.d.ts similarity index 100% rename from angular-idle/index.d.ts rename to types/angular-idle/index.d.ts diff --git a/angular-idle/tsconfig.json b/types/angular-idle/tsconfig.json similarity index 100% rename from angular-idle/tsconfig.json rename to types/angular-idle/tsconfig.json diff --git a/angular-jwt/angular-jwt-tests.ts b/types/angular-jwt/angular-jwt-tests.ts similarity index 96% rename from angular-jwt/angular-jwt-tests.ts rename to types/angular-jwt/angular-jwt-tests.ts index b20b2eea9d..88b177ba74 100644 --- a/angular-jwt/angular-jwt-tests.ts +++ b/types/angular-jwt/angular-jwt-tests.ts @@ -1,5 +1,3 @@ -/// - var app = angular.module("angular-jwt-tests", ["angular-jwt"]); var $jwtHelper: ng.jwt.IJwtHelper; diff --git a/angular-jwt/index.d.ts b/types/angular-jwt/index.d.ts similarity index 100% rename from angular-jwt/index.d.ts rename to types/angular-jwt/index.d.ts diff --git a/angular-jwt/tsconfig.json b/types/angular-jwt/tsconfig.json similarity index 100% rename from angular-jwt/tsconfig.json rename to types/angular-jwt/tsconfig.json diff --git a/angular-load/angular-load-tests.ts b/types/angular-load/angular-load-tests.ts similarity index 100% rename from angular-load/angular-load-tests.ts rename to types/angular-load/angular-load-tests.ts diff --git a/angular-load/index.d.ts b/types/angular-load/index.d.ts similarity index 100% rename from angular-load/index.d.ts rename to types/angular-load/index.d.ts diff --git a/angular-load/tsconfig.json b/types/angular-load/tsconfig.json similarity index 100% rename from angular-load/tsconfig.json rename to types/angular-load/tsconfig.json diff --git a/angular-loading-bar/angular-loading-bar-tests.ts b/types/angular-loading-bar/angular-loading-bar-tests.ts similarity index 100% rename from angular-loading-bar/angular-loading-bar-tests.ts rename to types/angular-loading-bar/angular-loading-bar-tests.ts diff --git a/angular-loading-bar/index.d.ts b/types/angular-loading-bar/index.d.ts similarity index 100% rename from angular-loading-bar/index.d.ts rename to types/angular-loading-bar/index.d.ts diff --git a/angular-loading-bar/tsconfig.json b/types/angular-loading-bar/tsconfig.json similarity index 100% rename from angular-loading-bar/tsconfig.json rename to types/angular-loading-bar/tsconfig.json diff --git a/angular-local-storage/angular-local-storage-tests.ts b/types/angular-local-storage/angular-local-storage-tests.ts similarity index 100% rename from angular-local-storage/angular-local-storage-tests.ts rename to types/angular-local-storage/angular-local-storage-tests.ts diff --git a/angular-local-storage/index.d.ts b/types/angular-local-storage/index.d.ts similarity index 100% rename from angular-local-storage/index.d.ts rename to types/angular-local-storage/index.d.ts diff --git a/angular-local-storage/tsconfig.json b/types/angular-local-storage/tsconfig.json similarity index 100% rename from angular-local-storage/tsconfig.json rename to types/angular-local-storage/tsconfig.json diff --git a/angular-localforage/angular-localforage-tests.ts b/types/angular-localforage/angular-localforage-tests.ts similarity index 100% rename from angular-localforage/angular-localforage-tests.ts rename to types/angular-localforage/angular-localforage-tests.ts diff --git a/angular-localforage/index.d.ts b/types/angular-localforage/index.d.ts similarity index 100% rename from angular-localforage/index.d.ts rename to types/angular-localforage/index.d.ts diff --git a/types/angular-localforage/package.json b/types/angular-localforage/package.json new file mode 100644 index 0000000000..07bf3d2615 --- /dev/null +++ b/types/angular-localforage/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "localforage": "^1.5.0" + } +} \ No newline at end of file diff --git a/angular-localforage/tsconfig.json b/types/angular-localforage/tsconfig.json similarity index 100% rename from angular-localforage/tsconfig.json rename to types/angular-localforage/tsconfig.json diff --git a/angular-locker/angular-locker-tests.ts b/types/angular-locker/angular-locker-tests.ts similarity index 100% rename from angular-locker/angular-locker-tests.ts rename to types/angular-locker/angular-locker-tests.ts diff --git a/angular-locker/index.d.ts b/types/angular-locker/index.d.ts similarity index 100% rename from angular-locker/index.d.ts rename to types/angular-locker/index.d.ts diff --git a/angular-locker/tsconfig.json b/types/angular-locker/tsconfig.json similarity index 100% rename from angular-locker/tsconfig.json rename to types/angular-locker/tsconfig.json diff --git a/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts similarity index 100% rename from angular-material/angular-material-tests.ts rename to types/angular-material/angular-material-tests.ts diff --git a/angular-material/index.d.ts b/types/angular-material/index.d.ts similarity index 99% rename from angular-material/index.d.ts rename to types/angular-material/index.d.ts index 0e27fe3b60..a8196269a4 100644 --- a/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -1,6 +1,6 @@ // 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 by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as angular from 'angular'; @@ -18,6 +18,7 @@ declare module 'angular' { controller?: string | Function; locals?: { [index: string]: any }; clickOutsideToClose?: boolean; + bindToController?: boolean; // default: false disableBackdrop?: boolean; escapeToClose?: boolean; resolve?: { [index: string]: () => angular.IPromise }; diff --git a/angular-material/tsconfig.json b/types/angular-material/tsconfig.json similarity index 100% rename from angular-material/tsconfig.json rename to types/angular-material/tsconfig.json diff --git a/angular-media-queries/angular-media-queries-tests.ts b/types/angular-media-queries/angular-media-queries-tests.ts similarity index 100% rename from angular-media-queries/angular-media-queries-tests.ts rename to types/angular-media-queries/angular-media-queries-tests.ts diff --git a/angular-media-queries/index.d.ts b/types/angular-media-queries/index.d.ts similarity index 100% rename from angular-media-queries/index.d.ts rename to types/angular-media-queries/index.d.ts diff --git a/angular-media-queries/tsconfig.json b/types/angular-media-queries/tsconfig.json similarity index 100% rename from angular-media-queries/tsconfig.json rename to types/angular-media-queries/tsconfig.json diff --git a/angular-meteor/angular-meteor-tests.ts b/types/angular-meteor/angular-meteor-tests.ts similarity index 100% rename from angular-meteor/angular-meteor-tests.ts rename to types/angular-meteor/angular-meteor-tests.ts diff --git a/angular-meteor/index.d.ts b/types/angular-meteor/index.d.ts similarity index 100% rename from angular-meteor/index.d.ts rename to types/angular-meteor/index.d.ts diff --git a/angular-meteor/tsconfig.json b/types/angular-meteor/tsconfig.json similarity index 100% rename from angular-meteor/tsconfig.json rename to types/angular-meteor/tsconfig.json diff --git a/angular-mocks/angular-mocks-tests.ts b/types/angular-mocks/angular-mocks-tests.ts similarity index 100% rename from angular-mocks/angular-mocks-tests.ts rename to types/angular-mocks/angular-mocks-tests.ts diff --git a/angular-mocks/index.d.ts b/types/angular-mocks/index.d.ts similarity index 100% rename from angular-mocks/index.d.ts rename to types/angular-mocks/index.d.ts diff --git a/angular-mocks/mocks.d.ts b/types/angular-mocks/mocks.d.ts similarity index 100% rename from angular-mocks/mocks.d.ts rename to types/angular-mocks/mocks.d.ts diff --git a/angular-mocks/tsconfig.json b/types/angular-mocks/tsconfig.json similarity index 100% rename from angular-mocks/tsconfig.json rename to types/angular-mocks/tsconfig.json diff --git a/angular-modal/angular-modal-tests.ts b/types/angular-modal/angular-modal-tests.ts similarity index 98% rename from angular-modal/angular-modal-tests.ts rename to types/angular-modal/angular-modal-tests.ts index 5be313840b..edb4d7e6ef 100644 --- a/angular-modal/angular-modal-tests.ts +++ b/types/angular-modal/angular-modal-tests.ts @@ -1,5 +1,3 @@ -/// - var btfModal: angularModal.AngularModalFactory; // Using template URL diff --git a/angular-modal/index.d.ts b/types/angular-modal/index.d.ts similarity index 100% rename from angular-modal/index.d.ts rename to types/angular-modal/index.d.ts diff --git a/angular-modal/tsconfig.json b/types/angular-modal/tsconfig.json similarity index 100% rename from angular-modal/tsconfig.json rename to types/angular-modal/tsconfig.json diff --git a/angular-notifications/angular-notifications-tests.ts b/types/angular-notifications/angular-notifications-tests.ts similarity index 100% rename from angular-notifications/angular-notifications-tests.ts rename to types/angular-notifications/angular-notifications-tests.ts diff --git a/angular-notifications/index.d.ts b/types/angular-notifications/index.d.ts similarity index 100% rename from angular-notifications/index.d.ts rename to types/angular-notifications/index.d.ts diff --git a/angular-notifications/tsconfig.json b/types/angular-notifications/tsconfig.json similarity index 100% rename from angular-notifications/tsconfig.json rename to types/angular-notifications/tsconfig.json diff --git a/angular-notify/angular-notify-tests.ts b/types/angular-notify/angular-notify-tests.ts similarity index 100% rename from angular-notify/angular-notify-tests.ts rename to types/angular-notify/angular-notify-tests.ts diff --git a/angular-notify/index.d.ts b/types/angular-notify/index.d.ts similarity index 100% rename from angular-notify/index.d.ts rename to types/angular-notify/index.d.ts diff --git a/angular-notify/tsconfig.json b/types/angular-notify/tsconfig.json similarity index 100% rename from angular-notify/tsconfig.json rename to types/angular-notify/tsconfig.json diff --git a/angular-oauth2/angular-oauth2-tests.ts b/types/angular-oauth2/angular-oauth2-tests.ts similarity index 78% rename from angular-oauth2/angular-oauth2-tests.ts rename to types/angular-oauth2/angular-oauth2-tests.ts index 2b2328d5ee..042fe537aa 100644 --- a/angular-oauth2/angular-oauth2-tests.ts +++ b/types/angular-oauth2/angular-oauth2-tests.ts @@ -1,7 +1,7 @@ import * as angular from 'angular'; angular.module('angular-oauth2-test', ['angular-oauth2']) - .config(['OAuthProvider', function(OAuthProvider:angular.oauth2.OAuthProvider){ + .config(['OAuthProvider', (OAuthProvider: angular.oauth2.OAuthProvider) => { OAuthProvider.configure({ baseUrl: 'https://api.website.com', clientId: 'CLIENT_ID', diff --git a/angular-oauth2/index.d.ts b/types/angular-oauth2/index.d.ts similarity index 95% rename from angular-oauth2/index.d.ts rename to types/angular-oauth2/index.d.ts index e6b9592874..23df762df1 100644 --- a/angular-oauth2/index.d.ts +++ b/types/angular-oauth2/index.d.ts @@ -6,8 +6,8 @@ import * as angular from 'angular'; declare module 'angular' { - export namespace oauth2 { - interface OAuthConfig { + namespace oauth2 { + interface OAuthConfig { baseUrl: string; clientId: string; clientSecret?: string; @@ -43,7 +43,5 @@ declare module 'angular' { interface OAuthTokenProvider { configure(params: OAuthTokenConfig): OAuthTokenConfig; } - } } - diff --git a/angular-oauth2/tsconfig.json b/types/angular-oauth2/tsconfig.json similarity index 87% rename from angular-oauth2/tsconfig.json rename to types/angular-oauth2/tsconfig.json index 717721bf79..e8a5250748 100644 --- a/angular-oauth2/tsconfig.json +++ b/types/angular-oauth2/tsconfig.json @@ -2,6 +2,10 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": [ + "es6", + "dom" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/angular-oauth2/tslint.json b/types/angular-oauth2/tslint.json similarity index 100% rename from angular-oauth2/tslint.json rename to types/angular-oauth2/tslint.json diff --git a/angular-odata-resources/angular-odata-resources-tests.ts b/types/angular-odata-resources/angular-odata-resources-tests.ts similarity index 100% rename from angular-odata-resources/angular-odata-resources-tests.ts rename to types/angular-odata-resources/angular-odata-resources-tests.ts diff --git a/angular-odata-resources/index.d.ts b/types/angular-odata-resources/index.d.ts similarity index 100% rename from angular-odata-resources/index.d.ts rename to types/angular-odata-resources/index.d.ts diff --git a/angular-odata-resources/tsconfig.json b/types/angular-odata-resources/tsconfig.json similarity index 100% rename from angular-odata-resources/tsconfig.json rename to types/angular-odata-resources/tsconfig.json diff --git a/angular-permission/angular-permission-tests.ts b/types/angular-permission/angular-permission-tests.ts similarity index 100% rename from angular-permission/angular-permission-tests.ts rename to types/angular-permission/angular-permission-tests.ts diff --git a/angular-permission/index.d.ts b/types/angular-permission/index.d.ts similarity index 100% rename from angular-permission/index.d.ts rename to types/angular-permission/index.d.ts diff --git a/angular-permission/tsconfig.json b/types/angular-permission/tsconfig.json similarity index 100% rename from angular-permission/tsconfig.json rename to types/angular-permission/tsconfig.json diff --git a/angular-promise-tracker/angular-promise-tracker-tests.ts b/types/angular-promise-tracker/angular-promise-tracker-tests.ts similarity index 100% rename from angular-promise-tracker/angular-promise-tracker-tests.ts rename to types/angular-promise-tracker/angular-promise-tracker-tests.ts diff --git a/angular-promise-tracker/index.d.ts b/types/angular-promise-tracker/index.d.ts similarity index 100% rename from angular-promise-tracker/index.d.ts rename to types/angular-promise-tracker/index.d.ts diff --git a/angular-promise-tracker/tsconfig.json b/types/angular-promise-tracker/tsconfig.json similarity index 100% rename from angular-promise-tracker/tsconfig.json rename to types/angular-promise-tracker/tsconfig.json diff --git a/angular-q-spread/angular-q-spread-tests.ts b/types/angular-q-spread/angular-q-spread-tests.ts similarity index 100% rename from angular-q-spread/angular-q-spread-tests.ts rename to types/angular-q-spread/angular-q-spread-tests.ts diff --git a/angular-q-spread/index.d.ts b/types/angular-q-spread/index.d.ts similarity index 100% rename from angular-q-spread/index.d.ts rename to types/angular-q-spread/index.d.ts diff --git a/angular-q-spread/tsconfig.json b/types/angular-q-spread/tsconfig.json similarity index 100% rename from angular-q-spread/tsconfig.json rename to types/angular-q-spread/tsconfig.json diff --git a/angular-resource/angular-resource-tests.ts b/types/angular-resource/angular-resource-tests.ts similarity index 100% rename from angular-resource/angular-resource-tests.ts rename to types/angular-resource/angular-resource-tests.ts diff --git a/angular-resource/index.d.ts b/types/angular-resource/index.d.ts similarity index 100% rename from angular-resource/index.d.ts rename to types/angular-resource/index.d.ts diff --git a/angular-resource/tsconfig.json b/types/angular-resource/tsconfig.json similarity index 100% rename from angular-resource/tsconfig.json rename to types/angular-resource/tsconfig.json diff --git a/angular-route/angular-route-tests.ts b/types/angular-route/angular-route-tests.ts similarity index 100% rename from angular-route/angular-route-tests.ts rename to types/angular-route/angular-route-tests.ts diff --git a/angular-route/index.d.ts b/types/angular-route/index.d.ts similarity index 100% rename from angular-route/index.d.ts rename to types/angular-route/index.d.ts diff --git a/angular-route/tsconfig.json b/types/angular-route/tsconfig.json similarity index 100% rename from angular-route/tsconfig.json rename to types/angular-route/tsconfig.json diff --git a/angular-sanitize/angular-sanitize-tests.ts b/types/angular-sanitize/angular-sanitize-tests.ts similarity index 100% rename from angular-sanitize/angular-sanitize-tests.ts rename to types/angular-sanitize/angular-sanitize-tests.ts diff --git a/angular-sanitize/index.d.ts b/types/angular-sanitize/index.d.ts similarity index 100% rename from angular-sanitize/index.d.ts rename to types/angular-sanitize/index.d.ts diff --git a/angular-sanitize/tsconfig.json b/types/angular-sanitize/tsconfig.json similarity index 100% rename from angular-sanitize/tsconfig.json rename to types/angular-sanitize/tsconfig.json diff --git a/angular-scenario/index.d.ts b/types/angular-scenario/index.d.ts similarity index 100% rename from angular-scenario/index.d.ts rename to types/angular-scenario/index.d.ts diff --git a/angular-scenario/tsconfig.json b/types/angular-scenario/tsconfig.json similarity index 100% rename from angular-scenario/tsconfig.json rename to types/angular-scenario/tsconfig.json diff --git a/angular-scroll/angular-scroll-tests.ts b/types/angular-scroll/angular-scroll-tests.ts similarity index 100% rename from angular-scroll/angular-scroll-tests.ts rename to types/angular-scroll/angular-scroll-tests.ts diff --git a/angular-scroll/index.d.ts b/types/angular-scroll/index.d.ts similarity index 100% rename from angular-scroll/index.d.ts rename to types/angular-scroll/index.d.ts diff --git a/angular-scroll/tsconfig.json b/types/angular-scroll/tsconfig.json similarity index 100% rename from angular-scroll/tsconfig.json rename to types/angular-scroll/tsconfig.json diff --git a/angular-signalr-hub/angular-signalr-hub-tests.ts b/types/angular-signalr-hub/angular-signalr-hub-tests.ts similarity index 100% rename from angular-signalr-hub/angular-signalr-hub-tests.ts rename to types/angular-signalr-hub/angular-signalr-hub-tests.ts diff --git a/angular-signalr-hub/index.d.ts b/types/angular-signalr-hub/index.d.ts similarity index 100% rename from angular-signalr-hub/index.d.ts rename to types/angular-signalr-hub/index.d.ts diff --git a/angular-signalr-hub/tsconfig.json b/types/angular-signalr-hub/tsconfig.json similarity index 100% rename from angular-signalr-hub/tsconfig.json rename to types/angular-signalr-hub/tsconfig.json diff --git a/angular-spinner/angular-spinner-tests.ts b/types/angular-spinner/angular-spinner-tests.ts similarity index 100% rename from angular-spinner/angular-spinner-tests.ts rename to types/angular-spinner/angular-spinner-tests.ts diff --git a/angular-spinner/index.d.ts b/types/angular-spinner/index.d.ts similarity index 100% rename from angular-spinner/index.d.ts rename to types/angular-spinner/index.d.ts diff --git a/angular-spinner/tsconfig.json b/types/angular-spinner/tsconfig.json similarity index 100% rename from angular-spinner/tsconfig.json rename to types/angular-spinner/tsconfig.json diff --git a/angular-storage/angular-storage-tests.ts b/types/angular-storage/angular-storage-tests.ts similarity index 100% rename from angular-storage/angular-storage-tests.ts rename to types/angular-storage/angular-storage-tests.ts diff --git a/angular-storage/index.d.ts b/types/angular-storage/index.d.ts similarity index 100% rename from angular-storage/index.d.ts rename to types/angular-storage/index.d.ts diff --git a/angular-storage/tsconfig.json b/types/angular-storage/tsconfig.json similarity index 100% rename from angular-storage/tsconfig.json rename to types/angular-storage/tsconfig.json diff --git a/angular-strap/angular-strap-tests.ts b/types/angular-strap/angular-strap-tests.ts similarity index 100% rename from angular-strap/angular-strap-tests.ts rename to types/angular-strap/angular-strap-tests.ts diff --git a/angular-strap/index.d.ts b/types/angular-strap/index.d.ts similarity index 100% rename from angular-strap/index.d.ts rename to types/angular-strap/index.d.ts diff --git a/angular-strap/tsconfig.json b/types/angular-strap/tsconfig.json similarity index 100% rename from angular-strap/tsconfig.json rename to types/angular-strap/tsconfig.json diff --git a/angular-toastr/angular-toastr-tests.ts b/types/angular-toastr/angular-toastr-tests.ts similarity index 100% rename from angular-toastr/angular-toastr-tests.ts rename to types/angular-toastr/angular-toastr-tests.ts diff --git a/angular-toastr/index.d.ts b/types/angular-toastr/index.d.ts similarity index 100% rename from angular-toastr/index.d.ts rename to types/angular-toastr/index.d.ts diff --git a/angular-toastr/tsconfig.json b/types/angular-toastr/tsconfig.json similarity index 100% rename from angular-toastr/tsconfig.json rename to types/angular-toastr/tsconfig.json diff --git a/angular-toasty/angular-toasty-tests.ts b/types/angular-toasty/angular-toasty-tests.ts similarity index 100% rename from angular-toasty/angular-toasty-tests.ts rename to types/angular-toasty/angular-toasty-tests.ts diff --git a/angular-toasty/index.d.ts b/types/angular-toasty/index.d.ts similarity index 100% rename from angular-toasty/index.d.ts rename to types/angular-toasty/index.d.ts diff --git a/angular-toasty/tsconfig.json b/types/angular-toasty/tsconfig.json similarity index 100% rename from angular-toasty/tsconfig.json rename to types/angular-toasty/tsconfig.json diff --git a/angular-touchspin/angular-touchspin-tests.ts b/types/angular-touchspin/angular-touchspin-tests.ts similarity index 100% rename from angular-touchspin/angular-touchspin-tests.ts rename to types/angular-touchspin/angular-touchspin-tests.ts diff --git a/angular-touchspin/index.d.ts b/types/angular-touchspin/index.d.ts similarity index 100% rename from angular-touchspin/index.d.ts rename to types/angular-touchspin/index.d.ts diff --git a/angular-touchspin/tsconfig.json b/types/angular-touchspin/tsconfig.json similarity index 100% rename from angular-touchspin/tsconfig.json rename to types/angular-touchspin/tsconfig.json diff --git a/angular-translate/angular-translate-tests.ts b/types/angular-translate/angular-translate-tests.ts similarity index 100% rename from angular-translate/angular-translate-tests.ts rename to types/angular-translate/angular-translate-tests.ts diff --git a/angular-translate/index.d.ts b/types/angular-translate/index.d.ts similarity index 100% rename from angular-translate/index.d.ts rename to types/angular-translate/index.d.ts diff --git a/angular-translate/tsconfig.json b/types/angular-translate/tsconfig.json similarity index 100% rename from angular-translate/tsconfig.json rename to types/angular-translate/tsconfig.json diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts similarity index 100% rename from angular-ui-bootstrap/angular-ui-bootstrap-tests.ts rename to types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts diff --git a/angular-ui-bootstrap/index.d.ts b/types/angular-ui-bootstrap/index.d.ts similarity index 97% rename from angular-ui-bootstrap/index.d.ts rename to types/angular-ui-bootstrap/index.d.ts index bc80d96b5a..1e4d15d282 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/types/angular-ui-bootstrap/index.d.ts @@ -15,6 +15,7 @@ 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 IModalInstanceService = angular.ui.bootstrap.IModalInstanceService; export type IModalScope = angular.ui.bootstrap.IModalScope; export type IModalSettings = angular.ui.bootstrap.IModalSettings; export type IModalStackService = angular.ui.bootstrap.IModalStackService; @@ -320,12 +321,12 @@ declare module 'angular' { interface IModalService { /** * @param {IModalSettings} options - * @returns {IModalServiceInstance} + * @returns {IModalInstanceService} */ - open(options: IModalSettings): IModalServiceInstance; + open(options: IModalSettings): IModalInstanceService; } - interface IModalServiceInstance { + interface IModalInstanceService { /** * 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. */ @@ -357,6 +358,11 @@ declare module 'angular' { closed: angular.IPromise; } + /** + * @deprecated use IModalInstanceService instead. + */ + interface IModalServiceInstance extends IModalInstanceService { } + 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. @@ -512,17 +518,17 @@ declare module 'angular' { /** * Opens a new modal instance. */ - open(modalInstance: IModalServiceInstance, modal: any): void; + open(modalInstance: IModalInstanceService, modal: any): void; /** * Closes a modal instance with an optional result. */ - close(modalInstance: IModalServiceInstance, result?: any): void; + close(modalInstance: IModalInstanceService, result?: any): void; /** * Dismisses a modal instance with an optional reason. */ - dismiss(modalInstance: IModalServiceInstance, reason?: any): void; + dismiss(modalInstance: IModalInstanceService, reason?: any): void; /** * Dismiss all open modal instances with an optional reason that will be passed to each instance. @@ -536,7 +542,7 @@ declare module 'angular' { } interface IModalStackedMapKeyValuePair { - key: IModalServiceInstance; + key: IModalInstanceService; value: any; } diff --git a/angular-ui-bootstrap/tsconfig.json b/types/angular-ui-bootstrap/tsconfig.json similarity index 100% rename from angular-ui-bootstrap/tsconfig.json rename to types/angular-ui-bootstrap/tsconfig.json diff --git a/angular-ui-notification/angular-ui-notification-tests.ts b/types/angular-ui-notification/angular-ui-notification-tests.ts similarity index 100% rename from angular-ui-notification/angular-ui-notification-tests.ts rename to types/angular-ui-notification/angular-ui-notification-tests.ts diff --git a/angular-ui-notification/index.d.ts b/types/angular-ui-notification/index.d.ts similarity index 100% rename from angular-ui-notification/index.d.ts rename to types/angular-ui-notification/index.d.ts diff --git a/angular-ui-notification/tsconfig.json b/types/angular-ui-notification/tsconfig.json similarity index 100% rename from angular-ui-notification/tsconfig.json rename to types/angular-ui-notification/tsconfig.json diff --git a/angular-ui-router-default/angular-ui-router-default-tests.ts b/types/angular-ui-router-default/angular-ui-router-default-tests.ts similarity index 100% rename from angular-ui-router-default/angular-ui-router-default-tests.ts rename to types/angular-ui-router-default/angular-ui-router-default-tests.ts diff --git a/angular-ui-router-default/index.d.ts b/types/angular-ui-router-default/index.d.ts similarity index 100% rename from angular-ui-router-default/index.d.ts rename to types/angular-ui-router-default/index.d.ts diff --git a/angular-ui-router-default/tsconfig.json b/types/angular-ui-router-default/tsconfig.json similarity index 100% rename from angular-ui-router-default/tsconfig.json rename to types/angular-ui-router-default/tsconfig.json diff --git a/angular-ui-router-uib-modal/angular-ui-router-uib-modal-tests.ts b/types/angular-ui-router-uib-modal/angular-ui-router-uib-modal-tests.ts similarity index 100% rename from angular-ui-router-uib-modal/angular-ui-router-uib-modal-tests.ts rename to types/angular-ui-router-uib-modal/angular-ui-router-uib-modal-tests.ts diff --git a/angular-ui-router-uib-modal/index.d.ts b/types/angular-ui-router-uib-modal/index.d.ts similarity index 100% rename from angular-ui-router-uib-modal/index.d.ts rename to types/angular-ui-router-uib-modal/index.d.ts diff --git a/angular-ui-router-uib-modal/tsconfig.json b/types/angular-ui-router-uib-modal/tsconfig.json similarity index 100% rename from angular-ui-router-uib-modal/tsconfig.json rename to types/angular-ui-router-uib-modal/tsconfig.json diff --git a/angular-ui-router/angular-ui-router-tests.ts b/types/angular-ui-router/angular-ui-router-tests.ts similarity index 100% rename from angular-ui-router/angular-ui-router-tests.ts rename to types/angular-ui-router/angular-ui-router-tests.ts diff --git a/angular-ui-router/index.d.ts b/types/angular-ui-router/index.d.ts similarity index 100% rename from angular-ui-router/index.d.ts rename to types/angular-ui-router/index.d.ts diff --git a/angular-ui-router/tsconfig.json b/types/angular-ui-router/tsconfig.json similarity index 100% rename from angular-ui-router/tsconfig.json rename to types/angular-ui-router/tsconfig.json diff --git a/angular-ui-scroll/angular-ui-scroll-tests.ts b/types/angular-ui-scroll/angular-ui-scroll-tests.ts similarity index 100% rename from angular-ui-scroll/angular-ui-scroll-tests.ts rename to types/angular-ui-scroll/angular-ui-scroll-tests.ts diff --git a/angular-ui-scroll/index.d.ts b/types/angular-ui-scroll/index.d.ts similarity index 100% rename from angular-ui-scroll/index.d.ts rename to types/angular-ui-scroll/index.d.ts diff --git a/angular-ui-scroll/tsconfig.json b/types/angular-ui-scroll/tsconfig.json similarity index 100% rename from angular-ui-scroll/tsconfig.json rename to types/angular-ui-scroll/tsconfig.json diff --git a/angular-ui-sortable/angular-ui-sortable-tests.ts b/types/angular-ui-sortable/angular-ui-sortable-tests.ts similarity index 100% rename from angular-ui-sortable/angular-ui-sortable-tests.ts rename to types/angular-ui-sortable/angular-ui-sortable-tests.ts diff --git a/angular-ui-sortable/index.d.ts b/types/angular-ui-sortable/index.d.ts similarity index 100% rename from angular-ui-sortable/index.d.ts rename to types/angular-ui-sortable/index.d.ts diff --git a/angular-ui-sortable/tsconfig.json b/types/angular-ui-sortable/tsconfig.json similarity index 100% rename from angular-ui-sortable/tsconfig.json rename to types/angular-ui-sortable/tsconfig.json diff --git a/angular-ui-tree/angular-ui-tree-tests.ts b/types/angular-ui-tree/angular-ui-tree-tests.ts similarity index 100% rename from angular-ui-tree/angular-ui-tree-tests.ts rename to types/angular-ui-tree/angular-ui-tree-tests.ts diff --git a/angular-ui-tree/index.d.ts b/types/angular-ui-tree/index.d.ts similarity index 100% rename from angular-ui-tree/index.d.ts rename to types/angular-ui-tree/index.d.ts diff --git a/angular-ui-tree/tsconfig.json b/types/angular-ui-tree/tsconfig.json similarity index 100% rename from angular-ui-tree/tsconfig.json rename to types/angular-ui-tree/tsconfig.json diff --git a/angular-websocket/angular-websocket-tests.ts b/types/angular-websocket/angular-websocket-tests.ts similarity index 100% rename from angular-websocket/angular-websocket-tests.ts rename to types/angular-websocket/angular-websocket-tests.ts diff --git a/angular-websocket/index.d.ts b/types/angular-websocket/index.d.ts similarity index 100% rename from angular-websocket/index.d.ts rename to types/angular-websocket/index.d.ts diff --git a/angular-websocket/tsconfig.json b/types/angular-websocket/tsconfig.json similarity index 100% rename from angular-websocket/tsconfig.json rename to types/angular-websocket/tsconfig.json diff --git a/angular-wizard/angular-wizard-tests.ts b/types/angular-wizard/angular-wizard-tests.ts similarity index 100% rename from angular-wizard/angular-wizard-tests.ts rename to types/angular-wizard/angular-wizard-tests.ts diff --git a/angular-wizard/index.d.ts b/types/angular-wizard/index.d.ts similarity index 100% rename from angular-wizard/index.d.ts rename to types/angular-wizard/index.d.ts diff --git a/angular-wizard/tsconfig.json b/types/angular-wizard/tsconfig.json similarity index 100% rename from angular-wizard/tsconfig.json rename to types/angular-wizard/tsconfig.json diff --git a/angular-xeditable/angular-xeditable-tests.ts b/types/angular-xeditable/angular-xeditable-tests.ts similarity index 100% rename from angular-xeditable/angular-xeditable-tests.ts rename to types/angular-xeditable/angular-xeditable-tests.ts diff --git a/angular-xeditable/index.d.ts b/types/angular-xeditable/index.d.ts similarity index 100% rename from angular-xeditable/index.d.ts rename to types/angular-xeditable/index.d.ts diff --git a/angular-xeditable/tsconfig.json b/types/angular-xeditable/tsconfig.json similarity index 100% rename from angular-xeditable/tsconfig.json rename to types/angular-xeditable/tsconfig.json diff --git a/angular.throttle/angular.throttle-tests.ts b/types/angular.throttle/angular.throttle-tests.ts similarity index 100% rename from angular.throttle/angular.throttle-tests.ts rename to types/angular.throttle/angular.throttle-tests.ts diff --git a/angular.throttle/index.d.ts b/types/angular.throttle/index.d.ts similarity index 100% rename from angular.throttle/index.d.ts rename to types/angular.throttle/index.d.ts diff --git a/angular.throttle/tsconfig.json b/types/angular.throttle/tsconfig.json similarity index 100% rename from angular.throttle/tsconfig.json rename to types/angular.throttle/tsconfig.json diff --git a/angular/README.md b/types/angular/README.md similarity index 100% rename from angular/README.md rename to types/angular/README.md diff --git a/angular/UNUSED_FILES.txt b/types/angular/UNUSED_FILES.txt similarity index 100% rename from angular/UNUSED_FILES.txt rename to types/angular/UNUSED_FILES.txt diff --git a/angular/angular-component-router.d.ts b/types/angular/angular-component-router.d.ts similarity index 99% rename from angular/angular-component-router.d.ts rename to types/angular/angular-component-router.d.ts index 92458331d6..da3afc7a71 100644 --- a/angular/angular-component-router.d.ts +++ b/types/angular/angular-component-router.d.ts @@ -178,6 +178,7 @@ declare namespace angular { registry: RouteRegistry; parent: Router; hostComponent: any; + currentInstruction: Instruction; /** * Constructs a child router. You probably don't need to use this unless you're writing a reusable diff --git a/angular/angular-tests.ts b/types/angular/angular-tests.ts similarity index 100% rename from angular/angular-tests.ts rename to types/angular/angular-tests.ts diff --git a/angular/index.d.ts b/types/angular/index.d.ts similarity index 99% rename from angular/index.d.ts rename to types/angular/index.d.ts index 5d47751844..485ad9ebb3 100644 --- a/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -26,7 +26,6 @@ import ng = angular; // ng module (angular.js) /////////////////////////////////////////////////////////////////////////////// declare namespace angular { - type Injectable = T | Array; // not directly implemented, but ensures that constructed class implements $get @@ -344,7 +343,6 @@ declare namespace angular { * 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 */ @@ -532,7 +530,6 @@ declare namespace angular { * see https://docs.angularjs.org/api/ng/directive/ngRepeat */ interface IRepeatScope extends IScope { - /** * iterator offset of the repeated element (0..length-1). */ @@ -562,7 +559,6 @@ declare namespace angular { * true if the iterator position $index is odd (otherwise false). */ $odd: boolean; - } interface IAngularEvent { @@ -1944,8 +1940,7 @@ declare namespace angular { /////////////////////////////////////////////////////////////////////////// // AUTO module (angular.js) /////////////////////////////////////////////////////////////////////////// - export namespace auto { - + namespace auto { /////////////////////////////////////////////////////////////////////// // InjectorService // see http://docs.angularjs.org/api/AUTO.$injector diff --git a/angular/tsconfig.json b/types/angular/tsconfig.json similarity index 100% rename from angular/tsconfig.json rename to types/angular/tsconfig.json diff --git a/angular/tslint.json b/types/angular/tslint.json similarity index 100% rename from angular/tslint.json rename to types/angular/tslint.json diff --git a/angularfire/angularfire-tests.ts b/types/angularfire/angularfire-tests.ts similarity index 100% rename from angularfire/angularfire-tests.ts rename to types/angularfire/angularfire-tests.ts diff --git a/angularfire/index.d.ts b/types/angularfire/index.d.ts similarity index 100% rename from angularfire/index.d.ts rename to types/angularfire/index.d.ts diff --git a/angularfire/tsconfig.json b/types/angularfire/tsconfig.json similarity index 100% rename from angularfire/tsconfig.json rename to types/angularfire/tsconfig.json diff --git a/angularlocalstorage/angularlocalstorage-tests.ts b/types/angularlocalstorage/angularlocalstorage-tests.ts similarity index 100% rename from angularlocalstorage/angularlocalstorage-tests.ts rename to types/angularlocalstorage/angularlocalstorage-tests.ts diff --git a/angularlocalstorage/index.d.ts b/types/angularlocalstorage/index.d.ts similarity index 100% rename from angularlocalstorage/index.d.ts rename to types/angularlocalstorage/index.d.ts diff --git a/angularlocalstorage/tsconfig.json b/types/angularlocalstorage/tsconfig.json similarity index 100% rename from angularlocalstorage/tsconfig.json rename to types/angularlocalstorage/tsconfig.json diff --git a/angulartics/angulartics-tests.ts b/types/angulartics/angulartics-tests.ts similarity index 100% rename from angulartics/angulartics-tests.ts rename to types/angulartics/angulartics-tests.ts diff --git a/angulartics/index.d.ts b/types/angulartics/index.d.ts similarity index 100% rename from angulartics/index.d.ts rename to types/angulartics/index.d.ts diff --git a/angulartics/tsconfig.json b/types/angulartics/tsconfig.json similarity index 100% rename from angulartics/tsconfig.json rename to types/angulartics/tsconfig.json diff --git a/animation-frame/animation-frame-tests.ts b/types/animation-frame/animation-frame-tests.ts similarity index 100% rename from animation-frame/animation-frame-tests.ts rename to types/animation-frame/animation-frame-tests.ts diff --git a/animation-frame/index.d.ts b/types/animation-frame/index.d.ts similarity index 100% rename from animation-frame/index.d.ts rename to types/animation-frame/index.d.ts diff --git a/animation-frame/tsconfig.json b/types/animation-frame/tsconfig.json similarity index 100% rename from animation-frame/tsconfig.json rename to types/animation-frame/tsconfig.json diff --git a/ansi-styles/ansi-styles-tests.ts b/types/ansi-styles/ansi-styles-tests.ts similarity index 100% rename from ansi-styles/ansi-styles-tests.ts rename to types/ansi-styles/ansi-styles-tests.ts diff --git a/ansi-styles/index.d.ts b/types/ansi-styles/index.d.ts similarity index 100% rename from ansi-styles/index.d.ts rename to types/ansi-styles/index.d.ts diff --git a/ansi-styles/tsconfig.json b/types/ansi-styles/tsconfig.json similarity index 100% rename from ansi-styles/tsconfig.json rename to types/ansi-styles/tsconfig.json diff --git a/ansicolors/index.d.ts b/types/ansicolors/index.d.ts similarity index 100% rename from ansicolors/index.d.ts rename to types/ansicolors/index.d.ts diff --git a/ansicolors/tsconfig.json b/types/ansicolors/tsconfig.json similarity index 100% rename from ansicolors/tsconfig.json rename to types/ansicolors/tsconfig.json diff --git a/any-db-transaction/any-db-transaction-tests.ts b/types/any-db-transaction/any-db-transaction-tests.ts similarity index 100% rename from any-db-transaction/any-db-transaction-tests.ts rename to types/any-db-transaction/any-db-transaction-tests.ts diff --git a/any-db-transaction/index.d.ts b/types/any-db-transaction/index.d.ts similarity index 100% rename from any-db-transaction/index.d.ts rename to types/any-db-transaction/index.d.ts diff --git a/any-db-transaction/tsconfig.json b/types/any-db-transaction/tsconfig.json similarity index 100% rename from any-db-transaction/tsconfig.json rename to types/any-db-transaction/tsconfig.json diff --git a/any-db/any-db-tests.ts b/types/any-db/any-db-tests.ts similarity index 100% rename from any-db/any-db-tests.ts rename to types/any-db/any-db-tests.ts diff --git a/any-db/index.d.ts b/types/any-db/index.d.ts similarity index 100% rename from any-db/index.d.ts rename to types/any-db/index.d.ts diff --git a/any-db/tsconfig.json b/types/any-db/tsconfig.json similarity index 100% rename from any-db/tsconfig.json rename to types/any-db/tsconfig.json diff --git a/anybar/anybar-tests.ts b/types/anybar/anybar-tests.ts similarity index 100% rename from anybar/anybar-tests.ts rename to types/anybar/anybar-tests.ts diff --git a/anybar/index.d.ts b/types/anybar/index.d.ts similarity index 100% rename from anybar/index.d.ts rename to types/anybar/index.d.ts diff --git a/anybar/tsconfig.json b/types/anybar/tsconfig.json similarity index 100% rename from anybar/tsconfig.json rename to types/anybar/tsconfig.json diff --git a/anydb-sql-migrations/anydb-sql-migrations-tests.ts b/types/anydb-sql-migrations/anydb-sql-migrations-tests.ts similarity index 100% rename from anydb-sql-migrations/anydb-sql-migrations-tests.ts rename to types/anydb-sql-migrations/anydb-sql-migrations-tests.ts diff --git a/anydb-sql-migrations/index.d.ts b/types/anydb-sql-migrations/index.d.ts similarity index 100% rename from anydb-sql-migrations/index.d.ts rename to types/anydb-sql-migrations/index.d.ts diff --git a/anydb-sql-migrations/tsconfig.json b/types/anydb-sql-migrations/tsconfig.json similarity index 100% rename from anydb-sql-migrations/tsconfig.json rename to types/anydb-sql-migrations/tsconfig.json diff --git a/anydb-sql/anydb-sql-tests.ts b/types/anydb-sql/anydb-sql-tests.ts similarity index 100% rename from anydb-sql/anydb-sql-tests.ts rename to types/anydb-sql/anydb-sql-tests.ts diff --git a/anydb-sql/index.d.ts b/types/anydb-sql/index.d.ts similarity index 100% rename from anydb-sql/index.d.ts rename to types/anydb-sql/index.d.ts diff --git a/anydb-sql/tsconfig.json b/types/anydb-sql/tsconfig.json similarity index 100% rename from anydb-sql/tsconfig.json rename to types/anydb-sql/tsconfig.json diff --git a/apex.js/apex.js-tests.ts b/types/apex.js/apex.js-tests.ts similarity index 100% rename from apex.js/apex.js-tests.ts rename to types/apex.js/apex.js-tests.ts diff --git a/apex.js/index.d.ts b/types/apex.js/index.d.ts similarity index 100% rename from apex.js/index.d.ts rename to types/apex.js/index.d.ts diff --git a/apex.js/tsconfig.json b/types/apex.js/tsconfig.json similarity index 100% rename from apex.js/tsconfig.json rename to types/apex.js/tsconfig.json diff --git a/apex.js/tslint.json b/types/apex.js/tslint.json similarity index 100% rename from apex.js/tslint.json rename to types/apex.js/tslint.json diff --git a/aphrodite/aphrodite-tests.tsx b/types/aphrodite/aphrodite-tests.tsx similarity index 100% rename from aphrodite/aphrodite-tests.tsx rename to types/aphrodite/aphrodite-tests.tsx diff --git a/aphrodite/index.d.ts b/types/aphrodite/index.d.ts similarity index 100% rename from aphrodite/index.d.ts rename to types/aphrodite/index.d.ts diff --git a/aphrodite/no-important/index.d.ts b/types/aphrodite/no-important/index.d.ts similarity index 100% rename from aphrodite/no-important/index.d.ts rename to types/aphrodite/no-important/index.d.ts diff --git a/aphrodite/tsconfig.json b/types/aphrodite/tsconfig.json similarity index 100% rename from aphrodite/tsconfig.json rename to types/aphrodite/tsconfig.json diff --git a/api-error-handler/api-error-handler-tests.ts b/types/api-error-handler/api-error-handler-tests.ts similarity index 100% rename from api-error-handler/api-error-handler-tests.ts rename to types/api-error-handler/api-error-handler-tests.ts diff --git a/api-error-handler/index.d.ts b/types/api-error-handler/index.d.ts similarity index 100% rename from api-error-handler/index.d.ts rename to types/api-error-handler/index.d.ts diff --git a/api-error-handler/tsconfig.json b/types/api-error-handler/tsconfig.json similarity index 100% rename from api-error-handler/tsconfig.json rename to types/api-error-handler/tsconfig.json diff --git a/apigee-access/apigee-access-tests.ts b/types/apigee-access/apigee-access-tests.ts similarity index 100% rename from apigee-access/apigee-access-tests.ts rename to types/apigee-access/apigee-access-tests.ts diff --git a/apigee-access/index.d.ts b/types/apigee-access/index.d.ts similarity index 100% rename from apigee-access/index.d.ts rename to types/apigee-access/index.d.ts diff --git a/apigee-access/tsconfig.json b/types/apigee-access/tsconfig.json similarity index 100% rename from apigee-access/tsconfig.json rename to types/apigee-access/tsconfig.json diff --git a/apn/apn-tests.ts b/types/apn/apn-tests.ts similarity index 100% rename from apn/apn-tests.ts rename to types/apn/apn-tests.ts diff --git a/apn/index.d.ts b/types/apn/index.d.ts similarity index 100% rename from apn/index.d.ts rename to types/apn/index.d.ts diff --git a/apn/tsconfig.json b/types/apn/tsconfig.json similarity index 100% rename from apn/tsconfig.json rename to types/apn/tsconfig.json diff --git a/app-root-path/app-root-path-tests.ts b/types/app-root-path/app-root-path-tests.ts similarity index 100% rename from app-root-path/app-root-path-tests.ts rename to types/app-root-path/app-root-path-tests.ts diff --git a/app-root-path/index.d.ts b/types/app-root-path/index.d.ts similarity index 100% rename from app-root-path/index.d.ts rename to types/app-root-path/index.d.ts diff --git a/app-root-path/tsconfig.json b/types/app-root-path/tsconfig.json similarity index 100% rename from app-root-path/tsconfig.json rename to types/app-root-path/tsconfig.json diff --git a/appframework/appframework-tests.ts b/types/appframework/appframework-tests.ts similarity index 100% rename from appframework/appframework-tests.ts rename to types/appframework/appframework-tests.ts diff --git a/appframework/index.d.ts b/types/appframework/index.d.ts similarity index 100% rename from appframework/index.d.ts rename to types/appframework/index.d.ts diff --git a/appframework/tsconfig.json b/types/appframework/tsconfig.json similarity index 100% rename from appframework/tsconfig.json rename to types/appframework/tsconfig.json diff --git a/appletvjs/README.md b/types/appletvjs/README.md similarity index 100% rename from appletvjs/README.md rename to types/appletvjs/README.md diff --git a/appletvjs/appletvjs-tests.ts b/types/appletvjs/appletvjs-tests.ts similarity index 100% rename from appletvjs/appletvjs-tests.ts rename to types/appletvjs/appletvjs-tests.ts diff --git a/appletvjs/index.d.ts b/types/appletvjs/index.d.ts similarity index 100% rename from appletvjs/index.d.ts rename to types/appletvjs/index.d.ts diff --git a/appletvjs/tsconfig.json b/types/appletvjs/tsconfig.json similarity index 100% rename from appletvjs/tsconfig.json rename to types/appletvjs/tsconfig.json diff --git a/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts similarity index 95% rename from applicationinsights-js/applicationinsights-js-tests.ts rename to types/applicationinsights-js/applicationinsights-js-tests.ts index 06a7d06bc5..66bc1f268d 100644 --- a/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -31,7 +31,7 @@ var config: Microsoft.ApplicationInsights.IConfig = { }; var appInsights: Microsoft.ApplicationInsights.IAppInsights = { - config: config, + config, context: null, queue: null, @@ -128,7 +128,8 @@ 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 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); @@ -146,13 +147,15 @@ 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 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 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); diff --git a/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts similarity index 99% rename from applicationinsights-js/index.d.ts rename to types/applicationinsights-js/index.d.ts index c032919618..ede1584bb5 100644 --- a/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -306,7 +306,6 @@ declare module Microsoft.Telemetry { } declare module Microsoft.ApplicationInsights.Telemetry { - class Event implements Microsoft.ApplicationInsights.ISerializable { static envelopeType: string; static dataType: string; @@ -794,7 +793,7 @@ declare module Microsoft.ApplicationInsights { } declare module 'applicationinsights-js' { - export let AppInsights: Microsoft.ApplicationInsights.IAppInsights; + const AppInsights: Microsoft.ApplicationInsights.IAppInsights; } declare var appInsights: Microsoft.ApplicationInsights.IAppInsights; \ No newline at end of file diff --git a/applicationinsights-js/tsconfig.json b/types/applicationinsights-js/tsconfig.json similarity index 100% rename from applicationinsights-js/tsconfig.json rename to types/applicationinsights-js/tsconfig.json diff --git a/applicationinsights-js/tslint.json b/types/applicationinsights-js/tslint.json similarity index 100% rename from applicationinsights-js/tslint.json rename to types/applicationinsights-js/tslint.json diff --git a/applicationinsights/applicationinsights-tests.ts b/types/applicationinsights/applicationinsights-tests.ts similarity index 100% rename from applicationinsights/applicationinsights-tests.ts rename to types/applicationinsights/applicationinsights-tests.ts diff --git a/applicationinsights/index.d.ts b/types/applicationinsights/index.d.ts similarity index 100% rename from applicationinsights/index.d.ts rename to types/applicationinsights/index.d.ts diff --git a/applicationinsights/tsconfig.json b/types/applicationinsights/tsconfig.json similarity index 100% rename from applicationinsights/tsconfig.json rename to types/applicationinsights/tsconfig.json diff --git a/arbiter/arbiter-tests.ts b/types/arbiter/arbiter-tests.ts similarity index 100% rename from arbiter/arbiter-tests.ts rename to types/arbiter/arbiter-tests.ts diff --git a/arbiter/index.d.ts b/types/arbiter/index.d.ts similarity index 100% rename from arbiter/index.d.ts rename to types/arbiter/index.d.ts diff --git a/arbiter/tsconfig.json b/types/arbiter/tsconfig.json similarity index 100% rename from arbiter/tsconfig.json rename to types/arbiter/tsconfig.json diff --git a/arcgis-js-api/arcgis-js-api-tests.ts b/types/arcgis-js-api/arcgis-js-api-tests.ts similarity index 100% rename from arcgis-js-api/arcgis-js-api-tests.ts rename to types/arcgis-js-api/arcgis-js-api-tests.ts diff --git a/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts similarity index 81% rename from arcgis-js-api/index.d.ts rename to types/arcgis-js-api/index.d.ts index 87df41a8d8..293c5190e9 100644 --- a/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 4.2 +// Type definitions for ArcGIS API for JavaScript 4.3 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -32,14 +32,19 @@ declare namespace JSX { declare namespace __esri { export class Accessor { + constructor(obj?: any); + 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; + watch(path: string | string[], callback: WatchCallback, sync?: boolean): WatchHandle; + protected notifyChange(propertyName: string): void; protected _get(propertyName: string): any; protected _get(propertyName: string): T; @@ -69,18 +74,521 @@ declare namespace __esri { remove(): void; } + export interface EachAlwaysResult { + promise: IPromise; + value: any; + error: any; + } + export interface PausableWatchHandle { remove(): void; pause(): void; resume(): void; } + export interface FeatureEditResult { + objectId: number; + error: any; + } + export interface AttributeParamValue { attributeName: string; parameterName: string; value: string; } + export interface DataWorkspace { + id: string; + name: string; + } + + export interface GroupMembership { + id: number; + name: string; + } + + export interface HoldType { + description: string; + id: number; + name: string; + } + + export interface JobPriority { + description: string; + name: string; + value: number; + } + + export interface JobQuery { + id: number; + name: string; + } + + export interface JobStatus { + caption: string; + description: string; + id: number; + name: string; + } + + export interface JobQueryContainer { + containers: JobQueryContainer[]; + id: number; + name: string; + queries: JobQuery[]; + } + + export interface JobQueryDetails { + aliases: string[]; + fields: string[]; + id: number; + name: string; + orderBy: string; + tables: string[]; + where: string; + } + + export interface Privilege { + description: string; + id: number; + name: string; + } + + export interface UserDetails { + lastName: string; + address: string; + faxNumber: string; + firstName: string; + fullName: string; + groups: GroupMembership[]; + email: string; + phoneNumber: string; + privileges: Privilege[]; + roomNumber: string; + userName: string; + userQueries: JobQueryContainer[]; + zipCode: string; + } + + export interface VersionInfo { + access: string; + name: string; + parent: string; + } + + export interface WorkflowManagerServiceInfo { + jobPriorities: JobPriority[]; + activityTypes: ActivityType[]; + currentVersion: number; + dataWorkspaces: DataWorkspace[]; + holdTypes: HoldType[]; + configProperties: any; + jobStatuses: JobStatus[]; + jobTypes: JobType[]; + notificationTypes: NotificationType[]; + privileges: Privilege[]; + publicQueries: JobQueryContainer[]; + } + + export interface JobType { + category: string; + description: string; + id: string; + name: string; + state: string; + } + + export interface JobTypeDetails { + defaultParentVersionName: string; + autoExecuteCreatedJobs: boolean; + category: string; + defaultAssignedTo: string; + defaultAssignedType: string; + defaultDataWorkspaceId: string; + defaultDescription: string; + defaultDueDate: string; + defaultJobDuration: number; + canDataWorkspaceChange: boolean; + defaultPriority: string; + defaultStartDate: Date; + description: string; + id: string; + jobNamingScheme: string; + jobVersionNamingScheme: string; + mxdNamingScheme: string; + name: string; + state: string; + } + + export interface TableRelationship { + cardinality: string; + linkField: string; + tableAlias: string; + tableName: string; + } + + export interface JobCreationParameters { + loi: Geometry; + assignedTo: string; + autoCommitWorkflow: boolean; + autoExecute: boolean; + dataWorkspaceId: string; + description: string; + dueDate: Date; + jobTypeId: number; + assignedType: string; + name: string; + numJobs: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + priority: number; + startDate: Date; + user: string; + } + + export interface JobQueryParameters { + aliases: string; + fields: string; + orderBy: string; + tables: string; + where: string; + user: string; + } + + export interface JobUpdateParameters { + ownedBy: string; + assignedTo: string; + dataWorkspaceId: string; + description: string; + dueDate: Date; + loi: Geometry; + jobId: number; + name: string; + assignedType: string; + parentJobId: number; + parentVersion: string; + percent: number; + priority: number; + startDate: Date; + status: number; + versionName: string; + user: string; + } + + export interface AuxRecordDescription { + properties: any; + recordId: number; + tableName: string; + } + + export interface ActivityType { + desription: string; + id: number; + message: string; + name: string; + } + + export interface AuxRecordContainer { + records: AuxRecord; + relationshipType: string; + tableAlias: string; + tableName: string; + } + + export interface JobTaskJobInfo { + name: string; + assignedTo: string; + childJobIds: number[]; + createdBy: string; + createdDate: Date; + dataWorkspaceId: string; + description: string; + dueDate: Date; + endDate: Date; + id: number; + jobTypeId: number; + loi: Geometry; + assignedType: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + pendingDays: number; + percentageComplete: number; + priority: number; + stage: string; + startDate: Date; + status: number; + versionExists: boolean; + versionInfo: JobVersionInfo; + versionName: string; + } + + export interface QueryResult { + fields: QueryFieldInfo[]; + rows: string[]; + } + + export interface AuxRecord { + displayProperty: any; + id: number; + recordvalues: AuxRecordValue; + } + + export interface AuxRecordValue { + filter: string; + alias: string; + data: any; + dataType: string; + displayOrder: number; + displayType: string; + domain: string; + canUpdate: boolean; + length: number; + name: string; + required: boolean; + tableListClass: string; + tableListDisplayField: string; + tableListStoreField: string; + userVisible: boolean; + } + + export interface FieldValue { + description: string; + value: any; + } + + export interface JobVersionInfo { + dataWorkspaceId: string; + name: string; + parent: string; + created: boolean; + owner: string; + } + + export interface QueryFieldInfo { + alias: string; + length: string; + name: string; + type: string; + } + + export interface JobAttachment { + filename: string; + folder: string; + id: number; + storageType: string; + } + + export interface JobDependency { + depJobId: number; + depOnType: string; + depOnValue: string; + heldOnValue: number; + holdOnType: string; + id: number; + jobID: string; + } + + export interface ChangeRule { + description: string; + evaluators: any[]; + id: number; + name: string; + notifier: any; + summarize: boolean; + } + + export interface DataSetEvaluator { + dataSetConfigurations: DatasetConfiguration[]; + name: string; + type: string; + } + + export interface AOIEvaluator { + aoi: Polygon; + inverse: boolean; + name: string; + relation: string; + type: string; + useJobAOI: boolean; + } + + export interface DatasetConfiguration { + changeCondition: number; + changeFields: string; + dataset: string; + dataWorkspaceId: string; + name: string; + whereConditions: WhereCondition[]; + } + + export interface EmailNotifier { + attachJobAttachments: boolean; + message: string; + name: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface WhereCondition { + compareValue: any; + field: string; + operator: string; + } + + export interface NotificationType { + attachJobAttachments: boolean; + id: number; + message: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface ChangeRuleMatch { + changeTime: Date; + changeType: string; + dataset: string; + dataWorkspaceId: string; + id: string; + jobID: string; + ruleID: string; + } + + export interface ReportDataGroup { + aggregateLabel: string; + aggregateValue: string; + row: string[]; + value: string; + } + + export interface ReportData { + columns: string[]; + description: string; + groups: ReportDataGroup[]; + title: string; + } + + export interface Report { + description: string; + hierarchy: string; + id: number; + name: string; + title: string; + } + + export interface ExecuteInfo { + conflicts: WorkflowConflicts; + errorCode: number; + errorDescription: string; + executionResult: string; + hasConflicts: boolean; + hasReturnCode: boolean; + jobID: number; + returnCode: number; + stepID: number; + threwError: boolean; + } + + export interface Step { + hasBeenExecuted: boolean; + assignedTo: string; + async: boolean; + autoRun: boolean; + canSkip: boolean; + canSpawnConcurrency: boolean; + commonId: number; + defaultPercentComplete: number; + assignedType: string; + hasBeenStarted: boolean; + id: number; + name: string; + selfCheck: boolean; + statusId: number; + stepPercentComplete: number; + notificationType: string; + stepType: StepType; + } + + export interface StepType { + program: string; + arguments: string; + executionType: string; + id: number; + name: string; + description: string; + stepDescriptionLink: string; + stepDescriptionType: string; + stepIndicatorType: string; + supportedPlatform: string; + visible: boolean; + } + + export interface WorkflowDisplayDetails { + annotations: WorkflowAnnotationDisplayDetails[]; + paths: WorkflowPathDisplayDetails[]; + steps: WorkflowStepDisplayDetails[]; + } + + export interface WorkflowOption { + returnCode: number; + steps: WorkflowStepInfo[]; + } + + export interface WorkflowStepInfo { + id: number; + name: string; + } + + export interface WorkflowAnnotationDisplayDetails { + centerX: number; + centerY: number; + fillColor: any; + height: number; + label: string; + labelColor: any; + OutlineColor: any; + width: number; + } + + export interface WorkflowConflicts { + jobID: number; + options: WorkflowOption[]; + spawnsConcurrency: boolean; + stepId: number; + } + + export interface WorkflowPathDisplayDetails { + destStepId: number; + sourceStepID: number; + label: string; + labelColor: any; + labelX: number; + labelY: number; + lineColor: any; + pathObject: any; + } + + export interface WorkflowStepDisplayDetails { + labelColor: any; + centerX: number; + fillColor: any; + height: number; + label: string; + centerY: number; + OutlineColor: any; + shape: string; + stepId: number; + stepType: string; + width: number; + } + export interface ExternalRenderer { setup(): void; render(): void; @@ -139,26 +647,6 @@ declare namespace __esri { 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; @@ -282,11 +770,33 @@ declare namespace __esri { offset?: number; } + export interface FeatureLayerApplyEditsEdits { + addFeatures?: Graphic[]; + updateFeatures?: Graphic[]; + deleteFeatures?: Graphic[] | any[]; + } + + export interface FeatureLayerCapabilities { + operations: FeatureLayerCapabilitiesOperations; + } + + export interface FeatureLayerCapabilitiesOperations { + supportsAdd: boolean; + supportsDelete: boolean; + supportsUpdate: boolean; + supportsEditing: boolean; + supportsQuery: boolean; + } + export interface FeatureLayerElevationInfo { mode: string; offset?: number; } + export interface FeatureLayerGetFieldDomainOptions { + feature: Graphic; + } + export interface GraphicsLayerElevationInfo { mode: string; offset?: number; @@ -306,6 +816,21 @@ declare namespace __esri { offset?: number; } + export interface StreamLayerFilter { + geometry: Extent; + where: string; + } + + export interface StreamLayerPurgeOptions { + displayCount: number; + age: number; + } + + export interface StreamLayerUpdateFilterFilterChanges { + geometry: Extent; + where: string; + } + export interface VectorTileLayerCurrentStyleInfo { serviceUrl: string; styleUrl: string; @@ -382,6 +907,14 @@ declare namespace __esri { label: string; } + export interface PointCloudRendererPointSizeAlgorithm { + type: string; + useRealWorldSymbolSizes: boolean; + size: number; + scaleFactor: number; + minSize: number; + } + export interface PointCloudClassBreaksRendererColorClassBreakInfos { minValue: number; maxValue: number; @@ -422,8 +955,8 @@ declare namespace __esri { } export interface Symbol3DStyleOrigin { - styleName: string; - styleUrl: string; + styleName?: string; + styleUrl?: string; name: string; } @@ -508,6 +1041,294 @@ declare namespace __esri { tolerance: number; } + export interface ConfigurationTaskGetDataWorkspaceDetailsParams { + dataWorkspaceId: string; + user: string; + } + + export interface ConfigurationTaskGetUserJobQueryDetailsParams { + queryId: number; + user: string; + } + + export interface JobTaskAddEmbeddedAttachmentParams { + jobId: number; + form: any; + user: string; + } + + export interface JobTaskAddLinkedAttachmentParams { + jobId: number; + attachmentType: number; + path: string; + user: string; + } + + export interface JobTaskAddLinkedRecordParams { + jobId: number; + tableName: string; + user: string; + } + + export interface JobTaskAssignJobsParams { + jobIds: number[]; + assignedType: string; + assignedTo: string; + user: string; + } + + export interface JobTaskCloseJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskCreateDependencyParams { + jobId: number; + heldOnType: string; + heldOnValue: number; + depJobId: number; + depOnType: string; + depOnValue: number; + user: string; + } + + export interface JobTaskCreateHoldParams { + jobId: number; + holdTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskCreateJobVersionParams { + jobId: number; + name: string; + parent: string; + user: string; + } + + export interface JobTaskDeleteAttachmentParams { + jobId: number; + attachmentId: number; + user: string; + } + + export interface JobTaskDeleteDependencyParams { + jobId: number; + dependencyId: number; + user: string; + } + + export interface JobTaskDeleteJobsParams { + jobIds: number[]; + deleteHistory?: boolean; + user: string; + } + + export interface JobTaskDeleteLinkedRecordParams { + jobId: number; + tableName: string; + recordId: number; + user: string; + } + + export interface JobTaskGetAttachmentContentUrlParams { + jobId: number; + attachmentId: number; + } + + export interface JobTaskListFieldValuesParams { + jobId: number; + tableName: string; + field: string; + user: string; + } + + export interface JobTaskListMultiLevelFieldValuesParams { + field: string; + previousSelectedValues: string[]; + user: string; + } + + export interface JobTaskLogActionParams { + jobId: number; + activityTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskQueryJobsParams { + queryId: number; + user: string; + } + + export interface JobTaskQueryMultiLevelSelectedValuesParams { + field: string; + user: string; + } + + export interface JobTaskReleaseHoldParams { + jobId: number; + holdId: number; + } + + export interface JobTaskReopenClosedJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskSearchJobsParams { + text: string; + user: string; + } + + export interface JobTaskUnassignJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskUpdateNotesParams { + jobId: number; + notes: string; + user: string; + } + + export interface JobTaskUpdateRecordParams { + jobId: number; + record: AuxRecordDescription; + user: string; + } + + export interface NotificationTaskAddChangeRuleParams { + rule: ChangeRule; + user: string; + } + + export interface NotificationTaskDeleteChangeRuleParams { + ruleId: string; + user: string; + } + + export interface NotificationTaskNotifySessionParams { + sessionid: string; + deleteAfter: boolean; + user: string; + } + + export interface NotificationTaskQueryChangeRulesParams { + name: string; + description: string; + searchType: string; + user: string; + } + + export interface NotificationTaskRunSpatialNotificationOnHistoryParams { + dataWorkspaceId: string; + from: Date; + to: Date; + logMatches: boolean; + send: boolean; + user: string; + } + + export interface NotificationTaskSendNotificationParams { + jobId: number; + notificationType: string; + user: string; + } + + export interface NotificationTaskSubscribeToNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface NotificationTaskUnsubscribeFromNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface ReportTaskGenerateReportParams { + reportId: number; + user: string; + } + + export interface ReportTaskGetReportContentUrlParams { + reportId: number; + user: number; + } + + export interface ReportTaskGetReportDataParams { + reportId: number; + user: string; + } + + export interface TokenTaskParseTokensParams { + jobId: any; + stringToParse: string; + user: string; + } + + export interface WorkflowTaskCanRunStepParams { + jobId: number; + stepId: number; + user: string; + } + + export interface WorkflowTaskExecuteStepsParams { + jobId: number; + stepIds: number[]; + auto: boolean; + user: string; + } + + export interface WorkflowTaskGetStepDescriptionParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepFileUrlParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskMarkStepsAsDoneParams { + jobId: number; + stepIds: number[]; + user: string; + } + + export interface WorkflowTaskMoveToNextStepParams { + jobId: number; + stepId: number; + returnCode: number; + user: string; + } + + export interface WorkflowTaskRecreateWorkflowParams { + jobId: number; + user: string; + } + + export interface WorkflowTaskResolveConflictParams { + jobId: number; + stepId: number; + optionReturnCode: number; + optionStepIds: number[]; + user: string; + } + + export interface WorkflowTaskSetCurrentStepParams { + jobId: number; + stepId: number; + user: string; + } + export interface MapViewConstraints { lods?: LOD[]; minScale?: number; @@ -804,6 +1625,17 @@ declare namespace __esri { urlPrefix: string; } + export interface configWorkers { + loaderConfig: configWorkersLoaderConfig; + } + + export interface configWorkersLoaderConfig { + has: any; + paths: any; + map: any; + packages: any[]; + } + export interface requestEsriRequestOptions { callbackParamName?: string; query?: any; @@ -827,6 +1659,7 @@ declare namespace __esri { cast?: Function; readOnly?: boolean; aliasOf?: string; + value?: any; } export interface colorCreateContinuousRendererParams { @@ -895,21 +1728,22 @@ declare namespace __esri { title: string; } - export interface sizeCreateVisualVariableParams { + export interface sizeCreateVisualVariablesParams { layer: FeatureLayer | SceneLayer; field: string; normalizationField?: string; basemap?: string | Basemap; sizeScheme?: any | any | any; - legendOptions?: sizeCreateVisualVariableParamsLegendOptions; + legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; statistics?: any; minValue?: number; maxValue?: number; view?: SceneView; worldScale?: boolean; + axis?: boolean; } - export interface sizeCreateVisualVariableParamsLegendOptions { + export interface sizeCreateVisualVariablesParamsLegendOptions { title: string; } @@ -972,6 +1806,7 @@ declare namespace __esri { } export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions { + axis?: boolean; sizeScheme?: any | any | any; legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; } @@ -1433,6 +2268,7 @@ declare namespace __esri { expand(factor: number): Extent; intersection(extent: Extent): Extent; intersects(geometry: Geometry): boolean; + normalize(): Extent[]; offset(dx: number, dy: number, dz: number): Extent; union(extent: Extent): Extent; } @@ -1519,6 +2355,7 @@ declare namespace __esri { copy(other: Point): void; distance(other: Point): number; equals(point: Point): boolean; + normalize(): Point; } interface PointConstructor { @@ -1556,6 +2393,9 @@ declare namespace __esri { interface PolygonConstructor { new(properties?: PolygonProperties): Polygon; + + fromExtent(extent: Extent): Polygon; + fromJSON(json: any): Polygon; } @@ -1873,6 +2713,7 @@ declare namespace __esri { } interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer { + capabilities: FeatureLayerCapabilities; copyright: string; definitionExpression: string; elevationInfo: FeatureLayerElevationInfo; @@ -1898,7 +2739,9 @@ declare namespace __esri { url: string; version: number; + applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; createQuery(): Query; + getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; queryExtent(params?: Query): IPromise; queryFeatureCount(params?: Query): IPromise; queryFeatures(params?: Query): IPromise; @@ -1914,6 +2757,7 @@ declare namespace __esri { export const FeatureLayer: FeatureLayerConstructor; interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + capabilities?: FeatureLayerCapabilities; copyright?: string; definitionExpression?: string; elevationInfo?: FeatureLayerElevationInfo; @@ -1940,6 +2784,26 @@ declare namespace __esri { version?: number; } + interface GeoRSSLayer extends Layer { + lineSymbol: SimpleLineSymbol; + pointSymbol: PictureMarkerSymbol; + polygonSymbol: SimpleFillSymbol; + url: string; + } + + interface GeoRSSLayerConstructor { + new(properties?: GeoRSSLayerProperties): GeoRSSLayer; + } + + export const GeoRSSLayer: GeoRSSLayerConstructor; + + interface GeoRSSLayerProperties extends LayerProperties { + lineSymbol?: SimpleLineSymbolProperties; + pointSymbol?: PictureMarkerSymbolProperties; + polygonSymbol?: SimpleFillSymbolProperties; + url?: string; + } + interface GraphicsLayer extends Layer, ScaleRangeLayer { elevationInfo: GraphicsLayerElevationInfo; graphics: Collection; @@ -2061,6 +2925,7 @@ declare namespace __esri { } interface SceneLayer extends Layer, SceneService, PortalLayer { + definitionExpression: string; elevationInfo: SceneLayerElevationInfo; fields: Field[]; geometryType: string; @@ -2072,6 +2937,7 @@ declare namespace __esri { popupTemplate: PopupTemplate; renderer: Renderer; + createQuery(): Query; getFieldUsageInfo(fieldName: string): any; queryExtent(params?: Query): IPromise; queryFeatureCount(params?: Query): IPromise; @@ -2088,6 +2954,7 @@ declare namespace __esri { export const SceneLayer: SceneLayerConstructor; interface SceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + definitionExpression?: string; elevationInfo?: SceneLayerElevationInfo; fields?: FieldProperties[]; geometryType?: string; @@ -2101,9 +2968,12 @@ declare namespace __esri { } interface StreamLayer extends FeatureLayer { + filter: StreamLayerFilter; geometryDefinition: Extent; maximumTrackPoints: number; - purgeOptions: any; + purgeOptions: StreamLayerPurgeOptions; + + updateFilter(filterChanges: StreamLayerUpdateFilterFilterChanges): IPromise; } interface StreamLayerConstructor { @@ -2115,9 +2985,10 @@ declare namespace __esri { export const StreamLayer: StreamLayerConstructor; interface StreamLayerProperties extends FeatureLayerProperties { + filter?: StreamLayerFilter; geometryDefinition?: ExtentProperties; maximumTrackPoints?: number; - purgeOptions?: any; + purgeOptions?: StreamLayerPurgeOptions; } interface UnknownLayer extends Layer { @@ -2199,13 +3070,20 @@ declare namespace __esri { } interface CodedValueDomainConstructor { - new(properties?: any): CodedValueDomain; + new(properties?: CodedValueDomainProperties): CodedValueDomain; + getName(code: string | number): string; + + fromJSON(json: any): CodedValueDomain; } export const CodedValueDomain: CodedValueDomainConstructor; + interface CodedValueDomainProperties extends DomainProperties { + codedValues?: CodedValueDomainCodedValues[]; + } + interface DimensionalDefinition { dimensionName: string; isSlice: boolean; @@ -2221,20 +3099,25 @@ declare namespace __esri { export const DimensionalDefinition: DimensionalDefinitionConstructor; - interface Domain { + interface Domain extends Accessor, JSONSupport { name: string; type: string; - - toJSON(): any; } interface DomainConstructor { - new(): Domain; + new(properties?: DomainProperties): Domain; + + fromJSON(json: any): Domain; } export const Domain: DomainConstructor; - interface Field extends JSONSupport { + interface DomainProperties { + name?: string; + type?: string; + } + + interface Field extends Accessor, JSONSupport { alias: string; domain: Domain; editable: boolean; @@ -2254,7 +3137,7 @@ declare namespace __esri { interface FieldProperties { alias?: string; - domain?: Domain; + domain?: DomainProperties; editable?: boolean; length?: number; name?: string; @@ -2262,7 +3145,7 @@ declare namespace __esri { type?: string; } - interface ImageParameters { + interface ImageParameters extends Accessor { dpi: number; extent: Extent; format: string; @@ -2278,20 +3161,39 @@ declare namespace __esri { } interface ImageParametersConstructor { - new(properties?: any): ImageParameters; + new(properties?: ImageParametersProperties): ImageParameters; } export const ImageParameters: ImageParametersConstructor; + interface ImageParametersProperties { + dpi?: number; + extent?: ExtentProperties; + format?: string; + height?: number; + imageSpatialReference?: SpatialReferenceProperties; + layerDefinitions?: string[]; + layerIds?: number[]; + layerOption?: string; + transparent?: boolean; + width?: number; + } + interface InheritedDomain extends Domain { } interface InheritedDomainConstructor { - new(): InheritedDomain; + new(properties?: InheritedDomainProperties): InheritedDomain; + + fromJSON(json: any): InheritedDomain; } export const InheritedDomain: InheritedDomainConstructor; + interface InheritedDomainProperties extends DomainProperties { + + } + interface LabelClass extends Accessor, JSONSupport { labelExpression: string; labelExpressionInfo: LabelClassLabelExpressionInfo; @@ -2301,6 +3203,8 @@ declare namespace __esri { symbol: TextSymbol | LabelSymbol3D; useCodedValues: boolean; where: string; + + clone(): LabelClass; } interface LabelClassConstructor { @@ -2372,7 +3276,7 @@ declare namespace __esri { width?: number; } - interface MosaicRule extends JSONSupport { + interface MosaicRule extends Accessor, JSONSupport { ascending: boolean; lockRasterIds: number[]; method: string; @@ -2406,7 +3310,7 @@ declare namespace __esri { where?: string; } - interface PixelBlock { + interface PixelBlock extends Accessor { height: number; mask: number[]; pixels: number[][]; @@ -2421,23 +3325,39 @@ declare namespace __esri { } interface PixelBlockConstructor { - new(properties?: any): PixelBlock; + new(properties?: PixelBlockProperties): PixelBlock; } export const PixelBlock: PixelBlockConstructor; + interface PixelBlockProperties { + height?: number; + mask?: number[]; + pixels?: number[][]; + pixelType?: string; + statistics?: PixelBlockStatistics[]; + width?: number; + } + interface RangeDomain extends Domain { maxValue: number; minValue: number; } interface RangeDomainConstructor { - new(): RangeDomain; + new(properties?: RangeDomainProperties): RangeDomain; + + fromJSON(json: any): RangeDomain; } export const RangeDomain: RangeDomainConstructor; - interface RasterFunction extends JSONSupport { + interface RangeDomainProperties extends DomainProperties { + maxValue?: number; + minValue?: number; + } + + interface RasterFunction extends Accessor, JSONSupport { functionArguments: any; functionName: string; outputPixelType: string; @@ -2875,6 +3795,7 @@ declare namespace __esri { role: string; roleId: string; thumbnailUrl: string; + units: string; userContentUrl: string; username: string; @@ -2907,6 +3828,7 @@ declare namespace __esri { role?: string; roleId?: string; thumbnailUrl?: string; + units?: string; userContentUrl?: string; username?: string; } @@ -3005,7 +3927,7 @@ declare namespace __esri { valueExpression: string; valueExpressionTitle: string; - addUniqueValueInfo(valueOrInfo: string | any, symbol: Symbol): void; + addUniqueValueInfo(valueOrInfo: string | any, symbol?: Symbol): void; clone(): UniqueValueRenderer; getUniqueValueInfo(graphic: Graphic): any; removeUniqueValueInfo(value: string): void; @@ -3034,6 +3956,7 @@ declare namespace __esri { } interface PointCloudRenderer extends Accessor, JSONSupport { + pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; pointsPerInch: number; } @@ -3046,6 +3969,7 @@ declare namespace __esri { export const PointCloudRenderer: PointCloudRendererConstructor; interface PointCloudRendererProperties { + pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; pointsPerInch?: number; } @@ -3133,6 +4057,30 @@ declare namespace __esri { type?: string; } + interface Action extends Accessor { + className: string; + id: string; + image: string; + title: string; + visible: boolean; + + clone(): Action; + } + + interface ActionConstructor { + new(properties?: ActionProperties): Action; + } + + export const Action: ActionConstructor; + + interface ActionProperties { + className?: string; + id?: string; + image?: string; + title?: string; + visible?: boolean; + } + interface ExtrudeSymbol3DLayer extends Symbol3DLayer { size: number; @@ -3817,8 +4765,6 @@ declare namespace __esri { } interface QueryTask extends Task { - gdbVersion: string; - execute(params: Query, requestOptions?: any): IPromise; executeForCount(params: Query, requestOptions?: any): IPromise; executeForExtent(params: Query, requestOptions?: any): IPromise; @@ -3833,7 +4779,7 @@ declare namespace __esri { export const QueryTask: QueryTaskConstructor; interface QueryTaskProperties extends TaskProperties { - gdbVersion?: string; + } interface PrintTask extends Task { @@ -4276,6 +5222,7 @@ declare namespace __esri { foundFieldName: string; layerId: number; layerName: string; + value: void; } interface FindResultConstructor { @@ -4292,6 +5239,7 @@ declare namespace __esri { foundFieldName?: string; layerId?: number; layerName?: string; + value?: void; } interface GeneralizeParameters extends Accessor { @@ -5042,6 +5990,173 @@ declare namespace __esri { trimExtendTo?: PolylineProperties; } + interface ConfigurationTask extends Task { + url: string; + + getAllGroups(requestOptions?: any): IPromise; + getAllUsers(requestOptions?: any): IPromise; + getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; + getGroup(groupId: number, requestOptions?: any): IPromise; + getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; + getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; + getServiceInfo(requestOptions?: any): IPromise; + getTableRelationshipsDetails(requestOptions?: any): IPromise; + getUser(user: string, requestOptions?: any): IPromise; + getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; + getVisibleJobTypes(user: string, requestOptions?: any): IPromise; + } + + interface ConfigurationTaskConstructor { + new(properties?: ConfigurationTaskProperties): ConfigurationTask; + } + + export const ConfigurationTask: ConfigurationTaskConstructor; + + interface ConfigurationTaskProperties extends TaskProperties { + url?: string; + } + + interface JobTask extends Task { + url: string; + + addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; + addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; + addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; + assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; + closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; + createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; + createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; + createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; + createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; + deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; + deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; + deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; + deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; + getActivityLog(jobId: number, requestOptions?: any): IPromise; + getAttachmentContentUrl(params: JobTaskGetAttachmentContentUrlParams): string; + getAttachments(jobId: number, requestOptions?: any): IPromise; + getDependencies(jobId: number, requestOptions?: any): IPromise; + getExtendedProperties(jobId: number, requestOptions?: any): IPromise; + getHolds(jobId: number, requestOptions?: any): IPromise; + getJob(jobId: number, requestOptions?: any): IPromise; + getJobIds(requestOptions?: any): IPromise; + getNotes(jobId: number, requestOptions?: any): IPromise; + listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; + listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; + logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; + queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; + queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; + queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; + releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; + reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; + searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; + unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; + updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; + updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; + updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; + } + + interface JobTaskConstructor { + new(properties?: JobTaskProperties): JobTask; + } + + export const JobTask: JobTaskConstructor; + + interface JobTaskProperties extends TaskProperties { + url?: string; + } + + interface NotificationTask extends Task { + url: string; + + addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; + deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; + getAllChangeRules(requestOptions?: any): IPromise; + getChangeRule(ruleId: string, requestOptions?: any): IPromise; + getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; + getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; + getSessionMatches(sessionId: string, requestOptions?: any): IPromise; + notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; + queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; + runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; + sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; + subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; + unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; + } + + interface NotificationTaskConstructor { + new(properties?: NotificationTaskProperties): NotificationTask; + } + + export const NotificationTask: NotificationTaskConstructor; + + interface NotificationTaskProperties extends TaskProperties { + url?: string; + } + + interface ReportTask extends Task { + url: string; + + generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; + getAllReports(requestOptions?: any): IPromise; + getReportContentUrl(params: ReportTaskGetReportContentUrlParams): string; + getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; + getReportStylesheet(reportId: number, requestOptions?: any): IPromise; + } + + interface ReportTaskConstructor { + new(properties?: ReportTaskProperties): ReportTask; + } + + export const ReportTask: ReportTaskConstructor; + + interface ReportTaskProperties extends TaskProperties { + url?: string; + } + + interface TokenTask extends Task { + parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; + } + + interface TokenTaskConstructor { + new(properties?: TokenTaskProperties): TokenTask; + } + + export const TokenTask: TokenTaskConstructor; + + interface TokenTaskProperties extends TaskProperties { + + } + + interface WorkflowTask extends Task { + url: string; + + canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; + executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; + getAllSteps(jobId: number, requestOptions?: any): IPromise; + getCurrentSteps(jobId: number, requestOptions?: any): IPromise; + getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; + getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; + getStepFileUrl(params: WorkflowTaskGetStepFileUrlParams): string; + getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; + getWorkflowImageUrl(jobId: number): string; + markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; + moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; + recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; + resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; + setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; + } + + interface WorkflowTaskConstructor { + new(properties?: WorkflowTaskProperties): WorkflowTask; + } + + export const WorkflowTask: WorkflowTaskConstructor; + + interface WorkflowTaskProperties extends TaskProperties { + url?: string; + } + interface MapView extends View { center: Point; constraints: MapViewConstraints; @@ -5053,6 +6168,7 @@ declare namespace __esri { zoom: number; goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | any, options?: MapViewGoToOptions): IPromise; + hasEventListener(type: string): boolean; hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; @@ -5090,6 +6206,7 @@ declare namespace __esri { zoom: number; goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | any, options?: SceneViewGoToOptions): IPromise; + hasEventListener(type: string): boolean; hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; @@ -5116,7 +6233,7 @@ declare namespace __esri { zoom?: number; } - interface View extends Accessor, corePromise, Evented, BreakpointsOwner, DOMContainer { + interface View extends Accessor, corePromise, BreakpointsOwner, DOMContainer { allLayerViews: Collection; animation: ViewAnimation; graphics: Collection; @@ -5238,16 +6355,33 @@ declare namespace __esri { pixelData?: ImageryLayerViewPixelData; } + interface SceneLayerView extends LayerView { + queryExtent(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; + } + + interface SceneLayerViewConstructor { + new(properties?: SceneLayerViewProperties): SceneLayerView; + } + + export const SceneLayerView: SceneLayerViewConstructor; + + interface SceneLayerViewProperties extends LayerViewProperties { + + } + interface UI extends Accessor { container: any; height: number; padding: any; - view: SceneView | MapView; + view: MapView | SceneView; width: number; - add(component: any | any[], position?: string | any): void; + add(component: Widget | any | string | any | any, position?: string | any): void; empty(position?: string): void; - move(component: any | any[], position?: string): void; + move(component: Widget | any | string | any | any, position?: string): void; remove(component: any | any[]): void; } @@ -5261,7 +6395,7 @@ declare namespace __esri { container?: any; height?: number; padding?: any | number; - view?: SceneView | MapView; + view?: MapView | SceneView; width?: number; } @@ -5406,9 +6540,11 @@ declare namespace __esri { visibleLayers?: SlideVisibleLayers; } - interface Attribution extends Accessor { - view: SceneView | MapView; + interface Attribution extends Widget { + view: MapView | SceneView; viewModel: AttributionViewModel; + + render(): any; } interface AttributionConstructor { @@ -5417,18 +6553,41 @@ declare namespace __esri { export const Attribution: AttributionConstructor; - interface AttributionProperties { - view?: SceneView | MapView; + interface AttributionProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: AttributionViewModel; } - interface BasemapToggle extends Accessor, Evented { + interface BasemapGallery extends Widget { + activeBasemap: Basemap; + source: LocalBasemapsSource | PortalBasemapsSource; + view: MapView | SceneView; + viewModel: BasemapGalleryViewModel; + + render(): any; + } + + interface BasemapGalleryConstructor { + new(properties?: BasemapGalleryProperties): BasemapGallery; + } + + export const BasemapGallery: BasemapGalleryConstructor; + + interface BasemapGalleryProperties extends WidgetProperties { + activeBasemap?: BasemapProperties; + source?: LocalBasemapsSource | PortalBasemapsSource; + view?: MapView | SceneView; + viewModel?: BasemapGalleryViewModelProperties; + } + + interface BasemapToggle extends Widget { activeBasemap: Basemap; nextBasemap: Basemap; titleVisible: boolean; - view: SceneView | MapView; + view: MapView | SceneView; viewModel: BasemapToggleViewModel; + render(): any; toggle(): void; } @@ -5438,15 +6597,15 @@ declare namespace __esri { export const BasemapToggle: BasemapToggleConstructor; - interface BasemapToggleProperties { + interface BasemapToggleProperties extends WidgetProperties { activeBasemap?: BasemapProperties; nextBasemap?: Basemap | string; titleVisible?: boolean; - view?: SceneView | MapView; + view?: MapView | SceneView; viewModel?: BasemapToggleViewModelProperties; } - interface ColorSlider extends Accessor { + interface ColorSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5469,7 +6628,7 @@ declare namespace __esri { export const ColorSlider: ColorSliderConstructor; - interface ColorSliderProperties { + interface ColorSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5486,10 +6645,11 @@ declare namespace __esri { visualVariable?: any; } - interface Compass extends Accessor { - view: SceneView | MapView; + interface Compass extends Widget { + view: MapView | SceneView; viewModel: CompassViewModel; + render(): any; reset(): void; } @@ -5499,17 +6659,51 @@ declare namespace __esri { export const Compass: CompassConstructor; - interface CompassProperties { - view?: SceneView | MapView; + interface CompassProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: CompassViewModelProperties; } - interface Home extends Accessor, Evented { + interface Expand extends Widget { + collapseTooltip: string; + content: any; + expanded: boolean; + expandIconClass: string; + expandTooltip: string; + iconNumber: string; + view: MapView | SceneView; + viewModel: ExpandViewModel; + + collapse(): void; + expand(): void; + render(): any; + toggle(): void; + } + + interface ExpandConstructor { + new(properties?: ExpandProperties): Expand; + } + + export const Expand: ExpandConstructor; + + interface ExpandProperties extends WidgetProperties { + collapseTooltip?: string; + content?: any | any | string | Widget; + expanded?: boolean; + expandIconClass?: string; + expandTooltip?: string; + iconNumber?: string; + view?: MapView | SceneView; + viewModel?: ExpandViewModelProperties; + } + + interface Home extends Widget { view: MapView | SceneView; viewModel: HomeViewModel; viewpoint: Viewpoint; go(): void; + render(): any; } interface HomeConstructor { @@ -5518,7 +6712,7 @@ declare namespace __esri { export const Home: HomeConstructor; - interface HomeProperties { + interface HomeProperties extends WidgetProperties { view?: MapView | SceneView; viewModel?: HomeViewModelProperties; viewpoint?: ViewpointProperties; @@ -5526,10 +6720,12 @@ declare namespace __esri { interface LayerList extends Widget { createActionsFunction: Function; - view: SceneView | MapView; + operationalItems: Collection; + view: MapView | SceneView; viewModel: LayerListViewModel; render(): any; + triggerAction(action: Action, item: ListItem): void; } interface LayerListConstructor { @@ -5540,13 +6736,14 @@ declare namespace __esri { interface LayerListProperties extends WidgetProperties { createActionsFunction?: Function; - view?: SceneView | MapView; + operationalItems?: Collection; + view?: MapView | SceneView; viewModel?: LayerListViewModelProperties; } - interface Legend extends Accessor { + interface Legend extends Accessor, Widgette { layerInfos: LegendLayerInfos[]; - view: SceneView | MapView; + view: MapView | SceneView; } interface LegendConstructor { @@ -5555,12 +6752,12 @@ declare namespace __esri { export const Legend: LegendConstructor; - interface LegendProperties { + interface LegendProperties extends WidgetteProperties { layerInfos?: LegendLayerInfos[]; - view?: SceneView | MapView; + view?: MapView | SceneView; } - interface Locate extends Accessor, Evented { + interface Locate extends Widget { geolocationOptions: any; goToLocationEnabled: boolean; graphic: Graphic; @@ -5568,6 +6765,7 @@ declare namespace __esri { viewModel: LocateViewModel; locate(): IPromise; + render(): any; } interface LocateConstructor { @@ -5576,7 +6774,7 @@ declare namespace __esri { export const Locate: LocateConstructor; - interface LocateProperties { + interface LocateProperties extends WidgetProperties { geolocationOptions?: any; goToLocationEnabled?: boolean; graphic?: GraphicProperties; @@ -5584,11 +6782,12 @@ declare namespace __esri { viewModel?: LocateViewModelProperties; } - interface NavigationToggle extends Accessor { + interface NavigationToggle extends Widget { layout: string; view: SceneView; viewModel: NavigationToggleViewModel; + render(): any; toggle(): void; } @@ -5598,13 +6797,13 @@ declare namespace __esri { export const NavigationToggle: NavigationToggleConstructor; - interface NavigationToggleProperties { + interface NavigationToggleProperties extends WidgetProperties { layout?: string; view?: SceneViewProperties; viewModel?: NavigationToggleViewModelProperties; } - interface Popup extends Accessor, Evented { + interface Popup extends Accessor, Widgette, Evented { actions: Collection; content: string; currentDockPosition: string; @@ -5636,7 +6835,7 @@ declare namespace __esri { export const Popup: PopupConstructor; - interface PopupProperties { + interface PopupProperties extends WidgetteProperties { actions?: Collection; content?: string | any; currentDockPosition?: string; @@ -5674,12 +6873,34 @@ declare namespace __esri { viewModel?: PrintViewModelProperties; } - interface Search extends Accessor, Evented { + interface ScaleBar extends Widget { + style: string; + unit: string; + view: MapView; + viewModel: ScaleBarViewModel; + + render(): any; + } + + interface ScaleBarConstructor { + new(properties?: ScaleBarProperties): ScaleBar; + } + + export const ScaleBar: ScaleBarConstructor; + + interface ScaleBarProperties extends WidgetProperties { + style?: string; + unit?: string; + view?: MapViewProperties; + viewModel?: ScaleBarViewModelProperties; + } + + interface Search extends Widget { activeSource: FeatureLayer | Locator; activeSourceIndex: number; allPlaceholder: string; autoSelect: boolean; - defaultSource: any; + defaultSource: any | any; maxResults: number; maxSuggestions: number; minSuggestCharacters: number; @@ -5690,6 +6911,7 @@ declare namespace __esri { resultGraphicEnabled: boolean; results: any[]; searchAllEnabled: boolean; + searching: boolean; searchTerm: string; selectedResult: any; sources: SearchSources; @@ -5699,6 +6921,7 @@ declare namespace __esri { viewModel: SearchViewModel; clear(): void; + render(): any; search(searchTerm?: string | Geometry | any | number[][]): IPromise; suggest(value?: string): IPromise; } @@ -5709,12 +6932,12 @@ declare namespace __esri { export const Search: SearchConstructor; - interface SearchProperties { + interface SearchProperties extends WidgetProperties { activeSource?: FeatureLayer | Locator; activeSourceIndex?: number; allPlaceholder?: string; autoSelect?: boolean; - defaultSource?: any; + defaultSource?: any | any; maxResults?: number; maxSuggestions?: number; minSuggestCharacters?: number; @@ -5725,6 +6948,7 @@ declare namespace __esri { resultGraphicEnabled?: boolean; results?: any[]; searchAllEnabled?: boolean; + searching?: boolean; searchTerm?: string; selectedResult?: any; sources?: SearchSources; @@ -5734,7 +6958,7 @@ declare namespace __esri { viewModel?: SearchViewModelProperties; } - interface SizeSlider extends Accessor { + interface SizeSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5757,7 +6981,7 @@ declare namespace __esri { export const SizeSlider: SizeSliderConstructor; - interface SizeSliderProperties { + interface SizeSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5774,7 +6998,7 @@ declare namespace __esri { visualVariable?: any; } - interface Track extends Accessor { + interface Track extends Widget { geolocationOptions: any; goToLocationEnabled: boolean; graphic: Graphic; @@ -5782,6 +7006,7 @@ declare namespace __esri { view: MapView | SceneView; viewModel: TrackViewModel; + render(): any; start(): void; stop(): void; } @@ -5792,7 +7017,7 @@ declare namespace __esri { export const Track: TrackConstructor; - interface TrackProperties { + interface TrackProperties extends WidgetProperties { geolocationOptions?: any; goToLocationEnabled?: boolean; graphic?: GraphicProperties; @@ -5801,7 +7026,7 @@ declare namespace __esri { viewModel?: TrackViewModelProperties; } - interface UnivariateColorSizeSlider extends Accessor { + interface UnivariateColorSizeSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5824,7 +7049,7 @@ declare namespace __esri { export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; - interface UnivariateColorSizeSliderProperties { + interface UnivariateColorSizeSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5847,7 +7072,9 @@ declare namespace __esri { id: string; destroy(): void; + own(handles: any[]): void; postInitialize(): void; + renderNow(): void; scheduleRender(): void; startup(): void; } @@ -5859,15 +7086,16 @@ declare namespace __esri { export const Widget: WidgetConstructor; interface WidgetProperties { - container?: string; + container?: string | any; destroyed?: boolean; id?: string; } - interface Zoom extends Accessor { - view: SceneView | MapView; + interface Zoom extends Widget { + view: MapView | SceneView; viewModel: ZoomViewModel; + render(): any; zoomIn(): void; zoomOut(): void; } @@ -5878,8 +7106,8 @@ declare namespace __esri { export const Zoom: ZoomConstructor; - interface ZoomProperties { - view?: SceneView | MapView; + interface ZoomProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: ZoomViewModelProperties; } @@ -5887,7 +7115,7 @@ declare namespace __esri { attributionText: string; itemDelimiter: string; state: string; - view: SceneView | MapView; + view: MapView | SceneView; } interface AttributionViewModelConstructor { @@ -5896,11 +7124,35 @@ declare namespace __esri { export const AttributionViewModel: AttributionViewModelConstructor; + interface BasemapGalleryViewModel extends Accessor { + activeBasemap: Basemap; + items: Collection; + source: LocalBasemapsSource | PortalBasemapsSource; + state: string; + view: MapView | SceneView; + + basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; + } + + interface BasemapGalleryViewModelConstructor { + new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; + } + + export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; + + interface BasemapGalleryViewModelProperties { + activeBasemap?: BasemapProperties; + items?: Collection; + source?: LocalBasemapsSource | PortalBasemapsSource; + state?: string; + view?: MapView | SceneView; + } + interface BasemapToggleViewModel extends Accessor, Evented { activeBasemap: Basemap; nextBasemap: Basemap; state: string; - view: SceneView | MapView; + view: MapView | SceneView; toggle(): void; } @@ -5915,12 +7167,13 @@ declare namespace __esri { activeBasemap?: BasemapProperties; nextBasemap?: Basemap | string; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } interface CompassViewModel extends Accessor { + orientation: any; state: string; - view: SceneView | MapView; + view: MapView | SceneView; reset(): void; } @@ -5932,8 +7185,27 @@ declare namespace __esri { export const CompassViewModel: CompassViewModelConstructor; interface CompassViewModelProperties { + orientation?: any; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; + } + + interface ExpandViewModel extends Accessor { + expanded: boolean; + state: string; + view: MapView | SceneView; + } + + interface ExpandViewModelConstructor { + new(properties?: ExpandViewModelProperties): ExpandViewModel; + } + + export const ExpandViewModel: ExpandViewModelConstructor; + + interface ExpandViewModelProperties { + expanded?: boolean; + state?: string; + view?: MapView | SceneView; } interface HomeViewModel extends Accessor, Evented { @@ -5960,9 +7232,9 @@ declare namespace __esri { createActionsFunction: Function; operationalItems: Collection; state: string; - view: SceneView | MapView; + view: MapView | SceneView; - triggerAction(actionIndex: number): void; + triggerAction(action: Action, item: ListItem): void; } interface LayerListViewModelConstructor { @@ -5975,9 +7247,32 @@ declare namespace __esri { createActionsFunction?: Function; operationalItems?: Collection; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } + interface ListItem { + actionsOpen: boolean; + actionsSections: Collection; + children: Collection; + error: Error; + layer: Layer; + open: boolean; + title: string; + updating: boolean; + view: MapView | SceneView; + visibilityMode: string; + visible: boolean; + visibleAtCurrentScale: boolean; + + clone(): ListItem; + } + + interface ListItemConstructor { + new(): ListItem; + } + + export const ListItem: ListItemConstructor; + interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { state: string; @@ -6075,6 +7370,20 @@ declare namespace __esri { view?: MapView | SceneView; } + interface ScaleBarViewModel extends Accessor { + view: MapView; + } + + interface ScaleBarViewModelConstructor { + new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; + } + + export const ScaleBarViewModel: ScaleBarViewModelConstructor; + + interface ScaleBarViewModelProperties { + view?: MapViewProperties; + } + interface SearchViewModel extends Accessor, Evented { activeSource: FeatureLayer | Locator; activeSourceIndex: number; @@ -6163,7 +7472,7 @@ declare namespace __esri { canZoomIn: boolean; canZoomOut: boolean; state: string; - view: SceneView | MapView; + view: MapView | SceneView; zoomIn(): void; zoomOut(): void; @@ -6179,7 +7488,7 @@ declare namespace __esri { canZoomIn?: boolean; canZoomOut?: boolean; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } interface JSONSupport { @@ -6301,6 +7610,8 @@ declare namespace __esri { dpi: number; gdbVersion: string; imageFormat: string; + imageMaxHeight: number; + imageMaxWidth: number; imageTransparency: boolean; sublayers: Collection; @@ -6320,6 +7631,8 @@ declare namespace __esri { dpi?: number; gdbVersion?: string; imageFormat?: string; + imageMaxHeight?: number; + imageMaxWidth?: number; imageTransparency?: boolean; sublayers?: Collection; } @@ -6547,6 +7860,24 @@ declare namespace __esri { width?: number; } + interface Widgette { + container: string | any; + visible: boolean; + + destroy(): void; + } + + interface WidgetteConstructor { + new(): Widgette; + } + + export const Widgette: WidgetteConstructor; + + interface WidgetteProperties { + container?: string | any; + visible?: boolean; + } + interface GeolocationPositioning { geolocationOptions: any; goToLocationEnabled: boolean; @@ -6569,8 +7900,10 @@ declare namespace __esri { interface config { geometryServiceUrl: string; + geoRSSServiceUrl: string; portalUrl: string; request: configRequest; + workers: configWorkers; } export const config: config; @@ -6596,13 +7929,19 @@ declare namespace __esri { export const lang: lang; interface promiseUtils { - eachAlways(promises: IPromise[]): IPromise[]; - reject(error?: any): IPromise; - resolve(value?: any): IPromise; + eachAlways(promises: IPromise[] | any): IPromise | any; + reject(error?: any): IPromise; + resolve(value?: T): IPromise; } export const promiseUtils: promiseUtils; + interface requireUtils { + when(moduleRequire: any, moduleNames: string[] | string): IPromise; + } + + export const requireUtils: requireUtils; + interface urlUtils { addProxyRule(rule: urlUtilsAddProxyRuleRule): number; getProxyRule(url: string): any; @@ -6636,7 +7975,7 @@ declare namespace __esri { interface decorators { aliasOf(propertyName: string): Function; cast(propertyName: string): Function; - cast(classFunction: Function): void; + cast(classFunction: Function): Function; declared(baseClass: T, ...mixinClasses: any[]): T; property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; subclass(declaredClass?: string): Function; @@ -6739,6 +8078,12 @@ declare namespace __esri { export const jsonUtils: jsonUtils; + interface normalizeUtils { + normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService): IPromise; + } + + export const normalizeUtils: normalizeUtils; + interface webMercatorUtils { canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; geographicToWebMercator(geometry: Geometry): Geometry; @@ -6765,7 +8110,7 @@ declare namespace __esri { interface size { createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; - createVisualVariable(params: sizeCreateVisualVariableParams): IPromise; + createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; } export const size: size; @@ -6787,13 +8132,17 @@ declare namespace __esri { histogram(params: histogramHistogramParams): IPromise; } - export const histogram: histogram; + const __histogramMapped: histogram; + export const histogram: typeof __histogramMapped.histogram; + interface summaryStatistics { summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; } - export const summaryStatistics: summaryStatistics; + const __summaryStatisticsMapped: summaryStatistics; + export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; + interface symbologyColor { cloneScheme(scheme: any): any; @@ -6824,16 +8173,6 @@ declare namespace __esri { 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; } @@ -6861,20 +8200,30 @@ declare namespace __esri { export const widget: widget; - interface ListItem { - actionsOpen: boolean; - actionsSections: Collection; - children: Collection; + interface BasemapGalleryItem { + basemap: Basemap; error: Error; - open: boolean; - title: string; - updating: boolean; - visibilityMode: string; - visible: boolean; - visibleAtCurrentScale: boolean; + state: string; + view: MapView | SceneView; } - export const ListItem: ListItem; + export const BasemapGalleryItem: BasemapGalleryItem; + + interface LocalBasemapsSource { + basemaps: Collection; + state: string; + } + + export const LocalBasemapsSource: LocalBasemapsSource; + + interface PortalBasemapsSource { + basemaps: Collection; + filterFunction: Function; + portal: Portal; + state: string; + } + + export const PortalBasemapsSource: PortalBasemapsSource; } declare module "esri" { @@ -6888,10 +8237,116 @@ declare module "esri" { export import WatchHandle = __esri.WatchHandle; + export import EachAlwaysResult = __esri.EachAlwaysResult; + export import PausableWatchHandle = __esri.PausableWatchHandle; + export import FeatureEditResult = __esri.FeatureEditResult; + export import AttributeParamValue = __esri.AttributeParamValue; + export import DataWorkspace = __esri.DataWorkspace; + + export import GroupMembership = __esri.GroupMembership; + + export import HoldType = __esri.HoldType; + + export import JobPriority = __esri.JobPriority; + + export import JobQuery = __esri.JobQuery; + + export import JobStatus = __esri.JobStatus; + + export import JobQueryContainer = __esri.JobQueryContainer; + + export import JobQueryDetails = __esri.JobQueryDetails; + + export import Privilege = __esri.Privilege; + + export import UserDetails = __esri.UserDetails; + + export import VersionInfo = __esri.VersionInfo; + + export import WorkflowManagerServiceInfo = __esri.WorkflowManagerServiceInfo; + + export import JobType = __esri.JobType; + + export import JobTypeDetails = __esri.JobTypeDetails; + + export import TableRelationship = __esri.TableRelationship; + + export import JobCreationParameters = __esri.JobCreationParameters; + + export import JobQueryParameters = __esri.JobQueryParameters; + + export import JobUpdateParameters = __esri.JobUpdateParameters; + + export import AuxRecordDescription = __esri.AuxRecordDescription; + + export import ActivityType = __esri.ActivityType; + + export import AuxRecordContainer = __esri.AuxRecordContainer; + + export import JobTaskJobInfo = __esri.JobTaskJobInfo; + + export import QueryResult = __esri.QueryResult; + + export import AuxRecord = __esri.AuxRecord; + + export import AuxRecordValue = __esri.AuxRecordValue; + + export import FieldValue = __esri.FieldValue; + + export import JobVersionInfo = __esri.JobVersionInfo; + + export import QueryFieldInfo = __esri.QueryFieldInfo; + + export import JobAttachment = __esri.JobAttachment; + + export import JobDependency = __esri.JobDependency; + + export import ChangeRule = __esri.ChangeRule; + + export import DataSetEvaluator = __esri.DataSetEvaluator; + + export import AOIEvaluator = __esri.AOIEvaluator; + + export import DatasetConfiguration = __esri.DatasetConfiguration; + + export import EmailNotifier = __esri.EmailNotifier; + + export import WhereCondition = __esri.WhereCondition; + + export import NotificationType = __esri.NotificationType; + + export import ChangeRuleMatch = __esri.ChangeRuleMatch; + + export import ReportDataGroup = __esri.ReportDataGroup; + + export import ReportData = __esri.ReportData; + + export import Report = __esri.Report; + + export import ExecuteInfo = __esri.ExecuteInfo; + + export import Step = __esri.Step; + + export import StepType = __esri.StepType; + + export import WorkflowDisplayDetails = __esri.WorkflowDisplayDetails; + + export import WorkflowOption = __esri.WorkflowOption; + + export import WorkflowStepInfo = __esri.WorkflowStepInfo; + + export import WorkflowAnnotationDisplayDetails = __esri.WorkflowAnnotationDisplayDetails; + + export import WorkflowConflicts = __esri.WorkflowConflicts; + + export import WorkflowPathDisplayDetails = __esri.WorkflowPathDisplayDetails; + + export import WorkflowStepDisplayDetails = __esri.WorkflowStepDisplayDetails; + export import ExternalRenderer = __esri.ExternalRenderer; export import RenderContext = __esri.RenderContext; @@ -6906,10 +8361,6 @@ declare module "esri" { 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; @@ -6966,8 +8417,16 @@ declare module "esri" { export import CSVLayerElevationInfo = __esri.CSVLayerElevationInfo; + export import FeatureLayerApplyEditsEdits = __esri.FeatureLayerApplyEditsEdits; + + export import FeatureLayerCapabilities = __esri.FeatureLayerCapabilities; + + export import FeatureLayerCapabilitiesOperations = __esri.FeatureLayerCapabilitiesOperations; + export import FeatureLayerElevationInfo = __esri.FeatureLayerElevationInfo; + export import FeatureLayerGetFieldDomainOptions = __esri.FeatureLayerGetFieldDomainOptions; + export import GraphicsLayerElevationInfo = __esri.GraphicsLayerElevationInfo; export import LayerFromArcGISServerUrlParams = __esri.LayerFromArcGISServerUrlParams; @@ -6976,6 +8435,12 @@ declare module "esri" { export import SceneLayerElevationInfo = __esri.SceneLayerElevationInfo; + export import StreamLayerFilter = __esri.StreamLayerFilter; + + export import StreamLayerPurgeOptions = __esri.StreamLayerPurgeOptions; + + export import StreamLayerUpdateFilterFilterChanges = __esri.StreamLayerUpdateFilterFilterChanges; + export import VectorTileLayerCurrentStyleInfo = __esri.VectorTileLayerCurrentStyleInfo; export import CodedValueDomainCodedValues = __esri.CodedValueDomainCodedValues; @@ -7004,6 +8469,8 @@ declare module "esri" { export import UniqueValueRendererUniqueValueInfos = __esri.UniqueValueRendererUniqueValueInfos; + export import PointCloudRendererPointSizeAlgorithm = __esri.PointCloudRendererPointSizeAlgorithm; + export import PointCloudClassBreaksRendererColorClassBreakInfos = __esri.PointCloudClassBreaksRendererColorClassBreakInfos; export import PointCloudStretchRendererStops = __esri.PointCloudStretchRendererStops; @@ -7042,6 +8509,102 @@ declare module "esri" { export import QueryQuantizationParameters = __esri.QueryQuantizationParameters; + export import ConfigurationTaskGetDataWorkspaceDetailsParams = __esri.ConfigurationTaskGetDataWorkspaceDetailsParams; + + export import ConfigurationTaskGetUserJobQueryDetailsParams = __esri.ConfigurationTaskGetUserJobQueryDetailsParams; + + export import JobTaskAddEmbeddedAttachmentParams = __esri.JobTaskAddEmbeddedAttachmentParams; + + export import JobTaskAddLinkedAttachmentParams = __esri.JobTaskAddLinkedAttachmentParams; + + export import JobTaskAddLinkedRecordParams = __esri.JobTaskAddLinkedRecordParams; + + export import JobTaskAssignJobsParams = __esri.JobTaskAssignJobsParams; + + export import JobTaskCloseJobsParams = __esri.JobTaskCloseJobsParams; + + export import JobTaskCreateDependencyParams = __esri.JobTaskCreateDependencyParams; + + export import JobTaskCreateHoldParams = __esri.JobTaskCreateHoldParams; + + export import JobTaskCreateJobVersionParams = __esri.JobTaskCreateJobVersionParams; + + export import JobTaskDeleteAttachmentParams = __esri.JobTaskDeleteAttachmentParams; + + export import JobTaskDeleteDependencyParams = __esri.JobTaskDeleteDependencyParams; + + export import JobTaskDeleteJobsParams = __esri.JobTaskDeleteJobsParams; + + export import JobTaskDeleteLinkedRecordParams = __esri.JobTaskDeleteLinkedRecordParams; + + export import JobTaskGetAttachmentContentUrlParams = __esri.JobTaskGetAttachmentContentUrlParams; + + export import JobTaskListFieldValuesParams = __esri.JobTaskListFieldValuesParams; + + export import JobTaskListMultiLevelFieldValuesParams = __esri.JobTaskListMultiLevelFieldValuesParams; + + export import JobTaskLogActionParams = __esri.JobTaskLogActionParams; + + export import JobTaskQueryJobsParams = __esri.JobTaskQueryJobsParams; + + export import JobTaskQueryMultiLevelSelectedValuesParams = __esri.JobTaskQueryMultiLevelSelectedValuesParams; + + export import JobTaskReleaseHoldParams = __esri.JobTaskReleaseHoldParams; + + export import JobTaskReopenClosedJobsParams = __esri.JobTaskReopenClosedJobsParams; + + export import JobTaskSearchJobsParams = __esri.JobTaskSearchJobsParams; + + export import JobTaskUnassignJobsParams = __esri.JobTaskUnassignJobsParams; + + export import JobTaskUpdateNotesParams = __esri.JobTaskUpdateNotesParams; + + export import JobTaskUpdateRecordParams = __esri.JobTaskUpdateRecordParams; + + export import NotificationTaskAddChangeRuleParams = __esri.NotificationTaskAddChangeRuleParams; + + export import NotificationTaskDeleteChangeRuleParams = __esri.NotificationTaskDeleteChangeRuleParams; + + export import NotificationTaskNotifySessionParams = __esri.NotificationTaskNotifySessionParams; + + export import NotificationTaskQueryChangeRulesParams = __esri.NotificationTaskQueryChangeRulesParams; + + export import NotificationTaskRunSpatialNotificationOnHistoryParams = __esri.NotificationTaskRunSpatialNotificationOnHistoryParams; + + export import NotificationTaskSendNotificationParams = __esri.NotificationTaskSendNotificationParams; + + export import NotificationTaskSubscribeToNotificationParams = __esri.NotificationTaskSubscribeToNotificationParams; + + export import NotificationTaskUnsubscribeFromNotificationParams = __esri.NotificationTaskUnsubscribeFromNotificationParams; + + export import ReportTaskGenerateReportParams = __esri.ReportTaskGenerateReportParams; + + export import ReportTaskGetReportContentUrlParams = __esri.ReportTaskGetReportContentUrlParams; + + export import ReportTaskGetReportDataParams = __esri.ReportTaskGetReportDataParams; + + export import TokenTaskParseTokensParams = __esri.TokenTaskParseTokensParams; + + export import WorkflowTaskCanRunStepParams = __esri.WorkflowTaskCanRunStepParams; + + export import WorkflowTaskExecuteStepsParams = __esri.WorkflowTaskExecuteStepsParams; + + export import WorkflowTaskGetStepDescriptionParams = __esri.WorkflowTaskGetStepDescriptionParams; + + export import WorkflowTaskGetStepFileUrlParams = __esri.WorkflowTaskGetStepFileUrlParams; + + export import WorkflowTaskGetStepParams = __esri.WorkflowTaskGetStepParams; + + export import WorkflowTaskMarkStepsAsDoneParams = __esri.WorkflowTaskMarkStepsAsDoneParams; + + export import WorkflowTaskMoveToNextStepParams = __esri.WorkflowTaskMoveToNextStepParams; + + export import WorkflowTaskRecreateWorkflowParams = __esri.WorkflowTaskRecreateWorkflowParams; + + export import WorkflowTaskResolveConflictParams = __esri.WorkflowTaskResolveConflictParams; + + export import WorkflowTaskSetCurrentStepParams = __esri.WorkflowTaskSetCurrentStepParams; + export import MapViewConstraints = __esri.MapViewConstraints; export import MapViewGoToOptions = __esri.MapViewGoToOptions; @@ -7124,6 +8687,10 @@ declare module "esri" { export import configRequestProxyRules = __esri.configRequestProxyRules; + export import configWorkers = __esri.configWorkers; + + export import configWorkersLoaderConfig = __esri.configWorkersLoaderConfig; + export import requestEsriRequestOptions = __esri.requestEsriRequestOptions; export import urlUtilsAddProxyRuleRule = __esri.urlUtilsAddProxyRuleRule; @@ -7144,9 +8711,9 @@ declare module "esri" { export import sizeCreateContinuousRendererParamsLegendOptions = __esri.sizeCreateContinuousRendererParamsLegendOptions; - export import sizeCreateVisualVariableParams = __esri.sizeCreateVisualVariableParams; + export import sizeCreateVisualVariablesParams = __esri.sizeCreateVisualVariablesParams; - export import sizeCreateVisualVariableParamsLegendOptions = __esri.sizeCreateVisualVariableParamsLegendOptions; + export import sizeCreateVisualVariablesParamsLegendOptions = __esri.sizeCreateVisualVariablesParamsLegendOptions; export import univariateColorSizeCreateContinuousRendererParams = __esri.univariateColorSizeCreateContinuousRendererParams; @@ -7351,6 +8918,11 @@ declare module "esri/layers/FeatureLayer" { export = FeatureLayer; } +declare module "esri/layers/GeoRSSLayer" { + import GeoRSSLayer = __esri.GeoRSSLayer; + export = GeoRSSLayer; +} + declare module "esri/layers/GraphicsLayer" { import GraphicsLayer = __esri.GraphicsLayer; export = GraphicsLayer; @@ -7571,6 +9143,11 @@ declare module "esri/renderers/PointCloudUniqueValueRenderer" { export = PointCloudUniqueValueRenderer; } +declare module "esri/support/Action" { + import Action = __esri.Action; + export = Action; +} + declare module "esri/symbols/ExtrudeSymbol3DLayer" { import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; export = ExtrudeSymbol3DLayer; @@ -7961,6 +9538,36 @@ declare module "esri/tasks/support/TrimExtendParameters" { export = TrimExtendParameters; } +declare module "esri/tasks/workflow/ConfigurationTask" { + import ConfigurationTask = __esri.ConfigurationTask; + export = ConfigurationTask; +} + +declare module "esri/tasks/workflow/JobTask" { + import JobTask = __esri.JobTask; + export = JobTask; +} + +declare module "esri/tasks/workflow/NotificationTask" { + import NotificationTask = __esri.NotificationTask; + export = NotificationTask; +} + +declare module "esri/tasks/workflow/ReportTask" { + import ReportTask = __esri.ReportTask; + export = ReportTask; +} + +declare module "esri/tasks/workflow/TokenTask" { + import TokenTask = __esri.TokenTask; + export = TokenTask; +} + +declare module "esri/tasks/workflow/WorkflowTask" { + import WorkflowTask = __esri.WorkflowTask; + export = WorkflowTask; +} + declare module "esri/views/MapView" { import MapView = __esri.MapView; export = MapView; @@ -8001,6 +9608,11 @@ declare module "esri/views/layers/ImageryLayerView" { export = ImageryLayerView; } +declare module "esri/views/layers/SceneLayerView" { + import SceneLayerView = __esri.SceneLayerView; + export = SceneLayerView; +} + declare module "esri/views/ui/UI" { import UI = __esri.UI; export = UI; @@ -8046,6 +9658,11 @@ declare module "esri/widgets/Attribution" { export = Attribution; } +declare module "esri/widgets/BasemapGallery" { + import BasemapGallery = __esri.BasemapGallery; + export = BasemapGallery; +} + declare module "esri/widgets/BasemapToggle" { import BasemapToggle = __esri.BasemapToggle; export = BasemapToggle; @@ -8061,6 +9678,11 @@ declare module "esri/widgets/Compass" { export = Compass; } +declare module "esri/widgets/Expand" { + import Expand = __esri.Expand; + export = Expand; +} + declare module "esri/widgets/Home" { import Home = __esri.Home; export = Home; @@ -8096,6 +9718,11 @@ declare module "esri/widgets/Print" { export = Print; } +declare module "esri/widgets/ScaleBar" { + import ScaleBar = __esri.ScaleBar; + export = ScaleBar; +} + declare module "esri/widgets/Search" { import Search = __esri.Search; export = Search; @@ -8131,6 +9758,11 @@ declare module "esri/widgets/Attribution/AttributionViewModel" { export = AttributionViewModel; } +declare module "esri/widgets/BasemapGallery/BasemapGalleryViewModel" { + import BasemapGalleryViewModel = __esri.BasemapGalleryViewModel; + export = BasemapGalleryViewModel; +} + declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { import BasemapToggleViewModel = __esri.BasemapToggleViewModel; export = BasemapToggleViewModel; @@ -8141,6 +9773,11 @@ declare module "esri/widgets/Compass/CompassViewModel" { export = CompassViewModel; } +declare module "esri/widgets/Expand/ExpandViewModel" { + import ExpandViewModel = __esri.ExpandViewModel; + export = ExpandViewModel; +} + declare module "esri/widgets/Home/HomeViewModel" { import HomeViewModel = __esri.HomeViewModel; export = HomeViewModel; @@ -8151,6 +9788,11 @@ declare module "esri/widgets/LayerList/LayerListViewModel" { export = LayerListViewModel; } +declare module "esri/widgets/LayerList/ListItem" { + import ListItem = __esri.ListItem; + export = ListItem; +} + declare module "esri/widgets/Locate/LocateViewModel" { import LocateViewModel = __esri.LocateViewModel; export = LocateViewModel; @@ -8171,6 +9813,11 @@ declare module "esri/widgets/Popup/PopupViewModel" { export = PopupViewModel; } +declare module "esri/widgets/ScaleBar/ScaleBarViewModel" { + import ScaleBarViewModel = __esri.ScaleBarViewModel; + export = ScaleBarViewModel; +} + declare module "esri/widgets/Search/SearchViewModel" { import SearchViewModel = __esri.SearchViewModel; export = SearchViewModel; @@ -8266,6 +9913,11 @@ declare module "esri/views/DOMContainer" { export = DOMContainer; } +declare module "esri/widgets/Widgette" { + import Widgette = __esri.Widgette; + export = Widgette; +} + declare module "esri/widgets/support/GeolocationPositioning" { import GeolocationPositioning = __esri.GeolocationPositioning; export = GeolocationPositioning; @@ -8296,6 +9948,11 @@ declare module "esri/core/promiseUtils" { export = promiseUtils; } +declare module "esri/core/requireUtils" { + import requireUtils = __esri.requireUtils; + export = requireUtils; +} + declare module "esri/core/urlUtils" { import urlUtils = __esri.urlUtils; export = urlUtils; @@ -8331,6 +9988,11 @@ declare module "esri/geometry/support/jsonUtils" { export = jsonUtils; } +declare module "esri/geometry/support/normalizeUtils" { + import normalizeUtils = __esri.normalizeUtils; + export = normalizeUtils; +} + declare module "esri/geometry/support/webMercatorUtils" { import webMercatorUtils = __esri.webMercatorUtils; export = webMercatorUtils; @@ -8391,11 +10053,6 @@ declare module "esri/renderers/support/jsonUtils" { 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; @@ -8411,7 +10068,17 @@ declare module "esri/widgets/support/widget" { export = widget; } -declare module "esri/widgets/LayerList/ListItem" { - import ListItem = __esri.ListItem; - export = ListItem; +declare module "esri/widgets/BasemapGallery/BasemapGalleryItem" { + import BasemapGalleryItem = __esri.BasemapGalleryItem; + export = BasemapGalleryItem; } + +declare module "esri/widgets/BasemapGallery/support/LocalBasemapsSource" { + import LocalBasemapsSource = __esri.LocalBasemapsSource; + export = LocalBasemapsSource; +} + +declare module "esri/widgets/BasemapGallery/support/PortalBasemapsSource" { + import PortalBasemapsSource = __esri.PortalBasemapsSource; + export = PortalBasemapsSource; +} \ No newline at end of file diff --git a/arcgis-js-api/tsconfig.json b/types/arcgis-js-api/tsconfig.json similarity index 100% rename from arcgis-js-api/tsconfig.json rename to types/arcgis-js-api/tsconfig.json diff --git a/arcgis-js-api/v3/arcgis-js-api-tests.ts b/types/arcgis-js-api/v3/arcgis-js-api-tests.ts similarity index 100% rename from arcgis-js-api/v3/arcgis-js-api-tests.ts rename to types/arcgis-js-api/v3/arcgis-js-api-tests.ts diff --git a/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts similarity index 100% rename from arcgis-js-api/v3/index.d.ts rename to types/arcgis-js-api/v3/index.d.ts diff --git a/arcgis-js-api/v3/tsconfig.json b/types/arcgis-js-api/v3/tsconfig.json similarity index 100% rename from arcgis-js-api/v3/tsconfig.json rename to types/arcgis-js-api/v3/tsconfig.json diff --git a/arcgis-rest-api/arcgis-rest-api-tests.ts b/types/arcgis-rest-api/arcgis-rest-api-tests.ts similarity index 100% rename from arcgis-rest-api/arcgis-rest-api-tests.ts rename to types/arcgis-rest-api/arcgis-rest-api-tests.ts diff --git a/arcgis-rest-api/index.d.ts b/types/arcgis-rest-api/index.d.ts similarity index 100% rename from arcgis-rest-api/index.d.ts rename to types/arcgis-rest-api/index.d.ts diff --git a/arcgis-rest-api/tsconfig.json b/types/arcgis-rest-api/tsconfig.json similarity index 100% rename from arcgis-rest-api/tsconfig.json rename to types/arcgis-rest-api/tsconfig.json diff --git a/arcgis-rest-api/tslint.json b/types/arcgis-rest-api/tslint.json similarity index 100% rename from arcgis-rest-api/tslint.json rename to types/arcgis-rest-api/tslint.json diff --git a/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts b/types/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts similarity index 100% rename from arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts rename to types/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts diff --git a/arcgis-to-geojson-utils/index.d.ts b/types/arcgis-to-geojson-utils/index.d.ts similarity index 100% rename from arcgis-to-geojson-utils/index.d.ts rename to types/arcgis-to-geojson-utils/index.d.ts diff --git a/arcgis-to-geojson-utils/tsconfig.json b/types/arcgis-to-geojson-utils/tsconfig.json similarity index 100% rename from arcgis-to-geojson-utils/tsconfig.json rename to types/arcgis-to-geojson-utils/tsconfig.json diff --git a/arcgis-to-geojson-utils/tslint.json b/types/arcgis-to-geojson-utils/tslint.json similarity index 100% rename from arcgis-to-geojson-utils/tslint.json rename to types/arcgis-to-geojson-utils/tslint.json diff --git a/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts similarity index 94% rename from archiver/archiver-tests.ts rename to types/archiver/archiver-tests.ts index d79b29f079..f186fb9bcb 100644 --- a/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -1,6 +1,3 @@ - -/// - import Archiver = require('archiver'); import FS = require('fs'); diff --git a/archiver/index.d.ts b/types/archiver/index.d.ts similarity index 100% rename from archiver/index.d.ts rename to types/archiver/index.d.ts diff --git a/archiver/tsconfig.json b/types/archiver/tsconfig.json similarity index 100% rename from archiver/tsconfig.json rename to types/archiver/tsconfig.json diff --git a/archy/archy-tests.ts b/types/archy/archy-tests.ts similarity index 100% rename from archy/archy-tests.ts rename to types/archy/archy-tests.ts diff --git a/archy/index.d.ts b/types/archy/index.d.ts similarity index 100% rename from archy/index.d.ts rename to types/archy/index.d.ts diff --git a/archy/tsconfig.json b/types/archy/tsconfig.json similarity index 100% rename from archy/tsconfig.json rename to types/archy/tsconfig.json diff --git a/argparse/argparse-tests.ts b/types/argparse/argparse-tests.ts similarity index 100% rename from argparse/argparse-tests.ts rename to types/argparse/argparse-tests.ts diff --git a/argparse/index.d.ts b/types/argparse/index.d.ts similarity index 100% rename from argparse/index.d.ts rename to types/argparse/index.d.ts diff --git a/argparse/tsconfig.json b/types/argparse/tsconfig.json similarity index 100% rename from argparse/tsconfig.json rename to types/argparse/tsconfig.json diff --git a/argv/argv-tests.ts b/types/argv/argv-tests.ts similarity index 100% rename from argv/argv-tests.ts rename to types/argv/argv-tests.ts diff --git a/argv/index.d.ts b/types/argv/index.d.ts similarity index 100% rename from argv/index.d.ts rename to types/argv/index.d.ts diff --git a/argv/tsconfig.json b/types/argv/tsconfig.json similarity index 100% rename from argv/tsconfig.json rename to types/argv/tsconfig.json diff --git a/array-find-index/array-find-index-tests.ts b/types/array-find-index/array-find-index-tests.ts similarity index 100% rename from array-find-index/array-find-index-tests.ts rename to types/array-find-index/array-find-index-tests.ts diff --git a/array-find-index/index.d.ts b/types/array-find-index/index.d.ts similarity index 100% rename from array-find-index/index.d.ts rename to types/array-find-index/index.d.ts diff --git a/array-find-index/tsconfig.json b/types/array-find-index/tsconfig.json similarity index 100% rename from array-find-index/tsconfig.json rename to types/array-find-index/tsconfig.json diff --git a/array-find-index/tslint.json b/types/array-find-index/tslint.json similarity index 100% rename from array-find-index/tslint.json rename to types/array-find-index/tslint.json diff --git a/array-foreach/array-foreach-tests.ts b/types/array-foreach/array-foreach-tests.ts similarity index 100% rename from array-foreach/array-foreach-tests.ts rename to types/array-foreach/array-foreach-tests.ts diff --git a/array-foreach/index.d.ts b/types/array-foreach/index.d.ts similarity index 100% rename from array-foreach/index.d.ts rename to types/array-foreach/index.d.ts diff --git a/array-foreach/tsconfig.json b/types/array-foreach/tsconfig.json similarity index 100% rename from array-foreach/tsconfig.json rename to types/array-foreach/tsconfig.json diff --git a/array-uniq/array-uniq-tests.ts b/types/array-uniq/array-uniq-tests.ts similarity index 100% rename from array-uniq/array-uniq-tests.ts rename to types/array-uniq/array-uniq-tests.ts diff --git a/array-uniq/index.d.ts b/types/array-uniq/index.d.ts similarity index 100% rename from array-uniq/index.d.ts rename to types/array-uniq/index.d.ts diff --git a/array-uniq/tsconfig.json b/types/array-uniq/tsconfig.json similarity index 100% rename from array-uniq/tsconfig.json rename to types/array-uniq/tsconfig.json diff --git a/array-uniq/tslint.json b/types/array-uniq/tslint.json similarity index 100% rename from array-uniq/tslint.json rename to types/array-uniq/tslint.json diff --git a/artyom.js/artyom.js-tests.ts b/types/artyom.js/artyom.js-tests.ts similarity index 100% rename from artyom.js/artyom.js-tests.ts rename to types/artyom.js/artyom.js-tests.ts diff --git a/artyom.js/index.d.ts b/types/artyom.js/index.d.ts similarity index 99% rename from artyom.js/index.d.ts rename to types/artyom.js/index.d.ts index 0b0f253827..ae120015ca 100644 --- a/artyom.js/index.d.ts +++ b/types/artyom.js/index.d.ts @@ -164,7 +164,6 @@ interface SpeechSynthesisVoice { } declare namespace Artyom { - interface ArtyomDevice { isChrome(): boolean; isMobile(): boolean; @@ -235,7 +234,7 @@ declare namespace Artyom { onend(): void; } - export interface ArtyomJS { + 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 @@ -499,13 +498,12 @@ declare namespace Artyom { /** * ArtyomBuilder bla, bla... */ - export class ArtyomBuilder { + class ArtyomBuilder { /** * Method to bla, bla, bla... */ static getInstance(): ArtyomJS } - } // tslint:disable-next-line:export-just-namespace diff --git a/artyom.js/tsconfig.json b/types/artyom.js/tsconfig.json similarity index 100% rename from artyom.js/tsconfig.json rename to types/artyom.js/tsconfig.json diff --git a/artyom.js/tslint.json b/types/artyom.js/tslint.json similarity index 100% rename from artyom.js/tslint.json rename to types/artyom.js/tslint.json diff --git a/asana/asana-tests.ts b/types/asana/asana-tests.ts similarity index 100% rename from asana/asana-tests.ts rename to types/asana/asana-tests.ts diff --git a/asana/index.d.ts b/types/asana/index.d.ts similarity index 100% rename from asana/index.d.ts rename to types/asana/index.d.ts diff --git a/asana/tsconfig.json b/types/asana/tsconfig.json similarity index 100% rename from asana/tsconfig.json rename to types/asana/tsconfig.json diff --git a/asciify/asciify-tests.ts b/types/asciify/asciify-tests.ts similarity index 100% rename from asciify/asciify-tests.ts rename to types/asciify/asciify-tests.ts diff --git a/asciify/index.d.ts b/types/asciify/index.d.ts similarity index 100% rename from asciify/index.d.ts rename to types/asciify/index.d.ts diff --git a/asciify/tsconfig.json b/types/asciify/tsconfig.json similarity index 100% rename from asciify/tsconfig.json rename to types/asciify/tsconfig.json diff --git a/asn1js/asn1js-tests.ts b/types/asn1js/asn1js-tests.ts similarity index 100% rename from asn1js/asn1js-tests.ts rename to types/asn1js/asn1js-tests.ts diff --git a/asn1js/index.d.ts b/types/asn1js/index.d.ts similarity index 100% rename from asn1js/index.d.ts rename to types/asn1js/index.d.ts diff --git a/asn1js/tsconfig.json b/types/asn1js/tsconfig.json similarity index 100% rename from asn1js/tsconfig.json rename to types/asn1js/tsconfig.json diff --git a/aspnet-identity-pw/aspnet-identity-pw-tests.ts b/types/aspnet-identity-pw/aspnet-identity-pw-tests.ts similarity index 100% rename from aspnet-identity-pw/aspnet-identity-pw-tests.ts rename to types/aspnet-identity-pw/aspnet-identity-pw-tests.ts diff --git a/aspnet-identity-pw/index.d.ts b/types/aspnet-identity-pw/index.d.ts similarity index 100% rename from aspnet-identity-pw/index.d.ts rename to types/aspnet-identity-pw/index.d.ts diff --git a/aspnet-identity-pw/tsconfig.json b/types/aspnet-identity-pw/tsconfig.json similarity index 100% rename from aspnet-identity-pw/tsconfig.json rename to types/aspnet-identity-pw/tsconfig.json diff --git a/assert-plus/assert-plus-tests.ts b/types/assert-plus/assert-plus-tests.ts similarity index 100% rename from assert-plus/assert-plus-tests.ts rename to types/assert-plus/assert-plus-tests.ts diff --git a/assert-plus/index.d.ts b/types/assert-plus/index.d.ts similarity index 100% rename from assert-plus/index.d.ts rename to types/assert-plus/index.d.ts diff --git a/assert-plus/tsconfig.json b/types/assert-plus/tsconfig.json similarity index 100% rename from assert-plus/tsconfig.json rename to types/assert-plus/tsconfig.json diff --git a/assert-plus/tslint.json b/types/assert-plus/tslint.json similarity index 100% rename from assert-plus/tslint.json rename to types/assert-plus/tslint.json diff --git a/assertion-error/assertion-error-tests.ts b/types/assertion-error/assertion-error-tests.ts similarity index 100% rename from assertion-error/assertion-error-tests.ts rename to types/assertion-error/assertion-error-tests.ts diff --git a/assertion-error/index.d.ts b/types/assertion-error/index.d.ts similarity index 100% rename from assertion-error/index.d.ts rename to types/assertion-error/index.d.ts diff --git a/assertion-error/tsconfig.json b/types/assertion-error/tsconfig.json similarity index 100% rename from assertion-error/tsconfig.json rename to types/assertion-error/tsconfig.json diff --git a/assertsharp/assertsharp-tests.ts b/types/assertsharp/assertsharp-tests.ts similarity index 100% rename from assertsharp/assertsharp-tests.ts rename to types/assertsharp/assertsharp-tests.ts diff --git a/assertsharp/index.d.ts b/types/assertsharp/index.d.ts similarity index 100% rename from assertsharp/index.d.ts rename to types/assertsharp/index.d.ts diff --git a/assertsharp/tsconfig.json b/types/assertsharp/tsconfig.json similarity index 100% rename from assertsharp/tsconfig.json rename to types/assertsharp/tsconfig.json diff --git a/async-lock/async-lock-tests.ts b/types/async-lock/async-lock-tests.ts similarity index 100% rename from async-lock/async-lock-tests.ts rename to types/async-lock/async-lock-tests.ts diff --git a/async-lock/index.d.ts b/types/async-lock/index.d.ts similarity index 100% rename from async-lock/index.d.ts rename to types/async-lock/index.d.ts diff --git a/async-lock/tsconfig.json b/types/async-lock/tsconfig.json similarity index 100% rename from async-lock/tsconfig.json rename to types/async-lock/tsconfig.json diff --git a/async-polling/async-polling-tests.ts b/types/async-polling/async-polling-tests.ts similarity index 100% rename from async-polling/async-polling-tests.ts rename to types/async-polling/async-polling-tests.ts diff --git a/async-polling/index.d.ts b/types/async-polling/index.d.ts similarity index 100% rename from async-polling/index.d.ts rename to types/async-polling/index.d.ts diff --git a/async-polling/tsconfig.json b/types/async-polling/tsconfig.json similarity index 100% rename from async-polling/tsconfig.json rename to types/async-polling/tsconfig.json diff --git a/async-writer/async-writer-tests.ts b/types/async-writer/async-writer-tests.ts similarity index 100% rename from async-writer/async-writer-tests.ts rename to types/async-writer/async-writer-tests.ts diff --git a/async-writer/index.d.ts b/types/async-writer/index.d.ts similarity index 100% rename from async-writer/index.d.ts rename to types/async-writer/index.d.ts diff --git a/async-writer/tsconfig.json b/types/async-writer/tsconfig.json similarity index 100% rename from async-writer/tsconfig.json rename to types/async-writer/tsconfig.json diff --git a/async/index.d.ts b/types/async/index.d.ts similarity index 74% rename from async/index.d.ts rename to types/async/index.d.ts index e3fbe7e512..33bb1a6c0e 100644 --- a/async/index.d.ts +++ b/types/async/index.d.ts @@ -6,17 +6,16 @@ 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 AsyncBooleanResultCallback { (err?: E, truthValue?: boolean): void; } +interface AsyncResultCallback { (err?: E, result?: T): void; } +interface AsyncResultArrayCallback { (err?: E, results?: (T | undefined)[]): void; } +interface AsyncResultObjectCallback { (err: E | undefined, 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 AsyncMemoIterator { (memo: R | undefined, item: T, callback: AsyncResultCallback): void; } interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } interface AsyncWorker { (task: T, callback: ErrorCallback): void; } @@ -76,7 +75,7 @@ interface AsyncPriorityQueue { interface AsyncCargo { length(): number; - payload: number; + payload?: number; push(task: any, callback? : Function): void; push(task: any[], callback? : Function): void; saturated(): void; @@ -91,34 +90,34 @@ interface AsyncCargo { interface Async { // Collections - each(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; + each(arr: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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; @@ -126,38 +125,38 @@ interface Async { reject: typeof async.filter; rejectSeries: typeof async.filter; rejectLimit: typeof async.filterLimit; - reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): void; + reduce(arr: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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; + sortBy(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + some(arr: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, 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: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; concat(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; concatSeries: typeof async.concat; @@ -175,7 +174,7 @@ interface Async { 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; + 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. @@ -186,29 +185,30 @@ interface Async { 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; + 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)[]; + reflect(fn: AsyncFunction) : (callback: (err: null, result: {error?: E, value?: T}) => void) => void; + reflectAll(tasks: AsyncFunction[]): ((callback: (err: null, result: {error?: E, value?: T}) => void) => void)[]; - timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; - timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; + 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; + transform(arr: T[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; + transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; - race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; + transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; + transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; + + race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; // Utils memoize(fn: Function, hasher?: Function): Function; @@ -226,4 +226,3 @@ declare var async: Async; declare module "async" { export = async; } - diff --git a/types/async/test/es6-generators.ts b/types/async/test/es6-generators.ts new file mode 100644 index 0000000000..2a7328a09a --- /dev/null +++ b/types/async/test/es6-generators.ts @@ -0,0 +1,54 @@ +function* collectionGenerator(): IterableIterator { } + +function funcMapIterator(value: T, callback: AsyncResultCallback) { } +function funcMapComplete(error: E, results: T[]) { } + +function booleanIterator(v: T, cb: (err: Error, res: boolean) => void) { } + +function eachIterator(item: T, callback: (err: Error) => void) { } +function eachOfIterator(item: T, key: K, callback: (err: Error) => void) { } + +function concatIterator(item: T, callback: (err: E, res: R[]) => void) { } + +async.map(collectionGenerator(), funcMapIterator, funcMapComplete) +async.mapSeries(collectionGenerator(), funcMapIterator, funcMapComplete) +async.mapLimit(collectionGenerator(), 2, funcMapIterator, funcMapComplete) + +async.filter(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) +async.filterSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) +async.filterLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) +async.select(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) +async.selectSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) +async.selectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) + +async.reject(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) +async.rejectSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) +async.rejectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) + +async.each(collectionGenerator(), eachIterator, function (err: Error) { }) +async.eachLimit(collectionGenerator(), 2, eachIterator, function (err: Error) { }) +async.eachSeries(collectionGenerator(), eachIterator, function (err: Error) { }) +async.eachOf(collectionGenerator(), eachOfIterator, function (err: Error) { }) +async.eachOfLimit(collectionGenerator(), 2, eachOfIterator, function (err: Error) { }) +async.eachOfSeries(collectionGenerator(), eachOfIterator, function (err: Error) { }) +async.forEach(collectionGenerator(), eachIterator, function (err: Error) { }) +async.forEachLimit(collectionGenerator(), 2, eachIterator, function (err: Error) { }) +async.forEachSeries(collectionGenerator(), eachIterator, function (err: Error) { }) +async.forEachOf(collectionGenerator(), eachOfIterator, function (err: Error) { }) +async.forEachOfLimit(collectionGenerator(), 2, eachOfIterator, function (err: Error) { }) +async.forEachOfSeries(collectionGenerator(), eachOfIterator, function (err: Error) { }) + +async.every(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.everyLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) +async.everySeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) + +async.some(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.someLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) +async.someSeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) + +async.detect(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.detectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) +async.detectSeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) + +async.concat(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }) +async.concatSeries(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }) diff --git a/types/async/test/explicit.ts b/types/async/test/explicit.ts new file mode 100644 index 0000000000..b9ea9c84ed --- /dev/null +++ b/types/async/test/explicit.ts @@ -0,0 +1,74 @@ + + +interface StringCallback { (err?: Error, result?: string): void; } +interface AsyncStringGetter { (callback: StringCallback): void; } + +var taskArray: AsyncStringGetter[] = [ + function (callback) { + setTimeout(function () { + callback(undefined, 'one'); + }, 200); + }, + function (callback) { + setTimeout(function () { + callback(undefined, 'two'); + }, 100); + }, +]; + +async.series(taskArray, function (err, results) { + if (results) { + let first = results[0]; + if (first) { + console.log(first.match(/o/)) + } + } +}); +async.parallel(taskArray, function (err, results) { + if (results) { + let first = results[0]; + if (first) { + console.log(first.match(/o/)) + } + } +}); +async.parallelLimit(taskArray, 3, function (err, results) { + if (results) { + let first = results[0]; + if (first) { + console.log(first.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(undefined, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(undefined, 2); + }, 100); + } +} + +async.series(taskDict, function(err, results) { + let one = results['one']; + console.log(one && one.toFixed(1)) +}); +async.parallel(taskDict, function(err, results) { + let one = results['one']; + console.log(one && one.toFixed(1)) +}); +async.parallelLimit(taskDict, 3, function(err, results) { + let one = results['one']; + console.log(one && one.toFixed(1)) +}); + diff --git a/async/test/index.ts b/types/async/test/index.ts similarity index 98% rename from async/test/index.ts rename to types/async/test/index.ts index 8c6be303e4..b30ca4c7ba 100644 --- a/async/test/index.ts +++ b/types/async/test/index.ts @@ -350,9 +350,9 @@ q2.unshift(['task3', 'task4', 'task5'], function (error) { }); -var aq = async.queue(function (level: number, callback: (error : Error, newLevel: number) => void) { +var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { console.log('hello ' + level); - callback(null, level+1); + callback(undefined, level+1); }); aq.push(1, function (err : Error, newLevel : number) { @@ -807,9 +807,9 @@ async.some({ // timeout -function myFunction1(foo : any, callback: (err : Error, result : any) => void ) : void { +function myFunction1(foo : any, callback: (err?: Error, result?: any) => void ) : void { console.log(`async.timeout 1 ${foo}`); - return callback(null, foo); + return callback(undefined, foo); } var wrapped1 = async.timeout(myFunction1, 1000); wrapped1({ bar: 'bar' }, function(err : Error, data : any) { @@ -817,9 +817,9 @@ wrapped1({ bar: 'bar' }, function(err : Error, data : any) { }); -function myFunction2(callback: (err : Error, result : any) => void ) : void { +function myFunction2(callback: (err?: Error, result?: any) => void ) : void { console.log(`async.timeout 2`); - return callback(null, { bar: 'bar' }); + return callback(undefined, { bar: 'bar' }); } var wrapped2 = async.timeout(myFunction2, 1000); @@ -827,9 +827,9 @@ wrapped2( function(err : Error, data : any) { console.log(`async.timeout 2 end ${data}`); }); -function myFunction3(callback: (err : Error, result : any) => void ) : void { +function myFunction3(callback: (err?: Error, result?: any) => void ) : void { console.log(`async.timeout 3`); - return callback(null, { bar: 'bar' }); + return callback(undefined, { bar: 'bar' }); } var wrapped3 = async.timeout(myFunction3, 1000, { bar: 'bar' }); diff --git a/types/async/tsconfig.json b/types/async/tsconfig.json new file mode 100644 index 0000000000..46ac98ea58 --- /dev/null +++ b/types/async/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/index.ts", + "test/explicit.ts", + "test/es6-generators.ts" + ] +} diff --git a/asyncblock/asyncblock-tests.ts b/types/asyncblock/asyncblock-tests.ts similarity index 100% rename from asyncblock/asyncblock-tests.ts rename to types/asyncblock/asyncblock-tests.ts diff --git a/asyncblock/index.d.ts b/types/asyncblock/index.d.ts similarity index 100% rename from asyncblock/index.d.ts rename to types/asyncblock/index.d.ts diff --git a/asyncblock/tsconfig.json b/types/asyncblock/tsconfig.json similarity index 100% rename from asyncblock/tsconfig.json rename to types/asyncblock/tsconfig.json diff --git a/atmosphere/atmosphere-tests.ts b/types/atmosphere/atmosphere-tests.ts similarity index 100% rename from atmosphere/atmosphere-tests.ts rename to types/atmosphere/atmosphere-tests.ts diff --git a/atmosphere/index.d.ts b/types/atmosphere/index.d.ts similarity index 100% rename from atmosphere/index.d.ts rename to types/atmosphere/index.d.ts diff --git a/atmosphere/tsconfig.json b/types/atmosphere/tsconfig.json similarity index 100% rename from atmosphere/tsconfig.json rename to types/atmosphere/tsconfig.json diff --git a/atom-keymap/.editorconfig b/types/atom-keymap/.editorconfig similarity index 100% rename from atom-keymap/.editorconfig rename to types/atom-keymap/.editorconfig diff --git a/atom-keymap/atom-keymap-tests.ts b/types/atom-keymap/atom-keymap-tests.ts similarity index 100% rename from atom-keymap/atom-keymap-tests.ts rename to types/atom-keymap/atom-keymap-tests.ts diff --git a/atom-keymap/index.d.ts b/types/atom-keymap/index.d.ts similarity index 100% rename from atom-keymap/index.d.ts rename to types/atom-keymap/index.d.ts diff --git a/atom-keymap/tsconfig.json b/types/atom-keymap/tsconfig.json similarity index 100% rename from atom-keymap/tsconfig.json rename to types/atom-keymap/tsconfig.json diff --git a/atom/api-docs.d.ts b/types/atom/api-docs.d.ts similarity index 100% rename from atom/api-docs.d.ts rename to types/atom/api-docs.d.ts diff --git a/atom/atom-tests.ts b/types/atom/atom-tests.ts similarity index 97% rename from atom/atom-tests.ts rename to types/atom/atom-tests.ts index 37b2fb314c..1b141fb492 100644 --- a/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1,5 +1,4 @@ /// -/// import path = require("path"); import _atom = require("atom"); diff --git a/atom/index.d.ts b/types/atom/index.d.ts similarity index 99% rename from atom/index.d.ts rename to types/atom/index.d.ts index 7c984bd812..05c9794eec 100644 --- a/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -3,7 +3,6 @@ // Definitions by: vvakame // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// /// /// @@ -1519,6 +1518,7 @@ declare var atom:AtomCore.IAtom; declare module "atom" { import spacePen = require("space-pen"); + import Q = require("q"); var $:typeof spacePen.$; var $$:typeof spacePen.$$; diff --git a/atom/tsconfig.json b/types/atom/tsconfig.json similarity index 89% rename from atom/tsconfig.json rename to types/atom/tsconfig.json index 3bb8fe9761..6c1bb13aef 100644 --- a/atom/tsconfig.json +++ b/types/atom/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/atpl/atpl-tests.ts b/types/atpl/atpl-tests.ts similarity index 100% rename from atpl/atpl-tests.ts rename to types/atpl/atpl-tests.ts diff --git a/atpl/index.d.ts b/types/atpl/index.d.ts similarity index 100% rename from atpl/index.d.ts rename to types/atpl/index.d.ts diff --git a/atpl/tsconfig.json b/types/atpl/tsconfig.json similarity index 100% rename from atpl/tsconfig.json rename to types/atpl/tsconfig.json diff --git a/types/aurelia-knockout/aurelia-knockout-tests.ts b/types/aurelia-knockout/aurelia-knockout-tests.ts new file mode 100644 index 0000000000..cf769d0dc2 --- /dev/null +++ b/types/aurelia-knockout/aurelia-knockout-tests.ts @@ -0,0 +1,9 @@ +export class ViewModel { + constructor(private knockoutBindable: KnockoutBindable) { + } + + activate(settings: any): void { + this.knockoutBindable.applyBindableValues(settings, this); + this.knockoutBindable.applyBindableValues(settings, this, true); + } +} diff --git a/types/aurelia-knockout/index.d.ts b/types/aurelia-knockout/index.d.ts new file mode 100644 index 0000000000..6f04567a5f --- /dev/null +++ b/types/aurelia-knockout/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for aurelia-knockout 2.0 +// Project: https://github.com/code-chris/aurelia-knockout +// Definitions by: Christian Kotzbauer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface KnockoutBindable { + /** + * Applys all values from a data object (usually the activation data) to the corresponding instance fields + * in the current view model if they are marked as @bindable. By default all matching values from the data object + * are applied. To only apply observable values set the last parameter to `true`. Subscriptions are created + * for all Knockout observables in the data object to update the view-model values respectively. + * + * @param data - the data object + * @param target - the target view model + * @param applyOnlyObservables - `true` if only observable values should be applied, false by default. + */ + applyBindableValues(data: any, target: any, applyOnlyObservables?: boolean): void; +} diff --git a/firebase-client/tsconfig.json b/types/aurelia-knockout/tsconfig.json similarity index 92% rename from firebase-client/tsconfig.json rename to types/aurelia-knockout/tsconfig.json index fdb35ab929..aa45dc1157 100644 --- a/firebase-client/tsconfig.json +++ b/types/aurelia-knockout/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "firebase-client-tests.ts" + "aurelia-knockout-tests.ts" ] -} \ No newline at end of file +} diff --git a/autoprefixer/tslint.json b/types/aurelia-knockout/tslint.json similarity index 100% rename from autoprefixer/tslint.json rename to types/aurelia-knockout/tslint.json diff --git a/auth0-angular/auth0-angular-tests.ts b/types/auth0-angular/auth0-angular-tests.ts similarity index 100% rename from auth0-angular/auth0-angular-tests.ts rename to types/auth0-angular/auth0-angular-tests.ts diff --git a/auth0-angular/index.d.ts b/types/auth0-angular/index.d.ts similarity index 100% rename from auth0-angular/index.d.ts rename to types/auth0-angular/index.d.ts diff --git a/auth0-angular/tsconfig.json b/types/auth0-angular/tsconfig.json similarity index 100% rename from auth0-angular/tsconfig.json rename to types/auth0-angular/tsconfig.json diff --git a/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts similarity index 100% rename from auth0-js/auth0-js-tests.ts rename to types/auth0-js/auth0-js-tests.ts diff --git a/auth0-js/index.d.ts b/types/auth0-js/index.d.ts similarity index 100% rename from auth0-js/index.d.ts rename to types/auth0-js/index.d.ts diff --git a/auth0-js/tsconfig.json b/types/auth0-js/tsconfig.json similarity index 100% rename from auth0-js/tsconfig.json rename to types/auth0-js/tsconfig.json diff --git a/auth0-js/v7/auth0-js-tests.ts b/types/auth0-js/v7/auth0-js-tests.ts similarity index 100% rename from auth0-js/v7/auth0-js-tests.ts rename to types/auth0-js/v7/auth0-js-tests.ts diff --git a/auth0-js/v7/index.d.ts b/types/auth0-js/v7/index.d.ts similarity index 100% rename from auth0-js/v7/index.d.ts rename to types/auth0-js/v7/index.d.ts diff --git a/auth0-js/v7/tsconfig.json b/types/auth0-js/v7/tsconfig.json similarity index 100% rename from auth0-js/v7/tsconfig.json rename to types/auth0-js/v7/tsconfig.json diff --git a/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts similarity index 100% rename from auth0-lock/auth0-lock-tests.ts rename to types/auth0-lock/auth0-lock-tests.ts diff --git a/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts similarity index 100% rename from auth0-lock/index.d.ts rename to types/auth0-lock/index.d.ts diff --git a/auth0-lock/package.json b/types/auth0-lock/package.json similarity index 100% rename from auth0-lock/package.json rename to types/auth0-lock/package.json diff --git a/auth0-lock/tsconfig.json b/types/auth0-lock/tsconfig.json similarity index 100% rename from auth0-lock/tsconfig.json rename to types/auth0-lock/tsconfig.json diff --git a/auth0.widget/auth0.widget-tests.ts b/types/auth0.widget/auth0.widget-tests.ts similarity index 100% rename from auth0.widget/auth0.widget-tests.ts rename to types/auth0.widget/auth0.widget-tests.ts diff --git a/auth0.widget/index.d.ts b/types/auth0.widget/index.d.ts similarity index 100% rename from auth0.widget/index.d.ts rename to types/auth0.widget/index.d.ts diff --git a/auth0.widget/package.json b/types/auth0.widget/package.json similarity index 100% rename from auth0.widget/package.json rename to types/auth0.widget/package.json diff --git a/auth0.widget/tsconfig.json b/types/auth0.widget/tsconfig.json similarity index 100% rename from auth0.widget/tsconfig.json rename to types/auth0.widget/tsconfig.json diff --git a/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts similarity index 98% rename from auth0/auth0-tests.ts rename to types/auth0/auth0-tests.ts index 502a72eec1..24a4aad87d 100644 --- a/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -1,5 +1,3 @@ -/// - import * as auth0 from 'auth0'; const management = new auth0.ManagementClient({ diff --git a/auth0/index.d.ts b/types/auth0/index.d.ts similarity index 100% rename from auth0/index.d.ts rename to types/auth0/index.d.ts diff --git a/auth0/tsconfig.json b/types/auth0/tsconfig.json similarity index 100% rename from auth0/tsconfig.json rename to types/auth0/tsconfig.json diff --git a/auto-launch/auto-launch-tests.ts b/types/auto-launch/auto-launch-tests.ts similarity index 100% rename from auto-launch/auto-launch-tests.ts rename to types/auto-launch/auto-launch-tests.ts diff --git a/auto-launch/index.d.ts b/types/auto-launch/index.d.ts similarity index 100% rename from auto-launch/index.d.ts rename to types/auto-launch/index.d.ts diff --git a/auto-launch/tsconfig.json b/types/auto-launch/tsconfig.json similarity index 100% rename from auto-launch/tsconfig.json rename to types/auto-launch/tsconfig.json diff --git a/autobahn/autobahn-tests.ts b/types/autobahn/autobahn-tests.ts similarity index 92% rename from autobahn/autobahn-tests.ts rename to types/autobahn/autobahn-tests.ts index 141a43547e..d753e960fe 100644 --- a/autobahn/autobahn-tests.ts +++ b/types/autobahn/autobahn-tests.ts @@ -34,7 +34,7 @@ function test_client() { session.publish('com.myapp.hello', ['Hello, world!']); // 3) register a procedure for remoting - session.register('com.myapp.add2', myInstance.add2); + session.register('com.myapp.add2', myInstance.add2, { invoke: 'roundrobin' }); // 4) call a remote procedure session.call('com.myapp.add2', [2, 3]).then( diff --git a/autobahn/index.d.ts b/types/autobahn/index.d.ts similarity index 98% rename from autobahn/index.d.ts rename to types/autobahn/index.d.ts index e93d3c065f..8a37bdf21b 100644 --- a/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for AutobahnJS v0.9.6 +// Type definitions for AutobahnJS v0.9.7 // Project: http://autobahn.ws/js/ // Definitions by: Elad Zelingher , Andy Hawkins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -177,6 +177,7 @@ declare namespace autobahn { interface IRegisterOptions { disclose_caller?: boolean; + invoke?: 'single' | 'roundrobin' | 'random' | 'first' | 'last'; } export class Connection { diff --git a/autobahn/tsconfig.json b/types/autobahn/tsconfig.json similarity index 100% rename from autobahn/tsconfig.json rename to types/autobahn/tsconfig.json diff --git a/autobind-decorator/autobind-decorator-tests.ts b/types/autobind-decorator/autobind-decorator-tests.ts similarity index 100% rename from autobind-decorator/autobind-decorator-tests.ts rename to types/autobind-decorator/autobind-decorator-tests.ts diff --git a/autobind-decorator/index.d.ts b/types/autobind-decorator/index.d.ts similarity index 100% rename from autobind-decorator/index.d.ts rename to types/autobind-decorator/index.d.ts diff --git a/autobind-decorator/tsconfig.json b/types/autobind-decorator/tsconfig.json similarity index 100% rename from autobind-decorator/tsconfig.json rename to types/autobind-decorator/tsconfig.json diff --git a/autolinker/autolinker-tests.ts b/types/autolinker/autolinker-tests.ts similarity index 100% rename from autolinker/autolinker-tests.ts rename to types/autolinker/autolinker-tests.ts diff --git a/autolinker/index.d.ts b/types/autolinker/index.d.ts similarity index 100% rename from autolinker/index.d.ts rename to types/autolinker/index.d.ts diff --git a/autolinker/tsconfig.json b/types/autolinker/tsconfig.json similarity index 100% rename from autolinker/tsconfig.json rename to types/autolinker/tsconfig.json diff --git a/autoprefixer-core/autoprefixer-core-tests.ts b/types/autoprefixer-core/autoprefixer-core-tests.ts similarity index 100% rename from autoprefixer-core/autoprefixer-core-tests.ts rename to types/autoprefixer-core/autoprefixer-core-tests.ts diff --git a/autoprefixer-core/index.d.ts b/types/autoprefixer-core/index.d.ts similarity index 100% rename from autoprefixer-core/index.d.ts rename to types/autoprefixer-core/index.d.ts diff --git a/autoprefixer-core/tsconfig.json b/types/autoprefixer-core/tsconfig.json similarity index 100% rename from autoprefixer-core/tsconfig.json rename to types/autoprefixer-core/tsconfig.json diff --git a/autoprefixer/autoprefixer-tests.ts b/types/autoprefixer/autoprefixer-tests.ts similarity index 100% rename from autoprefixer/autoprefixer-tests.ts rename to types/autoprefixer/autoprefixer-tests.ts diff --git a/autoprefixer/index.d.ts b/types/autoprefixer/index.d.ts similarity index 82% rename from autoprefixer/index.d.ts rename to types/autoprefixer/index.d.ts index 0a01c34d9a..b5249746d1 100644 --- a/autoprefixer/index.d.ts +++ b/types/autoprefixer/index.d.ts @@ -6,8 +6,7 @@ import { Plugin, Transformer as PostcssTransformer } from 'postcss'; declare namespace autoprefixer { - - export interface Options { + interface Options { browsers?: string[]; env?: string; cascade?: boolean; @@ -19,11 +18,11 @@ declare namespace autoprefixer { stats?: any; } - export interface Transformer extends PostcssTransformer { + interface Transformer extends PostcssTransformer { info(): string; } - export interface Autoprefixer extends Plugin { + interface Autoprefixer extends Plugin { (opts?: Options): Transformer; } } diff --git a/autoprefixer/package.json b/types/autoprefixer/package.json similarity index 100% rename from autoprefixer/package.json rename to types/autoprefixer/package.json diff --git a/autoprefixer/tsconfig.json b/types/autoprefixer/tsconfig.json similarity index 100% rename from autoprefixer/tsconfig.json rename to types/autoprefixer/tsconfig.json diff --git a/babel-code-frame/tslint.json b/types/autoprefixer/tslint.json similarity index 100% rename from babel-code-frame/tslint.json rename to types/autoprefixer/tslint.json diff --git a/autosize/autosize-tests.ts b/types/autosize/autosize-tests.ts similarity index 95% rename from autosize/autosize-tests.ts rename to types/autosize/autosize-tests.ts index a7eea57a62..fa0988be24 100644 --- a/autosize/autosize-tests.ts +++ b/types/autosize/autosize-tests.ts @@ -1,5 +1,3 @@ -/// - // from a NodeList autosize(document.querySelectorAll('textarea')); diff --git a/autosize/index.d.ts b/types/autosize/index.d.ts similarity index 100% rename from autosize/index.d.ts rename to types/autosize/index.d.ts diff --git a/autosize/tsconfig.json b/types/autosize/tsconfig.json similarity index 100% rename from autosize/tsconfig.json rename to types/autosize/tsconfig.json diff --git a/avoscloud-sdk/avoscloud-sdk-tests.ts b/types/avoscloud-sdk/avoscloud-sdk-tests.ts similarity index 100% rename from avoscloud-sdk/avoscloud-sdk-tests.ts rename to types/avoscloud-sdk/avoscloud-sdk-tests.ts diff --git a/avoscloud-sdk/index.d.ts b/types/avoscloud-sdk/index.d.ts similarity index 100% rename from avoscloud-sdk/index.d.ts rename to types/avoscloud-sdk/index.d.ts diff --git a/avoscloud-sdk/tsconfig.json b/types/avoscloud-sdk/tsconfig.json similarity index 100% rename from avoscloud-sdk/tsconfig.json rename to types/avoscloud-sdk/tsconfig.json diff --git a/types/awesomplete/awesomplete-tests.ts b/types/awesomplete/awesomplete-tests.ts new file mode 100644 index 0000000000..5a33aeb135 --- /dev/null +++ b/types/awesomplete/awesomplete-tests.ts @@ -0,0 +1,60 @@ +import * as Awesomplete from 'awesomplete'; + +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: (text: string, input: string) => { + return input.slice(0, input.indexOf("@")) + "@" + text; + }, + filter: Awesomplete.FILTER_STARTSWITH +}); + +new Awesomplete('input[data-multiple]', { + filter: (text: string, input: any) => { + return Awesomplete.FILTER_CONTAINS(text, input.match(/[^,]*$/)[0]); + }, + + replace: (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 = () => { + var list = JSON.parse(ajax.responseText).map((i: any) => i.name); + new Awesomplete(document.querySelector("#ajax-example input"), { list }); +}; +ajax.send(); diff --git a/types/awesomplete/index.d.ts b/types/awesomplete/index.d.ts new file mode 100644 index 0000000000..41abc36be6 --- /dev/null +++ b/types/awesomplete/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for Awesomplete 1.1 +// Project: https://leaverou.github.io/awesomplete/ +// Definitions by: webbiesdk , Ben Dixon , Trevor Bekolay +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Awesomplete { + constructor(input: Element | HTMLElement | string, o?: Awesomplete.Options); + static all: any[]; + 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: (left: number | any[], right: number | any[]) => number; + static REPLACE: (text: string) => void; + static DATA: (item: Awesomplete.Suggestion) => Awesomplete.Suggestion; + next: () => void; + container: HTMLElement; + select: (selected?: HTMLElement, originalTarget?: HTMLElement) => void; + previous: () => void; + index: number; + opened: number; + list: string | Element | Awesomplete.Suggestion[]; + input: HTMLElement | string; + goto: (i: number) => void; + ul: HTMLElement; + close: () => void; + evaluate: () => void; + selected: boolean; + open: () => void; + status: HTMLElement; +} + +declare namespace Awesomplete { + type Suggestion = string | {label: string | any, value: string | any} | [string, string]; + + interface Options { + list?: string | string[] | Element | Array<{ label: string, value: any }> | Array<[string, string]>; + minChars?: number; + maxItems?: number; + autoFirst?: boolean; + data?: (item: Suggestion, input: string) => string; + filter?: (text: string, input: string) => boolean; + sort?: (left: number | any[], right: number | any[]) => number; + item?: (text: string, input: string) => HTMLElement; + replace?: (text: string) => void; + } +} + +export = Awesomplete; +export as namespace Awesomplete; diff --git a/awesomplete/tsconfig.json b/types/awesomplete/tsconfig.json similarity index 100% rename from awesomplete/tsconfig.json rename to types/awesomplete/tsconfig.json diff --git a/base-64/tslint.json b/types/awesomplete/tslint.json similarity index 100% rename from base-64/tslint.json rename to types/awesomplete/tslint.json diff --git a/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts b/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts similarity index 100% rename from aws-iot-device-sdk/aws-iot-device-sdk-tests.ts rename to types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts diff --git a/aws-iot-device-sdk/index.d.ts b/types/aws-iot-device-sdk/index.d.ts similarity index 100% rename from aws-iot-device-sdk/index.d.ts rename to types/aws-iot-device-sdk/index.d.ts diff --git a/aws-iot-device-sdk/tsconfig.json b/types/aws-iot-device-sdk/tsconfig.json similarity index 100% rename from aws-iot-device-sdk/tsconfig.json rename to types/aws-iot-device-sdk/tsconfig.json diff --git a/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts similarity index 63% rename from aws-lambda/aws-lambda-tests.ts rename to types/aws-lambda/aws-lambda-tests.ts index fb09beda8a..3aede36d4c 100644 --- a/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -1,5 +1,3 @@ -/// - var str: string = "any string"; var date: Date = new Date(); var anyObj: any = { abc: 123 }; @@ -13,6 +11,51 @@ var clientContextClient: AWSLambda.ClientContextClient; var context: AWSLambda.Context; var identity: AWSLambda.CognitoIdentity; var proxyResult: AWSLambda.ProxyResult; +var snsEvt: AWSLambda.SNSEvent; +var snsEvtRecs: AWSLambda.SNSEventRecord[]; +var snsEvtRec: AWSLambda.SNSEventRecord; +var snsMsg: AWSLambda.SNSMessage; +var snsMsgAttr: AWSLambda.SNSMessageAttribute; +var snsMsgAttrs: AWSLambda.SNSMessageAttributes; +var S3CreateEvent: AWSLambda.S3CreateEvent = { + Records: [{ + eventVersion: 'string', + eventSource: 'string', + awsRegion: 'string', + eventTime: 'string', + eventName: 'string', + userIdentity: { + principalId: 'string' + }, + requestParameters: { + sourceIPAddress: 'string' + }, + responseElements: { + 'x-amz-request-id': 'string', + 'x-amz-id-2': 'string' + }, + s3: { + s3SchemaVersion: 'string', + configurationId: 'string', + bucket: { + name: 'string', + ownerIdentity: { + principalId: 'string' + }, + arn: 'string' + }, + object: { + key: 'string', + size: 1, + eTag: 'string', + versionId: 'string', + sequencer: 'string' + } + } + } + ] +}; + /* API Gateway Event */ str = apiGwEvt.body; @@ -44,10 +87,37 @@ str = apiGwEvt.requestContext.resourceId; str = apiGwEvt.requestContext.resourcePath; str = apiGwEvt.resource; +/* SNS Event */ +snsEvtRecs = snsEvt.Records; + +str = snsEvtRec.EventSource; +str = snsEvtRec.EventSubscriptionArn; +str = snsEvtRec.EventVersion; +snsMsg = snsEvtRec.Sns; + +str = snsMsg.SignatureVersion; +str = snsMsg.Timestamp; +str = snsMsg.Signature; +str = snsMsg.SigningCertUrl; +str = snsMsg.MessageId; +str = snsMsg.Message; +snsMsgAttrs = snsMsg.MessageAttributes; +str = snsMsg.Type; +str = snsMsg.UnsubscribeUrl; +str = snsMsg.TopicArn; +str = snsMsg.Subject; + +snsMsgAttrs["example"] = snsMsgAttr; + +str = snsMsgAttr.Type; +str = snsMsgAttr.Value; + /* Lambda Proxy Result */ num = proxyResult.statusCode; -str = proxyResult.headers["example"]; -str = proxyResult.body +proxyResult.headers["example"] = str; +proxyResult.headers["example"] = b; +proxyResult.headers["example"] = num; +str = proxyResult.body; /* Context */ b = context.callbackWaitsForEmptyEventLoop; @@ -111,5 +181,5 @@ 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) => {}; +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/types/aws-lambda/index.d.ts similarity index 68% rename from aws-lambda/index.d.ts rename to types/aws-lambda/index.d.ts index e8b70db7bd..c5e49d54c6 100644 --- a/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -1,6 +1,6 @@ // 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 by: James Darbyshire , Michael Skarum , Stef Heyenrath , Toby Hede , Rich Buggy , Simon Ramsay // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // API Gateway "event" @@ -39,6 +39,84 @@ interface APIGatewayEvent { resource: string; } +// SNS "event" +interface SNSMessageAttribute { + Type: string; + Value: string; +} + +interface SNSMessageAttributes { + [name: string]: SNSMessageAttribute; +} + +interface SNSMessage { + SignatureVersion: string; + Timestamp: string; + Signature: string; + SigningCertUrl: string; + MessageId: string; + Message: string; + MessageAttributes: SNSMessageAttributes; + Type: string; + UnsubscribeUrl: string; + TopicArn: string; + Subject: string; +} + +interface SNSEventRecord { + EventVersion: string; + EventSubscriptionArn: string; + EventSource: string; + Sns: SNSMessage; +} + +interface SNSEvent { + Records: Array; +} + +/** + * S3Create event + * https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html + */ +interface S3CreateEvent { + Records: [{ + eventVersion: string; + eventSource: string; + awsRegion: string + eventTime: string; + eventName: string; + userIdentity: { + principalId: string; + }, + requestParameters: { + sourceIPAddress: string; + }, + responseElements: { + 'x-amz-request-id': string; + 'x-amz-id-2': string; + }, + s3: { + s3SchemaVersion: string; + configurationId: string; + bucket: { + name: string; + ownerIdentity: { + principalId: string; + }, + arn: string; + }, + object: { + key: string; + size: number; + eTag: string; + versionId: string; + sequencer: string; + } + } + } + ]; +} + // Context // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html interface Context { @@ -97,7 +175,7 @@ interface ClientContextEnv { interface ProxyResult { statusCode: number; headers?: { - [header: string]: string; + [header: string]: boolean | number | string; }, body: string; } @@ -110,8 +188,8 @@ interface ProxyResult { * @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; +export type Handler = (event: any, context: Context, callback?: Callback) => void; +export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void; /** * Optional callback parameter. diff --git a/aws-lambda/tsconfig.json b/types/aws-lambda/tsconfig.json similarity index 100% rename from aws-lambda/tsconfig.json rename to types/aws-lambda/tsconfig.json diff --git a/aws-sdk/aws-sdk-tests.ts b/types/aws-sdk/aws-sdk-tests.ts similarity index 100% rename from aws-sdk/aws-sdk-tests.ts rename to types/aws-sdk/aws-sdk-tests.ts diff --git a/aws-sdk/index.d.ts b/types/aws-sdk/index.d.ts similarity index 100% rename from aws-sdk/index.d.ts rename to types/aws-sdk/index.d.ts diff --git a/aws-sdk/tsconfig.json b/types/aws-sdk/tsconfig.json similarity index 100% rename from aws-sdk/tsconfig.json rename to types/aws-sdk/tsconfig.json diff --git a/aws-serverless-express/aws-serverless-express-tests.ts b/types/aws-serverless-express/aws-serverless-express-tests.ts similarity index 88% rename from aws-serverless-express/aws-serverless-express-tests.ts rename to types/aws-serverless-express/aws-serverless-express-tests.ts index c46056ed25..97d236e043 100644 --- a/aws-serverless-express/aws-serverless-express-tests.ts +++ b/types/aws-serverless-express/aws-serverless-express-tests.ts @@ -1,9 +1,10 @@ -/// - import * as awsServerlessExpress from 'aws-serverless-express'; import * as express from 'express'; +import { eventContext } from 'aws-serverless-express/middleware'; const app = express(); +app.use(eventContext()); + const server = awsServerlessExpress.createServer(app, () => {}); const mockEvent = { diff --git a/aws-serverless-express/index.d.ts b/types/aws-serverless-express/index.d.ts similarity index 84% rename from aws-serverless-express/index.d.ts rename to types/aws-serverless-express/index.d.ts index e4601e6ccd..db49e6ca6b 100644 --- a/aws-serverless-express/index.d.ts +++ b/types/aws-serverless-express/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for aws-serverless-express +// Type definitions for aws-serverless-express 2.1 // Project: https://github.com/awslabs/aws-serverless-express -// Definitions by: Ben Speakman +// Definitions by: Ben Speakman , Josh Caffey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -16,4 +16,4 @@ export function proxy( server: http.Server, event: any, context: lambda.Context -): void; \ No newline at end of file +): void; diff --git a/types/aws-serverless-express/middleware.d.ts b/types/aws-serverless-express/middleware.d.ts new file mode 100644 index 0000000000..ff33b4c6ea --- /dev/null +++ b/types/aws-serverless-express/middleware.d.ts @@ -0,0 +1,8 @@ +import { RequestHandler } from 'express'; + +export interface Options { + reqPropKey?: string; + deleteHeaders?: boolean; +} + +export function eventContext(options?: Options): RequestHandler; diff --git a/aws-serverless-express/tsconfig.json b/types/aws-serverless-express/tsconfig.json similarity index 94% rename from aws-serverless-express/tsconfig.json rename to types/aws-serverless-express/tsconfig.json index a62cead1a1..62885fcda3 100644 --- a/aws-serverless-express/tsconfig.json +++ b/types/aws-serverless-express/tsconfig.json @@ -17,6 +17,7 @@ }, "files": [ "index.d.ts", + "middleware.d.ts", "aws-serverless-express-tests.ts" ] -} \ No newline at end of file +} diff --git a/base64-js/tslint.json b/types/aws-serverless-express/tslint.json similarity index 100% rename from base64-js/tslint.json rename to types/aws-serverless-express/tslint.json diff --git a/aws4/aws4-tests.ts b/types/aws4/aws4-tests.ts similarity index 100% rename from aws4/aws4-tests.ts rename to types/aws4/aws4-tests.ts diff --git a/aws4/index.d.ts b/types/aws4/index.d.ts similarity index 100% rename from aws4/index.d.ts rename to types/aws4/index.d.ts diff --git a/aws4/tsconfig.json b/types/aws4/tsconfig.json similarity index 100% rename from aws4/tsconfig.json rename to types/aws4/tsconfig.json diff --git a/axe-core/axe-core-tests.ts b/types/axe-core/axe-core-tests.ts similarity index 100% rename from axe-core/axe-core-tests.ts rename to types/axe-core/axe-core-tests.ts diff --git a/axe-core/index.d.ts b/types/axe-core/index.d.ts similarity index 100% rename from axe-core/index.d.ts rename to types/axe-core/index.d.ts diff --git a/axe-core/tsconfig.json b/types/axe-core/tsconfig.json similarity index 100% rename from axe-core/tsconfig.json rename to types/axe-core/tsconfig.json diff --git a/types/axel/axel-tests.ts b/types/axel/axel-tests.ts new file mode 100644 index 0000000000..553973b210 --- /dev/null +++ b/types/axel/axel-tests.ts @@ -0,0 +1,7 @@ + +import * as axel from 'axel'; + +axel.clear(); +axel.bg(0,255,0); +axel.line(1,1,10,10); +axel.cursor.restore(); diff --git a/types/axel/index.d.ts b/types/axel/index.d.ts new file mode 100644 index 0000000000..751e2c33fa --- /dev/null +++ b/types/axel/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Axel module +// Project: https://github.com/F1LT3R/axel +// Definitions by: Ruslan Molodyko +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Axel { + brush: string; + rows: number; + cols: number; + cursor: cursorInterface; + + lerp(p1: number, p2: number, m: number): number; + circ(x: number, y: number, m: number): number; + goto(x: number, y: number): void; + scrub(x1: number, y1: number, w: number, h: number): void; + box(x1: number, y1: number, w: number, h: number): void; + point(x: number, y: number, char: string): void; + dist(x1: number, y1: number, x2: number, y2: number): number; + line(x1: number, y1: number, x2: number, y2: number): void; + text(x: number, y: number, text: string): void; + fg(r: number, g: number, b: number): void; + bg(r: number, g: number, b: number): void; + draw(cb: Function): void; + clear(): void; +} + +declare interface cursorInterface { + on(): void; + off(): void; + reset(): void; + restore(): void; +} + +declare module 'axel' { + const instance: Axel; + export = instance; +} diff --git a/types/axel/tsconfig.json b/types/axel/tsconfig.json new file mode 100644 index 0000000000..0ac3689676 --- /dev/null +++ b/types/axel/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": [ + "axel-tests.ts", + "index.d.ts" + ] +} \ No newline at end of file diff --git a/azure-mobile-apps/azure-mobile-apps-tests.ts b/types/azure-mobile-apps/azure-mobile-apps-tests.ts similarity index 100% rename from azure-mobile-apps/azure-mobile-apps-tests.ts rename to types/azure-mobile-apps/azure-mobile-apps-tests.ts diff --git a/azure-mobile-apps/index.d.ts b/types/azure-mobile-apps/index.d.ts similarity index 100% rename from azure-mobile-apps/index.d.ts rename to types/azure-mobile-apps/index.d.ts diff --git a/azure-mobile-apps/tsconfig.json b/types/azure-mobile-apps/tsconfig.json similarity index 100% rename from azure-mobile-apps/tsconfig.json rename to types/azure-mobile-apps/tsconfig.json diff --git a/azure-mobile-services-client/azure-mobile-services-client-tests.ts b/types/azure-mobile-services-client/azure-mobile-services-client-tests.ts similarity index 100% rename from azure-mobile-services-client/azure-mobile-services-client-tests.ts rename to types/azure-mobile-services-client/azure-mobile-services-client-tests.ts diff --git a/azure-mobile-services-client/index.d.ts b/types/azure-mobile-services-client/index.d.ts similarity index 100% rename from azure-mobile-services-client/index.d.ts rename to types/azure-mobile-services-client/index.d.ts diff --git a/azure-mobile-services-client/tsconfig.json b/types/azure-mobile-services-client/tsconfig.json similarity index 100% rename from azure-mobile-services-client/tsconfig.json rename to types/azure-mobile-services-client/tsconfig.json diff --git a/azure-sb/azure-sb-tests.ts b/types/azure-sb/azure-sb-tests.ts similarity index 100% rename from azure-sb/azure-sb-tests.ts rename to types/azure-sb/azure-sb-tests.ts diff --git a/azure-sb/index.d.ts b/types/azure-sb/index.d.ts similarity index 100% rename from azure-sb/index.d.ts rename to types/azure-sb/index.d.ts diff --git a/azure-sb/tsconfig.json b/types/azure-sb/tsconfig.json similarity index 100% rename from azure-sb/tsconfig.json rename to types/azure-sb/tsconfig.json diff --git a/azure/azure-tests.ts b/types/azure/azure-tests.ts similarity index 100% rename from azure/azure-tests.ts rename to types/azure/azure-tests.ts diff --git a/azure/index.d.ts b/types/azure/index.d.ts similarity index 100% rename from azure/index.d.ts rename to types/azure/index.d.ts diff --git a/azure/tsconfig.json b/types/azure/tsconfig.json similarity index 100% rename from azure/tsconfig.json rename to types/azure/tsconfig.json diff --git a/b_/b_-tests.ts b/types/b_/b_-tests.ts similarity index 100% rename from b_/b_-tests.ts rename to types/b_/b_-tests.ts diff --git a/b_/index.d.ts b/types/b_/index.d.ts similarity index 100% rename from b_/index.d.ts rename to types/b_/index.d.ts diff --git a/b_/tsconfig.json b/types/b_/tsconfig.json similarity index 100% rename from b_/tsconfig.json rename to types/b_/tsconfig.json diff --git a/b_/tslint.json b/types/b_/tslint.json similarity index 100% rename from b_/tslint.json rename to types/b_/tslint.json diff --git a/babel-code-frame/babel-code-frame-tests.ts b/types/babel-code-frame/babel-code-frame-tests.ts similarity index 100% rename from babel-code-frame/babel-code-frame-tests.ts rename to types/babel-code-frame/babel-code-frame-tests.ts diff --git a/babel-code-frame/index.d.ts b/types/babel-code-frame/index.d.ts similarity index 100% rename from babel-code-frame/index.d.ts rename to types/babel-code-frame/index.d.ts diff --git a/babel-code-frame/tsconfig.json b/types/babel-code-frame/tsconfig.json similarity index 100% rename from babel-code-frame/tsconfig.json rename to types/babel-code-frame/tsconfig.json diff --git a/bigi/tslint.json b/types/babel-code-frame/tslint.json similarity index 100% rename from bigi/tslint.json rename to types/babel-code-frame/tslint.json diff --git a/babel-core/babel-core-tests.ts b/types/babel-core/babel-core-tests.ts similarity index 100% rename from babel-core/babel-core-tests.ts rename to types/babel-core/babel-core-tests.ts diff --git a/babel-core/index.d.ts b/types/babel-core/index.d.ts similarity index 100% rename from babel-core/index.d.ts rename to types/babel-core/index.d.ts diff --git a/babel-core/tsconfig.json b/types/babel-core/tsconfig.json similarity index 100% rename from babel-core/tsconfig.json rename to types/babel-core/tsconfig.json diff --git a/babel-generator/babel-generator-tests.ts b/types/babel-generator/babel-generator-tests.ts similarity index 100% rename from babel-generator/babel-generator-tests.ts rename to types/babel-generator/babel-generator-tests.ts diff --git a/babel-generator/index.d.ts b/types/babel-generator/index.d.ts similarity index 100% rename from babel-generator/index.d.ts rename to types/babel-generator/index.d.ts diff --git a/babel-generator/tsconfig.json b/types/babel-generator/tsconfig.json similarity index 100% rename from babel-generator/tsconfig.json rename to types/babel-generator/tsconfig.json diff --git a/babel-template/babel-template-tests.ts b/types/babel-template/babel-template-tests.ts similarity index 92% rename from babel-template/babel-template-tests.ts rename to types/babel-template/babel-template-tests.ts index b5d4547188..31e3bd44d9 100644 --- a/babel-template/babel-template-tests.ts +++ b/types/babel-template/babel-template-tests.ts @@ -1,7 +1,4 @@ - /// -/// - // Example from https://github.com/babel/babel/tree/master/packages/babel-template import template = require('babel-template'); diff --git a/babel-template/index.d.ts b/types/babel-template/index.d.ts similarity index 100% rename from babel-template/index.d.ts rename to types/babel-template/index.d.ts diff --git a/babel-template/tsconfig.json b/types/babel-template/tsconfig.json similarity index 100% rename from babel-template/tsconfig.json rename to types/babel-template/tsconfig.json diff --git a/babel-traverse/babel-traverse-tests.ts b/types/babel-traverse/babel-traverse-tests.ts similarity index 98% rename from babel-traverse/babel-traverse-tests.ts rename to types/babel-traverse/babel-traverse-tests.ts index 3779852c5f..98afbbc0a7 100644 --- a/babel-traverse/babel-traverse-tests.ts +++ b/types/babel-traverse/babel-traverse-tests.ts @@ -1,5 +1,3 @@ - -/// /// diff --git a/babel-traverse/index.d.ts b/types/babel-traverse/index.d.ts similarity index 100% rename from babel-traverse/index.d.ts rename to types/babel-traverse/index.d.ts diff --git a/babel-traverse/tsconfig.json b/types/babel-traverse/tsconfig.json similarity index 100% rename from babel-traverse/tsconfig.json rename to types/babel-traverse/tsconfig.json diff --git a/babel-types/babel-types-tests.ts b/types/babel-types/babel-types-tests.ts similarity index 100% rename from babel-types/babel-types-tests.ts rename to types/babel-types/babel-types-tests.ts diff --git a/babel-types/index.d.ts b/types/babel-types/index.d.ts similarity index 100% rename from babel-types/index.d.ts rename to types/babel-types/index.d.ts diff --git a/babel-types/tsconfig.json b/types/babel-types/tsconfig.json similarity index 100% rename from babel-types/tsconfig.json rename to types/babel-types/tsconfig.json diff --git a/babelify/babelify-tests.ts b/types/babelify/babelify-tests.ts similarity index 100% rename from babelify/babelify-tests.ts rename to types/babelify/babelify-tests.ts diff --git a/babelify/index.d.ts b/types/babelify/index.d.ts similarity index 100% rename from babelify/index.d.ts rename to types/babelify/index.d.ts diff --git a/babelify/tsconfig.json b/types/babelify/tsconfig.json similarity index 100% rename from babelify/tsconfig.json rename to types/babelify/tsconfig.json diff --git a/babylon/babylon-tests.ts b/types/babylon/babylon-tests.ts similarity index 86% rename from babylon/babylon-tests.ts rename to types/babylon/babylon-tests.ts index bb95625935..769d635e89 100644 --- a/babylon/babylon-tests.ts +++ b/types/babylon/babylon-tests.ts @@ -1,8 +1,3 @@ - -/// -/// - - // Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babylon import * as babylon from "babylon"; declare function assert(expr: boolean): void; diff --git a/babylon/index.d.ts b/types/babylon/index.d.ts similarity index 100% rename from babylon/index.d.ts rename to types/babylon/index.d.ts diff --git a/babylon/tsconfig.json b/types/babylon/tsconfig.json similarity index 100% rename from babylon/tsconfig.json rename to types/babylon/tsconfig.json diff --git a/babylonjs/babylonjs-tests.ts b/types/babylonjs/babylonjs-tests.ts similarity index 100% rename from babylonjs/babylonjs-tests.ts rename to types/babylonjs/babylonjs-tests.ts diff --git a/babylonjs/index.d.ts b/types/babylonjs/index.d.ts similarity index 100% rename from babylonjs/index.d.ts rename to types/babylonjs/index.d.ts diff --git a/babylonjs/tsconfig.json b/types/babylonjs/tsconfig.json similarity index 100% rename from babylonjs/tsconfig.json rename to types/babylonjs/tsconfig.json diff --git a/babyparse/babyparse-tests.ts b/types/babyparse/babyparse-tests.ts similarity index 100% rename from babyparse/babyparse-tests.ts rename to types/babyparse/babyparse-tests.ts diff --git a/babyparse/index.d.ts b/types/babyparse/index.d.ts similarity index 100% rename from babyparse/index.d.ts rename to types/babyparse/index.d.ts diff --git a/babyparse/tsconfig.json b/types/babyparse/tsconfig.json similarity index 100% rename from babyparse/tsconfig.json rename to types/babyparse/tsconfig.json diff --git a/backbone-associations/backbone-associations-tests.ts b/types/backbone-associations/backbone-associations-tests.ts similarity index 100% rename from backbone-associations/backbone-associations-tests.ts rename to types/backbone-associations/backbone-associations-tests.ts diff --git a/backbone-associations/index.d.ts b/types/backbone-associations/index.d.ts similarity index 100% rename from backbone-associations/index.d.ts rename to types/backbone-associations/index.d.ts diff --git a/backbone-associations/tsconfig.json b/types/backbone-associations/tsconfig.json similarity index 100% rename from backbone-associations/tsconfig.json rename to types/backbone-associations/tsconfig.json diff --git a/backbone-fetch-cache/backbone-fetch-cache-tests.ts b/types/backbone-fetch-cache/backbone-fetch-cache-tests.ts similarity index 100% rename from backbone-fetch-cache/backbone-fetch-cache-tests.ts rename to types/backbone-fetch-cache/backbone-fetch-cache-tests.ts diff --git a/backbone-fetch-cache/index.d.ts b/types/backbone-fetch-cache/index.d.ts similarity index 100% rename from backbone-fetch-cache/index.d.ts rename to types/backbone-fetch-cache/index.d.ts diff --git a/backbone-fetch-cache/tsconfig.json b/types/backbone-fetch-cache/tsconfig.json similarity index 100% rename from backbone-fetch-cache/tsconfig.json rename to types/backbone-fetch-cache/tsconfig.json diff --git a/backbone-relational/backbone-relational-tests.ts b/types/backbone-relational/backbone-relational-tests.ts similarity index 100% rename from backbone-relational/backbone-relational-tests.ts rename to types/backbone-relational/backbone-relational-tests.ts diff --git a/backbone-relational/index.d.ts b/types/backbone-relational/index.d.ts similarity index 100% rename from backbone-relational/index.d.ts rename to types/backbone-relational/index.d.ts diff --git a/backbone-relational/tsconfig.json b/types/backbone-relational/tsconfig.json similarity index 100% rename from backbone-relational/tsconfig.json rename to types/backbone-relational/tsconfig.json diff --git a/backbone.layoutmanager/backbone.layoutmanager-tests.ts b/types/backbone.layoutmanager/backbone.layoutmanager-tests.ts similarity index 97% rename from backbone.layoutmanager/backbone.layoutmanager-tests.ts rename to types/backbone.layoutmanager/backbone.layoutmanager-tests.ts index fe11ce9b18..edddb8352b 100644 --- a/backbone.layoutmanager/backbone.layoutmanager-tests.ts +++ b/types/backbone.layoutmanager/backbone.layoutmanager-tests.ts @@ -1,5 +1,3 @@ -/// - import * as Backbone from 'backbone'; // Example code. @@ -26,7 +24,7 @@ class View extends Backbone.Layout { "mouseleave": "removeElement" } } - + wrapElement(): void { this.$el.wrap(""); } diff --git a/backbone.layoutmanager/index.d.ts b/types/backbone.layoutmanager/index.d.ts similarity index 100% rename from backbone.layoutmanager/index.d.ts rename to types/backbone.layoutmanager/index.d.ts diff --git a/backbone.layoutmanager/tsconfig.json b/types/backbone.layoutmanager/tsconfig.json similarity index 100% rename from backbone.layoutmanager/tsconfig.json rename to types/backbone.layoutmanager/tsconfig.json diff --git a/backbone.localstorage/backbone.localstorage-tests.ts b/types/backbone.localstorage/backbone.localstorage-tests.ts similarity index 100% rename from backbone.localstorage/backbone.localstorage-tests.ts rename to types/backbone.localstorage/backbone.localstorage-tests.ts diff --git a/backbone.localstorage/index.d.ts b/types/backbone.localstorage/index.d.ts similarity index 100% rename from backbone.localstorage/index.d.ts rename to types/backbone.localstorage/index.d.ts diff --git a/backbone.localstorage/tsconfig.json b/types/backbone.localstorage/tsconfig.json similarity index 100% rename from backbone.localstorage/tsconfig.json rename to types/backbone.localstorage/tsconfig.json diff --git a/backbone.marionette/backbone.marionette-tests.ts b/types/backbone.marionette/backbone.marionette-tests.ts similarity index 97% rename from backbone.marionette/backbone.marionette-tests.ts rename to types/backbone.marionette/backbone.marionette-tests.ts index b5eb9d07c6..2c1f5b68bd 100644 --- a/backbone.marionette/backbone.marionette-tests.ts +++ b/types/backbone.marionette/backbone.marionette-tests.ts @@ -66,11 +66,11 @@ namespace MarionetteTests { 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(); + let layout: Marionette.View = this.layoutView.destroy(); } } - class AppLayoutView extends Marionette.LayoutView { + class AppLayoutView extends Marionette.View { constructor() { super({ el: 'body' }); } @@ -111,7 +111,7 @@ namespace MarionetteTests { } - class MyView extends Marionette.ItemView { + class MyView extends Marionette.View { behaviors: any; constructor(model: MyModel) { @@ -189,7 +189,7 @@ namespace MarionetteTests { constructor() { super(); this.childView = MyView; - this.childEvents = { + this.childViewEvents = { render: function () { console.log("a childView has been rendered"); } diff --git a/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts similarity index 90% rename from backbone.marionette/index.d.ts rename to types/backbone.marionette/index.d.ts index edaab2c2d6..d24f9d64f9 100644 --- a/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as Backbone from 'backbone'; +import * as Radio from 'backbone.radio'; export as namespace Marionette; export = Marionette; @@ -22,8 +23,6 @@ declare module 'backbone' { 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) @@ -180,6 +179,27 @@ declare namespace Marionette { * backbone conventions and utilities like initialize and Backbone.Events. */ class Object extends Backbone.Events { + + /** + * Defines the Radio channel that will be used for the requests and/or events + */ + channelName: string; + + /** + * Returns a Radio.Channel instance using 'channelName' + */ + getChannel(): Backbone.Radio.Channel; + + /** + * Defines an events hash with the events to be listened and its respective handlers + */ + radioEvents: any; + + /** + * Defines an events hash with the requests to be replied and its respective handlers + */ + radioRequests: any; + /** * Initialize is called immediately after the Object has been instantiated, * and is invoked with the same arguments that the constructor received. @@ -750,7 +770,7 @@ declare namespace Marionette { /** * View implements a destroy method, which is called by the region managers automatically. As part of the implementation. */ - destroy(...args: any[]): void; + destroy(...args: any[]): View; /** * In several cases you need to access ui elements inside the view to @@ -772,12 +792,37 @@ declare namespace Marionette { 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. + * 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. */ - onShow(): void; + 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(): any; + + /** + * 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; /** * Triggered just after the view has been destroyed. @@ -814,49 +859,65 @@ declare namespace Marionette { 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. + * 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. */ - serializeData(): any; + regionClass: 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; + * 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; /** - * Triggered before an ItemView is rendered. + * Add multiple regions as a {name: definition, name2: def2} object literal. */ - onBeforeRender(): void; + addRegions(regions: any): any; + + /** Returns a region from the layout view */ + getRegion(name: string): Region; /** - * 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. + * Removes the region with the specified name. + * @param name the name of the region to remove. */ - onRender(): void; + 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; } @@ -928,12 +989,12 @@ declare namespace Marionette { childViewEventPrefix: string; /** - * You can specify a childEvents hash or method which allows you to - * capture all bubbling childEvents without having to manually set bindings. + * You can specify a childViewEvents hash or method which allows you to + * capture all bubbling childViewEvents 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; + childViewEvents: any; /** * When a collection has no children, and you need to render a view other than @@ -1034,37 +1095,9 @@ declare namespace Marionette { */ 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 @@ -1132,165 +1165,6 @@ declare namespace Marionette { 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. @@ -1437,7 +1311,7 @@ declare namespace Marionette { 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. diff --git a/backbone.marionette/tsconfig.json b/types/backbone.marionette/tsconfig.json similarity index 100% rename from backbone.marionette/tsconfig.json rename to types/backbone.marionette/tsconfig.json diff --git a/backbone.paginator/backbone.paginator-tests.ts b/types/backbone.paginator/backbone.paginator-tests.ts similarity index 100% rename from backbone.paginator/backbone.paginator-tests.ts rename to types/backbone.paginator/backbone.paginator-tests.ts diff --git a/backbone.paginator/index.d.ts b/types/backbone.paginator/index.d.ts similarity index 100% rename from backbone.paginator/index.d.ts rename to types/backbone.paginator/index.d.ts diff --git a/backbone.paginator/tsconfig.json b/types/backbone.paginator/tsconfig.json similarity index 100% rename from backbone.paginator/tsconfig.json rename to types/backbone.paginator/tsconfig.json diff --git a/backbone.radio/backbone.radio-tests.ts b/types/backbone.radio/backbone.radio-tests.ts similarity index 100% rename from backbone.radio/backbone.radio-tests.ts rename to types/backbone.radio/backbone.radio-tests.ts diff --git a/backbone.radio/index.d.ts b/types/backbone.radio/index.d.ts similarity index 100% rename from backbone.radio/index.d.ts rename to types/backbone.radio/index.d.ts diff --git a/backbone.radio/tsconfig.json b/types/backbone.radio/tsconfig.json similarity index 100% rename from backbone.radio/tsconfig.json rename to types/backbone.radio/tsconfig.json diff --git a/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts similarity index 99% rename from backbone/backbone-tests.ts rename to types/backbone/backbone-tests.ts index accdb93979..c074ac57e5 100644 --- a/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -1,5 +1,3 @@ -/// - function test_events() { var object = new Backbone.Events(); diff --git a/backbone/index.d.ts b/types/backbone/index.d.ts similarity index 100% rename from backbone/index.d.ts rename to types/backbone/index.d.ts diff --git a/backbone/tsconfig.json b/types/backbone/tsconfig.json similarity index 100% rename from backbone/tsconfig.json rename to types/backbone/tsconfig.json diff --git a/backgrid/backgrid-tests.ts b/types/backgrid/backgrid-tests.ts similarity index 100% rename from backgrid/backgrid-tests.ts rename to types/backgrid/backgrid-tests.ts diff --git a/backgrid/index.d.ts b/types/backgrid/index.d.ts similarity index 100% rename from backgrid/index.d.ts rename to types/backgrid/index.d.ts diff --git a/backgrid/tsconfig.json b/types/backgrid/tsconfig.json similarity index 100% rename from backgrid/tsconfig.json rename to types/backgrid/tsconfig.json diff --git a/backlog-js/backlog-js-tests.ts b/types/backlog-js/backlog-js-tests.ts similarity index 100% rename from backlog-js/backlog-js-tests.ts rename to types/backlog-js/backlog-js-tests.ts diff --git a/backlog-js/index.d.ts b/types/backlog-js/index.d.ts similarity index 100% rename from backlog-js/index.d.ts rename to types/backlog-js/index.d.ts diff --git a/backlog-js/tsconfig.json b/types/backlog-js/tsconfig.json similarity index 100% rename from backlog-js/tsconfig.json rename to types/backlog-js/tsconfig.json diff --git a/baconjs/.editorconfig b/types/baconjs/.editorconfig similarity index 100% rename from baconjs/.editorconfig rename to types/baconjs/.editorconfig diff --git a/baconjs/baconjs-tests.ts b/types/baconjs/baconjs-tests.ts similarity index 100% rename from baconjs/baconjs-tests.ts rename to types/baconjs/baconjs-tests.ts diff --git a/baconjs/index.d.ts b/types/baconjs/index.d.ts similarity index 100% rename from baconjs/index.d.ts rename to types/baconjs/index.d.ts diff --git a/baconjs/tsconfig.json b/types/baconjs/tsconfig.json similarity index 100% rename from baconjs/tsconfig.json rename to types/baconjs/tsconfig.json diff --git a/barcode/barcode-tests.ts b/types/barcode/barcode-tests.ts similarity index 100% rename from barcode/barcode-tests.ts rename to types/barcode/barcode-tests.ts diff --git a/barcode/index.d.ts b/types/barcode/index.d.ts similarity index 100% rename from barcode/index.d.ts rename to types/barcode/index.d.ts diff --git a/barcode/tsconfig.json b/types/barcode/tsconfig.json similarity index 100% rename from barcode/tsconfig.json rename to types/barcode/tsconfig.json diff --git a/bardjs/bardjs-tests.ts b/types/bardjs/bardjs-tests.ts similarity index 99% rename from bardjs/bardjs-tests.ts rename to types/bardjs/bardjs-tests.ts index 2d312634ca..91172b7255 100644 --- a/bardjs/bardjs-tests.ts +++ b/types/bardjs/bardjs-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as angular from 'angular'; import 'angular-mocks'; diff --git a/bardjs/index.d.ts b/types/bardjs/index.d.ts similarity index 100% rename from bardjs/index.d.ts rename to types/bardjs/index.d.ts diff --git a/bardjs/tsconfig.json b/types/bardjs/tsconfig.json similarity index 100% rename from bardjs/tsconfig.json rename to types/bardjs/tsconfig.json diff --git a/base-64/base-64-tests.ts b/types/base-64/base-64-tests.ts similarity index 100% rename from base-64/base-64-tests.ts rename to types/base-64/base-64-tests.ts diff --git a/base-64/index.d.ts b/types/base-64/index.d.ts similarity index 100% rename from base-64/index.d.ts rename to types/base-64/index.d.ts diff --git a/base-64/tsconfig.json b/types/base-64/tsconfig.json similarity index 100% rename from base-64/tsconfig.json rename to types/base-64/tsconfig.json diff --git a/bitcoinjs-lib/tslint.json b/types/base-64/tslint.json similarity index 100% rename from bitcoinjs-lib/tslint.json rename to types/base-64/tslint.json diff --git a/base-x/base-x-tests.ts b/types/base-x/base-x-tests.ts similarity index 100% rename from base-x/base-x-tests.ts rename to types/base-x/base-x-tests.ts diff --git a/base-x/index.d.ts b/types/base-x/index.d.ts similarity index 100% rename from base-x/index.d.ts rename to types/base-x/index.d.ts diff --git a/base-x/tsconfig.json b/types/base-x/tsconfig.json similarity index 100% rename from base-x/tsconfig.json rename to types/base-x/tsconfig.json diff --git a/base16/base16-tests.ts b/types/base16/base16-tests.ts similarity index 100% rename from base16/base16-tests.ts rename to types/base16/base16-tests.ts diff --git a/base16/index.d.ts b/types/base16/index.d.ts similarity index 100% rename from base16/index.d.ts rename to types/base16/index.d.ts diff --git a/base16/tsconfig.json b/types/base16/tsconfig.json similarity index 100% rename from base16/tsconfig.json rename to types/base16/tsconfig.json diff --git a/base64-js/base64-js-tests.ts b/types/base64-js/base64-js-tests.ts similarity index 100% rename from base64-js/base64-js-tests.ts rename to types/base64-js/base64-js-tests.ts diff --git a/base64-js/index.d.ts b/types/base64-js/index.d.ts similarity index 100% rename from base64-js/index.d.ts rename to types/base64-js/index.d.ts diff --git a/base64-js/tsconfig.json b/types/base64-js/tsconfig.json similarity index 100% rename from base64-js/tsconfig.json rename to types/base64-js/tsconfig.json diff --git a/blacklist/tslint.json b/types/base64-js/tslint.json similarity index 100% rename from blacklist/tslint.json rename to types/base64-js/tslint.json diff --git a/base64url/base64url-tests.ts b/types/base64url/base64url-tests.ts similarity index 100% rename from base64url/base64url-tests.ts rename to types/base64url/base64url-tests.ts diff --git a/base64url/index.d.ts b/types/base64url/index.d.ts similarity index 100% rename from base64url/index.d.ts rename to types/base64url/index.d.ts diff --git a/base64url/tsconfig.json b/types/base64url/tsconfig.json similarity index 100% rename from base64url/tsconfig.json rename to types/base64url/tsconfig.json diff --git a/bases/bases-tests.ts b/types/bases/bases-tests.ts similarity index 100% rename from bases/bases-tests.ts rename to types/bases/bases-tests.ts diff --git a/bases/index.d.ts b/types/bases/index.d.ts similarity index 100% rename from bases/index.d.ts rename to types/bases/index.d.ts diff --git a/bases/tsconfig.json b/types/bases/tsconfig.json similarity index 100% rename from bases/tsconfig.json rename to types/bases/tsconfig.json diff --git a/basic-auth/basic-auth-tests.ts b/types/basic-auth/basic-auth-tests.ts similarity index 100% rename from basic-auth/basic-auth-tests.ts rename to types/basic-auth/basic-auth-tests.ts diff --git a/basic-auth/index.d.ts b/types/basic-auth/index.d.ts similarity index 100% rename from basic-auth/index.d.ts rename to types/basic-auth/index.d.ts diff --git a/basic-auth/tsconfig.json b/types/basic-auth/tsconfig.json similarity index 100% rename from basic-auth/tsconfig.json rename to types/basic-auth/tsconfig.json diff --git a/batch-stream/batch-stream-tests.ts b/types/batch-stream/batch-stream-tests.ts similarity index 89% rename from batch-stream/batch-stream-tests.ts rename to types/batch-stream/batch-stream-tests.ts index d3195466e8..4554530072 100644 --- a/batch-stream/batch-stream-tests.ts +++ b/types/batch-stream/batch-stream-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require('fs'); import BatchStream = require('batch-stream'); diff --git a/batch-stream/index.d.ts b/types/batch-stream/index.d.ts similarity index 100% rename from batch-stream/index.d.ts rename to types/batch-stream/index.d.ts diff --git a/batch-stream/tsconfig.json b/types/batch-stream/tsconfig.json similarity index 100% rename from batch-stream/tsconfig.json rename to types/batch-stream/tsconfig.json diff --git a/bazinga-translator/bazinga-translator-tests.ts b/types/bazinga-translator/bazinga-translator-tests.ts similarity index 87% rename from bazinga-translator/bazinga-translator-tests.ts rename to types/bazinga-translator/bazinga-translator-tests.ts index 8c5d1dafa8..3856ff22a1 100644 --- a/bazinga-translator/bazinga-translator-tests.ts +++ b/types/bazinga-translator/bazinga-translator-tests.ts @@ -1,5 +1,3 @@ -/// - Translator.fallback = 'en'; Translator.defaultDomain = 'messages'; diff --git a/bazinga-translator/index.d.ts b/types/bazinga-translator/index.d.ts similarity index 100% rename from bazinga-translator/index.d.ts rename to types/bazinga-translator/index.d.ts diff --git a/bazinga-translator/tsconfig.json b/types/bazinga-translator/tsconfig.json similarity index 100% rename from bazinga-translator/tsconfig.json rename to types/bazinga-translator/tsconfig.json diff --git a/bcrypt-nodejs/bcrypt-nodejs-tests.ts b/types/bcrypt-nodejs/bcrypt-nodejs-tests.ts similarity index 100% rename from bcrypt-nodejs/bcrypt-nodejs-tests.ts rename to types/bcrypt-nodejs/bcrypt-nodejs-tests.ts diff --git a/bcrypt-nodejs/index.d.ts b/types/bcrypt-nodejs/index.d.ts similarity index 100% rename from bcrypt-nodejs/index.d.ts rename to types/bcrypt-nodejs/index.d.ts diff --git a/bcrypt-nodejs/tsconfig.json b/types/bcrypt-nodejs/tsconfig.json similarity index 100% rename from bcrypt-nodejs/tsconfig.json rename to types/bcrypt-nodejs/tsconfig.json diff --git a/bcrypt/bcrypt-tests.ts b/types/bcrypt/bcrypt-tests.ts similarity index 100% rename from bcrypt/bcrypt-tests.ts rename to types/bcrypt/bcrypt-tests.ts diff --git a/bcrypt/index.d.ts b/types/bcrypt/index.d.ts similarity index 100% rename from bcrypt/index.d.ts rename to types/bcrypt/index.d.ts diff --git a/bcrypt/tsconfig.json b/types/bcrypt/tsconfig.json similarity index 100% rename from bcrypt/tsconfig.json rename to types/bcrypt/tsconfig.json diff --git a/bcryptjs/bcryptjs-tests.ts b/types/bcryptjs/bcryptjs-tests.ts similarity index 100% rename from bcryptjs/bcryptjs-tests.ts rename to types/bcryptjs/bcryptjs-tests.ts diff --git a/bcryptjs/index.d.ts b/types/bcryptjs/index.d.ts similarity index 100% rename from bcryptjs/index.d.ts rename to types/bcryptjs/index.d.ts diff --git a/bcryptjs/tsconfig.json b/types/bcryptjs/tsconfig.json similarity index 100% rename from bcryptjs/tsconfig.json rename to types/bcryptjs/tsconfig.json diff --git a/benchmark/benchmark-tests.ts b/types/benchmark/benchmark-tests.ts similarity index 100% rename from benchmark/benchmark-tests.ts rename to types/benchmark/benchmark-tests.ts diff --git a/benchmark/index.d.ts b/types/benchmark/index.d.ts similarity index 100% rename from benchmark/index.d.ts rename to types/benchmark/index.d.ts diff --git a/benchmark/tsconfig.json b/types/benchmark/tsconfig.json similarity index 100% rename from benchmark/tsconfig.json rename to types/benchmark/tsconfig.json diff --git a/better-curry/better-curry-tests.ts b/types/better-curry/better-curry-tests.ts similarity index 100% rename from better-curry/better-curry-tests.ts rename to types/better-curry/better-curry-tests.ts diff --git a/better-curry/index.d.ts b/types/better-curry/index.d.ts similarity index 100% rename from better-curry/index.d.ts rename to types/better-curry/index.d.ts diff --git a/better-curry/tsconfig.json b/types/better-curry/tsconfig.json similarity index 100% rename from better-curry/tsconfig.json rename to types/better-curry/tsconfig.json diff --git a/bezier-easing/bezier-easing-tests.ts b/types/bezier-easing/bezier-easing-tests.ts similarity index 100% rename from bezier-easing/bezier-easing-tests.ts rename to types/bezier-easing/bezier-easing-tests.ts diff --git a/bezier-easing/index.d.ts b/types/bezier-easing/index.d.ts similarity index 100% rename from bezier-easing/index.d.ts rename to types/bezier-easing/index.d.ts diff --git a/bezier-easing/tsconfig.json b/types/bezier-easing/tsconfig.json similarity index 100% rename from bezier-easing/tsconfig.json rename to types/bezier-easing/tsconfig.json diff --git a/bezier-js/bezier-js-tests.ts b/types/bezier-js/bezier-js-tests.ts similarity index 98% rename from bezier-js/bezier-js-tests.ts rename to types/bezier-js/bezier-js-tests.ts index f5fba4d947..003b6e1c45 100644 --- a/bezier-js/bezier-js-tests.ts +++ b/types/bezier-js/bezier-js-tests.ts @@ -1,5 +1,3 @@ -/// - function test() { var bezierjs: typeof BezierJs; diff --git a/bezier-js/index.d.ts b/types/bezier-js/index.d.ts similarity index 100% rename from bezier-js/index.d.ts rename to types/bezier-js/index.d.ts diff --git a/bezier-js/tsconfig.json b/types/bezier-js/tsconfig.json similarity index 100% rename from bezier-js/tsconfig.json rename to types/bezier-js/tsconfig.json diff --git a/bgiframe/index.d.ts b/types/bgiframe/index.d.ts similarity index 100% rename from bgiframe/index.d.ts rename to types/bgiframe/index.d.ts diff --git a/bgiframe/tsconfig.json b/types/bgiframe/tsconfig.json similarity index 100% rename from bgiframe/tsconfig.json rename to types/bgiframe/tsconfig.json diff --git a/big-integer/big-integer-tests.ts b/types/big-integer/big-integer-tests.ts similarity index 98% rename from big-integer/big-integer-tests.ts rename to types/big-integer/big-integer-tests.ts index 2ab3c1fad5..62f234b371 100644 --- a/big-integer/big-integer-tests.ts +++ b/types/big-integer/big-integer-tests.ts @@ -113,5 +113,6 @@ isBigInteger = x.times( "100" ); isNumber = x.toJSNumber(); isString = x.toString(); +isString = x.toString(36); isNumber = x.valueOf(); diff --git a/big-integer/index.d.ts b/types/big-integer/index.d.ts similarity index 99% rename from big-integer/index.d.ts rename to types/big-integer/index.d.ts index 452593e950..f8ca2b488c 100644 --- a/big-integer/index.d.ts +++ b/types/big-integer/index.d.ts @@ -195,7 +195,7 @@ interface BigInteger { toJSNumber(): number; /** Converts a bigInt to a string. */ - toString(): string; + toString( radix?: number ): string; /** Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion. */ valueOf(): number; diff --git a/big-integer/tsconfig.json b/types/big-integer/tsconfig.json similarity index 100% rename from big-integer/tsconfig.json rename to types/big-integer/tsconfig.json diff --git a/big.js/big.js-tests.ts b/types/big.js/big.js-tests.ts similarity index 100% rename from big.js/big.js-tests.ts rename to types/big.js/big.js-tests.ts diff --git a/big.js/index.d.ts b/types/big.js/index.d.ts similarity index 100% rename from big.js/index.d.ts rename to types/big.js/index.d.ts diff --git a/big.js/tsconfig.json b/types/big.js/tsconfig.json similarity index 100% rename from big.js/tsconfig.json rename to types/big.js/tsconfig.json diff --git a/bigi/bigi-tests.ts b/types/bigi/bigi-tests.ts similarity index 100% rename from bigi/bigi-tests.ts rename to types/bigi/bigi-tests.ts diff --git a/bigi/index.d.ts b/types/bigi/index.d.ts similarity index 100% rename from bigi/index.d.ts rename to types/bigi/index.d.ts diff --git a/bigi/tsconfig.json b/types/bigi/tsconfig.json similarity index 100% rename from bigi/tsconfig.json rename to types/bigi/tsconfig.json diff --git a/bootstrap-validator/tslint.json b/types/bigi/tslint.json similarity index 100% rename from bootstrap-validator/tslint.json rename to types/bigi/tslint.json diff --git a/bigint/bigint-tests.ts b/types/bigint/bigint-tests.ts similarity index 100% rename from bigint/bigint-tests.ts rename to types/bigint/bigint-tests.ts diff --git a/bigint/index.d.ts b/types/bigint/index.d.ts similarity index 100% rename from bigint/index.d.ts rename to types/bigint/index.d.ts diff --git a/bigint/tsconfig.json b/types/bigint/tsconfig.json similarity index 100% rename from bigint/tsconfig.json rename to types/bigint/tsconfig.json diff --git a/bignum/bignum-tests.ts b/types/bignum/bignum-tests.ts similarity index 100% rename from bignum/bignum-tests.ts rename to types/bignum/bignum-tests.ts diff --git a/bignum/index.d.ts b/types/bignum/index.d.ts similarity index 100% rename from bignum/index.d.ts rename to types/bignum/index.d.ts diff --git a/bignum/tsconfig.json b/types/bignum/tsconfig.json similarity index 100% rename from bignum/tsconfig.json rename to types/bignum/tsconfig.json diff --git a/types/bignumber.js/bignumber.js-tests.ts b/types/bignumber.js/bignumber.js-tests.ts new file mode 100644 index 0000000000..9dc96dd7ea --- /dev/null +++ b/types/bignumber.js/bignumber.js-tests.ts @@ -0,0 +1,443 @@ +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); + +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); + +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/types/bignumber.js/index.d.ts similarity index 94% rename from bignumber.js/index.d.ts rename to types/bignumber.js/index.d.ts index d94be507c7..10423b1ed3 100644 --- a/bignumber.js/index.d.ts +++ b/types/bignumber.js/index.d.ts @@ -10,9 +10,7 @@ export as namespace BigNumber; export = BigNumber; declare namespace BigNumber { - interface FormatConfig { - /** * The decimal separator. */ @@ -45,9 +43,8 @@ declare namespace BigNumber { } interface BigNumberConfig { - /** - * The maximum number of decimal places of the results of operations involving division, + * 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; @@ -59,56 +56,56 @@ declare namespace BigNumber { /** * 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, + * + * 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` + * + * 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, + * + * 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; @@ -116,15 +113,14 @@ declare namespace BigNumber { /** * The `FORMAT` object configures the format of the string returned by the toFormat method. */ - FORMAT: Partial + FORMAT: Partial; } type NumberLike = number | string | BigNumber; - type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - type ModuloMode = RoundingMode | 9 + 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. */ @@ -142,7 +138,7 @@ declare namespace BigNumber { /** * Configures the settings for this particular BigNumber constructor. - * + * */ config(obj?: Partial): BigNumberConfig; @@ -201,17 +197,17 @@ declare namespace 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) + * + * 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, + * + * 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; @@ -267,15 +263,14 @@ declare namespace BigNumber { ROUND_HALF_FLOOR: 8; /** - * The remainder is always positive. - * + * 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. */ @@ -293,26 +288,26 @@ declare namespace 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; @@ -348,15 +343,15 @@ declare namespace BigNumber { divToInt(n: NumberLike, base?: number): BigNumber; /** - * Returns `true` if the value of this BigNumber equals the value of `n`, otherwise returns `false`. - * + * 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`. - * + * 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; @@ -388,7 +383,7 @@ declare namespace BigNumber { /** * 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; @@ -434,12 +429,12 @@ declare namespace BigNumber { 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 + * 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 + * 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; @@ -455,18 +450,18 @@ declare namespace 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, + * + * 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, + * + * 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; @@ -493,44 +488,44 @@ declare namespace 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; @@ -547,36 +542,36 @@ declare namespace 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, + * 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. + * + * 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; @@ -584,17 +579,17 @@ declare namespace BigNumber { /** * 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. + * 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]; @@ -606,32 +601,32 @@ declare namespace BigNumber { /** * 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; diff --git a/bignumber.js/tsconfig.json b/types/bignumber.js/tsconfig.json similarity index 100% rename from bignumber.js/tsconfig.json rename to types/bignumber.js/tsconfig.json diff --git a/bignumber.js/tslint.json b/types/bignumber.js/tslint.json similarity index 100% rename from bignumber.js/tslint.json rename to types/bignumber.js/tslint.json diff --git a/bigscreen/bigscreen-tests.ts b/types/bigscreen/bigscreen-tests.ts similarity index 100% rename from bigscreen/bigscreen-tests.ts rename to types/bigscreen/bigscreen-tests.ts diff --git a/bigscreen/index.d.ts b/types/bigscreen/index.d.ts similarity index 100% rename from bigscreen/index.d.ts rename to types/bigscreen/index.d.ts diff --git a/bigscreen/tsconfig.json b/types/bigscreen/tsconfig.json similarity index 100% rename from bigscreen/tsconfig.json rename to types/bigscreen/tsconfig.json diff --git a/bind-ponyfill/bind-ponyfill-tests.ts b/types/bind-ponyfill/bind-ponyfill-tests.ts similarity index 100% rename from bind-ponyfill/bind-ponyfill-tests.ts rename to types/bind-ponyfill/bind-ponyfill-tests.ts diff --git a/bind-ponyfill/index.d.ts b/types/bind-ponyfill/index.d.ts similarity index 100% rename from bind-ponyfill/index.d.ts rename to types/bind-ponyfill/index.d.ts diff --git a/bind-ponyfill/tsconfig.json b/types/bind-ponyfill/tsconfig.json similarity index 100% rename from bind-ponyfill/tsconfig.json rename to types/bind-ponyfill/tsconfig.json diff --git a/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts b/types/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts similarity index 100% rename from bingmaps/Microsoft.Maps.AdvancedShapes.d.ts rename to types/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts diff --git a/bingmaps/Microsoft.Maps.Directions.d.ts b/types/bingmaps/Microsoft.Maps.Directions.d.ts similarity index 100% rename from bingmaps/Microsoft.Maps.Directions.d.ts rename to types/bingmaps/Microsoft.Maps.Directions.d.ts diff --git a/bingmaps/Microsoft.Maps.Search.d.ts b/types/bingmaps/Microsoft.Maps.Search.d.ts similarity index 100% rename from bingmaps/Microsoft.Maps.Search.d.ts rename to types/bingmaps/Microsoft.Maps.Search.d.ts diff --git a/bingmaps/Microsoft.Maps.Themes.BingTheme.d.ts b/types/bingmaps/Microsoft.Maps.Themes.BingTheme.d.ts similarity index 100% rename from bingmaps/Microsoft.Maps.Themes.BingTheme.d.ts rename to types/bingmaps/Microsoft.Maps.Themes.BingTheme.d.ts diff --git a/bingmaps/Microsoft.Maps.Traffic.d.ts b/types/bingmaps/Microsoft.Maps.Traffic.d.ts similarity index 100% rename from bingmaps/Microsoft.Maps.Traffic.d.ts rename to types/bingmaps/Microsoft.Maps.Traffic.d.ts diff --git a/bingmaps/Microsoft.Maps.VenueMaps.d.ts b/types/bingmaps/Microsoft.Maps.VenueMaps.d.ts similarity index 100% rename from bingmaps/Microsoft.Maps.VenueMaps.d.ts rename to types/bingmaps/Microsoft.Maps.VenueMaps.d.ts diff --git a/bingmaps/UNUSED_FILES.txt b/types/bingmaps/UNUSED_FILES.txt similarity index 100% rename from bingmaps/UNUSED_FILES.txt rename to types/bingmaps/UNUSED_FILES.txt diff --git a/bingmaps/bingmaps-tests.ts b/types/bingmaps/bingmaps-tests.ts similarity index 91% rename from bingmaps/bingmaps-tests.ts rename to types/bingmaps/bingmaps-tests.ts index 239e33094a..e83ff89aba 100644 --- a/bingmaps/bingmaps-tests.ts +++ b/types/bingmaps/bingmaps-tests.ts @@ -1,10 +1,3 @@ -/// -/// -/// -/// -/// -/// - namespace BingMapsTests { // An interactive set of Bing Maps AJAX control usages can be found at http://www.bingmapsportal.com/isdk/ajaxv7 diff --git a/bingmaps/index.d.ts b/types/bingmaps/index.d.ts similarity index 100% rename from bingmaps/index.d.ts rename to types/bingmaps/index.d.ts diff --git a/bingmaps/tsconfig.json b/types/bingmaps/tsconfig.json similarity index 100% rename from bingmaps/tsconfig.json rename to types/bingmaps/tsconfig.json diff --git a/bintrees/bintrees-tests.ts b/types/bintrees/bintrees-tests.ts similarity index 100% rename from bintrees/bintrees-tests.ts rename to types/bintrees/bintrees-tests.ts diff --git a/bintrees/index.d.ts b/types/bintrees/index.d.ts similarity index 100% rename from bintrees/index.d.ts rename to types/bintrees/index.d.ts diff --git a/bintrees/tsconfig.json b/types/bintrees/tsconfig.json similarity index 100% rename from bintrees/tsconfig.json rename to types/bintrees/tsconfig.json diff --git a/bip21/bip21-tests.ts b/types/bip21/bip21-tests.ts similarity index 100% rename from bip21/bip21-tests.ts rename to types/bip21/bip21-tests.ts diff --git a/bip21/index.d.ts b/types/bip21/index.d.ts similarity index 100% rename from bip21/index.d.ts rename to types/bip21/index.d.ts diff --git a/bip21/tsconfig.json b/types/bip21/tsconfig.json similarity index 100% rename from bip21/tsconfig.json rename to types/bip21/tsconfig.json diff --git a/bit-array/bit-array-tests.ts b/types/bit-array/bit-array-tests.ts similarity index 83% rename from bit-array/bit-array-tests.ts rename to types/bit-array/bit-array-tests.ts index 7c1ff57b1b..7d50de143c 100644 --- a/bit-array/bit-array-tests.ts +++ b/types/bit-array/bit-array-tests.ts @@ -1,5 +1,3 @@ -/// - import BitArray = require("bit-array"); const a = new BitArray(32); diff --git a/bit-array/index.d.ts b/types/bit-array/index.d.ts similarity index 100% rename from bit-array/index.d.ts rename to types/bit-array/index.d.ts diff --git a/bit-array/tsconfig.json b/types/bit-array/tsconfig.json similarity index 100% rename from bit-array/tsconfig.json rename to types/bit-array/tsconfig.json diff --git a/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts similarity index 100% rename from bitcoinjs-lib/bitcoinjs-lib-tests.ts rename to types/bitcoinjs-lib/bitcoinjs-lib-tests.ts diff --git a/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts similarity index 100% rename from bitcoinjs-lib/index.d.ts rename to types/bitcoinjs-lib/index.d.ts diff --git a/bitcoinjs-lib/tsconfig.json b/types/bitcoinjs-lib/tsconfig.json similarity index 100% rename from bitcoinjs-lib/tsconfig.json rename to types/bitcoinjs-lib/tsconfig.json diff --git a/browser-bunyan/tslint.json b/types/bitcoinjs-lib/tslint.json similarity index 100% rename from browser-bunyan/tslint.json rename to types/bitcoinjs-lib/tslint.json diff --git a/bittorrent-protocol/bittorrent-protocol-tests.ts b/types/bittorrent-protocol/bittorrent-protocol-tests.ts similarity index 78% rename from bittorrent-protocol/bittorrent-protocol-tests.ts rename to types/bittorrent-protocol/bittorrent-protocol-tests.ts index 1d0d17793a..f5f6b4649f 100644 --- a/bittorrent-protocol/bittorrent-protocol-tests.ts +++ b/types/bittorrent-protocol/bittorrent-protocol-tests.ts @@ -1,9 +1,16 @@ import * as Protocol from 'bittorrent-protocol'; import * as net from 'net'; +class TestExtension implements Protocol.Extension { + constructor(protected wire: Protocol.Wire) { } + name = 'extname'; +} + net.createServer(socket => { var wire = new Protocol(); + wire.use(TestExtension); + // pipe to and from the protocol socket.pipe(wire).pipe(socket); diff --git a/bittorrent-protocol/index.d.ts b/types/bittorrent-protocol/index.d.ts similarity index 83% rename from bittorrent-protocol/index.d.ts rename to types/bittorrent-protocol/index.d.ts index be1a60b179..6d838a90f5 100644 --- a/bittorrent-protocol/index.d.ts +++ b/types/bittorrent-protocol/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for bittorrent-protocol 2.1 +// Type definitions for bittorrent-protocol 2.2 // Project: https://github.com/feross/bittorrent-protocol#readme -// Definitions by: Tomasz Łaziuk +// Definitions by: Feross Aboukhadijeh , Tomasz Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -15,18 +15,18 @@ declare namespace BittorrentProtocol { (): Wire; } + export interface ExtensionConstructor { + new (wire: Wire): Extension; + } + 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; + onHandshake?: (infoHash: string, peerId: string, extensions: { [name: string]: boolean }) => void; + onExtendedHandshake?: (handshake: { [key: string]: any }) => void; + onMessage?: (buf: Buffer) => 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; @@ -52,7 +52,7 @@ declare namespace BittorrentProtocol { destroy(): void; - use(ext: Extension): void; + use(ext: ExtensionConstructor): void; handshake(infoHash: string | Buffer, peerId: string | Buffer, extensions?: any): void; diff --git a/bittorrent-protocol/tsconfig.json b/types/bittorrent-protocol/tsconfig.json similarity index 100% rename from bittorrent-protocol/tsconfig.json rename to types/bittorrent-protocol/tsconfig.json diff --git a/bittorrent-protocol/tslint.json b/types/bittorrent-protocol/tslint.json similarity index 100% rename from bittorrent-protocol/tslint.json rename to types/bittorrent-protocol/tslint.json diff --git a/bitwise-xor/bitwise-xor-tests.ts b/types/bitwise-xor/bitwise-xor-tests.ts similarity index 100% rename from bitwise-xor/bitwise-xor-tests.ts rename to types/bitwise-xor/bitwise-xor-tests.ts diff --git a/bitwise-xor/index.d.ts b/types/bitwise-xor/index.d.ts similarity index 100% rename from bitwise-xor/index.d.ts rename to types/bitwise-xor/index.d.ts diff --git a/bitwise-xor/tsconfig.json b/types/bitwise-xor/tsconfig.json similarity index 100% rename from bitwise-xor/tsconfig.json rename to types/bitwise-xor/tsconfig.json diff --git a/bl/bl-tests.ts b/types/bl/bl-tests.ts similarity index 100% rename from bl/bl-tests.ts rename to types/bl/bl-tests.ts diff --git a/bl/index.d.ts b/types/bl/index.d.ts similarity index 100% rename from bl/index.d.ts rename to types/bl/index.d.ts diff --git a/bl/tsconfig.json b/types/bl/tsconfig.json similarity index 100% rename from bl/tsconfig.json rename to types/bl/tsconfig.json diff --git a/blacklist/blacklist-tests.ts b/types/blacklist/blacklist-tests.ts similarity index 100% rename from blacklist/blacklist-tests.ts rename to types/blacklist/blacklist-tests.ts diff --git a/blacklist/index.d.ts b/types/blacklist/index.d.ts similarity index 100% rename from blacklist/index.d.ts rename to types/blacklist/index.d.ts diff --git a/blacklist/tsconfig.json b/types/blacklist/tsconfig.json similarity index 100% rename from blacklist/tsconfig.json rename to types/blacklist/tsconfig.json diff --git a/browser-fingerprint/tslint.json b/types/blacklist/tslint.json similarity index 100% rename from browser-fingerprint/tslint.json rename to types/blacklist/tslint.json diff --git a/blazy/blazy-tests.ts b/types/blazy/blazy-tests.ts similarity index 100% rename from blazy/blazy-tests.ts rename to types/blazy/blazy-tests.ts diff --git a/blazy/index.d.ts b/types/blazy/index.d.ts similarity index 100% rename from blazy/index.d.ts rename to types/blazy/index.d.ts diff --git a/blazy/tsconfig.json b/types/blazy/tsconfig.json similarity index 100% rename from blazy/tsconfig.json rename to types/blazy/tsconfig.json diff --git a/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts similarity index 100% rename from blessed/blessed-tests.ts rename to types/blessed/blessed-tests.ts diff --git a/blessed/index.d.ts b/types/blessed/index.d.ts similarity index 100% rename from blessed/index.d.ts rename to types/blessed/index.d.ts diff --git a/blessed/tsconfig.json b/types/blessed/tsconfig.json similarity index 100% rename from blessed/tsconfig.json rename to types/blessed/tsconfig.json diff --git a/blissfuljs/blissfuljs-tests.ts b/types/blissfuljs/blissfuljs-tests.ts similarity index 100% rename from blissfuljs/blissfuljs-tests.ts rename to types/blissfuljs/blissfuljs-tests.ts diff --git a/blissfuljs/index.d.ts b/types/blissfuljs/index.d.ts similarity index 100% rename from blissfuljs/index.d.ts rename to types/blissfuljs/index.d.ts diff --git a/blissfuljs/tsconfig.json b/types/blissfuljs/tsconfig.json similarity index 100% rename from blissfuljs/tsconfig.json rename to types/blissfuljs/tsconfig.json diff --git a/blob-stream/blob-stream-tests.ts b/types/blob-stream/blob-stream-tests.ts similarity index 74% rename from blob-stream/blob-stream-tests.ts rename to types/blob-stream/blob-stream-tests.ts index b9174859f9..40f9888788 100644 --- a/blob-stream/blob-stream-tests.ts +++ b/types/blob-stream/blob-stream-tests.ts @@ -1,6 +1,3 @@ - -/// - var bl = require('blob-stream'); var blob = bl.toBlob(); diff --git a/blob-stream/index.d.ts b/types/blob-stream/index.d.ts similarity index 100% rename from blob-stream/index.d.ts rename to types/blob-stream/index.d.ts diff --git a/blob-stream/tsconfig.json b/types/blob-stream/tsconfig.json similarity index 100% rename from blob-stream/tsconfig.json rename to types/blob-stream/tsconfig.json diff --git a/blocks/blocks-tests.ts b/types/blocks/blocks-tests.ts similarity index 100% rename from blocks/blocks-tests.ts rename to types/blocks/blocks-tests.ts diff --git a/blocks/index.d.ts b/types/blocks/index.d.ts similarity index 100% rename from blocks/index.d.ts rename to types/blocks/index.d.ts diff --git a/blocks/tsconfig.json b/types/blocks/tsconfig.json similarity index 100% rename from blocks/tsconfig.json rename to types/blocks/tsconfig.json diff --git a/types/bloomfilter/bloomfilter-tests.ts b/types/bloomfilter/bloomfilter-tests.ts new file mode 100644 index 0000000000..f1f3306d62 --- /dev/null +++ b/types/bloomfilter/bloomfilter-tests.ts @@ -0,0 +1,11 @@ +import { BloomFilter } from './index'; +function test_bloomfilter() { + const m: number = 10; + const k: number = 2; + + let bloomFilter = new BloomFilter(m, k); + let array: Array = bloomFilter.buckets; + let length: number = bloomFilter.buckets.length; + bloomFilter.add('someString'); + let test: boolean = bloomFilter.test('someString'); +} diff --git a/types/bloomfilter/index.d.ts b/types/bloomfilter/index.d.ts new file mode 100644 index 0000000000..071c32dfc6 --- /dev/null +++ b/types/bloomfilter/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for BloomFilter 0.1 +// Project: https://github.com/jasondavies/bloomfilter.js +// Definitions by: slawiko +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export declare class BloomFilter { + buckets: Array; + + constructor(m: number, k: number); + + add(value: any): void; + + test(value: any): boolean; +} diff --git a/google-protobuf/tsconfig.json b/types/bloomfilter/tsconfig.json similarity index 86% rename from google-protobuf/tsconfig.json rename to types/bloomfilter/tsconfig.json index 269fec20d9..b8bae54b77 100644 --- a/google-protobuf/tsconfig.json +++ b/types/bloomfilter/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -17,6 +18,6 @@ }, "files": [ "index.d.ts", - "google-protobuf-tests.ts" + "bloomfilter-tests.ts" ] -} \ No newline at end of file +} diff --git a/node-xmpp-core/tslint.json b/types/bloomfilter/tslint.json similarity index 100% rename from node-xmpp-core/tslint.json rename to types/bloomfilter/tslint.json diff --git a/blue-tape/blue-tape-tests.ts b/types/blue-tape/blue-tape-tests.ts similarity index 99% rename from blue-tape/blue-tape-tests.ts rename to types/blue-tape/blue-tape-tests.ts index 92b2641115..c34bc6e32c 100644 --- a/blue-tape/blue-tape-tests.ts +++ b/types/blue-tape/blue-tape-tests.ts @@ -1,4 +1,3 @@ -/// /// import tape = require('blue-tape'); diff --git a/blue-tape/index.d.ts b/types/blue-tape/index.d.ts similarity index 100% rename from blue-tape/index.d.ts rename to types/blue-tape/index.d.ts diff --git a/blue-tape/tsconfig.json b/types/blue-tape/tsconfig.json similarity index 100% rename from blue-tape/tsconfig.json rename to types/blue-tape/tsconfig.json diff --git a/bluebird-global/bluebird-global-tests.ts b/types/bluebird-global/bluebird-global-tests.ts similarity index 100% rename from bluebird-global/bluebird-global-tests.ts rename to types/bluebird-global/bluebird-global-tests.ts diff --git a/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts similarity index 99% rename from bluebird-global/index.d.ts rename to types/bluebird-global/index.d.ts index e4c4920501..a705222e9d 100644 --- a/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -80,6 +80,8 @@ declare global { // then: typeof Bluebird.prototype.then; thenReturn: typeof Bluebird.prototype.thenReturn; thenThrow: typeof Bluebird.prototype.thenThrow; + catchReturn: typeof Bluebird.prototype.catchReturn; + catchThrow: typeof Bluebird.prototype.catchThrow; throw: typeof Bluebird.prototype.throw; timeout: typeof Bluebird.prototype.timeout; toJSON: typeof Bluebird.prototype.toJSON; diff --git a/bluebird-global/tsconfig.json b/types/bluebird-global/tsconfig.json similarity index 100% rename from bluebird-global/tsconfig.json rename to types/bluebird-global/tsconfig.json diff --git a/bluebird-global/tslint.json b/types/bluebird-global/tslint.json similarity index 100% rename from bluebird-global/tslint.json rename to types/bluebird-global/tslint.json diff --git a/bluebird-retry/bluebird-retry-tests.ts b/types/bluebird-retry/bluebird-retry-tests.ts similarity index 95% rename from bluebird-retry/bluebird-retry-tests.ts rename to types/bluebird-retry/bluebird-retry-tests.ts index b63b360160..eb3260a007 100644 --- a/bluebird-retry/bluebird-retry-tests.ts +++ b/types/bluebird-retry/bluebird-retry-tests.ts @@ -1,5 +1,3 @@ - -/// import Promise = require('bluebird'); import retry = require('bluebird-retry'); diff --git a/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts similarity index 89% rename from bluebird-retry/index.d.ts rename to types/bluebird-retry/index.d.ts index 22c7b1c95e..63adc1476d 100644 --- a/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -17,6 +17,9 @@ declare namespace retry { timeout?: number; max_tries?: number; predicate?: any; + throw_original?: boolean; + context?: any; + args?: any; } } diff --git a/bluebird-retry/tsconfig.json b/types/bluebird-retry/tsconfig.json similarity index 100% rename from bluebird-retry/tsconfig.json rename to types/bluebird-retry/tsconfig.json diff --git a/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts similarity index 99% rename from bluebird/bluebird-tests.ts rename to types/bluebird/bluebird-tests.ts index c08a7bdc6b..b9fc8d0cef 100644 --- a/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -506,6 +506,15 @@ fooProm = fooProm.thenThrow(err); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +barProm = fooProm.catchReturn(bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooProm +fooProm = fooProm.catchThrow(err); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + str = fooProm.toString(); obj = fooProm.toJSON(); diff --git a/bluebird/index.d.ts b/types/bluebird/index.d.ts similarity index 96% rename from bluebird/index.d.ts rename to types/bluebird/index.d.ts index ecacedfd0d..e9a79d8834 100644 --- a/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -248,6 +248,37 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection; thenThrow(reason: Error): Bluebird; + /** + * Convenience method for: + * + * + * .catch(function() { + * return value; + * }); + * + * + * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.catchReturn()` + */ + catchReturn(value: U): Bluebird; + catchReturn(predicate: (error: any) => boolean, value: U): Bluebird; + catchReturn(ErrorClass: new (...args: any[]) => E, value: U): Bluebird; + catchReturn(predicate: Object, value: U): Bluebird; + + /** + * Convenience method for: + * + * + * .catch(function() { + * throw reason; + * }); + * + * Same limitations apply as with `.catchReturn()`. + */ + catchThrow(reason: Error): Bluebird; + catchThrow(predicate: (error: any) => boolean, reason: Error): Bluebird; + catchThrow(ErrorClass: new (...args: any[]) => E, reason: Error): Bluebird; + catchThrow(predicate: Object, reason: Error): Bluebird; + /** * Convert to String. */ @@ -502,11 +533,11 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(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; + 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 */ diff --git a/bluebird/tsconfig.json b/types/bluebird/tsconfig.json similarity index 100% rename from bluebird/tsconfig.json rename to types/bluebird/tsconfig.json diff --git a/bluebird/v1/bluebird-tests.ts b/types/bluebird/v1/bluebird-tests.ts similarity index 100% rename from bluebird/v1/bluebird-tests.ts rename to types/bluebird/v1/bluebird-tests.ts diff --git a/bluebird/v1/index.d.ts b/types/bluebird/v1/index.d.ts similarity index 100% rename from bluebird/v1/index.d.ts rename to types/bluebird/v1/index.d.ts diff --git a/bluebird/v1/tsconfig.json b/types/bluebird/v1/tsconfig.json similarity index 100% rename from bluebird/v1/tsconfig.json rename to types/bluebird/v1/tsconfig.json diff --git a/bluebird/v2/bluebird-tests.ts b/types/bluebird/v2/bluebird-tests.ts similarity index 100% rename from bluebird/v2/bluebird-tests.ts rename to types/bluebird/v2/bluebird-tests.ts diff --git a/bluebird/v2/index.d.ts b/types/bluebird/v2/index.d.ts similarity index 100% rename from bluebird/v2/index.d.ts rename to types/bluebird/v2/index.d.ts diff --git a/bluebird/v2/tsconfig.json b/types/bluebird/v2/tsconfig.json similarity index 100% rename from bluebird/v2/tsconfig.json rename to types/bluebird/v2/tsconfig.json diff --git a/types/blueimp-md5/blueimp-md5-tests.ts b/types/blueimp-md5/blueimp-md5-tests.ts new file mode 100644 index 0000000000..0b59ae2f24 --- /dev/null +++ b/types/blueimp-md5/blueimp-md5-tests.ts @@ -0,0 +1,5 @@ +import md5 = require("blueimp-md5"); + +function hash1(): string { + return md5('hello world'); +} diff --git a/types/blueimp-md5/index.d.ts b/types/blueimp-md5/index.d.ts new file mode 100644 index 0000000000..881d5c7afe --- /dev/null +++ b/types/blueimp-md5/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for blueimp-md5 v2.7.0 +// Project: https://github.com/blueimp/JavaScript-MD5 +// Definitions by: Ray Martone , Mikael Kohlmyr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function md5(value: string, key?: string, raw?: boolean): string; +export = md5; diff --git a/blueimp-md5/tsconfig.json b/types/blueimp-md5/tsconfig.json similarity index 100% rename from blueimp-md5/tsconfig.json rename to types/blueimp-md5/tsconfig.json diff --git a/body-parser/body-parser-tests.ts b/types/body-parser/body-parser-tests.ts similarity index 100% rename from body-parser/body-parser-tests.ts rename to types/body-parser/body-parser-tests.ts diff --git a/body-parser/index.d.ts b/types/body-parser/index.d.ts similarity index 72% rename from body-parser/index.d.ts rename to types/body-parser/index.d.ts index c0ce775bb0..8d068cb66a 100644 --- a/body-parser/index.d.ts +++ b/types/body-parser/index.d.ts @@ -13,36 +13,34 @@ import { Request, RequestHandler, Response } from 'express'; declare function bodyParser(options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded): RequestHandler; declare namespace bodyParser { - - export interface Options { + 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 { + interface OptionsJson extends Options { reviever?: (key: string, value: any) => any; strict?: boolean; } - export interface OptionsText extends Options { + interface OptionsText extends Options { defaultCharset?: string; } - export interface OptionsUrlencoded extends Options { + interface OptionsUrlencoded extends Options { extended?: boolean; parameterLimit?: number; } - export function json(options?: OptionsJson): RequestHandler; + function json(options?: OptionsJson): RequestHandler; - export function raw(options?: Options): RequestHandler; + function raw(options?: Options): RequestHandler; - export function text(options?: OptionsText): RequestHandler; - - export function urlencoded(options?: OptionsUrlencoded): RequestHandler; + function text(options?: OptionsText): RequestHandler; + function urlencoded(options?: OptionsUrlencoded): RequestHandler; } export = bodyParser; diff --git a/body-parser/tsconfig.json b/types/body-parser/tsconfig.json similarity index 100% rename from body-parser/tsconfig.json rename to types/body-parser/tsconfig.json diff --git a/body-parser/tslint.json b/types/body-parser/tslint.json similarity index 100% rename from body-parser/tslint.json rename to types/body-parser/tslint.json diff --git a/bonjour/bonjour-tests.ts b/types/bonjour/bonjour-tests.ts similarity index 100% rename from bonjour/bonjour-tests.ts rename to types/bonjour/bonjour-tests.ts diff --git a/bonjour/index.d.ts b/types/bonjour/index.d.ts similarity index 100% rename from bonjour/index.d.ts rename to types/bonjour/index.d.ts diff --git a/bonjour/tsconfig.json b/types/bonjour/tsconfig.json similarity index 100% rename from bonjour/tsconfig.json rename to types/bonjour/tsconfig.json diff --git a/bookshelf/bookshelf-tests.ts b/types/bookshelf/bookshelf-tests.ts similarity index 100% rename from bookshelf/bookshelf-tests.ts rename to types/bookshelf/bookshelf-tests.ts diff --git a/bookshelf/index.d.ts b/types/bookshelf/index.d.ts similarity index 99% rename from bookshelf/index.d.ts rename to types/bookshelf/index.d.ts index 4aa6fd38b5..398534806d 100644 --- a/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -2,7 +2,7 @@ // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 import Knex = require('knex'); import knex = require('knex'); @@ -17,7 +17,7 @@ interface Bookshelf extends Bookshelf.Events { Collection: typeof Bookshelf.Collection; plugin(name: string | string[] | Function, options?: any): Bookshelf; - transaction(callback: (transaction: knex.Transaction) => T): BlueBird; + transaction(callback: (transaction: knex.Transaction) => BlueBird): BlueBird; } declare function Bookshelf(knex: knex): Bookshelf; diff --git a/bookshelf/tsconfig.json b/types/bookshelf/tsconfig.json similarity index 100% rename from bookshelf/tsconfig.json rename to types/bookshelf/tsconfig.json diff --git a/boolify-string/boolify-string-tests.ts b/types/boolify-string/boolify-string-tests.ts similarity index 100% rename from boolify-string/boolify-string-tests.ts rename to types/boolify-string/boolify-string-tests.ts diff --git a/boolify-string/index.d.ts b/types/boolify-string/index.d.ts similarity index 100% rename from boolify-string/index.d.ts rename to types/boolify-string/index.d.ts diff --git a/boolify-string/tsconfig.json b/types/boolify-string/tsconfig.json similarity index 100% rename from boolify-string/tsconfig.json rename to types/boolify-string/tsconfig.json diff --git a/boom/boom-tests.ts b/types/boom/boom-tests.ts similarity index 100% rename from boom/boom-tests.ts rename to types/boom/boom-tests.ts diff --git a/boom/index.d.ts b/types/boom/index.d.ts similarity index 100% rename from boom/index.d.ts rename to types/boom/index.d.ts diff --git a/boom/tsconfig.json b/types/boom/tsconfig.json similarity index 100% rename from boom/tsconfig.json rename to types/boom/tsconfig.json diff --git a/bootbox/bootbox-tests.ts b/types/bootbox/bootbox-tests.ts similarity index 79% rename from bootbox/bootbox-tests.ts rename to types/bootbox/bootbox-tests.ts index 92a079f456..f5604d5312 100644 --- a/bootbox/bootbox-tests.ts +++ b/types/bootbox/bootbox-tests.ts @@ -6,7 +6,7 @@ bootbox.alert("Are we ok with callback?", function () { console.log("Callback called!"); }); bootbox.alert({ - size: "medium", + size: "small", message: "Are we ok with callback and custom button?", callback: function () { console.log("Callback called!"); @@ -38,7 +38,29 @@ bootbox.prompt({ console.log(result); } }); - +bootbox.prompt({ + title: "This is a prompt with a set of checkbox inputs!", + inputType: 'checkbox', + inputOptions: [ + { + text: 'Choice One', + value: '1', + group: 'Group 1' + }, + { + text: 'Choice Two', + value: '2', + group: 'Group 1' + }, + { + text: 'Choice Three', + value: '3' + } + ], + callback: function (result) { + console.log(result); + } +}); bootbox.dialog({ title: "Wassup?", diff --git a/bootbox/index.d.ts b/types/bootbox/index.d.ts similarity index 89% rename from bootbox/index.d.ts rename to types/bootbox/index.d.ts index 40494d5ca5..28d30e2ba0 100644 --- a/bootbox/index.d.ts +++ b/types/bootbox/index.d.ts @@ -1,6 +1,6 @@ // 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 by: Vincent Bortone , Kon Pik , Anup Kattel , Dominik Schroeter , Troy McKinnon , Stanny Nuytkens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -15,7 +15,8 @@ interface BootboxBaseOptions { closeButton?: boolean; animate?: boolean; className?: string; - size?: string; + /** All other values result in medium */ + size?: "small" | "large"; buttons?: BootboxButtonMap; // complex object where each key is of type BootboxButton } @@ -40,9 +41,10 @@ interface BootboxConfirmOptions extends BootboxDialogOptions { interface BootboxPromptOptions extends BootboxBaseOptions { title: string; value?: string; - inputType?: string; + inputType?: "text" | "textarea" | "email" | "select" | "checkbox" | "date" | "time" | "number" | "password"; callback: (result: string) => any; buttons?: BootboxConfirmPromptButtonMap; + inputOptions?: { text: string, value: string, group?: string }[]; } /** Bootbox options available when setting defaults for modals */ diff --git a/bootbox/tsconfig.json b/types/bootbox/tsconfig.json similarity index 100% rename from bootbox/tsconfig.json rename to types/bootbox/tsconfig.json diff --git a/bootpag/bootpag-tests.ts b/types/bootpag/bootpag-tests.ts similarity index 92% rename from bootpag/bootpag-tests.ts rename to types/bootpag/bootpag-tests.ts index 6a5503f9f8..a0a2a78cc3 100644 --- a/bootpag/bootpag-tests.ts +++ b/types/bootpag/bootpag-tests.ts @@ -1,5 +1,3 @@ -/// - var pagerSelector = ".bootpager"; var $pager = $(pagerSelector); diff --git a/bootpag/index.d.ts b/types/bootpag/index.d.ts similarity index 100% rename from bootpag/index.d.ts rename to types/bootpag/index.d.ts diff --git a/bootpag/tsconfig.json b/types/bootpag/tsconfig.json similarity index 100% rename from bootpag/tsconfig.json rename to types/bootpag/tsconfig.json diff --git a/bootstrap-datepicker/bootstrap-datepicker-tests.ts b/types/bootstrap-datepicker/bootstrap-datepicker-tests.ts similarity index 98% rename from bootstrap-datepicker/bootstrap-datepicker-tests.ts rename to types/bootstrap-datepicker/bootstrap-datepicker-tests.ts index cedc28c93c..372967ec21 100644 --- a/bootstrap-datepicker/bootstrap-datepicker-tests.ts +++ b/types/bootstrap-datepicker/bootstrap-datepicker-tests.ts @@ -1,4 +1,3 @@ -/// function tests_simple() { $('#datepicker').datepicker(); $('#datepicker').datepicker({ diff --git a/bootstrap-datepicker/index.d.ts b/types/bootstrap-datepicker/index.d.ts similarity index 100% rename from bootstrap-datepicker/index.d.ts rename to types/bootstrap-datepicker/index.d.ts diff --git a/bootstrap-datepicker/tsconfig.json b/types/bootstrap-datepicker/tsconfig.json similarity index 100% rename from bootstrap-datepicker/tsconfig.json rename to types/bootstrap-datepicker/tsconfig.json diff --git a/bootstrap-fileinput/index.d.ts b/types/bootstrap-fileinput/index.d.ts similarity index 100% rename from bootstrap-fileinput/index.d.ts rename to types/bootstrap-fileinput/index.d.ts diff --git a/bootstrap-fileinput/tsconfig.json b/types/bootstrap-fileinput/tsconfig.json similarity index 100% rename from bootstrap-fileinput/tsconfig.json rename to types/bootstrap-fileinput/tsconfig.json diff --git a/bootstrap-maxlength/bootstrap-maxlength-tests.ts b/types/bootstrap-maxlength/bootstrap-maxlength-tests.ts similarity index 98% rename from bootstrap-maxlength/bootstrap-maxlength-tests.ts rename to types/bootstrap-maxlength/bootstrap-maxlength-tests.ts index 32255bc66b..92c3f1b57e 100644 --- a/bootstrap-maxlength/bootstrap-maxlength-tests.ts +++ b/types/bootstrap-maxlength/bootstrap-maxlength-tests.ts @@ -1,5 +1,3 @@ -/// - // Examples from the projects github page $('input[maxlength]').maxlength(); diff --git a/bootstrap-maxlength/index.d.ts b/types/bootstrap-maxlength/index.d.ts similarity index 100% rename from bootstrap-maxlength/index.d.ts rename to types/bootstrap-maxlength/index.d.ts diff --git a/bootstrap-maxlength/tsconfig.json b/types/bootstrap-maxlength/tsconfig.json similarity index 100% rename from bootstrap-maxlength/tsconfig.json rename to types/bootstrap-maxlength/tsconfig.json diff --git a/bootstrap-notify/bootstrap-notify-tests.ts b/types/bootstrap-notify/bootstrap-notify-tests.ts similarity index 97% rename from bootstrap-notify/bootstrap-notify-tests.ts rename to types/bootstrap-notify/bootstrap-notify-tests.ts index 5ae4f2ffc1..2977d39abf 100644 --- a/bootstrap-notify/bootstrap-notify-tests.ts +++ b/types/bootstrap-notify/bootstrap-notify-tests.ts @@ -1,6 +1,3 @@ - -/// - //Test for bootstrap-notify v3.1.3 //Copied example directly from Bootstrap-notify site diff --git a/bootstrap-notify/index.d.ts b/types/bootstrap-notify/index.d.ts similarity index 100% rename from bootstrap-notify/index.d.ts rename to types/bootstrap-notify/index.d.ts diff --git a/bootstrap-notify/tsconfig.json b/types/bootstrap-notify/tsconfig.json similarity index 100% rename from bootstrap-notify/tsconfig.json rename to types/bootstrap-notify/tsconfig.json diff --git a/bootstrap-select/bootstrap-select-tests.ts b/types/bootstrap-select/bootstrap-select-tests.ts similarity index 96% rename from bootstrap-select/bootstrap-select-tests.ts rename to types/bootstrap-select/bootstrap-select-tests.ts index e2e8c88560..55900b3ab7 100644 --- a/bootstrap-select/bootstrap-select-tests.ts +++ b/types/bootstrap-select/bootstrap-select-tests.ts @@ -1,5 +1,3 @@ -/// - $(".selectpicker").selectpicker({ actionsBox: true, container: "body", diff --git a/bootstrap-select/index.d.ts b/types/bootstrap-select/index.d.ts similarity index 100% rename from bootstrap-select/index.d.ts rename to types/bootstrap-select/index.d.ts diff --git a/bootstrap-select/tsconfig.json b/types/bootstrap-select/tsconfig.json similarity index 100% rename from bootstrap-select/tsconfig.json rename to types/bootstrap-select/tsconfig.json diff --git a/bootstrap-slider/bootstrap-slider-tests.ts b/types/bootstrap-slider/bootstrap-slider-tests.ts similarity index 98% rename from bootstrap-slider/bootstrap-slider-tests.ts rename to types/bootstrap-slider/bootstrap-slider-tests.ts index 98701cedc3..df143d4c72 100644 --- a/bootstrap-slider/bootstrap-slider-tests.ts +++ b/types/bootstrap-slider/bootstrap-slider-tests.ts @@ -1,6 +1,3 @@ -/// - - $(function() { // examples from http://seiyria.github.io/bootstrap-slider/ diff --git a/bootstrap-slider/index.d.ts b/types/bootstrap-slider/index.d.ts similarity index 100% rename from bootstrap-slider/index.d.ts rename to types/bootstrap-slider/index.d.ts diff --git a/bootstrap-slider/tsconfig.json b/types/bootstrap-slider/tsconfig.json similarity index 100% rename from bootstrap-slider/tsconfig.json rename to types/bootstrap-slider/tsconfig.json diff --git a/bootstrap-switch/bootstrap-switch-tests.ts b/types/bootstrap-switch/bootstrap-switch-tests.ts similarity index 93% rename from bootstrap-switch/bootstrap-switch-tests.ts rename to types/bootstrap-switch/bootstrap-switch-tests.ts index 539399a78e..65fafff2e9 100644 --- a/bootstrap-switch/bootstrap-switch-tests.ts +++ b/types/bootstrap-switch/bootstrap-switch-tests.ts @@ -1,9 +1,6 @@ -/// - - function test_cases() { $('#switch').bootstrapSwitch(); - + $('#switch').bootstrapSwitch({ state: false }); @@ -15,7 +12,7 @@ function test_cases() { //var mySwitch = $('#switch').get(0); //mySwitch.toggleAnimate(); - + $('#switch').bootstrapSwitch('state', true, true); $('#switch').bootstrapSwitch('state') === true; diff --git a/bootstrap-switch/index.d.ts b/types/bootstrap-switch/index.d.ts similarity index 100% rename from bootstrap-switch/index.d.ts rename to types/bootstrap-switch/index.d.ts diff --git a/bootstrap-switch/tsconfig.json b/types/bootstrap-switch/tsconfig.json similarity index 100% rename from bootstrap-switch/tsconfig.json rename to types/bootstrap-switch/tsconfig.json diff --git a/bootstrap-table/bootstrap-table-tests.ts b/types/bootstrap-table/bootstrap-table-tests.ts similarity index 100% rename from bootstrap-table/bootstrap-table-tests.ts rename to types/bootstrap-table/bootstrap-table-tests.ts diff --git a/bootstrap-table/index.d.ts b/types/bootstrap-table/index.d.ts similarity index 100% rename from bootstrap-table/index.d.ts rename to types/bootstrap-table/index.d.ts diff --git a/bootstrap-table/tsconfig.json b/types/bootstrap-table/tsconfig.json similarity index 100% rename from bootstrap-table/tsconfig.json rename to types/bootstrap-table/tsconfig.json diff --git a/bootstrap-touchspin/bootstrap-touchspin-tests.ts b/types/bootstrap-touchspin/bootstrap-touchspin-tests.ts similarity index 98% rename from bootstrap-touchspin/bootstrap-touchspin-tests.ts rename to types/bootstrap-touchspin/bootstrap-touchspin-tests.ts index c8a6a713f9..7d1ea73437 100644 --- a/bootstrap-touchspin/bootstrap-touchspin-tests.ts +++ b/types/bootstrap-touchspin/bootstrap-touchspin-tests.ts @@ -1,6 +1,3 @@ -/// - - $(function () { // Example 1 from http://www.virtuosoft.eu/code/bootstrap-touchspin/ $("input[name='demo1']").TouchSpin({ @@ -26,7 +23,7 @@ $(function () { $("input[name='demo_vertical']").TouchSpin({ verticalbuttons: true }); - + // Example 4 from http://www.virtuosoft.eu/code/bootstrap-touchspin/ $("input[name='demo_vertical2']").TouchSpin({ verticalbuttons: true, diff --git a/bootstrap-touchspin/index.d.ts b/types/bootstrap-touchspin/index.d.ts similarity index 100% rename from bootstrap-touchspin/index.d.ts rename to types/bootstrap-touchspin/index.d.ts diff --git a/bootstrap-touchspin/tsconfig.json b/types/bootstrap-touchspin/tsconfig.json similarity index 100% rename from bootstrap-touchspin/tsconfig.json rename to types/bootstrap-touchspin/tsconfig.json diff --git a/bootstrap-validator/bootstrap-validator-tests.ts b/types/bootstrap-validator/bootstrap-validator-tests.ts similarity index 88% rename from bootstrap-validator/bootstrap-validator-tests.ts rename to types/bootstrap-validator/bootstrap-validator-tests.ts index 07d4753ed1..e43a094184 100644 --- a/bootstrap-validator/bootstrap-validator-tests.ts +++ b/types/bootstrap-validator/bootstrap-validator-tests.ts @@ -1,5 +1,3 @@ -/// - $('#myForm').validator(); $('#myForm').validator('update'); $('#myForm').validator('validate'); diff --git a/bootstrap-validator/index.d.ts b/types/bootstrap-validator/index.d.ts similarity index 100% rename from bootstrap-validator/index.d.ts rename to types/bootstrap-validator/index.d.ts diff --git a/bootstrap-validator/tsconfig.json b/types/bootstrap-validator/tsconfig.json similarity index 100% rename from bootstrap-validator/tsconfig.json rename to types/bootstrap-validator/tsconfig.json diff --git a/bufferstream/tslint.json b/types/bootstrap-validator/tslint.json similarity index 100% rename from bufferstream/tslint.json rename to types/bootstrap-validator/tslint.json diff --git a/bootstrap.paginator/index.d.ts b/types/bootstrap.paginator/index.d.ts similarity index 100% rename from bootstrap.paginator/index.d.ts rename to types/bootstrap.paginator/index.d.ts diff --git a/bootstrap.paginator/tsconfig.json b/types/bootstrap.paginator/tsconfig.json similarity index 100% rename from bootstrap.paginator/tsconfig.json rename to types/bootstrap.paginator/tsconfig.json diff --git a/bootstrap.timepicker/index.d.ts b/types/bootstrap.timepicker/index.d.ts similarity index 100% rename from bootstrap.timepicker/index.d.ts rename to types/bootstrap.timepicker/index.d.ts diff --git a/bootstrap.timepicker/tsconfig.json b/types/bootstrap.timepicker/tsconfig.json similarity index 100% rename from bootstrap.timepicker/tsconfig.json rename to types/bootstrap.timepicker/tsconfig.json diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts b/types/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts similarity index 99% rename from bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts rename to types/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts index 3373bdb9e8..70c8f8a586 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts +++ b/types/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts @@ -1,5 +1,3 @@ -/// - import * as moment from "moment"; const dp = $("#picker").datetimepicker().data("DateTimePicker"); @@ -118,7 +116,6 @@ function test_timeZone() { strFormats = dp.timeZone() as string; } - function test_widgetParent() { let nullW: null = null; let str: string = "myId"; diff --git a/bootstrap.v3.datetimepicker/index.d.ts b/types/bootstrap.v3.datetimepicker/index.d.ts similarity index 96% rename from bootstrap.v3.datetimepicker/index.d.ts rename to types/bootstrap.v3.datetimepicker/index.d.ts index d8ec008dca..653135057d 100644 --- a/bootstrap.v3.datetimepicker/index.d.ts +++ b/types/bootstrap.v3.datetimepicker/index.d.ts @@ -49,9 +49,9 @@ export interface Datetimepicker { 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 + 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 + options(options: DatetimepickerOptions): void; /**Shows the widget * Emits: * - dp.show - if the widget was hidden before that call @@ -85,14 +85,14 @@ export interface Datetimepicker { /**Returns the options.daysOfWeekDisabled configuration * IMPORTANT! Throws exception if not set explicitly https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1459 */ - daysOfWeekDisabled(): Array; + daysOfWeekDisabled(): number[]; /**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; + daysOfWeekDisabled(days: number[]): void; /**Returns the options.dayViewHeaderFormat option. */ dayViewHeaderFormat(): string; /**Used to customize the header of the day view. */ @@ -117,22 +117,22 @@ export interface Datetimepicker { */ disabledDates(dates: boolean | Array): void; /**Returns the options.disabledHours option. - * NOTES: probably should be: disabledHours(): boolean | Array; see: DatetimepickerOptions + * NOTES: probably should be: disabledHours(): boolean | number[]; 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; + disabledHours(value: boolean | number[]): 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>; + disabledTimeIntervals(): boolean | moment.Moment[][]; /**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; + disabledTimeIntervals(value: boolean | moment.Moment[][]): void; /**Returns the options.enabledDates option * NOTES: probably should be: enabledDates(): boolean | Array; see: DatetimepickerOptions */ @@ -144,12 +144,12 @@ export interface Datetimepicker { */ enabledDates(dates: boolean | Array): void; /**Returns the options.enabledHours option. - * NOTES: probably should be: enabledHours(): boolean | Array; see: DatetimepickerOptions + * NOTES: probably should be: enabledHours(): boolean | number[]; 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; + enabledHours(value: boolean | number[]): 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 */ @@ -303,7 +303,7 @@ export interface Datetimepicker { */ viewMode(value: string): void; /**Returns a $(element) variable with the currently set options.widgetParent option. */ - widgetParent(): string | JQuery | null + widgetParent(): string | JQuery | null; /**Takes a string or $(element) value. */ widgetParent(widgetParent: string | JQuery | null): void; /**Returns the options.widgetPositioning object */ @@ -332,7 +332,7 @@ export interface DatetimepickerOptions { * Accepts: array of numbers from 0-6 * @default: false */ - daysOfWeekDisabled?: Array | boolean; + daysOfWeekDisabled?: number[] | boolean; /**Changes the heading of the datepicker when in "days" view. * @default: "MMMM YYYY" */ @@ -358,12 +358,12 @@ export interface DatetimepickerOptions { * eg disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ - disabledHours?: boolean | Array | any; + disabledHours?: boolean | number[] | 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>; + disabledTimeIntervals?: boolean | moment.Moment[][]; /**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. @@ -377,7 +377,7 @@ export interface DatetimepickerOptions { * eg enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ - enabledHours?: boolean | Array; + enabledHours?: boolean | number[]; /**Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 * @default: false */ @@ -566,7 +566,6 @@ type EventName = "dp.show" | "dp.hide" | "dp.error"; declare global { interface JQuery { - datetimepicker(options?: DatetimepickerOptions): JQuery; data(key: "DateTimePicker"): Datetimepicker; @@ -575,21 +574,21 @@ declare global { 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: "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; 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.change", handler: (eventobject: ChangeEvent) => any): JQuery; + off(events: "dp.change", selector?: string, handler?: (eventobject: ChangeEvent) => any): JQuery; off(events: "dp.update", handler: (eventobject: UpdateEvent) => any): JQuery; off(events: "dp.update", selector?: string, handler?: (eventobject: UpdateEvent) => any): JQuery; + + off(events: EventName, handler: (eventobject: Event) => any): JQuery; + off(events: EventName, selector?: string, handler?: (eventobject: Event) => any): JQuery; } } diff --git a/bootstrap.v3.datetimepicker/package.json b/types/bootstrap.v3.datetimepicker/package.json similarity index 100% rename from bootstrap.v3.datetimepicker/package.json rename to types/bootstrap.v3.datetimepicker/package.json diff --git a/bootstrap.v3.datetimepicker/tsconfig.json b/types/bootstrap.v3.datetimepicker/tsconfig.json similarity index 100% rename from bootstrap.v3.datetimepicker/tsconfig.json rename to types/bootstrap.v3.datetimepicker/tsconfig.json diff --git a/bootstrap.v3.datetimepicker/tslint.json b/types/bootstrap.v3.datetimepicker/tslint.json similarity index 100% rename from bootstrap.v3.datetimepicker/tslint.json rename to types/bootstrap.v3.datetimepicker/tslint.json diff --git a/bootstrap.v3.datetimepicker/v3/index.d.ts b/types/bootstrap.v3.datetimepicker/v3/index.d.ts similarity index 100% rename from bootstrap.v3.datetimepicker/v3/index.d.ts rename to types/bootstrap.v3.datetimepicker/v3/index.d.ts diff --git a/bootstrap.v3.datetimepicker/v3/package.json b/types/bootstrap.v3.datetimepicker/v3/package.json similarity index 100% rename from bootstrap.v3.datetimepicker/v3/package.json rename to types/bootstrap.v3.datetimepicker/v3/package.json diff --git a/bootstrap.v3.datetimepicker/v3/tsconfig.json b/types/bootstrap.v3.datetimepicker/v3/tsconfig.json similarity index 100% rename from bootstrap.v3.datetimepicker/v3/tsconfig.json rename to types/bootstrap.v3.datetimepicker/v3/tsconfig.json diff --git a/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts similarity index 96% rename from bootstrap/bootstrap-tests.ts rename to types/bootstrap/bootstrap-tests.ts index cef85d5d42..cd786b41a7 100644 --- a/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -1,6 +1,3 @@ -/// - - $('body').off('.data-api'); $('body').off('.alert.data-api'); diff --git a/bootstrap/index.d.ts b/types/bootstrap/index.d.ts similarity index 100% rename from bootstrap/index.d.ts rename to types/bootstrap/index.d.ts diff --git a/bootstrap/tsconfig.json b/types/bootstrap/tsconfig.json similarity index 100% rename from bootstrap/tsconfig.json rename to types/bootstrap/tsconfig.json diff --git a/bounce.js/bounce.js-tests.ts b/types/bounce.js/bounce.js-tests.ts similarity index 100% rename from bounce.js/bounce.js-tests.ts rename to types/bounce.js/bounce.js-tests.ts diff --git a/bounce.js/index.d.ts b/types/bounce.js/index.d.ts similarity index 100% rename from bounce.js/index.d.ts rename to types/bounce.js/index.d.ts diff --git a/bounce.js/tsconfig.json b/types/bounce.js/tsconfig.json similarity index 100% rename from bounce.js/tsconfig.json rename to types/bounce.js/tsconfig.json diff --git a/bowser/bowser-tests.ts b/types/bowser/bowser-tests.ts similarity index 100% rename from bowser/bowser-tests.ts rename to types/bowser/bowser-tests.ts diff --git a/bowser/index.d.ts b/types/bowser/index.d.ts similarity index 100% rename from bowser/index.d.ts rename to types/bowser/index.d.ts diff --git a/bowser/tsconfig.json b/types/bowser/tsconfig.json similarity index 100% rename from bowser/tsconfig.json rename to types/bowser/tsconfig.json diff --git a/box2d/README.md b/types/box2d/README.md similarity index 100% rename from box2d/README.md rename to types/box2d/README.md diff --git a/box2d/box2d-tests.ts b/types/box2d/box2d-tests.ts similarity index 100% rename from box2d/box2d-tests.ts rename to types/box2d/box2d-tests.ts diff --git a/box2d/index.d.ts b/types/box2d/index.d.ts similarity index 100% rename from box2d/index.d.ts rename to types/box2d/index.d.ts diff --git a/box2d/tsconfig.json b/types/box2d/tsconfig.json similarity index 100% rename from box2d/tsconfig.json rename to types/box2d/tsconfig.json diff --git a/braintree-web/braintree-web-tests.ts b/types/braintree-web/braintree-web-tests.ts similarity index 100% rename from braintree-web/braintree-web-tests.ts rename to types/braintree-web/braintree-web-tests.ts diff --git a/braintree-web/index.d.ts b/types/braintree-web/index.d.ts similarity index 100% rename from braintree-web/index.d.ts rename to types/braintree-web/index.d.ts diff --git a/braintree-web/tsconfig.json b/types/braintree-web/tsconfig.json similarity index 100% rename from braintree-web/tsconfig.json rename to types/braintree-web/tsconfig.json 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/breeze/index.d.ts b/types/breeze/index.d.ts similarity index 93% rename from breeze/index.d.ts rename to types/breeze/index.d.ts index 8cc109d746..323e9a8f87 100644 --- a/breeze/index.d.ts +++ b/types/breeze/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Breeze 1.5.x +// Type definitions for Breeze 1.6.3 // Project: http://www.breezejs.com/ // Definitions by: Boris Yankov , IdeaBlade // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,7 +12,10 @@ // 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 Jul 28 2016 - Serkan "coni2k" Holat +// 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 { @@ -89,6 +92,19 @@ declare namespace breeze.core { 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 { @@ -214,19 +230,23 @@ declare namespace breeze { export class DataServiceAdapter { checkForRecomposition(interfaceInitializedArgs: { interfaceName: string; isDefault: boolean }): void; initialize(): void; - fetchMetadata(metadataStore: MetadataStore, dataService: DataService): breeze.promises.IPromise; - executeQuery(mappingContext: { getUrl: () => string; query: EntityQuery; dataService: DataService }): breeze.promises.IPromise; - saveChanges(saveContext: { resourceName: string; dataService: DataService }, saveBundle: Object): breeze.promises.IPromise; + 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; }; }); } @@ -241,6 +261,7 @@ declare namespace breeze { export interface NodeContext { nodeType: string; + propertyName: string; } export class DataTypeSymbol extends breeze.core.EnumSymbol { @@ -333,8 +354,8 @@ declare namespace breeze { isNavigationPropertyLoaded(navigationProperty: string): boolean; isNavigationPropertyLoaded(navigationProperty: NavigationProperty): boolean; - loadNavigationProperty(navigationProperty: string, callback?: Function, errorCallback?: Function): breeze.promises.IPromise; - loadNavigationProperty(navigationProperty: NavigationProperty, callback?: Function, errorCallback?: Function): breeze.promises.IPromise; + loadNavigationProperty(navigationProperty: string, callback?: Function, errorCallback?: Function): Promise; + loadNavigationProperty(navigationProperty: NavigationProperty, callback?: Function, errorCallback?: Function): Promise; rejectChanges(): void; @@ -423,16 +444,16 @@ declare namespace breeze { 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): breeze.promises.IPromise; - executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise; + 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): breeze.promises.IPromise; - fetchEntityByKey(typeName: string, keyValues: any[], checkLocalCacheFirst?: boolean): breeze.promises.IPromise; - fetchEntityByKey(entityKey: EntityKey): breeze.promises.IPromise; - fetchMetadata(callback?: (schema: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise; + 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[]; @@ -466,7 +487,7 @@ declare namespace breeze { 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): breeze.promises.IPromise; + saveChanges(entities?: Entity[], saveOptions?: SaveOptions, callback?: SaveChangesSuccessCallback, errorCallback?: SaveChangesErrorCallback): Promise; setProperties(config: EntityManagerProperties): void; } @@ -554,7 +575,7 @@ declare namespace breeze { /** Create query from an expression tree */ constructor(tree: Object); - execute(callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise; + execute(callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise; executeLocally(): Entity[]; expand(propertyPaths: string[]): EntityQuery; expand(propertyPaths: string): EntityQuery; @@ -591,6 +612,8 @@ declare namespace breeze { 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; @@ -721,13 +744,14 @@ declare namespace breeze { addDataService(dataService: DataService, shouldOverwrite?: boolean): void; addEntityType(structuralType: IStructuralType): void; exportMetadata(): string; - fetchMetadata(dataService: string, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise; - fetchMetadata(dataService: DataService, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise; + 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; @@ -796,7 +820,7 @@ declare namespace breeze { export interface IRecursiveArray { [i: number]: T | IRecursiveArray; } - + export class Predicate { constructor(); constructor(property: string, operator: string, value: any); @@ -904,10 +928,16 @@ declare namespace breeze { export interface SaveResult { entities: Entity[]; - keyMappings: any; + keyMappings: KeyMapping[]; XHR: XMLHttpRequest; } + export interface KeyMapping { + entityTypeName: string; + tempValue: any; + realValue: any; + } + export class ValidationError { key: string; context: any; @@ -993,7 +1023,7 @@ declare namespace breeze { /** 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. + /** 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 */ @@ -1044,20 +1074,16 @@ declare namespace breeze.config { @return {an instance of the specified adapter} **/ export function getAdapterInstance(interfaceName: string, adapterName?: string): Object; - - export interface Adapter { - getRoutePrefix: Function - } /** - Initializes a single adapter implementation. Initialization means either newing a instance of the + 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. + @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): Adapter; + export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): Object; export interface AdapterInstancesConfig { /** the name of a previously registered "ajax" adapter */ @@ -1080,15 +1106,15 @@ declare namespace breeze.config { 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. + 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. + @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 */ @@ -1101,27 +1127,17 @@ declare namespace breeze.config { /** 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 IPromise { - then(onFulfill: (value: T) => U, onReject?: (reason: any) => U): IPromise; - then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => U): IPromise; - then(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise): IPromise; - then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => IPromise): IPromise; - catch(onRejected: (reason: any) => U): IPromise; - catch(onRejected: (reason: any) => IPromise): IPromise; - finally(finallyCallback: () => any): IPromise; - } - export interface IDeferred { - promise: IPromise; + promise: Promise; resolve(value: T): void; reject(reason: any): void; } export interface IPromiseService { defer(): IDeferred; - reject(reason?: any): IPromise; - resolve(object: T): IPromise; - resolve(object: IPromise): IPromise; + reject(reason?: any): Promise; + resolve(object: T): Promise; + resolve(object: Promise): Promise; } } 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/browser-bunyan/index.d.ts b/types/browser-bunyan/index.d.ts similarity index 85% rename from browser-bunyan/index.d.ts rename to types/browser-bunyan/index.d.ts index f2981bfacd..bb243e4324 100644 --- a/browser-bunyan/index.d.ts +++ b/types/browser-bunyan/index.d.ts @@ -6,7 +6,7 @@ import bunyan = require("bunyan"); declare module "bunyan" { - export function ConsoleFormattedStream(): void; + 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/camelcase-keys/tslint.json b/types/browser-bunyan/tslint.json similarity index 100% rename from camelcase-keys/tslint.json rename to types/browser-bunyan/tslint.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/chai-json-schema/tslint.json b/types/browser-fingerprint/tslint.json similarity index 100% rename from chai-json-schema/tslint.json rename to types/browser-fingerprint/tslint.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/bson/index.d.ts b/types/bson/index.d.ts similarity index 100% rename from bson/index.d.ts rename to types/bson/index.d.ts 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/bufferstream/index.d.ts b/types/bufferstream/index.d.ts similarity index 97% rename from bufferstream/index.d.ts rename to types/bufferstream/index.d.ts index 1d1ffcdb10..0642fd8740 100644 --- a/bufferstream/index.d.ts +++ b/types/bufferstream/index.d.ts @@ -59,9 +59,9 @@ declare class BufferStream extends stream.Duplex { */ length: number; } // https://github.com/dodo/node-bufferstream/blob/master/src/buffer-stream.coffee#L28 -declare namespace BufferStream { - export interface Opts { +declare namespace BufferStream { + interface Opts { /* default encoding for writing strings */ @@ -85,5 +85,5 @@ declare namespace BufferStream { // String or Buffer split?: any; } - export var fn: {warn: boolean}; + 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/chai-subset/tslint.json b/types/bufferstream/tslint.json similarity index 100% rename from chai-subset/tslint.json rename to types/bufferstream/tslint.json diff --git a/bugsnag/bugsnag-tests.ts b/types/bugsnag/bugsnag-tests.ts similarity index 100% rename from bugsnag/bugsnag-tests.ts rename to types/bugsnag/bugsnag-tests.ts diff --git a/bugsnag/index.d.ts b/types/bugsnag/index.d.ts similarity index 100% rename from bugsnag/index.d.ts rename to types/bugsnag/index.d.ts diff --git a/bugsnag/tsconfig.json b/types/bugsnag/tsconfig.json similarity index 100% rename from bugsnag/tsconfig.json rename to types/bugsnag/tsconfig.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..ef2096a4c8 --- /dev/null +++ b/types/bunyan-blackhole/bunyan-blackhole-tests.ts @@ -0,0 +1,26 @@ +import blackhole = require("bunyan-blackhole"); + + + +var 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"); + +var 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/easy-api-request/tsconfig.json b/types/bunyan-blackhole/tsconfig.json similarity index 92% rename from easy-api-request/tsconfig.json rename to types/bunyan-blackhole/tsconfig.json index 663d9a15d0..cddd529d29 100644 --- a/easy-api-request/tsconfig.json +++ b/types/bunyan-blackhole/tsconfig.json @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "easy-api-request-tests.ts" + "bunyan-blackhole-tests.ts" ] } \ No newline at end of file diff --git a/gettext.js/tslint.json b/types/bunyan-blackhole/tslint.json similarity index 100% rename from gettext.js/tslint.json rename to types/bunyan-blackhole/tslint.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/business-rules-engine/index.d.ts b/types/business-rules-engine/index.d.ts similarity index 99% rename from business-rules-engine/index.d.ts rename to types/business-rules-engine/index.d.ts index 4f71b43dfb..a74bcf180d 100644 --- a/business-rules-engine/index.d.ts +++ b/types/business-rules-engine/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Source: typings/business-rules-engine/Validation.d.ts -/// import * as Q from "q"; 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/business-rules-engine/tsconfig.json b/types/business-rules-engine/tsconfig.json similarity index 90% rename from business-rules-engine/tsconfig.json rename to types/business-rules-engine/tsconfig.json index 008e622d1f..a80b05099b 100644 --- a/business-rules-engine/tsconfig.json +++ b/types/business-rules-engine/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true 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/c3/index.d.ts b/types/c3/index.d.ts similarity index 99% rename from c3/index.d.ts rename to types/c3/index.d.ts index 5edb096395..748b19bfc5 100644 --- a/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -145,7 +145,9 @@ declare namespace c3 { /** * Change step type for step chart. 'step', 'step-before' and 'step-after' can be used. */ - step_type?: string; + step?: { + type: string; + }; }; area?: { 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/camelcase-keys/camelcase-keys-tests.ts b/types/camelcase-keys/camelcase-keys-tests.ts similarity index 100% rename from camelcase-keys/camelcase-keys-tests.ts rename to types/camelcase-keys/camelcase-keys-tests.ts 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/chai-xml/tslint.json b/types/camelcase-keys/tslint.json similarity index 100% rename from chai-xml/tslint.json rename to types/camelcase-keys/tslint.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/canvas-gauges/index.d.ts b/types/canvas-gauges/index.d.ts similarity index 100% rename from canvas-gauges/index.d.ts rename to types/canvas-gauges/index.d.ts 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/casperjs/index.d.ts b/types/casperjs/index.d.ts similarity index 99% rename from casperjs/index.d.ts rename to types/casperjs/index.d.ts index f252509af3..e8388d17c7 100644 --- a/casperjs/index.d.ts +++ b/types/casperjs/index.d.ts @@ -39,7 +39,7 @@ export class 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: () => T, ...args: any[]): T + evaluate(fn: (...args: any[]) => T, ...args: any[]): T evaluateOrDie(fn: () => any, message?: string, status?: number): Casper; exit(status?: number): Casper; exists(selector: string): boolean; 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/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/chai-json-schema/index.d.ts b/types/chai-json-schema/index.d.ts similarity index 87% rename from chai-json-schema/index.d.ts rename to types/chai-json-schema/index.d.ts index 1498510f9f..69aec8bec7 100644 --- a/chai-json-schema/index.d.ts +++ b/types/chai-json-schema/index.d.ts @@ -9,16 +9,16 @@ import tv4 = require('tv4'); declare global { namespace Chai { - export interface Assert { + interface Assert { jsonSchema(value: any, schema: any, msg?: string): void; notJsonSchema(value: any, schema: any, msg?: string): void; } - export interface LanguageChains { + interface LanguageChains { jsonSchema(schema: any, msg?: string): void; } - export interface ChaiStatic { + interface ChaiStatic { tv4: tv4.TV4; } } 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/checkstyle-formatter/tslint.json b/types/chai-json-schema/tslint.json similarity index 100% rename from checkstyle-formatter/tslint.json rename to types/chai-json-schema/tslint.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/chai-oequal/tslint.json b/types/chai-oequal/tslint.json similarity index 100% rename from chai-oequal/tslint.json rename to types/chai-oequal/tslint.json 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 100% rename from chai-subset/chai-subset-tests.ts rename to types/chai-subset/chai-subset-tests.ts 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/chunked-dc/tslint.json b/types/chai-subset/tslint.json similarity index 100% rename from chunked-dc/tslint.json rename to types/chai-subset/tslint.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/clamp-js/tslint.json b/types/chai-xml/tslint.json similarity index 100% rename from clamp-js/tslint.json rename to types/chai-xml/tslint.json diff --git a/chai/chai-tests.ts b/types/chai/chai-tests.ts similarity index 100% rename from chai/chai-tests.ts rename to types/chai/chai-tests.ts diff --git a/chai/index.d.ts b/types/chai/index.d.ts similarity index 100% rename from chai/index.d.ts rename to types/chai/index.d.ts 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/charm/charm-tests.ts b/types/charm/charm-tests.ts similarity index 100% rename from charm/charm-tests.ts rename to types/charm/charm-tests.ts 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/charm/tslint.json b/types/charm/tslint.json similarity index 100% rename from charm/tslint.json rename to types/charm/tslint.json 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/chart.js/index.d.ts b/types/chart.js/index.d.ts similarity index 95% rename from chart.js/index.d.ts rename to types/chart.js/index.d.ts index 425bf96b81..cad58a2aa8 100644 --- a/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,11 +1,16 @@ -// Type definitions for Chart.js +// 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: CanvasRenderingContext2D | HTMLCanvasElement, options: Chart.ChartConfiguration); + constructor( + context: string | JQuery | CanvasRenderingContext2D | HTMLCanvasElement | string[] | CanvasRenderingContext2D[] | HTMLCanvasElement[], + options: Chart.ChartConfiguration + ); config: Chart.ChartConfiguration; data: Chart.ChartData; destroy: () => {}; @@ -32,6 +37,8 @@ declare namespace Chart { export type ScaleType = 'category' | 'linear' | 'logarithmic' | 'time' | 'radialLinear'; + export type PositionType = 'left' | 'right' | 'top' | 'bottom'; + export interface ChartLegendItem { text?: string; fillStyle?: string; @@ -342,7 +349,7 @@ declare namespace Chart { export interface ChartScales { type?: ScaleType | string; display?: boolean; - position?: string; + position?: PositionType | string; beforeUpdate?: (scale?: any) => void; beforeSetDimension?: (scale?: any) => void; beforeDataLimits?: (scale?: any) => void; @@ -364,29 +371,25 @@ declare namespace Chart { yAxes?: ChartYAxe[]; } - export interface ChartXAxe { + export interface CommonAxe { type?: ScaleType | string; display?: boolean; id?: string; stacked?: boolean; - categoryPercentage?: number; - barPercentage?: number; - barThickness?: number; - gridLines?: GridLineOptions; position?: string; ticks?: TickOptions; - time?: TimeScale; + gridLines?: GridLineOptions; + barThickness?: number; scaleLabel?: ScaleTitleOptions; } - export interface ChartYAxe { - type?: ScaleType | string; - display?: boolean; - id?: string; - stacked?: boolean; - position?: string; - ticks?: TickOptions; - scaleLabel?: ScaleTitleOptions; + export interface ChartXAxe extends CommonAxe { + categoryPercentage?: number; + barPercentage?: number; + time?: TimeScale; + } + + export interface ChartYAxe extends CommonAxe { } export interface LinearScale extends ChartScales { @@ -410,16 +413,16 @@ declare namespace Chart { } export interface TimeScale extends ChartScales { - format?: string; displayFormats?: TimeDisplayFormat; isoWeekday?: boolean; max?: string; min?: string; parser?: string | ((arg: any) => any); - round?: string; + round?: TimeUnit; tooltipFormat?: string; unit?: TimeUnit; unitStepSize?: number; + minUnit?: TimeUnit; } export interface RadialLinearScale { 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/cheap-ruler/cheap-ruler-tests.ts b/types/cheap-ruler/cheap-ruler-tests.ts similarity index 100% rename from cheap-ruler/cheap-ruler-tests.ts rename to types/cheap-ruler/cheap-ruler-tests.ts diff --git a/cheap-ruler/index.d.ts b/types/cheap-ruler/index.d.ts similarity index 100% rename from cheap-ruler/index.d.ts rename to types/cheap-ruler/index.d.ts diff --git a/cheap-ruler/tsconfig.json b/types/cheap-ruler/tsconfig.json similarity index 100% rename from cheap-ruler/tsconfig.json rename to types/cheap-ruler/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/clipboard/tslint.json b/types/checkstyle-formatter/tslint.json similarity index 100% rename from clipboard/tslint.json rename to types/checkstyle-formatter/tslint.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/cheerio/index.d.ts b/types/cheerio/index.d.ts similarity index 96% rename from cheerio/index.d.ts rename to types/cheerio/index.d.ts index e94eb1a68c..f3615674f5 100644 --- a/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Cheerio v0.17.0 +// Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Cheerio { @@ -47,10 +47,11 @@ interface Cheerio { 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; @@ -60,6 +61,9 @@ interface 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; @@ -126,6 +130,8 @@ interface 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; @@ -266,4 +272,4 @@ declare var cheerio:CheerioAPI; declare module "cheerio" { export = cheerio; -} +} \ No newline at end of file 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/chocolatechipjs/chocolatechipjs-tests.ts b/types/chocolatechipjs/chocolatechipjs-tests.ts similarity index 98% rename from chocolatechipjs/chocolatechipjs-tests.ts rename to types/chocolatechipjs/chocolatechipjs-tests.ts index 465ea2b0a9..7036358aed 100644 --- a/chocolatechipjs/chocolatechipjs-tests.ts +++ b/types/chocolatechipjs/chocolatechipjs-tests.ts @@ -1,4 +1,3 @@ -/// // ChocolateChipStatic -- DOM creation, etc. $(function() { alert('Ready to do stuff!'); @@ -282,7 +281,7 @@ fetch('../controllers/php-post.php', { }, body: formData }) -.then($.json) +.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 + ".
    "); @@ -300,12 +299,12 @@ interface putData { var putData = $('#fileText').val(); fetch('../controllers/php-put.php', { method: 'put', - headers: { - "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, body: putData }) -.then($.json) +.then($.json) .then(function(data:any): any { console.dir(data.base); $("#message_ajax").append('

    ' + data.result + '

    '); @@ -324,12 +323,12 @@ interface deleteData { var file = $('#fileName').val(); fetch('../controllers/php-delete.php', { method: 'delete', - headers: { - "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, body: file }) -.then($.json) +.then($.json) .then(function(data: any): any { $("#message_ajax").html("
    DELETE was sent to the server successfully.
    "); $("#message_ajax").append('

    ' + data.result + '

    '); diff --git a/chocolatechipjs/index.d.ts b/types/chocolatechipjs/index.d.ts similarity index 100% rename from chocolatechipjs/index.d.ts rename to types/chocolatechipjs/index.d.ts 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/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/chrome/index.d.ts b/types/chrome/index.d.ts similarity index 99% rename from chrome/index.d.ts rename to types/chrome/index.d.ts index b88ae5faf0..1b07c1c2e8 100644 --- a/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -4854,7 +4854,7 @@ declare namespace chrome.proxy { */ declare namespace chrome.runtime { /** This will be defined during an API method callback if there was an error */ - var lastError: LastError; + var lastError: LastError | undefined; /** The ID of the extension/app. */ var id: string; @@ -5974,6 +5974,12 @@ declare namespace chrome.tabs { 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. @@ -6557,6 +6563,12 @@ declare namespace chrome.tabs { * @since Chrome 38. */ var onZoomChange: TabZoomChangeEvent; + + /** + * An ID which represents the absence of a browser tab. + * @since Chrome 46. + */ + var TAB_ID_NONE: -1; } //////////////////// diff --git a/chrome/test/chrome-app.ts b/types/chrome/test/chrome-app.ts similarity index 100% rename from chrome/test/chrome-app.ts rename to types/chrome/test/chrome-app.ts diff --git a/chrome/test/index.ts b/types/chrome/test/index.ts similarity index 94% rename from chrome/test/index.ts rename to types/chrome/test/index.ts index 3074b8a0c3..3da3f534be 100644 --- a/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -194,6 +194,35 @@ function beforeRedditNavigation() { },{urls: ["http://*/*"], types: ["image"]}); } +// for chrome.tabs.InjectDetails.frameId +function executeScriptFramed () { + + const tabId = 123; + const frameId = 0; + + const code = "alert('hi');"; + + chrome.tabs.executeScript({frameId, code}); + chrome.tabs.insertCSS({frameId, code}); + + chrome.tabs.executeScript(tabId, {frameId, code}); + chrome.tabs.insertCSS(tabId, {frameId, code}); + +} + +// for chrome.tabs.TAB_ID_NONE +function realTabsOnly () { + chrome.webRequest.onBeforeRequest.addListener(function (details) { + if (details.tabId === chrome.tabs.TAB_ID_NONE) { + console.log("Request not related to a tab. %o", details); + return; + } + // ... + }, { + urls: [""] + }); +} + // contrived settings example function proxySettings() { chrome.proxy.settings.get({ incognito: true }, (details) => { diff --git a/chrome/tsconfig.json b/types/chrome/tsconfig.json similarity index 100% rename from chrome/tsconfig.json rename to types/chrome/tsconfig.json diff --git a/chui/chui-tests.ts b/types/chui/chui-tests.ts similarity index 100% rename from chui/chui-tests.ts rename to types/chui/chui-tests.ts diff --git a/chui/index.d.ts b/types/chui/index.d.ts similarity index 100% rename from chui/index.d.ts rename to types/chui/index.d.ts diff --git a/chui/tsconfig.json b/types/chui/tsconfig.json similarity index 100% rename from chui/tsconfig.json rename to types/chui/tsconfig.json diff --git a/chunked-dc/chunked-dc-tests.ts b/types/chunked-dc/chunked-dc-tests.ts similarity index 100% rename from chunked-dc/chunked-dc-tests.ts rename to types/chunked-dc/chunked-dc-tests.ts diff --git a/chunked-dc/index.d.ts b/types/chunked-dc/index.d.ts similarity index 100% rename from chunked-dc/index.d.ts rename to types/chunked-dc/index.d.ts diff --git a/chunked-dc/tsconfig.json b/types/chunked-dc/tsconfig.json similarity index 100% rename from chunked-dc/tsconfig.json rename to types/chunked-dc/tsconfig.json diff --git a/clndr/tslint.json b/types/chunked-dc/tslint.json similarity index 100% rename from clndr/tslint.json rename to types/chunked-dc/tslint.json diff --git a/circular-json/circular-json-tests.ts b/types/circular-json/circular-json-tests.ts similarity index 100% rename from circular-json/circular-json-tests.ts rename to types/circular-json/circular-json-tests.ts diff --git a/circular-json/index.d.ts b/types/circular-json/index.d.ts similarity index 100% rename from circular-json/index.d.ts rename to types/circular-json/index.d.ts diff --git a/circular-json/tsconfig.json b/types/circular-json/tsconfig.json similarity index 100% rename from circular-json/tsconfig.json rename to types/circular-json/tsconfig.json diff --git a/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts similarity index 100% rename from ckeditor/ckeditor-tests.ts rename to types/ckeditor/ckeditor-tests.ts diff --git a/ckeditor/index.d.ts b/types/ckeditor/index.d.ts similarity index 100% rename from ckeditor/index.d.ts rename to types/ckeditor/index.d.ts diff --git a/ckeditor/tsconfig.json b/types/ckeditor/tsconfig.json similarity index 100% rename from ckeditor/tsconfig.json rename to types/ckeditor/tsconfig.json diff --git a/clamp-js/clamp-js-tests.ts b/types/clamp-js/clamp-js-tests.ts old mode 100755 new mode 100644 similarity index 100% rename from clamp-js/clamp-js-tests.ts rename to types/clamp-js/clamp-js-tests.ts diff --git a/clamp-js/index.d.ts b/types/clamp-js/index.d.ts old mode 100755 new mode 100644 similarity index 82% rename from clamp-js/index.d.ts rename to types/clamp-js/index.d.ts index 2e86e544f7..2fa557bac6 --- a/clamp-js/index.d.ts +++ b/types/clamp-js/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace clamp { - export interface ClampOptions { + interface ClampOptions { clamp?: number|string; useNativeClamp?: boolean; splitOnChars?: string[]; @@ -13,9 +13,9 @@ declare namespace clamp { truncationHTML?: string | null; } - export interface ClampResponse { - 'original': string; - 'clamped': string; + interface ClampResponse { + original: string; + clamped: string; } } diff --git a/clamp-js/tsconfig.json b/types/clamp-js/tsconfig.json old mode 100755 new mode 100644 similarity index 100% rename from clamp-js/tsconfig.json rename to types/clamp-js/tsconfig.json diff --git a/code/tslint.json b/types/clamp-js/tslint.json similarity index 100% rename from code/tslint.json rename to types/clamp-js/tslint.json diff --git a/classnames/classnames-tests.ts b/types/classnames/classnames-tests.ts similarity index 100% rename from classnames/classnames-tests.ts rename to types/classnames/classnames-tests.ts diff --git a/classnames/index.d.ts b/types/classnames/index.d.ts similarity index 100% rename from classnames/index.d.ts rename to types/classnames/index.d.ts diff --git a/classnames/tsconfig.json b/types/classnames/tsconfig.json similarity index 100% rename from classnames/tsconfig.json rename to types/classnames/tsconfig.json diff --git a/cldrjs/UNUSED_FILES.txt b/types/cldrjs/UNUSED_FILES.txt similarity index 100% rename from cldrjs/UNUSED_FILES.txt rename to types/cldrjs/UNUSED_FILES.txt diff --git a/cldrjs/cldr.js-event.d.ts b/types/cldrjs/cldr.js-event.d.ts similarity index 100% rename from cldrjs/cldr.js-event.d.ts rename to types/cldrjs/cldr.js-event.d.ts diff --git a/cldrjs/cldr.js-supplemental.d.ts b/types/cldrjs/cldr.js-supplemental.d.ts similarity index 100% rename from cldrjs/cldr.js-supplemental.d.ts rename to types/cldrjs/cldr.js-supplemental.d.ts diff --git a/cldrjs/index.d.ts b/types/cldrjs/index.d.ts similarity index 100% rename from cldrjs/index.d.ts rename to types/cldrjs/index.d.ts diff --git a/cldrjs/test/event.ts b/types/cldrjs/test/event.ts similarity index 100% rename from cldrjs/test/event.ts rename to types/cldrjs/test/event.ts diff --git a/cldrjs/test/index.ts b/types/cldrjs/test/index.ts similarity index 100% rename from cldrjs/test/index.ts rename to types/cldrjs/test/index.ts diff --git a/cldrjs/test/supplemental.ts b/types/cldrjs/test/supplemental.ts similarity index 100% rename from cldrjs/test/supplemental.ts rename to types/cldrjs/test/supplemental.ts diff --git a/cldrjs/tsconfig.json b/types/cldrjs/tsconfig.json similarity index 100% rename from cldrjs/tsconfig.json rename to types/cldrjs/tsconfig.json diff --git a/clean-css/clean-css-tests.ts b/types/clean-css/clean-css-tests.ts similarity index 100% rename from clean-css/clean-css-tests.ts rename to types/clean-css/clean-css-tests.ts diff --git a/clean-css/index.d.ts b/types/clean-css/index.d.ts similarity index 100% rename from clean-css/index.d.ts rename to types/clean-css/index.d.ts diff --git a/clean-css/tsconfig.json b/types/clean-css/tsconfig.json similarity index 100% rename from clean-css/tsconfig.json rename to types/clean-css/tsconfig.json diff --git a/cli-color/cli-color-tests.ts b/types/cli-color/cli-color-tests.ts similarity index 100% rename from cli-color/cli-color-tests.ts rename to types/cli-color/cli-color-tests.ts diff --git a/cli-color/index.d.ts b/types/cli-color/index.d.ts similarity index 100% rename from cli-color/index.d.ts rename to types/cli-color/index.d.ts diff --git a/cli-color/tsconfig.json b/types/cli-color/tsconfig.json similarity index 100% rename from cli-color/tsconfig.json rename to types/cli-color/tsconfig.json diff --git a/cli/cli-tests.ts b/types/cli/cli-tests.ts similarity index 100% rename from cli/cli-tests.ts rename to types/cli/cli-tests.ts diff --git a/cli/index.d.ts b/types/cli/index.d.ts similarity index 100% rename from cli/index.d.ts rename to types/cli/index.d.ts diff --git a/cli/tsconfig.json b/types/cli/tsconfig.json similarity index 100% rename from cli/tsconfig.json rename to types/cli/tsconfig.json diff --git a/fix b/types/cliff/cliff-tests.ts similarity index 100% rename from fix rename to types/cliff/cliff-tests.ts diff --git a/cliff/index.d.ts b/types/cliff/index.d.ts similarity index 100% rename from cliff/index.d.ts rename to types/cliff/index.d.ts diff --git a/cliff/tsconfig.json b/types/cliff/tsconfig.json similarity index 100% rename from cliff/tsconfig.json rename to types/cliff/tsconfig.json diff --git a/clipboard-js/clipboard-js-tests.ts b/types/clipboard-js/clipboard-js-tests.ts similarity index 100% rename from clipboard-js/clipboard-js-tests.ts rename to types/clipboard-js/clipboard-js-tests.ts diff --git a/clipboard-js/index.d.ts b/types/clipboard-js/index.d.ts similarity index 100% rename from clipboard-js/index.d.ts rename to types/clipboard-js/index.d.ts diff --git a/clipboard-js/tsconfig.json b/types/clipboard-js/tsconfig.json similarity index 100% rename from clipboard-js/tsconfig.json rename to types/clipboard-js/tsconfig.json diff --git a/clipboard/clipboard-tests.ts b/types/clipboard/clipboard-tests.ts similarity index 100% rename from clipboard/clipboard-tests.ts rename to types/clipboard/clipboard-tests.ts diff --git a/clipboard/index.d.ts b/types/clipboard/index.d.ts similarity index 100% rename from clipboard/index.d.ts rename to types/clipboard/index.d.ts diff --git a/clipboard/tsconfig.json b/types/clipboard/tsconfig.json similarity index 100% rename from clipboard/tsconfig.json rename to types/clipboard/tsconfig.json diff --git a/codependency/tslint.json b/types/clipboard/tslint.json similarity index 100% rename from codependency/tslint.json rename to types/clipboard/tslint.json diff --git a/clndr/clndr-tests.ts b/types/clndr/clndr-tests.ts similarity index 100% rename from clndr/clndr-tests.ts rename to types/clndr/clndr-tests.ts diff --git a/clndr/index.d.ts b/types/clndr/index.d.ts similarity index 100% rename from clndr/index.d.ts rename to types/clndr/index.d.ts diff --git a/clndr/package.json b/types/clndr/package.json similarity index 100% rename from clndr/package.json rename to types/clndr/package.json diff --git a/clndr/tsconfig.json b/types/clndr/tsconfig.json similarity index 100% rename from clndr/tsconfig.json rename to types/clndr/tsconfig.json diff --git a/coinstring/tslint.json b/types/clndr/tslint.json similarity index 100% rename from coinstring/tslint.json rename to types/clndr/tslint.json diff --git a/clone/clone-tests.ts b/types/clone/clone-tests.ts similarity index 100% rename from clone/clone-tests.ts rename to types/clone/clone-tests.ts diff --git a/clone/index.d.ts b/types/clone/index.d.ts similarity index 100% rename from clone/index.d.ts rename to types/clone/index.d.ts diff --git a/clone/tsconfig.json b/types/clone/tsconfig.json similarity index 100% rename from clone/tsconfig.json rename to types/clone/tsconfig.json diff --git a/closure-compiler/closure-compiler-tests.ts b/types/closure-compiler/closure-compiler-tests.ts similarity index 100% rename from closure-compiler/closure-compiler-tests.ts rename to types/closure-compiler/closure-compiler-tests.ts diff --git a/closure-compiler/index.d.ts b/types/closure-compiler/index.d.ts similarity index 100% rename from closure-compiler/index.d.ts rename to types/closure-compiler/index.d.ts diff --git a/closure-compiler/tsconfig.json b/types/closure-compiler/tsconfig.json similarity index 100% rename from closure-compiler/tsconfig.json rename to types/closure-compiler/tsconfig.json diff --git a/co-body/co-body-tests.ts b/types/co-body/co-body-tests.ts similarity index 93% rename from co-body/co-body-tests.ts rename to types/co-body/co-body-tests.ts index 6011632399..944cadd394 100644 --- a/co-body/co-body-tests.ts +++ b/types/co-body/co-body-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as koa from 'koa'; import * as parse from 'co-body'; diff --git a/co-body/index.d.ts b/types/co-body/index.d.ts similarity index 100% rename from co-body/index.d.ts rename to types/co-body/index.d.ts diff --git a/co-body/tsconfig.json b/types/co-body/tsconfig.json similarity index 100% rename from co-body/tsconfig.json rename to types/co-body/tsconfig.json diff --git a/co-views/co-views-tests.ts b/types/co-views/co-views-tests.ts similarity index 100% rename from co-views/co-views-tests.ts rename to types/co-views/co-views-tests.ts diff --git a/co-views/index.d.ts b/types/co-views/index.d.ts similarity index 96% rename from co-views/index.d.ts rename to types/co-views/index.d.ts index 5df2238c12..3eda7191b1 100644 --- a/co-views/index.d.ts +++ b/types/co-views/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace CoViews { - export interface Options { + interface Options { /** * default extname */ diff --git a/co-views/tsconfig.json b/types/co-views/tsconfig.json similarity index 100% rename from co-views/tsconfig.json rename to types/co-views/tsconfig.json diff --git a/co-views/tslint.json b/types/co-views/tslint.json similarity index 100% rename from co-views/tslint.json rename to types/co-views/tslint.json diff --git a/code/code-tests.ts b/types/code/code-tests.ts similarity index 100% rename from code/code-tests.ts rename to types/code/code-tests.ts diff --git a/code/index.d.ts b/types/code/index.d.ts similarity index 100% rename from code/index.d.ts rename to types/code/index.d.ts diff --git a/code/tsconfig.json b/types/code/tsconfig.json similarity index 100% rename from code/tsconfig.json rename to types/code/tsconfig.json diff --git a/colors/tslint.json b/types/code/tslint.json similarity index 100% rename from colors/tslint.json rename to types/code/tslint.json diff --git a/codemirror/codemirror-matchbrackets.d.ts b/types/codemirror/codemirror-matchbrackets.d.ts similarity index 100% rename from codemirror/codemirror-matchbrackets.d.ts rename to types/codemirror/codemirror-matchbrackets.d.ts diff --git a/codemirror/codemirror-runmode.d.ts b/types/codemirror/codemirror-runmode.d.ts similarity index 100% rename from codemirror/codemirror-runmode.d.ts rename to types/codemirror/codemirror-runmode.d.ts diff --git a/codemirror/codemirror-showhint.d.ts b/types/codemirror/codemirror-showhint.d.ts similarity index 100% rename from codemirror/codemirror-showhint.d.ts rename to types/codemirror/codemirror-showhint.d.ts diff --git a/codemirror/index.d.ts b/types/codemirror/index.d.ts similarity index 100% rename from codemirror/index.d.ts rename to types/codemirror/index.d.ts diff --git a/codemirror/searchcursor.d.ts b/types/codemirror/searchcursor.d.ts similarity index 100% rename from codemirror/searchcursor.d.ts rename to types/codemirror/searchcursor.d.ts diff --git a/codemirror/test/index.ts b/types/codemirror/test/index.ts similarity index 100% rename from codemirror/test/index.ts rename to types/codemirror/test/index.ts diff --git a/codemirror/test/matchbrackets.ts b/types/codemirror/test/matchbrackets.ts similarity index 100% rename from codemirror/test/matchbrackets.ts rename to types/codemirror/test/matchbrackets.ts diff --git a/codemirror/test/runmode.ts b/types/codemirror/test/runmode.ts similarity index 100% rename from codemirror/test/runmode.ts rename to types/codemirror/test/runmode.ts diff --git a/codemirror/test/searchcursor.ts b/types/codemirror/test/searchcursor.ts similarity index 100% rename from codemirror/test/searchcursor.ts rename to types/codemirror/test/searchcursor.ts diff --git a/codemirror/test/showhint.ts b/types/codemirror/test/showhint.ts similarity index 100% rename from codemirror/test/showhint.ts rename to types/codemirror/test/showhint.ts diff --git a/codemirror/tsconfig.json b/types/codemirror/tsconfig.json similarity index 100% rename from codemirror/tsconfig.json rename to types/codemirror/tsconfig.json diff --git a/codependency/codependency-tests.ts b/types/codependency/codependency-tests.ts similarity index 100% rename from codependency/codependency-tests.ts rename to types/codependency/codependency-tests.ts diff --git a/codependency/index.d.ts b/types/codependency/index.d.ts similarity index 100% rename from codependency/index.d.ts rename to types/codependency/index.d.ts diff --git a/codependency/tsconfig.json b/types/codependency/tsconfig.json similarity index 100% rename from codependency/tsconfig.json rename to types/codependency/tsconfig.json diff --git a/combined-stream/tslint.json b/types/codependency/tslint.json similarity index 100% rename from combined-stream/tslint.json rename to types/codependency/tslint.json diff --git a/coffeeify/coffeeify-tests.ts b/types/coffeeify/coffeeify-tests.ts similarity index 100% rename from coffeeify/coffeeify-tests.ts rename to types/coffeeify/coffeeify-tests.ts diff --git a/coffeeify/index.d.ts b/types/coffeeify/index.d.ts similarity index 100% rename from coffeeify/index.d.ts rename to types/coffeeify/index.d.ts diff --git a/coffeeify/tsconfig.json b/types/coffeeify/tsconfig.json similarity index 100% rename from coffeeify/tsconfig.json rename to types/coffeeify/tsconfig.json diff --git a/coinstring/coinstring-tests.ts b/types/coinstring/coinstring-tests.ts similarity index 98% rename from coinstring/coinstring-tests.ts rename to types/coinstring/coinstring-tests.ts index ab11a44fb7..1cc3fb9a42 100644 --- a/coinstring/coinstring-tests.ts +++ b/types/coinstring/coinstring-tests.ts @@ -1,8 +1,5 @@ -/// - import cs = require('coinstring'); - var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); var version = 0x80; // Bitcoin private key diff --git a/coinstring/index.d.ts b/types/coinstring/index.d.ts similarity index 100% rename from coinstring/index.d.ts rename to types/coinstring/index.d.ts diff --git a/coinstring/tsconfig.json b/types/coinstring/tsconfig.json similarity index 100% rename from coinstring/tsconfig.json rename to types/coinstring/tsconfig.json diff --git a/comment-json/tslint.json b/types/coinstring/tslint.json similarity index 100% rename from comment-json/tslint.json rename to types/coinstring/tslint.json diff --git a/color/color-tests.ts b/types/color/color-tests.ts similarity index 100% rename from color/color-tests.ts rename to types/color/color-tests.ts diff --git a/color/index.d.ts b/types/color/index.d.ts similarity index 100% rename from color/index.d.ts rename to types/color/index.d.ts diff --git a/color/tsconfig.json b/types/color/tsconfig.json similarity index 100% rename from color/tsconfig.json rename to types/color/tsconfig.json diff --git a/color/v0/color-tests.ts b/types/color/v0/color-tests.ts similarity index 100% rename from color/v0/color-tests.ts rename to types/color/v0/color-tests.ts diff --git a/color/v0/index.d.ts b/types/color/v0/index.d.ts similarity index 100% rename from color/v0/index.d.ts rename to types/color/v0/index.d.ts diff --git a/color/v0/tsconfig.json b/types/color/v0/tsconfig.json similarity index 100% rename from color/v0/tsconfig.json rename to types/color/v0/tsconfig.json diff --git a/colorbrewer/colorbrewer-tests.ts b/types/colorbrewer/colorbrewer-tests.ts similarity index 100% rename from colorbrewer/colorbrewer-tests.ts rename to types/colorbrewer/colorbrewer-tests.ts diff --git a/colorbrewer/index.d.ts b/types/colorbrewer/index.d.ts similarity index 100% rename from colorbrewer/index.d.ts rename to types/colorbrewer/index.d.ts diff --git a/colorbrewer/tsconfig.json b/types/colorbrewer/tsconfig.json similarity index 100% rename from colorbrewer/tsconfig.json rename to types/colorbrewer/tsconfig.json diff --git a/colors/colors-tests.ts b/types/colors/colors-tests.ts similarity index 100% rename from colors/colors-tests.ts rename to types/colors/colors-tests.ts diff --git a/colors/index.d.ts b/types/colors/index.d.ts similarity index 100% rename from colors/index.d.ts rename to types/colors/index.d.ts diff --git a/colors/safe.d.ts b/types/colors/safe.d.ts similarity index 100% rename from colors/safe.d.ts rename to types/colors/safe.d.ts diff --git a/colors/tsconfig.json b/types/colors/tsconfig.json similarity index 100% rename from colors/tsconfig.json rename to types/colors/tsconfig.json diff --git a/concat-stream/tslint.json b/types/colors/tslint.json similarity index 100% rename from concat-stream/tslint.json rename to types/colors/tslint.json diff --git a/com.darktalker.cordova.screenshot/com.darktalker.cordova.screenshot-tests.ts b/types/com.darktalker.cordova.screenshot/com.darktalker.cordova.screenshot-tests.ts similarity index 100% rename from com.darktalker.cordova.screenshot/com.darktalker.cordova.screenshot-tests.ts rename to types/com.darktalker.cordova.screenshot/com.darktalker.cordova.screenshot-tests.ts diff --git a/com.darktalker.cordova.screenshot/index.d.ts b/types/com.darktalker.cordova.screenshot/index.d.ts similarity index 100% rename from com.darktalker.cordova.screenshot/index.d.ts rename to types/com.darktalker.cordova.screenshot/index.d.ts diff --git a/com.darktalker.cordova.screenshot/tsconfig.json b/types/com.darktalker.cordova.screenshot/tsconfig.json similarity index 100% rename from com.darktalker.cordova.screenshot/tsconfig.json rename to types/com.darktalker.cordova.screenshot/tsconfig.json diff --git a/combined-stream/combined-stream-tests.ts b/types/combined-stream/combined-stream-tests.ts similarity index 100% rename from combined-stream/combined-stream-tests.ts rename to types/combined-stream/combined-stream-tests.ts diff --git a/combined-stream/index.d.ts b/types/combined-stream/index.d.ts similarity index 91% rename from combined-stream/index.d.ts rename to types/combined-stream/index.d.ts index cada758701..271814a4af 100644 --- a/combined-stream/index.d.ts +++ b/types/combined-stream/index.d.ts @@ -43,14 +43,14 @@ declare class CombinedStream extends Stream implements CombinedStream.Options { } declare namespace CombinedStream { - export interface Options { + interface Options { maxDataSize?: number; pauseStreams?: boolean; } - export function create(options?: Options): CombinedStream; + function create(options?: Options): CombinedStream; - export function isStreamLike(stream: any): stream is Stream; + function isStreamLike(stream: any): stream is Stream; } export = CombinedStream; diff --git a/combined-stream/tsconfig.json b/types/combined-stream/tsconfig.json similarity index 100% rename from combined-stream/tsconfig.json rename to types/combined-stream/tsconfig.json diff --git a/conf/tslint.json b/types/combined-stream/tslint.json similarity index 100% rename from conf/tslint.json rename to types/combined-stream/tslint.json diff --git a/combokeys/combokeys-tests.ts b/types/combokeys/combokeys-tests.ts similarity index 100% rename from combokeys/combokeys-tests.ts rename to types/combokeys/combokeys-tests.ts diff --git a/combokeys/index.d.ts b/types/combokeys/index.d.ts similarity index 100% rename from combokeys/index.d.ts rename to types/combokeys/index.d.ts diff --git a/combokeys/tsconfig.json b/types/combokeys/tsconfig.json similarity index 100% rename from combokeys/tsconfig.json rename to types/combokeys/tsconfig.json diff --git a/cometd/index.d.ts b/types/cometd/index.d.ts similarity index 100% rename from cometd/index.d.ts rename to types/cometd/index.d.ts diff --git a/cometd/tsconfig.json b/types/cometd/tsconfig.json similarity index 100% rename from cometd/tsconfig.json rename to types/cometd/tsconfig.json diff --git a/commander/commander-tests.ts b/types/commander/commander-tests.ts similarity index 100% rename from commander/commander-tests.ts rename to types/commander/commander-tests.ts diff --git a/commander/index.d.ts b/types/commander/index.d.ts similarity index 100% rename from commander/index.d.ts rename to types/commander/index.d.ts diff --git a/commander/tsconfig.json b/types/commander/tsconfig.json similarity index 100% rename from commander/tsconfig.json rename to types/commander/tsconfig.json diff --git a/commangular/commangular-mock.d.ts b/types/commangular/commangular-mock.d.ts similarity index 100% rename from commangular/commangular-mock.d.ts rename to types/commangular/commangular-mock.d.ts diff --git a/commangular/index.d.ts b/types/commangular/index.d.ts similarity index 100% rename from commangular/index.d.ts rename to types/commangular/index.d.ts diff --git a/commangular/tsconfig.json b/types/commangular/tsconfig.json similarity index 100% rename from commangular/tsconfig.json rename to types/commangular/tsconfig.json diff --git a/comment-json/comment-json-tests.ts b/types/comment-json/comment-json-tests.ts similarity index 100% rename from comment-json/comment-json-tests.ts rename to types/comment-json/comment-json-tests.ts diff --git a/comment-json/index.d.ts b/types/comment-json/index.d.ts similarity index 100% rename from comment-json/index.d.ts rename to types/comment-json/index.d.ts diff --git a/comment-json/tsconfig.json b/types/comment-json/tsconfig.json similarity index 100% rename from comment-json/tsconfig.json rename to types/comment-json/tsconfig.json diff --git a/configstore/tslint.json b/types/comment-json/tslint.json similarity index 100% rename from configstore/tslint.json rename to types/comment-json/tslint.json diff --git a/common-tags/common-tags-tests.ts b/types/common-tags/common-tags-tests.ts similarity index 100% rename from common-tags/common-tags-tests.ts rename to types/common-tags/common-tags-tests.ts diff --git a/common-tags/index.d.ts b/types/common-tags/index.d.ts similarity index 100% rename from common-tags/index.d.ts rename to types/common-tags/index.d.ts diff --git a/common-tags/tsconfig.json b/types/common-tags/tsconfig.json similarity index 100% rename from common-tags/tsconfig.json rename to types/common-tags/tsconfig.json diff --git a/commonmark/commonmark-tests.ts b/types/commonmark/commonmark-tests.ts similarity index 100% rename from commonmark/commonmark-tests.ts rename to types/commonmark/commonmark-tests.ts diff --git a/commonmark/index.d.ts b/types/commonmark/index.d.ts similarity index 100% rename from commonmark/index.d.ts rename to types/commonmark/index.d.ts diff --git a/commonmark/tsconfig.json b/types/commonmark/tsconfig.json similarity index 100% rename from commonmark/tsconfig.json rename to types/commonmark/tsconfig.json diff --git a/compare-version/compare-version-tests.ts b/types/compare-version/compare-version-tests.ts similarity index 100% rename from compare-version/compare-version-tests.ts rename to types/compare-version/compare-version-tests.ts diff --git a/compare-version/index.d.ts b/types/compare-version/index.d.ts similarity index 100% rename from compare-version/index.d.ts rename to types/compare-version/index.d.ts diff --git a/compare-version/tsconfig.json b/types/compare-version/tsconfig.json similarity index 100% rename from compare-version/tsconfig.json rename to types/compare-version/tsconfig.json diff --git a/complex/complex-tests.ts b/types/complex/complex-tests.ts similarity index 100% rename from complex/complex-tests.ts rename to types/complex/complex-tests.ts diff --git a/complex/index.d.ts b/types/complex/index.d.ts similarity index 100% rename from complex/index.d.ts rename to types/complex/index.d.ts diff --git a/complex/tsconfig.json b/types/complex/tsconfig.json similarity index 100% rename from complex/tsconfig.json rename to types/complex/tsconfig.json diff --git a/component-emitter/component-emitter-tests.ts b/types/component-emitter/component-emitter-tests.ts similarity index 100% rename from component-emitter/component-emitter-tests.ts rename to types/component-emitter/component-emitter-tests.ts diff --git a/component-emitter/index.d.ts b/types/component-emitter/index.d.ts similarity index 100% rename from component-emitter/index.d.ts rename to types/component-emitter/index.d.ts diff --git a/component-emitter/tsconfig.json b/types/component-emitter/tsconfig.json similarity index 100% rename from component-emitter/tsconfig.json rename to types/component-emitter/tsconfig.json diff --git a/compose-function/compose-function-tests.ts b/types/compose-function/compose-function-tests.ts similarity index 100% rename from compose-function/compose-function-tests.ts rename to types/compose-function/compose-function-tests.ts diff --git a/compose-function/index.d.ts b/types/compose-function/index.d.ts similarity index 100% rename from compose-function/index.d.ts rename to types/compose-function/index.d.ts diff --git a/compose-function/tsconfig.json b/types/compose-function/tsconfig.json similarity index 100% rename from compose-function/tsconfig.json rename to types/compose-function/tsconfig.json diff --git a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts new file mode 100644 index 0000000000..3939bf5847 --- /dev/null +++ b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -0,0 +1,14 @@ +import { Configuration } from 'webpack'; +import CompressionPlugin = require('compression-webpack-plugin'); + +const c: Configuration = { + plugins: [ + new CompressionPlugin({ + asset: "[path].gz[query]", + algorithm: "gzip", + test: /\.js$|\.html$/, + threshold: 10240, + minRatio: 0.8 + }) + ] +}; diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..4f2453e3b1 --- /dev/null +++ b/types/compression-webpack-plugin/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for compression-webpack-plugin 0.3 +// Project: https://github.com/webpack-contrib/compression-webpack-plugin +// Definitions by: Anton Kandybo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = CompressionPlugin; + +declare class CompressionPlugin extends Plugin { + constructor(options?: CompressionPlugin.Options); +} + +declare namespace CompressionPlugin { + interface Options { + asset?: string; + algorithm?: string; + test?: RegExp | RegExp[]; + regExp?: RegExp | RegExp[]; + threshold?: number; + minRatio?: number; + + // zopfli options + verbose?: boolean; + verbose_more?: boolean; + numiterations?: number; + blocksplitting?: boolean; + blocksplittinglast?: boolean; + blocksplittingmax?: number; + + // zlib options + level?: number; + flush?: number; + chunkSize?: number; + windowBits?: number; + memLevel?: number; + strategy?: number; + dictionary?: any; + } +} diff --git a/types/compression-webpack-plugin/tsconfig.json b/types/compression-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..70383d3658 --- /dev/null +++ b/types/compression-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "compression-webpack-plugin-tests.ts" + ] +} diff --git a/types/compression-webpack-plugin/tslint.json b/types/compression-webpack-plugin/tslint.json new file mode 100644 index 0000000000..70cee1ba88 --- /dev/null +++ b/types/compression-webpack-plugin/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "../tslint.json" +} + \ No newline at end of file diff --git a/compression/compression-tests.ts b/types/compression/compression-tests.ts similarity index 100% rename from compression/compression-tests.ts rename to types/compression/compression-tests.ts diff --git a/compression/index.d.ts b/types/compression/index.d.ts similarity index 100% rename from compression/index.d.ts rename to types/compression/index.d.ts diff --git a/compression/tsconfig.json b/types/compression/tsconfig.json similarity index 100% rename from compression/tsconfig.json rename to types/compression/tsconfig.json diff --git a/concat-stream/concat-stream-tests.ts b/types/concat-stream/concat-stream-tests.ts similarity index 100% rename from concat-stream/concat-stream-tests.ts rename to types/concat-stream/concat-stream-tests.ts diff --git a/concat-stream/index.d.ts b/types/concat-stream/index.d.ts similarity index 100% rename from concat-stream/index.d.ts rename to types/concat-stream/index.d.ts diff --git a/concat-stream/tsconfig.json b/types/concat-stream/tsconfig.json similarity index 100% rename from concat-stream/tsconfig.json rename to types/concat-stream/tsconfig.json diff --git a/connect-ensure-login/tslint.json b/types/concat-stream/tslint.json similarity index 100% rename from connect-ensure-login/tslint.json rename to types/concat-stream/tslint.json diff --git a/concaveman/concaveman-tests.ts b/types/concaveman/concaveman-tests.ts similarity index 100% rename from concaveman/concaveman-tests.ts rename to types/concaveman/concaveman-tests.ts diff --git a/concaveman/index.d.ts b/types/concaveman/index.d.ts similarity index 100% rename from concaveman/index.d.ts rename to types/concaveman/index.d.ts diff --git a/concaveman/tsconfig.json b/types/concaveman/tsconfig.json similarity index 100% rename from concaveman/tsconfig.json rename to types/concaveman/tsconfig.json diff --git a/conf/conf-tests.ts b/types/conf/conf-tests.ts similarity index 100% rename from conf/conf-tests.ts rename to types/conf/conf-tests.ts diff --git a/conf/index.d.ts b/types/conf/index.d.ts similarity index 100% rename from conf/index.d.ts rename to types/conf/index.d.ts diff --git a/conf/tsconfig.json b/types/conf/tsconfig.json similarity index 100% rename from conf/tsconfig.json rename to types/conf/tsconfig.json diff --git a/content-disposition/tslint.json b/types/conf/tslint.json similarity index 100% rename from content-disposition/tslint.json rename to types/conf/tslint.json diff --git a/confidence/confidence-tests.ts b/types/confidence/confidence-tests.ts similarity index 100% rename from confidence/confidence-tests.ts rename to types/confidence/confidence-tests.ts diff --git a/confidence/index.d.ts b/types/confidence/index.d.ts similarity index 100% rename from confidence/index.d.ts rename to types/confidence/index.d.ts diff --git a/confidence/tsconfig.json b/types/confidence/tsconfig.json similarity index 100% rename from confidence/tsconfig.json rename to types/confidence/tsconfig.json diff --git a/config/config-tests.ts b/types/config/config-tests.ts similarity index 100% rename from config/config-tests.ts rename to types/config/config-tests.ts diff --git a/config/index.d.ts b/types/config/index.d.ts similarity index 100% rename from config/index.d.ts rename to types/config/index.d.ts diff --git a/config/tsconfig.json b/types/config/tsconfig.json similarity index 100% rename from config/tsconfig.json rename to types/config/tsconfig.json diff --git a/configstore/configstore-tests.ts b/types/configstore/configstore-tests.ts similarity index 59% rename from configstore/configstore-tests.ts rename to types/configstore/configstore-tests.ts index 724dbe9a38..ffd04e31a7 100644 --- a/configstore/configstore-tests.ts +++ b/types/configstore/configstore-tests.ts @@ -1,12 +1,10 @@ - import Configstore = require('configstore'); -var cs = new Configstore('foo'); +const cs = new Configstore('foo'); -var value: any; -var key: string; -var num: number; -var bool: any; -var object: any; +let value: any; +let key: string; +let num: number; +let object: any; cs.set(key, value); value = cs.get(key); diff --git a/configstore/index.d.ts b/types/configstore/index.d.ts similarity index 97% rename from configstore/index.d.ts rename to types/configstore/index.d.ts index 628a4a1d6c..2617f2bce0 100644 --- a/configstore/index.d.ts +++ b/types/configstore/index.d.ts @@ -65,7 +65,7 @@ declare class Configstore { } declare namespace Configstore { - export interface ConfigstoreOptions { + interface ConfigstoreOptions { globalConfigPath?: boolean; } } diff --git a/configstore/tsconfig.json b/types/configstore/tsconfig.json similarity index 100% rename from configstore/tsconfig.json rename to types/configstore/tsconfig.json diff --git a/convert-source-map/tslint.json b/types/configstore/tslint.json similarity index 100% rename from convert-source-map/tslint.json rename to types/configstore/tslint.json diff --git a/confit/confit-tests.ts b/types/confit/confit-tests.ts similarity index 100% rename from confit/confit-tests.ts rename to types/confit/confit-tests.ts diff --git a/confit/index.d.ts b/types/confit/index.d.ts similarity index 100% rename from confit/index.d.ts rename to types/confit/index.d.ts diff --git a/confit/tsconfig.json b/types/confit/tsconfig.json similarity index 100% rename from confit/tsconfig.json rename to types/confit/tsconfig.json diff --git a/connect-ensure-login/connect-ensure-login-tests.ts b/types/connect-ensure-login/connect-ensure-login-tests.ts similarity index 98% rename from connect-ensure-login/connect-ensure-login-tests.ts rename to types/connect-ensure-login/connect-ensure-login-tests.ts index 68ce1a76a2..708f76a9ba 100644 --- a/connect-ensure-login/connect-ensure-login-tests.ts +++ b/types/connect-ensure-login/connect-ensure-login-tests.ts @@ -10,4 +10,4 @@ login.ensureLoggedOut(); login.ensureLoggedOut("/"); login.ensureLoggedOut({ redirectTo: "/", -}); \ No newline at end of file +}); diff --git a/connect-ensure-login/index.d.ts b/types/connect-ensure-login/index.d.ts similarity index 91% rename from connect-ensure-login/index.d.ts rename to types/connect-ensure-login/index.d.ts index d542f63a90..fb1716abf9 100644 --- a/connect-ensure-login/index.d.ts +++ b/types/connect-ensure-login/index.d.ts @@ -47,7 +47,7 @@ interface LoggedOutOptions { * ensureLoggedIn({ redirectTo: '/session/new', setReturnTo: false }), * function(req, res) { ... }); */ -export declare function ensureLoggedIn(options?: LoggedInOptions | string): RequestHandler; +export function ensureLoggedIn(options?: LoggedInOptions | string): RequestHandler; /** * Ensure that no user is logged in before proceeding to next route middleware. @@ -70,4 +70,4 @@ export declare function ensureLoggedIn(options?: LoggedInOptions | string): Requ * ensureLoggedOut({ redirectTo: '/home' }), * function(req, res) { ... }); */ -export declare function ensureLoggedOut(options?: LoggedOutOptions | string): RequestHandler; \ No newline at end of file +export function ensureLoggedOut(options?: LoggedOutOptions | string): RequestHandler; diff --git a/connect-ensure-login/tsconfig.json b/types/connect-ensure-login/tsconfig.json similarity index 100% rename from connect-ensure-login/tsconfig.json rename to types/connect-ensure-login/tsconfig.json diff --git a/cookie-signature/tslint.json b/types/connect-ensure-login/tslint.json similarity index 100% rename from cookie-signature/tslint.json rename to types/connect-ensure-login/tslint.json diff --git a/connect-flash/connect-flash-tests.ts b/types/connect-flash/connect-flash-tests.ts similarity index 100% rename from connect-flash/connect-flash-tests.ts rename to types/connect-flash/connect-flash-tests.ts diff --git a/connect-flash/index.d.ts b/types/connect-flash/index.d.ts similarity index 100% rename from connect-flash/index.d.ts rename to types/connect-flash/index.d.ts diff --git a/connect-flash/tsconfig.json b/types/connect-flash/tsconfig.json similarity index 100% rename from connect-flash/tsconfig.json rename to types/connect-flash/tsconfig.json diff --git a/connect-livereload/connect-livereload-tests.ts b/types/connect-livereload/connect-livereload-tests.ts similarity index 100% rename from connect-livereload/connect-livereload-tests.ts rename to types/connect-livereload/connect-livereload-tests.ts diff --git a/connect-livereload/index.d.ts b/types/connect-livereload/index.d.ts similarity index 100% rename from connect-livereload/index.d.ts rename to types/connect-livereload/index.d.ts diff --git a/connect-livereload/tsconfig.json b/types/connect-livereload/tsconfig.json similarity index 100% rename from connect-livereload/tsconfig.json rename to types/connect-livereload/tsconfig.json diff --git a/connect-modrewrite/connect-modrewrite-tests.ts b/types/connect-modrewrite/connect-modrewrite-tests.ts similarity index 100% rename from connect-modrewrite/connect-modrewrite-tests.ts rename to types/connect-modrewrite/connect-modrewrite-tests.ts diff --git a/connect-modrewrite/index.d.ts b/types/connect-modrewrite/index.d.ts similarity index 100% rename from connect-modrewrite/index.d.ts rename to types/connect-modrewrite/index.d.ts diff --git a/connect-modrewrite/tsconfig.json b/types/connect-modrewrite/tsconfig.json similarity index 100% rename from connect-modrewrite/tsconfig.json rename to types/connect-modrewrite/tsconfig.json diff --git a/connect-mongo/connect-mongo-tests.ts b/types/connect-mongo/connect-mongo-tests.ts similarity index 100% rename from connect-mongo/connect-mongo-tests.ts rename to types/connect-mongo/connect-mongo-tests.ts diff --git a/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts similarity index 100% rename from connect-mongo/index.d.ts rename to types/connect-mongo/index.d.ts diff --git a/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json similarity index 100% rename from connect-mongo/tsconfig.json rename to types/connect-mongo/tsconfig.json diff --git a/connect-redis/connect-redis-tests.ts b/types/connect-redis/connect-redis-tests.ts similarity index 75% rename from connect-redis/connect-redis-tests.ts rename to types/connect-redis/connect-redis-tests.ts index ed21f3b4be..3c50074117 100644 --- a/connect-redis/connect-redis-tests.ts +++ b/types/connect-redis/connect-redis-tests.ts @@ -1,5 +1,3 @@ -/// - import * as connectRedis from "connect-redis"; import * as session from "express-session"; diff --git a/connect-redis/index.d.ts b/types/connect-redis/index.d.ts similarity index 100% rename from connect-redis/index.d.ts rename to types/connect-redis/index.d.ts diff --git a/connect-redis/tsconfig.json b/types/connect-redis/tsconfig.json similarity index 100% rename from connect-redis/tsconfig.json rename to types/connect-redis/tsconfig.json diff --git a/connect-slashes/connect-slashes-tests.ts b/types/connect-slashes/connect-slashes-tests.ts similarity index 100% rename from connect-slashes/connect-slashes-tests.ts rename to types/connect-slashes/connect-slashes-tests.ts diff --git a/connect-slashes/index.d.ts b/types/connect-slashes/index.d.ts similarity index 100% rename from connect-slashes/index.d.ts rename to types/connect-slashes/index.d.ts diff --git a/connect-slashes/tsconfig.json b/types/connect-slashes/tsconfig.json similarity index 100% rename from connect-slashes/tsconfig.json rename to types/connect-slashes/tsconfig.json diff --git a/connect-timeout/connect-timeout-tests.ts b/types/connect-timeout/connect-timeout-tests.ts similarity index 100% rename from connect-timeout/connect-timeout-tests.ts rename to types/connect-timeout/connect-timeout-tests.ts diff --git a/connect-timeout/index.d.ts b/types/connect-timeout/index.d.ts similarity index 100% rename from connect-timeout/index.d.ts rename to types/connect-timeout/index.d.ts diff --git a/connect-timeout/tsconfig.json b/types/connect-timeout/tsconfig.json similarity index 100% rename from connect-timeout/tsconfig.json rename to types/connect-timeout/tsconfig.json diff --git a/connect/connect-tests.ts b/types/connect/connect-tests.ts similarity index 100% rename from connect/connect-tests.ts rename to types/connect/connect-tests.ts diff --git a/connect/index.d.ts b/types/connect/index.d.ts similarity index 100% rename from connect/index.d.ts rename to types/connect/index.d.ts diff --git a/connect/tsconfig.json b/types/connect/tsconfig.json similarity index 100% rename from connect/tsconfig.json rename to types/connect/tsconfig.json diff --git a/console-stamp/console-stamp-tests.ts b/types/console-stamp/console-stamp-tests.ts similarity index 100% rename from console-stamp/console-stamp-tests.ts rename to types/console-stamp/console-stamp-tests.ts diff --git a/console-stamp/index.d.ts b/types/console-stamp/index.d.ts similarity index 100% rename from console-stamp/index.d.ts rename to types/console-stamp/index.d.ts diff --git a/console-stamp/tsconfig.json b/types/console-stamp/tsconfig.json similarity index 100% rename from console-stamp/tsconfig.json rename to types/console-stamp/tsconfig.json diff --git a/consolidate/consolidate-tests.ts b/types/consolidate/consolidate-tests.ts similarity index 100% rename from consolidate/consolidate-tests.ts rename to types/consolidate/consolidate-tests.ts diff --git a/consolidate/index.d.ts b/types/consolidate/index.d.ts similarity index 100% rename from consolidate/index.d.ts rename to types/consolidate/index.d.ts diff --git a/consolidate/tsconfig.json b/types/consolidate/tsconfig.json similarity index 100% rename from consolidate/tsconfig.json rename to types/consolidate/tsconfig.json diff --git a/consul/consul-tests.ts b/types/consul/consul-tests.ts similarity index 100% rename from consul/consul-tests.ts rename to types/consul/consul-tests.ts diff --git a/consul/index.d.ts b/types/consul/index.d.ts similarity index 100% rename from consul/index.d.ts rename to types/consul/index.d.ts diff --git a/consul/tsconfig.json b/types/consul/tsconfig.json similarity index 100% rename from consul/tsconfig.json rename to types/consul/tsconfig.json diff --git a/content-disposition/content-disposition-tests.ts b/types/content-disposition/content-disposition-tests.ts similarity index 100% rename from content-disposition/content-disposition-tests.ts rename to types/content-disposition/content-disposition-tests.ts diff --git a/content-disposition/index.d.ts b/types/content-disposition/index.d.ts similarity index 77% rename from content-disposition/index.d.ts rename to types/content-disposition/index.d.ts index 4d0bbd8d94..31e60c1041 100644 --- a/content-disposition/index.d.ts +++ b/types/content-disposition/index.d.ts @@ -4,17 +4,17 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace contentDisposition { - export interface ContentDisposition { + interface ContentDisposition { type: string; parameters: any; } - export interface Options { + interface Options { type?: string; fallback?: string | boolean; } - export function parse(contentDispositionHeader: string): ContentDisposition; + function parse(contentDispositionHeader: string): ContentDisposition; } declare function contentDisposition(filename?: string, options?: contentDisposition.Options): string; diff --git a/content-disposition/tsconfig.json b/types/content-disposition/tsconfig.json similarity index 100% rename from content-disposition/tsconfig.json rename to types/content-disposition/tsconfig.json diff --git a/cookies/tslint.json b/types/content-disposition/tslint.json similarity index 100% rename from cookies/tslint.json rename to types/content-disposition/tslint.json diff --git a/content-type/content-type-tests.ts b/types/content-type/content-type-tests.ts similarity index 100% rename from content-type/content-type-tests.ts rename to types/content-type/content-type-tests.ts diff --git a/content-type/index.d.ts b/types/content-type/index.d.ts similarity index 100% rename from content-type/index.d.ts rename to types/content-type/index.d.ts diff --git a/content-type/tsconfig.json b/types/content-type/tsconfig.json similarity index 100% rename from content-type/tsconfig.json rename to types/content-type/tsconfig.json diff --git a/contentful-resolve-response/contentful-resolve-response-tests.ts b/types/contentful-resolve-response/contentful-resolve-response-tests.ts similarity index 100% rename from contentful-resolve-response/contentful-resolve-response-tests.ts rename to types/contentful-resolve-response/contentful-resolve-response-tests.ts diff --git a/contentful-resolve-response/index.d.ts b/types/contentful-resolve-response/index.d.ts similarity index 100% rename from contentful-resolve-response/index.d.ts rename to types/contentful-resolve-response/index.d.ts diff --git a/contentful-resolve-response/tsconfig.json b/types/contentful-resolve-response/tsconfig.json similarity index 100% rename from contentful-resolve-response/tsconfig.json rename to types/contentful-resolve-response/tsconfig.json diff --git a/contextjs/contextjs-tests.ts b/types/contextjs/contextjs-tests.ts similarity index 100% rename from contextjs/contextjs-tests.ts rename to types/contextjs/contextjs-tests.ts diff --git a/contextjs/index.d.ts b/types/contextjs/index.d.ts similarity index 100% rename from contextjs/index.d.ts rename to types/contextjs/index.d.ts diff --git a/contextjs/tsconfig.json b/types/contextjs/tsconfig.json similarity index 100% rename from contextjs/tsconfig.json rename to types/contextjs/tsconfig.json diff --git a/continuation-local-storage/continuation-local-storage-tests.ts b/types/continuation-local-storage/continuation-local-storage-tests.ts similarity index 100% rename from continuation-local-storage/continuation-local-storage-tests.ts rename to types/continuation-local-storage/continuation-local-storage-tests.ts diff --git a/continuation-local-storage/index.d.ts b/types/continuation-local-storage/index.d.ts similarity index 100% rename from continuation-local-storage/index.d.ts rename to types/continuation-local-storage/index.d.ts diff --git a/continuation-local-storage/tsconfig.json b/types/continuation-local-storage/tsconfig.json similarity index 100% rename from continuation-local-storage/tsconfig.json rename to types/continuation-local-storage/tsconfig.json diff --git a/convert-source-map/convert-source-map-tests.ts b/types/convert-source-map/convert-source-map-tests.ts similarity index 100% rename from convert-source-map/convert-source-map-tests.ts rename to types/convert-source-map/convert-source-map-tests.ts diff --git a/convert-source-map/index.d.ts b/types/convert-source-map/index.d.ts similarity index 100% rename from convert-source-map/index.d.ts rename to types/convert-source-map/index.d.ts diff --git a/convert-source-map/tsconfig.json b/types/convert-source-map/tsconfig.json similarity index 100% rename from convert-source-map/tsconfig.json rename to types/convert-source-map/tsconfig.json diff --git a/cordova-sqlite-storage/tslint.json b/types/convert-source-map/tslint.json similarity index 100% rename from cordova-sqlite-storage/tslint.json rename to types/convert-source-map/tslint.json diff --git a/convict/convict-tests.ts b/types/convict/convict-tests.ts similarity index 100% rename from convict/convict-tests.ts rename to types/convict/convict-tests.ts diff --git a/convict/index.d.ts b/types/convict/index.d.ts similarity index 100% rename from convict/index.d.ts rename to types/convict/index.d.ts diff --git a/convict/tsconfig.json b/types/convict/tsconfig.json similarity index 100% rename from convict/tsconfig.json rename to types/convict/tsconfig.json diff --git a/cookie-parser/cookie-parser-tests.ts b/types/cookie-parser/cookie-parser-tests.ts similarity index 100% rename from cookie-parser/cookie-parser-tests.ts rename to types/cookie-parser/cookie-parser-tests.ts diff --git a/cookie-parser/index.d.ts b/types/cookie-parser/index.d.ts similarity index 100% rename from cookie-parser/index.d.ts rename to types/cookie-parser/index.d.ts diff --git a/cookie-parser/tsconfig.json b/types/cookie-parser/tsconfig.json similarity index 100% rename from cookie-parser/tsconfig.json rename to types/cookie-parser/tsconfig.json diff --git a/cookie-session/cookie-session-tests.ts b/types/cookie-session/cookie-session-tests.ts similarity index 100% rename from cookie-session/cookie-session-tests.ts rename to types/cookie-session/cookie-session-tests.ts diff --git a/cookie-session/index.d.ts b/types/cookie-session/index.d.ts similarity index 100% rename from cookie-session/index.d.ts rename to types/cookie-session/index.d.ts diff --git a/cookie-session/tsconfig.json b/types/cookie-session/tsconfig.json similarity index 100% rename from cookie-session/tsconfig.json rename to types/cookie-session/tsconfig.json diff --git a/cookie-signature/cookie-signature-tests.ts b/types/cookie-signature/cookie-signature-tests.ts similarity index 100% rename from cookie-signature/cookie-signature-tests.ts rename to types/cookie-signature/cookie-signature-tests.ts diff --git a/cookie-signature/index.d.ts b/types/cookie-signature/index.d.ts similarity index 100% rename from cookie-signature/index.d.ts rename to types/cookie-signature/index.d.ts diff --git a/cookie-signature/tsconfig.json b/types/cookie-signature/tsconfig.json similarity index 100% rename from cookie-signature/tsconfig.json rename to types/cookie-signature/tsconfig.json diff --git a/cpy/tslint.json b/types/cookie-signature/tslint.json similarity index 100% rename from cpy/tslint.json rename to types/cookie-signature/tslint.json diff --git a/cookie/cookie-tests.ts b/types/cookie/cookie-tests.ts similarity index 85% rename from cookie/cookie-tests.ts rename to types/cookie/cookie-tests.ts index 2581a5c372..dd5be0f850 100644 --- a/cookie/cookie-tests.ts +++ b/types/cookie/cookie-tests.ts @@ -17,7 +17,7 @@ function test_parse(): void { } function test_options(): void { - var serializeOptions: CookieSerializeOptions = { + var serializeOptions: cookie.CookieSerializeOptions = { encode: (x: string) => x, path: '/', expires: new Date(), @@ -27,7 +27,7 @@ function test_options(): void { httpOnly: false }; - var parseOptios: CookieParseOptions = { + var parseOptios: cookie.CookieParseOptions = { decode: (x: string) => x }; } diff --git a/types/cookie/index.d.ts b/types/cookie/index.d.ts new file mode 100644 index 0000000000..507eaee01d --- /dev/null +++ b/types/cookie/index.d.ts @@ -0,0 +1,118 @@ +// Type definitions for cookie v0.3.0 +// Project: https://github.com/jshttp/cookie +// Definitions by: Pine Mizune +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface CookieSerializeOptions { + /** + * Specifies the value for the Domain Set-Cookie attribute. By default, no + * domain is set, and most clients will consider the cookie to apply to only + * the current domain. + */ + domain?: string; + /** + * Specifies a function that will be used to encode a cookie's value. Since + * value of a cookie has a limited character set (and must be a simple + * string), this function can be used to encode a value into a string suited + * for a cookie's value. + * + * The default function is the global `encodeURIComponent`, which will + * encode a JavaScript string into UTF-8 byte sequences and then URL-encode + * any that fall outside of the cookie range. + */ + encode?: (val: string) => string; + /** + * Specifies the `Date` object to be the value for the `Expires` + * `Set-Cookie` attribute. By default, no expiration is set, and most + * clients will consider this a "non-persistent cookie" and will delete it + * on a condition like exiting a web browser application. + * + * *Note* the cookie storage model specification states that if both + * `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is + * possible not all clients by obey this, so if both are set, they should + * point to the same date and time. + */ + expires?: Date; + /** + * Specifies the boolean value for the `HttpOnly` `Set-Cookie` attribute. + * When truthy, the `HttpOnly` attribute is set, otherwise it is not. By + * default, the `HttpOnly` attribute is not set. + * + * *Note* be careful when setting this to true, as compliant clients will + * not allow client-side JavaScript to see the cookie in `document.cookie`. + */ + httpOnly?: boolean; + /** + * Specifies the number (in seconds) to be the value for the `Max-Age` + * `Set-Cookie` attribute. The given number will be converted to an integer + * by rounding down. By default, no maximum age is set. + * + * *Note* the cookie storage model specification states that if both + * `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is + * possible not all clients by obey this, so if both are set, they should + * point to the same date and time. + */ + maxAge?: number; + /** + * Specifies the value for the `Path` `Set-Cookie` attribute. By default, + * the path is considered the "default path". + */ + path?: string; + /** + * Specifies the boolean or string to be the value for the `SameSite` + * `Set-Cookie` attribute. + * + * - `true` will set the `SameSite` attribute to `Strict` for strict same + * site enforcement. + * - `false` will not set the `SameSite` attribute. + * - `'lax'` will set the `SameSite` attribute to Lax for lax same site + * enforcement. + * - `'strict'` will set the `SameSite` attribute to Strict for strict same + * site enforcement. + */ + sameSite?: boolean | 'lax' | 'strict'; + /** + * Specifies the boolean value for the `Secure` `Set-Cookie` attribute. When + * truthy, the `Secure` attribute is set, otherwise it is not. By default, + * the `Secure` attribute is not set. + * + * *Note* be careful when setting this to `true`, as compliant clients will + * not send the cookie back to the server in the future if the browser does + * not have an HTTPS connection. + */ + secure?: boolean; +} + +interface CookieParseOptions { + /** + * Specifies a function that will be used to decode a cookie's value. Since + * the value of a cookie has a limited character set (and must be a simple + * string), this function can be used to decode a previously-encoded cookie + * value into a JavaScript string or other object. + * + * The default function is the global `decodeURIComponent`, which will decode + * any URL-encoded sequences into their byte representations. + * + * *Note* if an error is thrown from this function, the original, non-decoded + * cookie value will be returned as the cookie's value. + */ + decode?: (val: string) => string; +} + +/** + * Parse an HTTP Cookie header string and returning an object of all cookie + * name-value pairs. + * + * @param str the string representing a `Cookie` header value + * @param options object containing parsing options + */ +export function parse(str: string, options?: CookieParseOptions): { [key: string]: string }; + +/** + * Serialize a cookie name-value pair into a `Set-Cookie` header string. + * + * @param name the name for the cookie + * @param val value to set the cookie to + * @param options object containing serialization options + */ +export function serialize(name: string, val: string, options?: CookieSerializeOptions): string; diff --git a/cookie/tsconfig.json b/types/cookie/tsconfig.json similarity index 100% rename from cookie/tsconfig.json rename to types/cookie/tsconfig.json diff --git a/cookiejs/cookiejs-tests.ts b/types/cookiejs/cookiejs-tests.ts similarity index 100% rename from cookiejs/cookiejs-tests.ts rename to types/cookiejs/cookiejs-tests.ts diff --git a/cookiejs/index.d.ts b/types/cookiejs/index.d.ts similarity index 100% rename from cookiejs/index.d.ts rename to types/cookiejs/index.d.ts diff --git a/cookiejs/tsconfig.json b/types/cookiejs/tsconfig.json similarity index 100% rename from cookiejs/tsconfig.json rename to types/cookiejs/tsconfig.json diff --git a/cookies/cookies-tests.ts b/types/cookies/cookies-tests.ts similarity index 97% rename from cookies/cookies-tests.ts rename to types/cookies/cookies-tests.ts index 30e07d3000..112246907c 100644 --- a/cookies/cookies-tests.ts +++ b/types/cookies/cookies-tests.ts @@ -1,5 +1,3 @@ -/// - import * as Cookies from 'cookies'; import * as http from 'http'; @@ -38,4 +36,4 @@ const server = http.createServer((req, res) => { "tampered expected: undefined\n\n" + "tampered: " + tampered + "\n\n" ); -}); \ No newline at end of file +}); diff --git a/cookies/index.d.ts b/types/cookies/index.d.ts similarity index 94% rename from cookies/index.d.ts rename to types/cookies/index.d.ts index 390890bb4a..55feb7ec7d 100644 --- a/cookies/index.d.ts +++ b/types/cookies/index.d.ts @@ -7,7 +7,7 @@ import { IncomingMessage, ServerResponse } from 'http'; import * as Keygrip from 'keygrip'; -declare interface Cookies { +interface Cookies { secure: boolean; request: IncomingMessage; response: ServerResponse; @@ -27,27 +27,26 @@ declare interface Cookies { set(name: string, value?: string, opts?: Cookies.SetOption): this; } - declare namespace Cookies { /** * for backward-compatibility */ - export type ICookies = Cookies; + type ICookies = Cookies; /** * for backward-compatibility */ - export type IOptions = SetOption; + type IOptions = SetOption; - export interface Option { + interface Option { keys: string[] | Keygrip; secure?: boolean; } - export interface GetOption { + interface GetOption { signed: boolean; } - export interface SetOption { + interface SetOption { /** * a number representing the milliseconds from Date.now() for expiry */ @@ -97,9 +96,9 @@ declare namespace Cookies { overwrite?: boolean; } - export type CookieAttr = SetOption; + type CookieAttr = SetOption; - export interface Cookie { + interface Cookie { name: string; value: string; /** @@ -119,7 +118,7 @@ declare namespace Cookies { } } -declare interface CookiesFunction { +interface CookiesFunction { (request: IncomingMessage, response: ServerResponse, options?: Cookies.Option): Cookies; /** * "options" array of key strings is deprecated, provide using options {"keys": keygrip} diff --git a/cookies/tsconfig.json b/types/cookies/tsconfig.json similarity index 100% rename from cookies/tsconfig.json rename to types/cookies/tsconfig.json diff --git a/crc/tslint.json b/types/cookies/tslint.json similarity index 100% rename from crc/tslint.json rename to types/cookies/tslint.json diff --git a/copy-paste/copy-paste-tests.ts b/types/copy-paste/copy-paste-tests.ts similarity index 100% rename from copy-paste/copy-paste-tests.ts rename to types/copy-paste/copy-paste-tests.ts diff --git a/copy-paste/index.d.ts b/types/copy-paste/index.d.ts similarity index 100% rename from copy-paste/index.d.ts rename to types/copy-paste/index.d.ts diff --git a/copy-paste/tsconfig.json b/types/copy-paste/tsconfig.json similarity index 100% rename from copy-paste/tsconfig.json rename to types/copy-paste/tsconfig.json diff --git a/copy-webpack-plugin/copy-webpack-plugin-tests.ts b/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts similarity index 100% rename from copy-webpack-plugin/copy-webpack-plugin-tests.ts rename to types/copy-webpack-plugin/copy-webpack-plugin-tests.ts diff --git a/copy-webpack-plugin/index.d.ts b/types/copy-webpack-plugin/index.d.ts similarity index 100% rename from copy-webpack-plugin/index.d.ts rename to types/copy-webpack-plugin/index.d.ts diff --git a/copy-webpack-plugin/tsconfig.json b/types/copy-webpack-plugin/tsconfig.json similarity index 100% rename from copy-webpack-plugin/tsconfig.json rename to types/copy-webpack-plugin/tsconfig.json diff --git a/cordova-ionic/cordova-ionic-tests.ts b/types/cordova-ionic/cordova-ionic-tests.ts similarity index 100% rename from cordova-ionic/cordova-ionic-tests.ts rename to types/cordova-ionic/cordova-ionic-tests.ts diff --git a/cordova-ionic/index.d.ts b/types/cordova-ionic/index.d.ts similarity index 100% rename from cordova-ionic/index.d.ts rename to types/cordova-ionic/index.d.ts diff --git a/cordova-ionic/keyboard.d.ts b/types/cordova-ionic/keyboard.d.ts similarity index 100% rename from cordova-ionic/keyboard.d.ts rename to types/cordova-ionic/keyboard.d.ts diff --git a/cordova-ionic/tsconfig.json b/types/cordova-ionic/tsconfig.json similarity index 100% rename from cordova-ionic/tsconfig.json rename to types/cordova-ionic/tsconfig.json diff --git a/cordova-plugin-app-version/cordova-plugin-app-version-tests.ts b/types/cordova-plugin-app-version/cordova-plugin-app-version-tests.ts similarity index 100% rename from cordova-plugin-app-version/cordova-plugin-app-version-tests.ts rename to types/cordova-plugin-app-version/cordova-plugin-app-version-tests.ts diff --git a/types/cordova-plugin-app-version/index.d.ts b/types/cordova-plugin-app-version/index.d.ts new file mode 100644 index 0000000000..b30beef9c6 --- /dev/null +++ b/types/cordova-plugin-app-version/index.d.ts @@ -0,0 +1,13 @@ +// 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: () => Promise; + getPackageName: () => Promise; + getVersionCode: () => Promise; + getVersionNumber: () => Promise; + }; +} diff --git a/cordova-plugin-app-version/tsconfig.json b/types/cordova-plugin-app-version/tsconfig.json similarity index 100% rename from cordova-plugin-app-version/tsconfig.json rename to types/cordova-plugin-app-version/tsconfig.json diff --git a/cordova-plugin-background-mode/cordova-plugin-background-mode-tests.ts b/types/cordova-plugin-background-mode/cordova-plugin-background-mode-tests.ts similarity index 100% rename from cordova-plugin-background-mode/cordova-plugin-background-mode-tests.ts rename to types/cordova-plugin-background-mode/cordova-plugin-background-mode-tests.ts diff --git a/cordova-plugin-background-mode/index.d.ts b/types/cordova-plugin-background-mode/index.d.ts similarity index 100% rename from cordova-plugin-background-mode/index.d.ts rename to types/cordova-plugin-background-mode/index.d.ts diff --git a/cordova-plugin-background-mode/tsconfig.json b/types/cordova-plugin-background-mode/tsconfig.json similarity index 100% rename from cordova-plugin-background-mode/tsconfig.json rename to types/cordova-plugin-background-mode/tsconfig.json diff --git a/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts similarity index 85% rename from cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts rename to types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts index 4dafa2e966..1c62521293 100644 --- a/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts +++ b/types/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts @@ -1,5 +1,3 @@ -/// - window.addEventListener('batterystatus', (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); diff --git a/cordova-plugin-battery-status/index.d.ts b/types/cordova-plugin-battery-status/index.d.ts similarity index 100% rename from cordova-plugin-battery-status/index.d.ts rename to types/cordova-plugin-battery-status/index.d.ts diff --git a/cordova-plugin-battery-status/tsconfig.json b/types/cordova-plugin-battery-status/tsconfig.json similarity index 100% rename from cordova-plugin-battery-status/tsconfig.json rename to types/cordova-plugin-battery-status/tsconfig.json diff --git a/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts b/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts similarity index 100% rename from cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts rename to types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts diff --git a/cordova-plugin-ble-central/index.d.ts b/types/cordova-plugin-ble-central/index.d.ts similarity index 100% rename from cordova-plugin-ble-central/index.d.ts rename to types/cordova-plugin-ble-central/index.d.ts diff --git a/cordova-plugin-ble-central/tsconfig.json b/types/cordova-plugin-ble-central/tsconfig.json similarity index 100% rename from cordova-plugin-ble-central/tsconfig.json rename to types/cordova-plugin-ble-central/tsconfig.json diff --git a/cordova-plugin-camera/cordova-plugin-camera-tests.ts b/types/cordova-plugin-camera/cordova-plugin-camera-tests.ts similarity index 91% rename from cordova-plugin-camera/cordova-plugin-camera-tests.ts rename to types/cordova-plugin-camera/cordova-plugin-camera-tests.ts index 00edf02b0a..2f1b661775 100644 --- a/cordova-plugin-camera/cordova-plugin-camera-tests.ts +++ b/types/cordova-plugin-camera/cordova-plugin-camera-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.camera.getPicture( (data: string) => { alert('Got photo!'); }, (message: string)=> { alert('Failed!: ' + message); }, diff --git a/cordova-plugin-camera/index.d.ts b/types/cordova-plugin-camera/index.d.ts similarity index 100% rename from cordova-plugin-camera/index.d.ts rename to types/cordova-plugin-camera/index.d.ts diff --git a/cordova-plugin-camera/tsconfig.json b/types/cordova-plugin-camera/tsconfig.json similarity index 100% rename from cordova-plugin-camera/tsconfig.json rename to types/cordova-plugin-camera/tsconfig.json diff --git a/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts b/types/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts similarity index 94% rename from cordova-plugin-contacts/cordova-plugin-contacts-tests.ts rename to types/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts index c50912c3ba..26243ab43a 100644 --- a/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts +++ b/types/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts @@ -1,5 +1,3 @@ -/// - var contact: Contact = navigator.contacts.create({ nickname: 'John Smith', displayName: 'John Smith', diff --git a/cordova-plugin-contacts/index.d.ts b/types/cordova-plugin-contacts/index.d.ts similarity index 100% rename from cordova-plugin-contacts/index.d.ts rename to types/cordova-plugin-contacts/index.d.ts diff --git a/cordova-plugin-contacts/tsconfig.json b/types/cordova-plugin-contacts/tsconfig.json similarity index 100% rename from cordova-plugin-contacts/tsconfig.json rename to types/cordova-plugin-contacts/tsconfig.json diff --git a/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts b/types/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts similarity index 92% rename from cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts rename to types/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts index 17b1e49930..1b335beaf7 100644 --- a/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts +++ b/types/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.accelerometer.getCurrentAcceleration( (acc: Acceleration) => { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); }, () => { alert('Error!'); }); diff --git a/cordova-plugin-device-motion/index.d.ts b/types/cordova-plugin-device-motion/index.d.ts similarity index 100% rename from cordova-plugin-device-motion/index.d.ts rename to types/cordova-plugin-device-motion/index.d.ts diff --git a/cordova-plugin-device-motion/tsconfig.json b/types/cordova-plugin-device-motion/tsconfig.json similarity index 100% rename from cordova-plugin-device-motion/tsconfig.json rename to types/cordova-plugin-device-motion/tsconfig.json diff --git a/cordova-plugin-device-name/README.md b/types/cordova-plugin-device-name/README.md similarity index 100% rename from cordova-plugin-device-name/README.md rename to types/cordova-plugin-device-name/README.md diff --git a/cordova-plugin-device-name/cordova-plugin-device-name-tests.ts b/types/cordova-plugin-device-name/cordova-plugin-device-name-tests.ts similarity index 100% rename from cordova-plugin-device-name/cordova-plugin-device-name-tests.ts rename to types/cordova-plugin-device-name/cordova-plugin-device-name-tests.ts diff --git a/cordova-plugin-device-name/index.d.ts b/types/cordova-plugin-device-name/index.d.ts similarity index 100% rename from cordova-plugin-device-name/index.d.ts rename to types/cordova-plugin-device-name/index.d.ts diff --git a/cordova-plugin-device-name/tsconfig.json b/types/cordova-plugin-device-name/tsconfig.json similarity index 100% rename from cordova-plugin-device-name/tsconfig.json rename to types/cordova-plugin-device-name/tsconfig.json diff --git a/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts b/types/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts similarity index 93% rename from cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts rename to types/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts index 097a66e99e..ab025d5fbf 100644 --- a/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts +++ b/types/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.compass.getCurrentHeading( (heading: CompassHeading)=> { console.log('Got heading to ' + heading.magneticHeading); }, (error: CompassError)=> { alert('Error! ' + error.code); }, diff --git a/cordova-plugin-device-orientation/index.d.ts b/types/cordova-plugin-device-orientation/index.d.ts similarity index 100% rename from cordova-plugin-device-orientation/index.d.ts rename to types/cordova-plugin-device-orientation/index.d.ts diff --git a/cordova-plugin-device-orientation/tsconfig.json b/types/cordova-plugin-device-orientation/tsconfig.json similarity index 100% rename from cordova-plugin-device-orientation/tsconfig.json rename to types/cordova-plugin-device-orientation/tsconfig.json diff --git a/cordova-plugin-device/cordova-plugin-device-tests.ts b/types/cordova-plugin-device/cordova-plugin-device-tests.ts similarity index 50% rename from cordova-plugin-device/cordova-plugin-device-tests.ts rename to types/cordova-plugin-device/cordova-plugin-device-tests.ts index 450eadb1f0..cb894785c2 100644 --- a/cordova-plugin-device/cordova-plugin-device-tests.ts +++ b/types/cordova-plugin-device/cordova-plugin-device-tests.ts @@ -1,3 +1 @@ -/// - console.log(JSON.stringify(device)); \ No newline at end of file diff --git a/cordova-plugin-device/index.d.ts b/types/cordova-plugin-device/index.d.ts similarity index 100% rename from cordova-plugin-device/index.d.ts rename to types/cordova-plugin-device/index.d.ts diff --git a/cordova-plugin-device/tsconfig.json b/types/cordova-plugin-device/tsconfig.json similarity index 100% rename from cordova-plugin-device/tsconfig.json rename to types/cordova-plugin-device/tsconfig.json diff --git a/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts b/types/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts similarity index 84% rename from cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts rename to types/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts index dd9396f36f..498d7d1000 100644 --- a/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts +++ b/types/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts @@ -1,4 +1,2 @@ -/// - navigator.notification.alert('Alert!', () => { alert('You\'re alerted'); }, 'Alert', 'Ok'); navigator.notification.confirm('Are you ok?', (choice: number) => { alert('Your choice is ' + choice); }); diff --git a/cordova-plugin-dialogs/index.d.ts b/types/cordova-plugin-dialogs/index.d.ts similarity index 100% rename from cordova-plugin-dialogs/index.d.ts rename to types/cordova-plugin-dialogs/index.d.ts diff --git a/cordova-plugin-dialogs/tsconfig.json b/types/cordova-plugin-dialogs/tsconfig.json similarity index 100% rename from cordova-plugin-dialogs/tsconfig.json rename to types/cordova-plugin-dialogs/tsconfig.json diff --git a/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts b/types/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts similarity index 100% rename from cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts rename to types/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts diff --git a/cordova-plugin-email-composer/index.d.ts b/types/cordova-plugin-email-composer/index.d.ts similarity index 100% rename from cordova-plugin-email-composer/index.d.ts rename to types/cordova-plugin-email-composer/index.d.ts diff --git a/cordova-plugin-email-composer/tsconfig.json b/types/cordova-plugin-email-composer/tsconfig.json similarity index 100% rename from cordova-plugin-email-composer/tsconfig.json rename to types/cordova-plugin-email-composer/tsconfig.json diff --git a/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts b/types/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts similarity index 97% rename from cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts rename to types/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts index 4050b2c4aa..eec24db2e0 100644 --- a/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts +++ b/types/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts @@ -1,5 +1,3 @@ -/// - var file = new FileTransfer(); file.onprogress = (ev: ProgressEvent) => { diff --git a/cordova-plugin-file-transfer/index.d.ts b/types/cordova-plugin-file-transfer/index.d.ts similarity index 100% rename from cordova-plugin-file-transfer/index.d.ts rename to types/cordova-plugin-file-transfer/index.d.ts diff --git a/cordova-plugin-file-transfer/tsconfig.json b/types/cordova-plugin-file-transfer/tsconfig.json similarity index 100% rename from cordova-plugin-file-transfer/tsconfig.json rename to types/cordova-plugin-file-transfer/tsconfig.json diff --git a/cordova-plugin-file/cordova-plugin-file-tests.ts b/types/cordova-plugin-file/cordova-plugin-file-tests.ts similarity index 97% rename from cordova-plugin-file/cordova-plugin-file-tests.ts rename to types/cordova-plugin-file/cordova-plugin-file-tests.ts index bd9d7de672..37538434e3 100644 --- a/cordova-plugin-file/cordova-plugin-file-tests.ts +++ b/types/cordova-plugin-file/cordova-plugin-file-tests.ts @@ -1,5 +1,4 @@ /// -/// function fsaccessor(fs: FileSystem) { console.log('FS root is: ' + fs.root.name); diff --git a/cordova-plugin-file/index.d.ts b/types/cordova-plugin-file/index.d.ts similarity index 100% rename from cordova-plugin-file/index.d.ts rename to types/cordova-plugin-file/index.d.ts diff --git a/cordova-plugin-file/tsconfig.json b/types/cordova-plugin-file/tsconfig.json similarity index 100% rename from cordova-plugin-file/tsconfig.json rename to types/cordova-plugin-file/tsconfig.json diff --git a/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts b/types/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts similarity index 91% rename from cordova-plugin-globalization/cordova-plugin-globalization-tests.ts rename to types/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts index 0a58703a32..4b80f2ff72 100644 --- a/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts +++ b/types/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.globalization.dateToString(new Date(), (date) => { console.log(JSON.stringify(date)); }, (error) => { alert(error.message); }, diff --git a/cordova-plugin-globalization/index.d.ts b/types/cordova-plugin-globalization/index.d.ts similarity index 100% rename from cordova-plugin-globalization/index.d.ts rename to types/cordova-plugin-globalization/index.d.ts diff --git a/cordova-plugin-globalization/tsconfig.json b/types/cordova-plugin-globalization/tsconfig.json similarity index 100% rename from cordova-plugin-globalization/tsconfig.json rename to types/cordova-plugin-globalization/tsconfig.json diff --git a/cordova-plugin-ibeacon/cordova-plugin-ibeacon-tests.ts b/types/cordova-plugin-ibeacon/cordova-plugin-ibeacon-tests.ts similarity index 100% rename from cordova-plugin-ibeacon/cordova-plugin-ibeacon-tests.ts rename to types/cordova-plugin-ibeacon/cordova-plugin-ibeacon-tests.ts diff --git a/types/cordova-plugin-ibeacon/index.d.ts b/types/cordova-plugin-ibeacon/index.d.ts new file mode 100644 index 0000000000..3530ccb70d --- /dev/null +++ b/types/cordova-plugin-ibeacon/index.d.ts @@ -0,0 +1,99 @@ +// 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 + +import * as Q from "q"; + +declare global { + interface CordovaPlugins { + locationManager: BeaconPlugin.LocationManager; + } + + 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; + } + } +} \ No newline at end of file diff --git a/cordova-plugin-ibeacon/tsconfig.json b/types/cordova-plugin-ibeacon/tsconfig.json similarity index 89% rename from cordova-plugin-ibeacon/tsconfig.json rename to types/cordova-plugin-ibeacon/tsconfig.json index 603b991c64..af70edc7f5 100644 --- a/cordova-plugin-ibeacon/tsconfig.json +++ b/types/cordova-plugin-ibeacon/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts similarity index 94% rename from cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts rename to types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts index 43b0d28153..cef288c921 100644 --- a/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts +++ b/types/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts @@ -1,5 +1,3 @@ -/// - // InAppBrowser plugin //---------------------------------------------------------------------- diff --git a/cordova-plugin-inappbrowser/index.d.ts b/types/cordova-plugin-inappbrowser/index.d.ts similarity index 100% rename from cordova-plugin-inappbrowser/index.d.ts rename to types/cordova-plugin-inappbrowser/index.d.ts diff --git a/cordova-plugin-inappbrowser/tsconfig.json b/types/cordova-plugin-inappbrowser/tsconfig.json similarity index 100% rename from cordova-plugin-inappbrowser/tsconfig.json rename to types/cordova-plugin-inappbrowser/tsconfig.json diff --git a/cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts b/types/cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts similarity index 100% rename from cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts rename to types/cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts diff --git a/cordova-plugin-insomnia/index.d.ts b/types/cordova-plugin-insomnia/index.d.ts similarity index 100% rename from cordova-plugin-insomnia/index.d.ts rename to types/cordova-plugin-insomnia/index.d.ts diff --git a/cordova-plugin-insomnia/tsconfig.json b/types/cordova-plugin-insomnia/tsconfig.json similarity index 100% rename from cordova-plugin-insomnia/tsconfig.json rename to types/cordova-plugin-insomnia/tsconfig.json diff --git a/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts b/types/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts similarity index 94% rename from cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts rename to types/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts index 3dce2776bf..767eaa6ed2 100644 --- a/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts +++ b/types/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts @@ -1,5 +1,3 @@ -/// - Keyboard.shrinkView(true); Keyboard.shrinkView(false); Keyboard.hideFormAccessoryBar(true); diff --git a/cordova-plugin-keyboard/index.d.ts b/types/cordova-plugin-keyboard/index.d.ts similarity index 100% rename from cordova-plugin-keyboard/index.d.ts rename to types/cordova-plugin-keyboard/index.d.ts diff --git a/cordova-plugin-keyboard/tsconfig.json b/types/cordova-plugin-keyboard/tsconfig.json similarity index 100% rename from cordova-plugin-keyboard/tsconfig.json rename to types/cordova-plugin-keyboard/tsconfig.json diff --git a/cordova-plugin-mapsforge/cordova-plugin-mapsforge-tests.ts b/types/cordova-plugin-mapsforge/cordova-plugin-mapsforge-tests.ts similarity index 100% rename from cordova-plugin-mapsforge/cordova-plugin-mapsforge-tests.ts rename to types/cordova-plugin-mapsforge/cordova-plugin-mapsforge-tests.ts diff --git a/cordova-plugin-mapsforge/index.d.ts b/types/cordova-plugin-mapsforge/index.d.ts similarity index 100% rename from cordova-plugin-mapsforge/index.d.ts rename to types/cordova-plugin-mapsforge/index.d.ts diff --git a/cordova-plugin-mapsforge/tsconfig.json b/types/cordova-plugin-mapsforge/tsconfig.json similarity index 100% rename from cordova-plugin-mapsforge/tsconfig.json rename to types/cordova-plugin-mapsforge/tsconfig.json diff --git a/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts b/types/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts similarity index 90% rename from cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts rename to types/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts index 8bd56c714f..91fdefa74f 100644 --- a/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts +++ b/types/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts @@ -1,5 +1,3 @@ -/// - console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes)); navigator.device.capture.captureAudio( diff --git a/cordova-plugin-media-capture/index.d.ts b/types/cordova-plugin-media-capture/index.d.ts similarity index 100% rename from cordova-plugin-media-capture/index.d.ts rename to types/cordova-plugin-media-capture/index.d.ts diff --git a/cordova-plugin-media-capture/tsconfig.json b/types/cordova-plugin-media-capture/tsconfig.json similarity index 100% rename from cordova-plugin-media-capture/tsconfig.json rename to types/cordova-plugin-media-capture/tsconfig.json diff --git a/cordova-plugin-media/cordova-plugin-media-tests.ts b/types/cordova-plugin-media/cordova-plugin-media-tests.ts similarity index 88% rename from cordova-plugin-media/cordova-plugin-media-tests.ts rename to types/cordova-plugin-media/cordova-plugin-media-tests.ts index 76e39c8d7b..1c00c850e5 100644 --- a/cordova-plugin-media/cordova-plugin-media-tests.ts +++ b/types/cordova-plugin-media/cordova-plugin-media-tests.ts @@ -1,5 +1,3 @@ -/// - // Media and Media Capture //---------------------------------------------------------------------- diff --git a/cordova-plugin-media/index.d.ts b/types/cordova-plugin-media/index.d.ts similarity index 100% rename from cordova-plugin-media/index.d.ts rename to types/cordova-plugin-media/index.d.ts diff --git a/cordova-plugin-media/tsconfig.json b/types/cordova-plugin-media/tsconfig.json similarity index 100% rename from cordova-plugin-media/tsconfig.json rename to types/cordova-plugin-media/tsconfig.json diff --git a/cordova-plugin-ms-adal/cordova-plugin-ms-adal-tests.ts b/types/cordova-plugin-ms-adal/cordova-plugin-ms-adal-tests.ts similarity index 100% rename from cordova-plugin-ms-adal/cordova-plugin-ms-adal-tests.ts rename to types/cordova-plugin-ms-adal/cordova-plugin-ms-adal-tests.ts diff --git a/cordova-plugin-ms-adal/index.d.ts b/types/cordova-plugin-ms-adal/index.d.ts similarity index 100% rename from cordova-plugin-ms-adal/index.d.ts rename to types/cordova-plugin-ms-adal/index.d.ts diff --git a/cordova-plugin-ms-adal/tsconfig.json b/types/cordova-plugin-ms-adal/tsconfig.json similarity index 100% rename from cordova-plugin-ms-adal/tsconfig.json rename to types/cordova-plugin-ms-adal/tsconfig.json diff --git a/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts b/types/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts similarity index 85% rename from cordova-plugin-network-information/cordova-plugin-network-information-tests.ts rename to types/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts index 702aeb5714..0c4bfd7a2d 100644 --- a/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts +++ b/types/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts @@ -1,5 +1,3 @@ -/// - var connType = navigator.connection.type; if (connType == Connection.WIFI) { console.log('Congratulations, you\'re with fast Internet!'); diff --git a/cordova-plugin-network-information/index.d.ts b/types/cordova-plugin-network-information/index.d.ts similarity index 100% rename from cordova-plugin-network-information/index.d.ts rename to types/cordova-plugin-network-information/index.d.ts diff --git a/cordova-plugin-network-information/tsconfig.json b/types/cordova-plugin-network-information/tsconfig.json similarity index 100% rename from cordova-plugin-network-information/tsconfig.json rename to types/cordova-plugin-network-information/tsconfig.json diff --git a/cordova-plugin-ouralabs/cordova-plugin-ouralabs-tests.ts b/types/cordova-plugin-ouralabs/cordova-plugin-ouralabs-tests.ts similarity index 100% rename from cordova-plugin-ouralabs/cordova-plugin-ouralabs-tests.ts rename to types/cordova-plugin-ouralabs/cordova-plugin-ouralabs-tests.ts diff --git a/cordova-plugin-ouralabs/index.d.ts b/types/cordova-plugin-ouralabs/index.d.ts similarity index 100% rename from cordova-plugin-ouralabs/index.d.ts rename to types/cordova-plugin-ouralabs/index.d.ts diff --git a/cordova-plugin-ouralabs/tsconfig.json b/types/cordova-plugin-ouralabs/tsconfig.json similarity index 100% rename from cordova-plugin-ouralabs/tsconfig.json rename to types/cordova-plugin-ouralabs/tsconfig.json diff --git a/cordova-plugin-qrscanner/cordova-plugin-qrscanner-tests.ts b/types/cordova-plugin-qrscanner/cordova-plugin-qrscanner-tests.ts similarity index 100% rename from cordova-plugin-qrscanner/cordova-plugin-qrscanner-tests.ts rename to types/cordova-plugin-qrscanner/cordova-plugin-qrscanner-tests.ts diff --git a/cordova-plugin-qrscanner/index.d.ts b/types/cordova-plugin-qrscanner/index.d.ts similarity index 100% rename from cordova-plugin-qrscanner/index.d.ts rename to types/cordova-plugin-qrscanner/index.d.ts diff --git a/cordova-plugin-qrscanner/tsconfig.json b/types/cordova-plugin-qrscanner/tsconfig.json similarity index 100% rename from cordova-plugin-qrscanner/tsconfig.json rename to types/cordova-plugin-qrscanner/tsconfig.json diff --git a/cordova-plugin-spinner/cordova-plugin-spinner-tests.ts b/types/cordova-plugin-spinner/cordova-plugin-spinner-tests.ts similarity index 100% rename from cordova-plugin-spinner/cordova-plugin-spinner-tests.ts rename to types/cordova-plugin-spinner/cordova-plugin-spinner-tests.ts diff --git a/cordova-plugin-spinner/index.d.ts b/types/cordova-plugin-spinner/index.d.ts similarity index 100% rename from cordova-plugin-spinner/index.d.ts rename to types/cordova-plugin-spinner/index.d.ts diff --git a/cordova-plugin-spinner/tsconfig.json b/types/cordova-plugin-spinner/tsconfig.json similarity index 100% rename from cordova-plugin-spinner/tsconfig.json rename to types/cordova-plugin-spinner/tsconfig.json diff --git a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts b/types/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts similarity index 62% rename from cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts rename to types/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts index d24720eb1d..5938396ad4 100644 --- a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts +++ b/types/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts @@ -1,4 +1,2 @@ -/// - navigator.splashscreen.show(); navigator.splashscreen.hide(); \ No newline at end of file diff --git a/cordova-plugin-splashscreen/index.d.ts b/types/cordova-plugin-splashscreen/index.d.ts similarity index 100% rename from cordova-plugin-splashscreen/index.d.ts rename to types/cordova-plugin-splashscreen/index.d.ts diff --git a/cordova-plugin-splashscreen/tsconfig.json b/types/cordova-plugin-splashscreen/tsconfig.json similarity index 100% rename from cordova-plugin-splashscreen/tsconfig.json rename to types/cordova-plugin-splashscreen/tsconfig.json diff --git a/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts b/types/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts similarity index 91% rename from cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts rename to types/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts index 9d22ca912c..623211d6c6 100644 --- a/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts +++ b/types/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts @@ -1,6 +1,3 @@ -/// - - var statusBar: StatusBar = window.StatusBar; statusBar.overlaysWebView(true); statusBar.overlaysWebView(false); diff --git a/cordova-plugin-statusbar/index.d.ts b/types/cordova-plugin-statusbar/index.d.ts similarity index 100% rename from cordova-plugin-statusbar/index.d.ts rename to types/cordova-plugin-statusbar/index.d.ts diff --git a/cordova-plugin-statusbar/tsconfig.json b/types/cordova-plugin-statusbar/tsconfig.json similarity index 100% rename from cordova-plugin-statusbar/tsconfig.json rename to types/cordova-plugin-statusbar/tsconfig.json diff --git a/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts b/types/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts similarity index 82% rename from cordova-plugin-vibration/cordova-plugin-vibration-tests.ts rename to types/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts index b34cd23675..33cdb43436 100644 --- a/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts +++ b/types/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts @@ -1,5 +1,3 @@ -/// - var notification: Notification; notification.vibrate(100); diff --git a/cordova-plugin-vibration/index.d.ts b/types/cordova-plugin-vibration/index.d.ts similarity index 100% rename from cordova-plugin-vibration/index.d.ts rename to types/cordova-plugin-vibration/index.d.ts diff --git a/cordova-plugin-vibration/tsconfig.json b/types/cordova-plugin-vibration/tsconfig.json similarity index 100% rename from cordova-plugin-vibration/tsconfig.json rename to types/cordova-plugin-vibration/tsconfig.json diff --git a/cordova-plugin-websql/cordova-plugin-websql-tests.ts b/types/cordova-plugin-websql/cordova-plugin-websql-tests.ts similarity index 92% rename from cordova-plugin-websql/cordova-plugin-websql-tests.ts rename to types/cordova-plugin-websql/cordova-plugin-websql-tests.ts index 8679b3d5c3..c6299a489c 100644 --- a/cordova-plugin-websql/cordova-plugin-websql-tests.ts +++ b/types/cordova-plugin-websql/cordova-plugin-websql-tests.ts @@ -1,6 +1,3 @@ -/// - - var db = window.openDatabase('Test', '0.1', 'test', 1024 * 1024 * 5); db.transaction( (tx: SqlTransaction) => { diff --git a/cordova-plugin-websql/index.d.ts b/types/cordova-plugin-websql/index.d.ts similarity index 100% rename from cordova-plugin-websql/index.d.ts rename to types/cordova-plugin-websql/index.d.ts diff --git a/cordova-plugin-websql/tsconfig.json b/types/cordova-plugin-websql/tsconfig.json similarity index 100% rename from cordova-plugin-websql/tsconfig.json rename to types/cordova-plugin-websql/tsconfig.json diff --git a/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts b/types/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts old mode 100755 new mode 100644 similarity index 100% rename from cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts rename to types/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts diff --git a/cordova-plugin-x-socialsharing/index.d.ts b/types/cordova-plugin-x-socialsharing/index.d.ts similarity index 100% rename from cordova-plugin-x-socialsharing/index.d.ts rename to types/cordova-plugin-x-socialsharing/index.d.ts diff --git a/cordova-plugin-x-socialsharing/tsconfig.json b/types/cordova-plugin-x-socialsharing/tsconfig.json similarity index 100% rename from cordova-plugin-x-socialsharing/tsconfig.json rename to types/cordova-plugin-x-socialsharing/tsconfig.json diff --git a/cordova-sqlite-storage/cordova-sqlite-storage-tests.ts b/types/cordova-sqlite-storage/cordova-sqlite-storage-tests.ts similarity index 100% rename from cordova-sqlite-storage/cordova-sqlite-storage-tests.ts rename to types/cordova-sqlite-storage/cordova-sqlite-storage-tests.ts diff --git a/cordova-sqlite-storage/index.d.ts b/types/cordova-sqlite-storage/index.d.ts similarity index 100% rename from cordova-sqlite-storage/index.d.ts rename to types/cordova-sqlite-storage/index.d.ts diff --git a/cordova-sqlite-storage/tsconfig.json b/types/cordova-sqlite-storage/tsconfig.json similarity index 100% rename from cordova-sqlite-storage/tsconfig.json rename to types/cordova-sqlite-storage/tsconfig.json diff --git a/croppie/tslint.json b/types/cordova-sqlite-storage/tslint.json similarity index 100% rename from croppie/tslint.json rename to types/cordova-sqlite-storage/tslint.json diff --git a/cordova.plugins.diagnostic/cordova.plugins.diagnostic-tests.ts b/types/cordova.plugins.diagnostic/cordova.plugins.diagnostic-tests.ts similarity index 100% rename from cordova.plugins.diagnostic/cordova.plugins.diagnostic-tests.ts rename to types/cordova.plugins.diagnostic/cordova.plugins.diagnostic-tests.ts diff --git a/cordova.plugins.diagnostic/index.d.ts b/types/cordova.plugins.diagnostic/index.d.ts similarity index 100% rename from cordova.plugins.diagnostic/index.d.ts rename to types/cordova.plugins.diagnostic/index.d.ts diff --git a/cordova.plugins.diagnostic/tsconfig.json b/types/cordova.plugins.diagnostic/tsconfig.json similarity index 100% rename from cordova.plugins.diagnostic/tsconfig.json rename to types/cordova.plugins.diagnostic/tsconfig.json diff --git a/cordova/cordova-tests.ts b/types/cordova/cordova-tests.ts similarity index 100% rename from cordova/cordova-tests.ts rename to types/cordova/cordova-tests.ts diff --git a/cordova/index.d.ts b/types/cordova/index.d.ts similarity index 100% rename from cordova/index.d.ts rename to types/cordova/index.d.ts diff --git a/cordova/tsconfig.json b/types/cordova/tsconfig.json similarity index 100% rename from cordova/tsconfig.json rename to types/cordova/tsconfig.json diff --git a/cordova_app_version_plugin/README.md b/types/cordova_app_version_plugin/README.md similarity index 100% rename from cordova_app_version_plugin/README.md rename to types/cordova_app_version_plugin/README.md diff --git a/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts b/types/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts similarity index 100% rename from cordova_app_version_plugin/cordova_app_version_plugin-tests.ts rename to types/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts diff --git a/cordova_app_version_plugin/index.d.ts b/types/cordova_app_version_plugin/index.d.ts similarity index 100% rename from cordova_app_version_plugin/index.d.ts rename to types/cordova_app_version_plugin/index.d.ts diff --git a/cordova_app_version_plugin/tsconfig.json b/types/cordova_app_version_plugin/tsconfig.json similarity index 100% rename from cordova_app_version_plugin/tsconfig.json rename to types/cordova_app_version_plugin/tsconfig.json diff --git a/cordovarduino/cordovarduino-tests.ts b/types/cordovarduino/cordovarduino-tests.ts similarity index 100% rename from cordovarduino/cordovarduino-tests.ts rename to types/cordovarduino/cordovarduino-tests.ts diff --git a/cordovarduino/index.d.ts b/types/cordovarduino/index.d.ts similarity index 100% rename from cordovarduino/index.d.ts rename to types/cordovarduino/index.d.ts diff --git a/cordovarduino/tsconfig.json b/types/cordovarduino/tsconfig.json similarity index 100% rename from cordovarduino/tsconfig.json rename to types/cordovarduino/tsconfig.json diff --git a/core-decorators/core-decorators-tests.ts b/types/core-decorators/core-decorators-tests.ts similarity index 94% rename from core-decorators/core-decorators-tests.ts rename to types/core-decorators/core-decorators-tests.ts index 04a22c19cf..ef4659e56b 100644 --- a/core-decorators/core-decorators-tests.ts +++ b/types/core-decorators/core-decorators-tests.ts @@ -1,4 +1,3 @@ - // // @autobind // @@ -35,7 +34,7 @@ class Meal { entree: string = 'steak'; } -var dinner = new Meal(); +const dinner = new Meal(); dinner.entree = 'salmon'; // @@ -99,11 +98,9 @@ person2.facepalmHarder(); // @debounce // - import { debounce } from 'core-decorators'; class Editor { - content = ''; @debounce(500) @@ -119,7 +116,6 @@ class Editor { import { throttle } from 'core-decorators'; class Editor2 { - content = ''; @throttle(500, {leading: false}) @@ -162,8 +158,8 @@ class Meal2 { cost: number = 4.44; } -var dinner2 = new Meal2(); -for (var key in dinner2) { +const dinner2 = new Meal2(); +for (const key in dinner2) { key; // "entree" only, not "cost" } @@ -182,7 +178,7 @@ class Meal3 { entree: string = 'steak'; } -var dinner3 = new Meal3(); +const dinner3 = new Meal3(); Object.defineProperty(dinner3, 'entree', { enumerable: false @@ -196,7 +192,7 @@ Object.defineProperty(dinner3, 'entree', { declare function memoize(func: T): T; import { decorate } from 'core-decorators'; -var count = 0; +let count = 0; class Task { @decorate(memoize) @@ -207,8 +203,8 @@ class Task { } } -var task = new Task(); -var data = [1, 2, 3]; +const task = new Task(); +const data = [1, 2, 3]; task.doSomethingExpensive(data); task.doSomethingExpensive(data); @@ -232,7 +228,7 @@ class Editor3 { hugeBuffer = createHugeBuffer(); } -var editor = new Editor3(); +const editor = new Editor3(); // createHugeBuffer() has not been called yet editor.hugeBuffer; @@ -270,7 +266,7 @@ class Bird { } } -var bird = new Bird(); +const bird = new Bird(); bird.singMatingCall(); // alerts "tweet tweet" @@ -288,17 +284,12 @@ const myConsole = { class Bird2 { @time('sing') - sing() { - } + sing() {} @time('sing2', myConsole) - sing2() { - - } + sing2() {} } -var bird2 = new Bird2(); +const bird2 = new Bird2(); bird2.sing(); // console.time label will be 'sing-0' bird2.sing(); // console.time label will be 'sing-1' - - diff --git a/core-decorators/index.d.ts b/types/core-decorators/index.d.ts similarity index 100% rename from core-decorators/index.d.ts rename to types/core-decorators/index.d.ts diff --git a/core-decorators/tsconfig.json b/types/core-decorators/tsconfig.json similarity index 100% rename from core-decorators/tsconfig.json rename to types/core-decorators/tsconfig.json diff --git a/core-decorators/tslint.json b/types/core-decorators/tslint.json similarity index 100% rename from core-decorators/tslint.json rename to types/core-decorators/tslint.json diff --git a/core-js/core-js-tests.ts b/types/core-js/core-js-tests.ts similarity index 99% rename from core-js/core-js-tests.ts rename to types/core-js/core-js-tests.ts index 42cd770b86..3f585db33e 100644 --- a/core-js/core-js-tests.ts +++ b/types/core-js/core-js-tests.ts @@ -1,5 +1,3 @@ - - interface Point { x: number; y: number; } interface Point3D extends Point { z: number; } @@ -8,7 +6,7 @@ let s: string; let i: number; let b: boolean; let f: () => void; -let o: Object; +let o: {}; let r: RegExp; let sym: symbol; let e: Error; @@ -21,7 +19,7 @@ let arrayOfPoint3D: Point3D[]; let arrayOfSymbol: symbol[]; let arrayOfPropertyKey: PropertyKey[]; let arrayOfAny: any[]; -let arrayOfStringAny: [string, any][]; +let arrayOfStringAny: Array<[string, any]>; let arrayLikeOfAny: ArrayLike; let iterableOfPoint: Iterable; let iterableOfStringPoint: Iterable<[string, Point]>; @@ -57,7 +55,7 @@ let dictOfAny: Dict; // ############################################################################################# // ECMAScript 6: Object & Function -// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, +// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, // es6.object.to-string, es6.function.name and es6.function.has-instance. // ############################################################################################# @@ -88,8 +86,8 @@ arrayOfPoint = Array.of(point, point); // ############################################################################################# // 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, +// 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 // ############################################################################################# diff --git a/core-js/index.d.ts b/types/core-js/index.d.ts similarity index 51% rename from core-js/index.d.ts rename to types/core-js/index.d.ts index a0a10708d9..0bbe4974ae 100644 --- a/core-js/index.d.ts +++ b/types/core-js/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for core-js v0.9.7 +// Type definitions for core-js 0.9 // Project: https://github.com/zloirock/core-js/ // Definitions by: Ron Buckton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,539 +19,12 @@ 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 */ @@ -562,193 +36,6 @@ interface SymbolConstructor { 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[]; @@ -759,135 +46,6 @@ interface $for extends IterableIterator { 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, @@ -895,19 +53,11 @@ declare namespace Reflect { // 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][]; +interface Object { getOwnPropertyDescriptors(object: any): PropertyDescriptorMap; } @@ -942,7 +92,7 @@ interface ArrayConstructor { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + concat(array: ArrayLike, ...items: Array): 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. @@ -969,19 +119,13 @@ interface ArrayConstructor { */ 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[]; + splice(array: ArrayLike, start: number, deleteCount?: number, ...items: T[]): T[]; /** * Inserts new elements at the start of an array. @@ -1005,14 +149,16 @@ interface ArrayConstructor { /** * 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 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 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; @@ -1039,30 +185,38 @@ interface ArrayConstructor { 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. + * 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. + * @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. + * 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. + * @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. + * 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. + * @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. + * 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. + * @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; @@ -1090,7 +244,7 @@ interface ArrayConstructor { * @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; + find(array: ArrayLike, predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T; /** * Returns the index of the first element in the array where predicate is true, and undefined @@ -1125,8 +279,8 @@ interface ArrayConstructor { 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; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; + turn(array: ArrayLike, callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; } // ############################################################################################# @@ -1180,7 +334,7 @@ declare var log: Log; interface Dict { [key: string]: T; [key: number]: T; - //[key: symbol]: T; + // [key: symbol]: T; } interface DictConstructor { @@ -1257,12 +411,12 @@ interface Array { /** * Non-standard. */ - turn(callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + turn(callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; /** * Non-standard. */ - turn(callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; + turn(callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; } // ############################################################################################# @@ -1302,7 +456,7 @@ interface String { declare function delay(msec: number): Promise; declare namespace core { - var version: string; + const version: string; namespace Reflect { function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; @@ -1313,21 +467,18 @@ declare namespace core { 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 has(target: any, propertyKey: string | symbol): boolean; function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; + function ownKeys(target: any): PropertyKey[]; 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: { + const 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; @@ -1351,27 +502,24 @@ declare namespace core { make(proto: T, mixin?: any): T; }; - var Function: { + const 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; + const Array: { + from(arrayLike: ArrayLike | Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; + from(arrayLike: ArrayLike | Iterable): T[]; + of(...items: T[]): T[]; push(array: ArrayLike, ...items: T[]): number; pop(array: ArrayLike): T; - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + concat(array: ArrayLike, ...items: Array): 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[]; + 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; @@ -1387,16 +535,16 @@ declare namespace core { 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; + find(array: ArrayLike, predicate: (value: T, index: number, obj: T[]) => 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; + turn(array: ArrayLike, callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; }; - var String: { + const String: { codePointAt(text: string, pos: number): number; includes(text: string, searchString: string, position?: number): boolean; endsWith(text: string, searchString: string, endPosition?: number): boolean; @@ -1411,14 +559,14 @@ declare namespace core { unescapeHTML(text: string): string; }; - var Date: { + const 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: { + const Number: { EPSILON: number; isFinite(number: number): boolean; isInteger(number: number): boolean; @@ -1448,7 +596,7 @@ declare namespace core { random(lim?: number): number; }; - var Math: { + const Math: { clz32(x: number): number; imul(x: number, y: number): number; sign(x: number): number; @@ -1468,20 +616,20 @@ declare namespace core { cbrt(x: number): number; }; - var RegExp: { + const 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; + const Map: MapConstructor; + const Set: SetConstructor; + const WeakMap: WeakMapConstructor; + const WeakSet: WeakSetConstructor; + const Promise: PromiseConstructor; + const Symbol: SymbolConstructor; + const Dict: DictConstructor; + const global: any; + const log: Log; + const _: boolean; function setTimeout(handler: any, timeout?: any, ...args: any[]): number; @@ -1523,47 +671,47 @@ declare module "core-js/core/$for" { export = $for; } declare module "core-js/core/_" { - var _: typeof core._; + const _: typeof core._; export = _; } declare module "core-js/core/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/core/date" { - var Date: typeof core.Date; + const Date: typeof core.Date; export = Date; } declare module "core-js/core/delay" { - var delay: typeof core.delay; + const delay: typeof core.delay; export = delay; } declare module "core-js/core/dict" { - var Dict: typeof core.Dict; + const Dict: typeof core.Dict; export = Dict; } declare module "core-js/core/function" { - var Function: typeof core.Function; + const Function: typeof core.Function; export = Function; } declare module "core-js/core/global" { - var global: typeof core.global; + const global: typeof core.global; export = global; } declare module "core-js/core/log" { - var log: typeof core.log; + const log: typeof core.log; export = log; } declare module "core-js/core/number" { - var Number: typeof core.Number; + const Number: typeof core.Number; export = Number; } declare module "core-js/core/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/core/string" { - var String: typeof core.String; + const String: typeof core.String; export = String; } declare module "core-js/fn/$for" { @@ -1571,614 +719,613 @@ declare module "core-js/fn/$for" { export = $for; } declare module "core-js/fn/_" { - var _: typeof core._; + const _: typeof core._; export = _; } declare module "core-js/fn/clear-immediate" { - var clearImmediate: typeof core.clearImmediate; + const clearImmediate: typeof core.clearImmediate; export = clearImmediate; } declare module "core-js/fn/delay" { - var delay: typeof core.delay; + const delay: typeof core.delay; export = delay; } declare module "core-js/fn/dict" { - var Dict: typeof core.Dict; + const Dict: typeof core.Dict; export = Dict; } declare module "core-js/fn/get-iterator" { - var getIterator: typeof core.getIterator; + const getIterator: typeof core.getIterator; export = getIterator; } declare module "core-js/fn/global" { - var global: typeof core.global; + const global: typeof core.global; export = global; } declare module "core-js/fn/is-iterable" { - var isIterable: typeof core.isIterable; + const isIterable: typeof core.isIterable; export = isIterable; } declare module "core-js/fn/log" { - var log: typeof core.log; + const log: typeof core.log; export = log; } declare module "core-js/fn/map" { - var Map: typeof core.Map; + const Map: typeof core.Map; export = Map; } declare module "core-js/fn/promise" { - var Promise: typeof core.Promise; + const Promise: typeof core.Promise; export = Promise; } declare module "core-js/fn/set" { - var Set: typeof core.Set; + const Set: typeof core.Set; export = Set; } declare module "core-js/fn/set-immediate" { - var setImmediate: typeof core.setImmediate; + const setImmediate: typeof core.setImmediate; export = setImmediate; } declare module "core-js/fn/set-interval" { - var setInterval: typeof core.setInterval; + const setInterval: typeof core.setInterval; export = setInterval; } declare module "core-js/fn/set-timeout" { - var setTimeout: typeof core.setTimeout; + const setTimeout: typeof core.setTimeout; export = setTimeout; } declare module "core-js/fn/weak-map" { - var WeakMap: typeof core.WeakMap; + const WeakMap: typeof core.WeakMap; export = WeakMap; } declare module "core-js/fn/weak-set" { - var WeakSet: typeof core.WeakSet; + const WeakSet: typeof core.WeakSet; export = WeakSet; } declare module "core-js/fn/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/fn/array/concat" { - var concat: typeof core.Array.concat; + const concat: typeof core.Array.concat; export = concat; } declare module "core-js/fn/array/copy-within" { - var copyWithin: typeof core.Array.copyWithin; + const copyWithin: typeof core.Array.copyWithin; export = copyWithin; } declare module "core-js/fn/array/entries" { - var entries: typeof core.Array.entries; + const entries: typeof core.Array.entries; export = entries; } declare module "core-js/fn/array/every" { - var every: typeof core.Array.every; + const every: typeof core.Array.every; export = every; } declare module "core-js/fn/array/fill" { - var fill: typeof core.Array.fill; + const fill: typeof core.Array.fill; export = fill; } declare module "core-js/fn/array/filter" { - var filter: typeof core.Array.filter; + const filter: typeof core.Array.filter; export = filter; } declare module "core-js/fn/array/find" { - var find: typeof core.Array.find; + const find: typeof core.Array.find; export = find; } declare module "core-js/fn/array/find-index" { - var findIndex: typeof core.Array.findIndex; + const findIndex: typeof core.Array.findIndex; export = findIndex; } declare module "core-js/fn/array/for-each" { - var forEach: typeof core.Array.forEach; + const forEach: typeof core.Array.forEach; export = forEach; } declare module "core-js/fn/array/from" { - var from: typeof core.Array.from; + const from: typeof core.Array.from; export = from; } declare module "core-js/fn/array/includes" { - var includes: typeof core.Array.includes; + const includes: typeof core.Array.includes; export = includes; } declare module "core-js/fn/array/index-of" { - var indexOf: typeof core.Array.indexOf; + const indexOf: typeof core.Array.indexOf; export = indexOf; } declare module "core-js/fn/array/join" { - var join: typeof core.Array.join; + const join: typeof core.Array.join; export = join; } declare module "core-js/fn/array/keys" { - var keys: typeof core.Array.keys; + const keys: typeof core.Array.keys; export = keys; } declare module "core-js/fn/array/last-index-of" { - var lastIndexOf: typeof core.Array.lastIndexOf; + const lastIndexOf: typeof core.Array.lastIndexOf; export = lastIndexOf; } declare module "core-js/fn/array/map" { - var map: typeof core.Array.map; + const map: typeof core.Array.map; export = map; } declare module "core-js/fn/array/of" { - var of: typeof core.Array.of; + const of: typeof core.Array.of; export = of; } declare module "core-js/fn/array/pop" { - var pop: typeof core.Array.pop; + const pop: typeof core.Array.pop; export = pop; } declare module "core-js/fn/array/push" { - var push: typeof core.Array.push; + const push: typeof core.Array.push; export = push; } declare module "core-js/fn/array/reduce" { - var reduce: typeof core.Array.reduce; + const reduce: typeof core.Array.reduce; export = reduce; } declare module "core-js/fn/array/reduce-right" { - var reduceRight: typeof core.Array.reduceRight; + const reduceRight: typeof core.Array.reduceRight; export = reduceRight; } declare module "core-js/fn/array/reverse" { - var reverse: typeof core.Array.reverse; + const reverse: typeof core.Array.reverse; export = reverse; } declare module "core-js/fn/array/shift" { - var shift: typeof core.Array.shift; + const shift: typeof core.Array.shift; export = shift; } declare module "core-js/fn/array/slice" { - var slice: typeof core.Array.slice; + const slice: typeof core.Array.slice; export = slice; } declare module "core-js/fn/array/some" { - var some: typeof core.Array.some; + const some: typeof core.Array.some; export = some; } declare module "core-js/fn/array/sort" { - var sort: typeof core.Array.sort; + const sort: typeof core.Array.sort; export = sort; } declare module "core-js/fn/array/splice" { - var splice: typeof core.Array.splice; + const splice: typeof core.Array.splice; export = splice; } declare module "core-js/fn/array/turn" { - var turn: typeof core.Array.turn; + const turn: typeof core.Array.turn; export = turn; } declare module "core-js/fn/array/unshift" { - var unshift: typeof core.Array.unshift; + const unshift: typeof core.Array.unshift; export = unshift; } declare module "core-js/fn/array/values" { - var values: typeof core.Array.values; + const values: typeof core.Array.values; export = values; } declare module "core-js/fn/date" { - var Date: typeof core.Date; + const Date: typeof core.Date; export = Date; } declare module "core-js/fn/date/add-locale" { - var addLocale: typeof core.addLocale; + const addLocale: typeof core.addLocale; export = addLocale; } declare module "core-js/fn/date/format" { - var format: typeof core.Date.format; + const format: typeof core.Date.format; export = format; } declare module "core-js/fn/date/formatUTC" { - var formatUTC: typeof core.Date.formatUTC; + const formatUTC: typeof core.Date.formatUTC; export = formatUTC; } declare module "core-js/fn/function" { - var Function: typeof core.Function; + const Function: typeof core.Function; export = Function; } declare module "core-js/fn/function/has-instance" { - var hasInstance: (value: any) => boolean; + const hasInstance: (value: any) => boolean; export = hasInstance; } -declare module "core-js/fn/function/name" -{ +declare module "core-js/fn/function/name" { } declare module "core-js/fn/function/part" { - var part: typeof core.Function.part; + const part: typeof core.Function.part; export = part; } declare module "core-js/fn/math" { - var Math: typeof core.Math; + const Math: typeof core.Math; export = Math; } declare module "core-js/fn/math/acosh" { - var acosh: typeof core.Math.acosh; + const acosh: typeof core.Math.acosh; export = acosh; } declare module "core-js/fn/math/asinh" { - var asinh: typeof core.Math.asinh; + const asinh: typeof core.Math.asinh; export = asinh; } declare module "core-js/fn/math/atanh" { - var atanh: typeof core.Math.atanh; + const atanh: typeof core.Math.atanh; export = atanh; } declare module "core-js/fn/math/cbrt" { - var cbrt: typeof core.Math.cbrt; + const cbrt: typeof core.Math.cbrt; export = cbrt; } declare module "core-js/fn/math/clz32" { - var clz32: typeof core.Math.clz32; + const clz32: typeof core.Math.clz32; export = clz32; } declare module "core-js/fn/math/cosh" { - var cosh: typeof core.Math.cosh; + const cosh: typeof core.Math.cosh; export = cosh; } declare module "core-js/fn/math/expm1" { - var expm1: typeof core.Math.expm1; + const expm1: typeof core.Math.expm1; export = expm1; } declare module "core-js/fn/math/fround" { - var fround: typeof core.Math.fround; + const fround: typeof core.Math.fround; export = fround; } declare module "core-js/fn/math/hypot" { - var hypot: typeof core.Math.hypot; + const hypot: typeof core.Math.hypot; export = hypot; } declare module "core-js/fn/math/imul" { - var imul: typeof core.Math.imul; + const imul: typeof core.Math.imul; export = imul; } declare module "core-js/fn/math/log10" { - var log10: typeof core.Math.log10; + const log10: typeof core.Math.log10; export = log10; } declare module "core-js/fn/math/log1p" { - var log1p: typeof core.Math.log1p; + const log1p: typeof core.Math.log1p; export = log1p; } declare module "core-js/fn/math/log2" { - var log2: typeof core.Math.log2; + const log2: typeof core.Math.log2; export = log2; } declare module "core-js/fn/math/sign" { - var sign: typeof core.Math.sign; + const sign: typeof core.Math.sign; export = sign; } declare module "core-js/fn/math/sinh" { - var sinh: typeof core.Math.sinh; + const sinh: typeof core.Math.sinh; export = sinh; } declare module "core-js/fn/math/tanh" { - var tanh: typeof core.Math.tanh; + const tanh: typeof core.Math.tanh; export = tanh; } declare module "core-js/fn/math/trunc" { - var trunc: typeof core.Math.trunc; + const trunc: typeof core.Math.trunc; export = trunc; } declare module "core-js/fn/number" { - var Number: typeof core.Number; + const Number: typeof core.Number; export = Number; } declare module "core-js/fn/number/epsilon" { - var EPSILON: typeof core.Number.EPSILON; + const EPSILON: typeof core.Number.EPSILON; export = EPSILON; } declare module "core-js/fn/number/is-finite" { - var isFinite: typeof core.Number.isFinite; + const isFinite: typeof core.Number.isFinite; export = isFinite; } declare module "core-js/fn/number/is-integer" { - var isInteger: typeof core.Number.isInteger; + const isInteger: typeof core.Number.isInteger; export = isInteger; } declare module "core-js/fn/number/is-nan" { - var isNaN: typeof core.Number.isNaN; + const isNaN: typeof core.Number.isNaN; export = isNaN; } declare module "core-js/fn/number/is-safe-integer" { - var isSafeInteger: typeof core.Number.isSafeInteger; + const 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; + const 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; + const 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; + const parseFloat: typeof core.Number.parseFloat; export = parseFloat; } declare module "core-js/fn/number/parse-int" { - var parseInt: typeof core.Number.parseInt; + const parseInt: typeof core.Number.parseInt; export = parseInt; } declare module "core-js/fn/number/random" { - var random: typeof core.Number.random; + const random: typeof core.Number.random; export = random; } declare module "core-js/fn/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/fn/object/assign" { - var assign: typeof core.Object.assign; + const assign: typeof core.Object.assign; export = assign; } declare module "core-js/fn/object/classof" { - var classof: typeof core.Object.classof; + const classof: typeof core.Object.classof; export = classof; } declare module "core-js/fn/object/create" { - var create: typeof core.Object.create; + const create: typeof core.Object.create; export = create; } declare module "core-js/fn/object/define" { - var define: typeof core.Object.define; + const define: typeof core.Object.define; export = define; } declare module "core-js/fn/object/define-properties" { - var defineProperties: typeof core.Object.defineProperties; + const defineProperties: typeof core.Object.defineProperties; export = defineProperties; } declare module "core-js/fn/object/define-property" { - var defineProperty: typeof core.Object.defineProperty; + const defineProperty: typeof core.Object.defineProperty; export = defineProperty; } declare module "core-js/fn/object/entries" { - var entries: typeof core.Object.entries; + const entries: typeof core.Object.entries; export = entries; } declare module "core-js/fn/object/freeze" { - var freeze: typeof core.Object.freeze; + const freeze: typeof core.Object.freeze; export = freeze; } declare module "core-js/fn/object/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; + const getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; export = getOwnPropertyDescriptor; } declare module "core-js/fn/object/get-own-property-descriptors" { - var getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; + const getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; export = getOwnPropertyDescriptors; } declare module "core-js/fn/object/get-own-property-names" { - var getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; + const getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; export = getOwnPropertyNames; } declare module "core-js/fn/object/get-own-property-symbols" { - var getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; + const getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; export = getOwnPropertySymbols; } declare module "core-js/fn/object/get-prototype-of" { - var getPrototypeOf: typeof core.Object.getPrototypeOf; + const getPrototypeOf: typeof core.Object.getPrototypeOf; export = getPrototypeOf; } declare module "core-js/fn/object/is" { - var is: typeof core.Object.is; + const is: typeof core.Object.is; export = is; } declare module "core-js/fn/object/is-extensible" { - var isExtensible: typeof core.Object.isExtensible; + const isExtensible: typeof core.Object.isExtensible; export = isExtensible; } declare module "core-js/fn/object/is-frozen" { - var isFrozen: typeof core.Object.isFrozen; + const isFrozen: typeof core.Object.isFrozen; export = isFrozen; } declare module "core-js/fn/object/is-object" { - var isObject: typeof core.Object.isObject; + const isObject: typeof core.Object.isObject; export = isObject; } declare module "core-js/fn/object/is-sealed" { - var isSealed: typeof core.Object.isSealed; + const isSealed: typeof core.Object.isSealed; export = isSealed; } declare module "core-js/fn/object/keys" { - var keys: typeof core.Object.keys; + const keys: typeof core.Object.keys; export = keys; } declare module "core-js/fn/object/make" { - var make: typeof core.Object.make; + const make: typeof core.Object.make; export = make; } declare module "core-js/fn/object/prevent-extensions" { - var preventExtensions: typeof core.Object.preventExtensions; + const preventExtensions: typeof core.Object.preventExtensions; export = preventExtensions; } declare module "core-js/fn/object/seal" { - var seal: typeof core.Object.seal; + const seal: typeof core.Object.seal; export = seal; } declare module "core-js/fn/object/set-prototype-of" { - var setPrototypeOf: typeof core.Object.setPrototypeOf; + const setPrototypeOf: typeof core.Object.setPrototypeOf; export = setPrototypeOf; } declare module "core-js/fn/object/values" { - var values: typeof core.Object.values; + const values: typeof core.Object.values; export = values; } declare module "core-js/fn/reflect" { - var Reflect: typeof core.Reflect; + const Reflect: typeof core.Reflect; export = Reflect; } declare module "core-js/fn/reflect/apply" { - var apply: typeof core.Reflect.apply; + const apply: typeof core.Reflect.apply; export = apply; } declare module "core-js/fn/reflect/construct" { - var construct: typeof core.Reflect.construct; + const construct: typeof core.Reflect.construct; export = construct; } declare module "core-js/fn/reflect/define-property" { - var defineProperty: typeof core.Reflect.defineProperty; + const defineProperty: typeof core.Reflect.defineProperty; export = defineProperty; } declare module "core-js/fn/reflect/delete-property" { - var deleteProperty: typeof core.Reflect.deleteProperty; + const deleteProperty: typeof core.Reflect.deleteProperty; export = deleteProperty; } declare module "core-js/fn/reflect/enumerate" { - var enumerate: typeof core.Reflect.enumerate; + const enumerate: typeof core.Reflect.enumerate; export = enumerate; } declare module "core-js/fn/reflect/get" { - var get: typeof core.Reflect.get; + const get: typeof core.Reflect.get; export = get; } declare module "core-js/fn/reflect/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; + const getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; export = getOwnPropertyDescriptor; } declare module "core-js/fn/reflect/get-prototype-of" { - var getPrototypeOf: typeof core.Reflect.getPrototypeOf; + const getPrototypeOf: typeof core.Reflect.getPrototypeOf; export = getPrototypeOf; } declare module "core-js/fn/reflect/has" { - var has: typeof core.Reflect.has; + const has: typeof core.Reflect.has; export = has; } declare module "core-js/fn/reflect/is-extensible" { - var isExtensible: typeof core.Reflect.isExtensible; + const isExtensible: typeof core.Reflect.isExtensible; export = isExtensible; } declare module "core-js/fn/reflect/own-keys" { - var ownKeys: typeof core.Reflect.ownKeys; + const ownKeys: typeof core.Reflect.ownKeys; export = ownKeys; } declare module "core-js/fn/reflect/prevent-extensions" { - var preventExtensions: typeof core.Reflect.preventExtensions; + const preventExtensions: typeof core.Reflect.preventExtensions; export = preventExtensions; } declare module "core-js/fn/reflect/set" { - var set: typeof core.Reflect.set; + const set: typeof core.Reflect.set; export = set; } declare module "core-js/fn/reflect/set-prototype-of" { - var setPrototypeOf: typeof core.Reflect.setPrototypeOf; + const setPrototypeOf: typeof core.Reflect.setPrototypeOf; export = setPrototypeOf; } declare module "core-js/fn/regexp" { - var RegExp: typeof core.RegExp; + const RegExp: typeof core.RegExp; export = RegExp; } declare module "core-js/fn/regexp/escape" { - var escape: typeof core.RegExp.escape; + const escape: typeof core.RegExp.escape; export = escape; } declare module "core-js/fn/string" { - var String: typeof core.String; + const String: typeof core.String; export = String; } declare module "core-js/fn/string/at" { - var at: typeof core.String.at; + const at: typeof core.String.at; export = at; } declare module "core-js/fn/string/code-point-at" { - var codePointAt: typeof core.String.codePointAt; + const codePointAt: typeof core.String.codePointAt; export = codePointAt; } declare module "core-js/fn/string/ends-with" { - var endsWith: typeof core.String.endsWith; + const endsWith: typeof core.String.endsWith; export = endsWith; } declare module "core-js/fn/string/escape-html" { - var escapeHTML: typeof core.String.escapeHTML; + const escapeHTML: typeof core.String.escapeHTML; export = escapeHTML; } declare module "core-js/fn/string/from-code-point" { - var fromCodePoint: typeof core.String.fromCodePoint; + const fromCodePoint: typeof core.String.fromCodePoint; export = fromCodePoint; } declare module "core-js/fn/string/includes" { - var includes: typeof core.String.includes; + const includes: typeof core.String.includes; export = includes; } declare module "core-js/fn/string/lpad" { - var lpad: typeof core.String.lpad; + const lpad: typeof core.String.lpad; export = lpad; } declare module "core-js/fn/string/raw" { - var raw: typeof core.String.raw; + const raw: typeof core.String.raw; export = raw; } declare module "core-js/fn/string/repeat" { - var repeat: typeof core.String.repeat; + const repeat: typeof core.String.repeat; export = repeat; } declare module "core-js/fn/string/rpad" { - var rpad: typeof core.String.rpad; + const rpad: typeof core.String.rpad; export = rpad; } declare module "core-js/fn/string/starts-with" { - var startsWith: typeof core.String.startsWith; + const startsWith: typeof core.String.startsWith; export = startsWith; } declare module "core-js/fn/string/unescape-html" { - var unescapeHTML: typeof core.String.unescapeHTML; + const unescapeHTML: typeof core.String.unescapeHTML; export = unescapeHTML; } declare module "core-js/fn/symbol" { - var Symbol: typeof core.Symbol; + const Symbol: typeof core.Symbol; export = Symbol; } declare module "core-js/fn/symbol/for" { - var _for: typeof core.Symbol.for; + const _for: typeof core.Symbol.for; export = _for; } declare module "core-js/fn/symbol/has-instance" { - var hasInstance: typeof core.Symbol.hasInstance; + const hasInstance: typeof core.Symbol.hasInstance; export = hasInstance; } declare module "core-js/fn/symbol/is-concat-spreadable" { - var isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; + const isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; export = isConcatSpreadable; } declare module "core-js/fn/symbol/iterator" { - var iterator: typeof core.Symbol.iterator; + const iterator: typeof core.Symbol.iterator; export = iterator; } declare module "core-js/fn/symbol/key-for" { - var keyFor: typeof core.Symbol.keyFor; + const keyFor: typeof core.Symbol.keyFor; export = keyFor; } declare module "core-js/fn/symbol/match" { - var match: typeof core.Symbol.match; + const match: typeof core.Symbol.match; export = match; } declare module "core-js/fn/symbol/replace" { - var replace: typeof core.Symbol.replace; + const replace: typeof core.Symbol.replace; export = replace; } declare module "core-js/fn/symbol/search" { - var search: typeof core.Symbol.search; + const search: typeof core.Symbol.search; export = search; } declare module "core-js/fn/symbol/species" { - var species: typeof core.Symbol.species; + const species: typeof core.Symbol.species; export = species; } declare module "core-js/fn/symbol/split" { - var split: typeof core.Symbol.split; + const split: typeof core.Symbol.split; export = split; } declare module "core-js/fn/symbol/to-primitive" { - var toPrimitive: typeof core.Symbol.toPrimitive; + const toPrimitive: typeof core.Symbol.toPrimitive; export = toPrimitive; } declare module "core-js/fn/symbol/to-string-tag" { - var toStringTag: typeof core.Symbol.toStringTag; + const toStringTag: typeof core.Symbol.toStringTag; export = toStringTag; } declare module "core-js/fn/symbol/unscopables" { - var unscopables: typeof core.Symbol.unscopables; + const unscopables: typeof core.Symbol.unscopables; export = unscopables; } declare module "core-js/es5" { @@ -2188,93 +1335,93 @@ declare module "core-js/es6" { export = core; } declare module "core-js/es6/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/es6/function" { - var Function: typeof core.Function; + const Function: typeof core.Function; export = Function; } declare module "core-js/es6/map" { - var Map: typeof core.Map; + const Map: typeof core.Map; export = Map; } declare module "core-js/es6/math" { - var Math: typeof core.Math; + const Math: typeof core.Math; export = Math; } declare module "core-js/es6/number" { - var Number: typeof core.Number; + const Number: typeof core.Number; export = Number; } declare module "core-js/es6/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/es6/promise" { - var Promise: typeof core.Promise; + const Promise: typeof core.Promise; export = Promise; } declare module "core-js/es6/reflect" { - var Reflect: typeof core.Reflect; + const Reflect: typeof core.Reflect; export = Reflect; } declare module "core-js/es6/regexp" { - var RegExp: typeof core.RegExp; + const RegExp: typeof core.RegExp; export = RegExp; } declare module "core-js/es6/set" { - var Set: typeof core.Set; + const Set: typeof core.Set; export = Set; } declare module "core-js/es6/string" { - var String: typeof core.String; + const String: typeof core.String; export = String; } declare module "core-js/es6/symbol" { - var Symbol: typeof core.Symbol; + const Symbol: typeof core.Symbol; export = Symbol; } declare module "core-js/es6/weak-map" { - var WeakMap: typeof core.WeakMap; + const WeakMap: typeof core.WeakMap; export = WeakMap; } declare module "core-js/es6/weak-set" { - var WeakSet: typeof core.WeakSet; + const WeakSet: typeof core.WeakSet; export = WeakSet; } declare module "core-js/es7" { export = core; } declare module "core-js/es7/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/es7/map" { - var Map: typeof core.Map; + const Map: typeof core.Map; export = Map; } declare module "core-js/es7/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/es7/regexp" { - var RegExp: typeof core.RegExp; + const RegExp: typeof core.RegExp; export = RegExp; } declare module "core-js/es7/set" { - var Set: typeof core.Set; + const Set: typeof core.Set; export = Set; } declare module "core-js/es7/string" { - var String: typeof core.String; + const String: typeof core.String; export = String; } declare module "core-js/js" { export = core; } declare module "core-js/js/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/web" { @@ -2303,47 +1450,47 @@ declare module "core-js/library/core/$for" { export = $for; } declare module "core-js/library/core/_" { - var _: typeof core._; + const _: typeof core._; export = _; } declare module "core-js/library/core/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/library/core/date" { - var Date: typeof core.Date; + const Date: typeof core.Date; export = Date; } declare module "core-js/library/core/delay" { - var delay: typeof core.delay; + const delay: typeof core.delay; export = delay; } declare module "core-js/library/core/dict" { - var Dict: typeof core.Dict; + const Dict: typeof core.Dict; export = Dict; } declare module "core-js/library/core/function" { - var Function: typeof core.Function; + const Function: typeof core.Function; export = Function; } declare module "core-js/library/core/global" { - var global: typeof core.global; + const global: typeof core.global; export = global; } declare module "core-js/library/core/log" { - var log: typeof core.log; + const log: typeof core.log; export = log; } declare module "core-js/library/core/number" { - var Number: typeof core.Number; + const Number: typeof core.Number; export = Number; } declare module "core-js/library/core/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/library/core/string" { - var String: typeof core.String; + const String: typeof core.String; export = String; } declare module "core-js/library/fn/$for" { @@ -2351,613 +1498,613 @@ declare module "core-js/library/fn/$for" { export = $for; } declare module "core-js/library/fn/_" { - var _: typeof core._; + const _: typeof core._; export = _; } declare module "core-js/library/fn/clear-immediate" { - var clearImmediate: typeof core.clearImmediate; + const clearImmediate: typeof core.clearImmediate; export = clearImmediate; } declare module "core-js/library/fn/delay" { - var delay: typeof core.delay; + const delay: typeof core.delay; export = delay; } declare module "core-js/library/fn/dict" { - var Dict: typeof core.Dict; + const Dict: typeof core.Dict; export = Dict; } declare module "core-js/library/fn/get-iterator" { - var getIterator: typeof core.getIterator; + const getIterator: typeof core.getIterator; export = getIterator; } declare module "core-js/library/fn/global" { - var global: typeof core.global; + const global: typeof core.global; export = global; } declare module "core-js/library/fn/is-iterable" { - var isIterable: typeof core.isIterable; + const isIterable: typeof core.isIterable; export = isIterable; } declare module "core-js/library/fn/log" { - var log: typeof core.log; + const log: typeof core.log; export = log; } declare module "core-js/library/fn/map" { - var Map: typeof core.Map; + const Map: typeof core.Map; export = Map; } declare module "core-js/library/fn/promise" { - var Promise: typeof core.Promise; + const Promise: typeof core.Promise; export = Promise; } declare module "core-js/library/fn/set" { - var Set: typeof core.Set; + const Set: typeof core.Set; export = Set; } declare module "core-js/library/fn/set-immediate" { - var setImmediate: typeof core.setImmediate; + const setImmediate: typeof core.setImmediate; export = setImmediate; } declare module "core-js/library/fn/set-interval" { - var setInterval: typeof core.setInterval; + const setInterval: typeof core.setInterval; export = setInterval; } declare module "core-js/library/fn/set-timeout" { - var setTimeout: typeof core.setTimeout; + const setTimeout: typeof core.setTimeout; export = setTimeout; } declare module "core-js/library/fn/weak-map" { - var WeakMap: typeof core.WeakMap; + const WeakMap: typeof core.WeakMap; export = WeakMap; } declare module "core-js/library/fn/weak-set" { - var WeakSet: typeof core.WeakSet; + const WeakSet: typeof core.WeakSet; export = WeakSet; } declare module "core-js/library/fn/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/library/fn/array/concat" { - var concat: typeof core.Array.concat; + const concat: typeof core.Array.concat; export = concat; } declare module "core-js/library/fn/array/copy-within" { - var copyWithin: typeof core.Array.copyWithin; + const copyWithin: typeof core.Array.copyWithin; export = copyWithin; } declare module "core-js/library/fn/array/entries" { - var entries: typeof core.Array.entries; + const entries: typeof core.Array.entries; export = entries; } declare module "core-js/library/fn/array/every" { - var every: typeof core.Array.every; + const every: typeof core.Array.every; export = every; } declare module "core-js/library/fn/array/fill" { - var fill: typeof core.Array.fill; + const fill: typeof core.Array.fill; export = fill; } declare module "core-js/library/fn/array/filter" { - var filter: typeof core.Array.filter; + const filter: typeof core.Array.filter; export = filter; } declare module "core-js/library/fn/array/find" { - var find: typeof core.Array.find; + const find: typeof core.Array.find; export = find; } declare module "core-js/library/fn/array/find-index" { - var findIndex: typeof core.Array.findIndex; + const findIndex: typeof core.Array.findIndex; export = findIndex; } declare module "core-js/library/fn/array/for-each" { - var forEach: typeof core.Array.forEach; + const forEach: typeof core.Array.forEach; export = forEach; } declare module "core-js/library/fn/array/from" { - var from: typeof core.Array.from; + const from: typeof core.Array.from; export = from; } declare module "core-js/library/fn/array/includes" { - var includes: typeof core.Array.includes; + const includes: typeof core.Array.includes; export = includes; } declare module "core-js/library/fn/array/index-of" { - var indexOf: typeof core.Array.indexOf; + const indexOf: typeof core.Array.indexOf; export = indexOf; } declare module "core-js/library/fn/array/join" { - var join: typeof core.Array.join; + const join: typeof core.Array.join; export = join; } declare module "core-js/library/fn/array/keys" { - var keys: typeof core.Array.keys; + const keys: typeof core.Array.keys; export = keys; } declare module "core-js/library/fn/array/last-index-of" { - var lastIndexOf: typeof core.Array.lastIndexOf; + const lastIndexOf: typeof core.Array.lastIndexOf; export = lastIndexOf; } declare module "core-js/library/fn/array/map" { - var map: typeof core.Array.map; + const map: typeof core.Array.map; export = map; } declare module "core-js/library/fn/array/of" { - var of: typeof core.Array.of; + const of: typeof core.Array.of; export = of; } declare module "core-js/library/fn/array/pop" { - var pop: typeof core.Array.pop; + const pop: typeof core.Array.pop; export = pop; } declare module "core-js/library/fn/array/push" { - var push: typeof core.Array.push; + const push: typeof core.Array.push; export = push; } declare module "core-js/library/fn/array/reduce" { - var reduce: typeof core.Array.reduce; + const reduce: typeof core.Array.reduce; export = reduce; } declare module "core-js/library/fn/array/reduce-right" { - var reduceRight: typeof core.Array.reduceRight; + const reduceRight: typeof core.Array.reduceRight; export = reduceRight; } declare module "core-js/library/fn/array/reverse" { - var reverse: typeof core.Array.reverse; + const reverse: typeof core.Array.reverse; export = reverse; } declare module "core-js/library/fn/array/shift" { - var shift: typeof core.Array.shift; + const shift: typeof core.Array.shift; export = shift; } declare module "core-js/library/fn/array/slice" { - var slice: typeof core.Array.slice; + const slice: typeof core.Array.slice; export = slice; } declare module "core-js/library/fn/array/some" { - var some: typeof core.Array.some; + const some: typeof core.Array.some; export = some; } declare module "core-js/library/fn/array/sort" { - var sort: typeof core.Array.sort; + const sort: typeof core.Array.sort; export = sort; } declare module "core-js/library/fn/array/splice" { - var splice: typeof core.Array.splice; + const splice: typeof core.Array.splice; export = splice; } declare module "core-js/library/fn/array/turn" { - var turn: typeof core.Array.turn; + const turn: typeof core.Array.turn; export = turn; } declare module "core-js/library/fn/array/unshift" { - var unshift: typeof core.Array.unshift; + const unshift: typeof core.Array.unshift; export = unshift; } declare module "core-js/library/fn/array/values" { - var values: typeof core.Array.values; + const values: typeof core.Array.values; export = values; } declare module "core-js/library/fn/date" { - var Date: typeof core.Date; + const Date: typeof core.Date; export = Date; } declare module "core-js/library/fn/date/add-locale" { - var addLocale: typeof core.addLocale; + const addLocale: typeof core.addLocale; export = addLocale; } declare module "core-js/library/fn/date/format" { - var format: typeof core.Date.format; + const format: typeof core.Date.format; export = format; } declare module "core-js/library/fn/date/formatUTC" { - var formatUTC: typeof core.Date.formatUTC; + const formatUTC: typeof core.Date.formatUTC; export = formatUTC; } declare module "core-js/library/fn/function" { - var Function: typeof core.Function; + const Function: typeof core.Function; export = Function; } declare module "core-js/library/fn/function/has-instance" { - var hasInstance: (value: any) => boolean; + const 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; + const part: typeof core.Function.part; export = part; } declare module "core-js/library/fn/math" { - var Math: typeof core.Math; + const Math: typeof core.Math; export = Math; } declare module "core-js/library/fn/math/acosh" { - var acosh: typeof core.Math.acosh; + const acosh: typeof core.Math.acosh; export = acosh; } declare module "core-js/library/fn/math/asinh" { - var asinh: typeof core.Math.asinh; + const asinh: typeof core.Math.asinh; export = asinh; } declare module "core-js/library/fn/math/atanh" { - var atanh: typeof core.Math.atanh; + const atanh: typeof core.Math.atanh; export = atanh; } declare module "core-js/library/fn/math/cbrt" { - var cbrt: typeof core.Math.cbrt; + const cbrt: typeof core.Math.cbrt; export = cbrt; } declare module "core-js/library/fn/math/clz32" { - var clz32: typeof core.Math.clz32; + const clz32: typeof core.Math.clz32; export = clz32; } declare module "core-js/library/fn/math/cosh" { - var cosh: typeof core.Math.cosh; + const cosh: typeof core.Math.cosh; export = cosh; } declare module "core-js/library/fn/math/expm1" { - var expm1: typeof core.Math.expm1; + const expm1: typeof core.Math.expm1; export = expm1; } declare module "core-js/library/fn/math/fround" { - var fround: typeof core.Math.fround; + const fround: typeof core.Math.fround; export = fround; } declare module "core-js/library/fn/math/hypot" { - var hypot: typeof core.Math.hypot; + const hypot: typeof core.Math.hypot; export = hypot; } declare module "core-js/library/fn/math/imul" { - var imul: typeof core.Math.imul; + const imul: typeof core.Math.imul; export = imul; } declare module "core-js/library/fn/math/log10" { - var log10: typeof core.Math.log10; + const log10: typeof core.Math.log10; export = log10; } declare module "core-js/library/fn/math/log1p" { - var log1p: typeof core.Math.log1p; + const log1p: typeof core.Math.log1p; export = log1p; } declare module "core-js/library/fn/math/log2" { - var log2: typeof core.Math.log2; + const log2: typeof core.Math.log2; export = log2; } declare module "core-js/library/fn/math/sign" { - var sign: typeof core.Math.sign; + const sign: typeof core.Math.sign; export = sign; } declare module "core-js/library/fn/math/sinh" { - var sinh: typeof core.Math.sinh; + const sinh: typeof core.Math.sinh; export = sinh; } declare module "core-js/library/fn/math/tanh" { - var tanh: typeof core.Math.tanh; + const tanh: typeof core.Math.tanh; export = tanh; } declare module "core-js/library/fn/math/trunc" { - var trunc: typeof core.Math.trunc; + const trunc: typeof core.Math.trunc; export = trunc; } declare module "core-js/library/fn/number" { - var Number: typeof core.Number; + const Number: typeof core.Number; export = Number; } declare module "core-js/library/fn/number/epsilon" { - var EPSILON: typeof core.Number.EPSILON; + const EPSILON: typeof core.Number.EPSILON; export = EPSILON; } declare module "core-js/library/fn/number/is-finite" { - var isFinite: typeof core.Number.isFinite; + const isFinite: typeof core.Number.isFinite; export = isFinite; } declare module "core-js/library/fn/number/is-integer" { - var isInteger: typeof core.Number.isInteger; + const isInteger: typeof core.Number.isInteger; export = isInteger; } declare module "core-js/library/fn/number/is-nan" { - var isNaN: typeof core.Number.isNaN; + const isNaN: typeof core.Number.isNaN; export = isNaN; } declare module "core-js/library/fn/number/is-safe-integer" { - var isSafeInteger: typeof core.Number.isSafeInteger; + const 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; + const 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; + const 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; + const parseFloat: typeof core.Number.parseFloat; export = parseFloat; } declare module "core-js/library/fn/number/parse-int" { - var parseInt: typeof core.Number.parseInt; + const parseInt: typeof core.Number.parseInt; export = parseInt; } declare module "core-js/library/fn/number/random" { - var random: typeof core.Number.random; + const random: typeof core.Number.random; export = random; } declare module "core-js/library/fn/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/library/fn/object/assign" { - var assign: typeof core.Object.assign; + const assign: typeof core.Object.assign; export = assign; } declare module "core-js/library/fn/object/classof" { - var classof: typeof core.Object.classof; + const classof: typeof core.Object.classof; export = classof; } declare module "core-js/library/fn/object/create" { - var create: typeof core.Object.create; + const create: typeof core.Object.create; export = create; } declare module "core-js/library/fn/object/define" { - var define: typeof core.Object.define; + const define: typeof core.Object.define; export = define; } declare module "core-js/library/fn/object/define-properties" { - var defineProperties: typeof core.Object.defineProperties; + const defineProperties: typeof core.Object.defineProperties; export = defineProperties; } declare module "core-js/library/fn/object/define-property" { - var defineProperty: typeof core.Object.defineProperty; + const defineProperty: typeof core.Object.defineProperty; export = defineProperty; } declare module "core-js/library/fn/object/entries" { - var entries: typeof core.Object.entries; + const entries: typeof core.Object.entries; export = entries; } declare module "core-js/library/fn/object/freeze" { - var freeze: typeof core.Object.freeze; + const freeze: typeof core.Object.freeze; export = freeze; } declare module "core-js/library/fn/object/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; + const getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; export = getOwnPropertyDescriptor; } declare module "core-js/library/fn/object/get-own-property-descriptors" { - var getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; + const getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; export = getOwnPropertyDescriptors; } declare module "core-js/library/fn/object/get-own-property-names" { - var getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; + const getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; export = getOwnPropertyNames; } declare module "core-js/library/fn/object/get-own-property-symbols" { - var getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; + const getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; export = getOwnPropertySymbols; } declare module "core-js/library/fn/object/get-prototype-of" { - var getPrototypeOf: typeof core.Object.getPrototypeOf; + const getPrototypeOf: typeof core.Object.getPrototypeOf; export = getPrototypeOf; } declare module "core-js/library/fn/object/is" { - var is: typeof core.Object.is; + const is: typeof core.Object.is; export = is; } declare module "core-js/library/fn/object/is-extensible" { - var isExtensible: typeof core.Object.isExtensible; + const isExtensible: typeof core.Object.isExtensible; export = isExtensible; } declare module "core-js/library/fn/object/is-frozen" { - var isFrozen: typeof core.Object.isFrozen; + const isFrozen: typeof core.Object.isFrozen; export = isFrozen; } declare module "core-js/library/fn/object/is-object" { - var isObject: typeof core.Object.isObject; + const isObject: typeof core.Object.isObject; export = isObject; } declare module "core-js/library/fn/object/is-sealed" { - var isSealed: typeof core.Object.isSealed; + const isSealed: typeof core.Object.isSealed; export = isSealed; } declare module "core-js/library/fn/object/keys" { - var keys: typeof core.Object.keys; + const keys: typeof core.Object.keys; export = keys; } declare module "core-js/library/fn/object/make" { - var make: typeof core.Object.make; + const make: typeof core.Object.make; export = make; } declare module "core-js/library/fn/object/prevent-extensions" { - var preventExtensions: typeof core.Object.preventExtensions; + const preventExtensions: typeof core.Object.preventExtensions; export = preventExtensions; } declare module "core-js/library/fn/object/seal" { - var seal: typeof core.Object.seal; + const seal: typeof core.Object.seal; export = seal; } declare module "core-js/library/fn/object/set-prototype-of" { - var setPrototypeOf: typeof core.Object.setPrototypeOf; + const setPrototypeOf: typeof core.Object.setPrototypeOf; export = setPrototypeOf; } declare module "core-js/library/fn/object/values" { - var values: typeof core.Object.values; + const values: typeof core.Object.values; export = values; } declare module "core-js/library/fn/reflect" { - var Reflect: typeof core.Reflect; + const Reflect: typeof core.Reflect; export = Reflect; } declare module "core-js/library/fn/reflect/apply" { - var apply: typeof core.Reflect.apply; + const apply: typeof core.Reflect.apply; export = apply; } declare module "core-js/library/fn/reflect/construct" { - var construct: typeof core.Reflect.construct; + const construct: typeof core.Reflect.construct; export = construct; } declare module "core-js/library/fn/reflect/define-property" { - var defineProperty: typeof core.Reflect.defineProperty; + const defineProperty: typeof core.Reflect.defineProperty; export = defineProperty; } declare module "core-js/library/fn/reflect/delete-property" { - var deleteProperty: typeof core.Reflect.deleteProperty; + const deleteProperty: typeof core.Reflect.deleteProperty; export = deleteProperty; } declare module "core-js/library/fn/reflect/enumerate" { - var enumerate: typeof core.Reflect.enumerate; + const enumerate: typeof core.Reflect.enumerate; export = enumerate; } declare module "core-js/library/fn/reflect/get" { - var get: typeof core.Reflect.get; + const get: typeof core.Reflect.get; export = get; } declare module "core-js/library/fn/reflect/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; + const getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; export = getOwnPropertyDescriptor; } declare module "core-js/library/fn/reflect/get-prototype-of" { - var getPrototypeOf: typeof core.Reflect.getPrototypeOf; + const getPrototypeOf: typeof core.Reflect.getPrototypeOf; export = getPrototypeOf; } declare module "core-js/library/fn/reflect/has" { - var has: typeof core.Reflect.has; + const has: typeof core.Reflect.has; export = has; } declare module "core-js/library/fn/reflect/is-extensible" { - var isExtensible: typeof core.Reflect.isExtensible; + const isExtensible: typeof core.Reflect.isExtensible; export = isExtensible; } declare module "core-js/library/fn/reflect/own-keys" { - var ownKeys: typeof core.Reflect.ownKeys; + const ownKeys: typeof core.Reflect.ownKeys; export = ownKeys; } declare module "core-js/library/fn/reflect/prevent-extensions" { - var preventExtensions: typeof core.Reflect.preventExtensions; + const preventExtensions: typeof core.Reflect.preventExtensions; export = preventExtensions; } declare module "core-js/library/fn/reflect/set" { - var set: typeof core.Reflect.set; + const set: typeof core.Reflect.set; export = set; } declare module "core-js/library/fn/reflect/set-prototype-of" { - var setPrototypeOf: typeof core.Reflect.setPrototypeOf; + const setPrototypeOf: typeof core.Reflect.setPrototypeOf; export = setPrototypeOf; } declare module "core-js/library/fn/regexp" { - var RegExp: typeof core.RegExp; + const RegExp: typeof core.RegExp; export = RegExp; } declare module "core-js/library/fn/regexp/escape" { - var escape: typeof core.RegExp.escape; + const escape: typeof core.RegExp.escape; export = escape; } declare module "core-js/library/fn/string" { - var String: typeof core.String; + const String: typeof core.String; export = String; } declare module "core-js/library/fn/string/at" { - var at: typeof core.String.at; + const at: typeof core.String.at; export = at; } declare module "core-js/library/fn/string/code-point-at" { - var codePointAt: typeof core.String.codePointAt; + const codePointAt: typeof core.String.codePointAt; export = codePointAt; } declare module "core-js/library/fn/string/ends-with" { - var endsWith: typeof core.String.endsWith; + const endsWith: typeof core.String.endsWith; export = endsWith; } declare module "core-js/library/fn/string/escape-html" { - var escapeHTML: typeof core.String.escapeHTML; + const escapeHTML: typeof core.String.escapeHTML; export = escapeHTML; } declare module "core-js/library/fn/string/from-code-point" { - var fromCodePoint: typeof core.String.fromCodePoint; + const fromCodePoint: typeof core.String.fromCodePoint; export = fromCodePoint; } declare module "core-js/library/fn/string/includes" { - var includes: typeof core.String.includes; + const includes: typeof core.String.includes; export = includes; } declare module "core-js/library/fn/string/lpad" { - var lpad: typeof core.String.lpad; + const lpad: typeof core.String.lpad; export = lpad; } declare module "core-js/library/fn/string/raw" { - var raw: typeof core.String.raw; + const raw: typeof core.String.raw; export = raw; } declare module "core-js/library/fn/string/repeat" { - var repeat: typeof core.String.repeat; + const repeat: typeof core.String.repeat; export = repeat; } declare module "core-js/library/fn/string/rpad" { - var rpad: typeof core.String.rpad; + const rpad: typeof core.String.rpad; export = rpad; } declare module "core-js/library/fn/string/starts-with" { - var startsWith: typeof core.String.startsWith; + const startsWith: typeof core.String.startsWith; export = startsWith; } declare module "core-js/library/fn/string/unescape-html" { - var unescapeHTML: typeof core.String.unescapeHTML; + const unescapeHTML: typeof core.String.unescapeHTML; export = unescapeHTML; } declare module "core-js/library/fn/symbol" { - var Symbol: typeof core.Symbol; + const Symbol: typeof core.Symbol; export = Symbol; } declare module "core-js/library/fn/symbol/for" { - var _for: typeof core.Symbol.for; + const _for: typeof core.Symbol.for; export = _for; } declare module "core-js/library/fn/symbol/has-instance" { - var hasInstance: typeof core.Symbol.hasInstance; + const hasInstance: typeof core.Symbol.hasInstance; export = hasInstance; } declare module "core-js/library/fn/symbol/is-concat-spreadable" { - var isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; + const isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; export = isConcatSpreadable; } declare module "core-js/library/fn/symbol/iterator" { - var iterator: typeof core.Symbol.iterator; + const iterator: typeof core.Symbol.iterator; export = iterator; } declare module "core-js/library/fn/symbol/key-for" { - var keyFor: typeof core.Symbol.keyFor; + const keyFor: typeof core.Symbol.keyFor; export = keyFor; } declare module "core-js/library/fn/symbol/match" { - var match: typeof core.Symbol.match; + const match: typeof core.Symbol.match; export = match; } declare module "core-js/library/fn/symbol/replace" { - var replace: typeof core.Symbol.replace; + const replace: typeof core.Symbol.replace; export = replace; } declare module "core-js/library/fn/symbol/search" { - var search: typeof core.Symbol.search; + const search: typeof core.Symbol.search; export = search; } declare module "core-js/library/fn/symbol/species" { - var species: typeof core.Symbol.species; + const species: typeof core.Symbol.species; export = species; } declare module "core-js/library/fn/symbol/split" { - var split: typeof core.Symbol.split; + const split: typeof core.Symbol.split; export = split; } declare module "core-js/library/fn/symbol/to-primitive" { - var toPrimitive: typeof core.Symbol.toPrimitive; + const toPrimitive: typeof core.Symbol.toPrimitive; export = toPrimitive; } declare module "core-js/library/fn/symbol/to-string-tag" { - var toStringTag: typeof core.Symbol.toStringTag; + const toStringTag: typeof core.Symbol.toStringTag; export = toStringTag; } declare module "core-js/library/fn/symbol/unscopables" { - var unscopables: typeof core.Symbol.unscopables; + const unscopables: typeof core.Symbol.unscopables; export = unscopables; } declare module "core-js/library/es5" { @@ -2967,93 +2114,93 @@ declare module "core-js/library/es6" { export = core; } declare module "core-js/library/es6/array" { - var Array: typeof core.Array; + const Array: typeof core.Array; export = Array; } declare module "core-js/library/es6/function" { - var Function: typeof core.Function; + const Function: typeof core.Function; export = Function; } declare module "core-js/library/es6/map" { - var Map: typeof core.Map; + const Map: typeof core.Map; export = Map; } declare module "core-js/library/es6/math" { - var Math: typeof core.Math; + const Math: typeof core.Math; export = Math; } declare module "core-js/library/es6/number" { - var Number: typeof core.Number; + const Number: typeof core.Number; export = Number; } declare module "core-js/library/es6/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/library/es6/promise" { - var Promise: typeof core.Promise; + const Promise: typeof core.Promise; export = Promise; } declare module "core-js/library/es6/reflect" { - var Reflect: typeof core.Reflect; + const Reflect: typeof core.Reflect; export = Reflect; } declare module "core-js/library/es6/regexp" { - var RegExp: typeof core.RegExp; + const RegExp: typeof core.RegExp; export = RegExp; } declare module "core-js/library/es6/set" { - var Set: typeof core.Set; + const Set: typeof core.Set; export = Set; } declare module "core-js/library/es6/string" { - var String: typeof core.String; + const String: typeof core.String; export = String; } declare module "core-js/library/es6/symbol" { - var Symbol: typeof core.Symbol; + const Symbol: typeof core.Symbol; export = Symbol; } declare module "core-js/library/es6/weak-map" { - var WeakMap: typeof core.WeakMap; + const WeakMap: typeof core.WeakMap; export = WeakMap; } declare module "core-js/library/es6/weak-set" { - var WeakSet: typeof core.WeakSet; + const 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; + const Array: typeof core.Array; export = Array; } declare module "core-js/library/es7/map" { - var Map: typeof core.Map; + const Map: typeof core.Map; export = Map; } declare module "core-js/library/es7/object" { - var Object: typeof core.Object; + const Object: typeof core.Object; export = Object; } declare module "core-js/library/es7/regexp" { - var RegExp: typeof core.RegExp; + const RegExp: typeof core.RegExp; export = RegExp; } declare module "core-js/library/es7/set" { - var Set: typeof core.Set; + const Set: typeof core.Set; export = Set; } declare module "core-js/library/es7/string" { - var String: typeof core.String; + const 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; + const Array: typeof core.Array; export = Array; } declare module "core-js/library/web" { diff --git a/core-js/tsconfig.json b/types/core-js/tsconfig.json similarity index 86% rename from core-js/tsconfig.json rename to types/core-js/tsconfig.json index b37502a626..8c7007b563 100644 --- a/core-js/tsconfig.json +++ b/types/core-js/tsconfig.json @@ -2,8 +2,9 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "dom" + "es2017", + "dom", + "dom.iterable" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/steed/tslint.json b/types/core-js/tslint.json similarity index 100% rename from steed/tslint.json rename to types/core-js/tslint.json diff --git a/cors/cors-tests.ts b/types/cors/cors-tests.ts similarity index 100% rename from cors/cors-tests.ts rename to types/cors/cors-tests.ts diff --git a/cors/index.d.ts b/types/cors/index.d.ts similarity index 93% rename from cors/index.d.ts rename to types/cors/index.d.ts index ecad80d187..6c1fc3e4c3 100644 --- a/cors/index.d.ts +++ b/types/cors/index.d.ts @@ -10,7 +10,7 @@ import express = require('express'); type CustomOrigin = ( requestOrigin: string, - callback: (err: Error, allow?: boolean) => void + callback: (err: Error | null, allow?: boolean) => void ) => void; declare namespace e { diff --git a/cors/tsconfig.json b/types/cors/tsconfig.json similarity index 100% rename from cors/tsconfig.json rename to types/cors/tsconfig.json diff --git a/couchbase/couchbase-tests.ts b/types/couchbase/couchbase-tests.ts similarity index 100% rename from couchbase/couchbase-tests.ts rename to types/couchbase/couchbase-tests.ts diff --git a/couchbase/index.d.ts b/types/couchbase/index.d.ts similarity index 100% rename from couchbase/index.d.ts rename to types/couchbase/index.d.ts diff --git a/couchbase/tsconfig.json b/types/couchbase/tsconfig.json similarity index 100% rename from couchbase/tsconfig.json rename to types/couchbase/tsconfig.json diff --git a/countdown/countdown-tests.ts b/types/countdown/countdown-tests.ts similarity index 100% rename from countdown/countdown-tests.ts rename to types/countdown/countdown-tests.ts diff --git a/countdown/index.d.ts b/types/countdown/index.d.ts similarity index 100% rename from countdown/index.d.ts rename to types/countdown/index.d.ts diff --git a/countdown/tsconfig.json b/types/countdown/tsconfig.json similarity index 100% rename from countdown/tsconfig.json rename to types/countdown/tsconfig.json diff --git a/cpy/cpy-tests.ts b/types/cpy/cpy-tests.ts similarity index 100% rename from cpy/cpy-tests.ts rename to types/cpy/cpy-tests.ts diff --git a/cpy/index.d.ts b/types/cpy/index.d.ts similarity index 100% rename from cpy/index.d.ts rename to types/cpy/index.d.ts diff --git a/cpy/tsconfig.json b/types/cpy/tsconfig.json similarity index 100% rename from cpy/tsconfig.json rename to types/cpy/tsconfig.json diff --git a/csv-stringify/tslint.json b/types/cpy/tslint.json similarity index 100% rename from csv-stringify/tslint.json rename to types/cpy/tslint.json diff --git a/cradle/cradle-tests.ts b/types/cradle/cradle-tests.ts similarity index 100% rename from cradle/cradle-tests.ts rename to types/cradle/cradle-tests.ts diff --git a/cradle/index.d.ts b/types/cradle/index.d.ts similarity index 100% rename from cradle/index.d.ts rename to types/cradle/index.d.ts diff --git a/cradle/tsconfig.json b/types/cradle/tsconfig.json similarity index 100% rename from cradle/tsconfig.json rename to types/cradle/tsconfig.json diff --git a/crc/crc-tests.ts b/types/crc/crc-tests.ts similarity index 100% rename from crc/crc-tests.ts rename to types/crc/crc-tests.ts diff --git a/crc/index.d.ts b/types/crc/index.d.ts similarity index 100% rename from crc/index.d.ts rename to types/crc/index.d.ts diff --git a/crc/tsconfig.json b/types/crc/tsconfig.json similarity index 100% rename from crc/tsconfig.json rename to types/crc/tsconfig.json diff --git a/currency-formatter/tslint.json b/types/crc/tslint.json similarity index 100% rename from currency-formatter/tslint.json rename to types/crc/tslint.json diff --git a/create-error/create-error-tests.ts b/types/create-error/create-error-tests.ts similarity index 100% rename from create-error/create-error-tests.ts rename to types/create-error/create-error-tests.ts diff --git a/create-error/index.d.ts b/types/create-error/index.d.ts similarity index 100% rename from create-error/index.d.ts rename to types/create-error/index.d.ts diff --git a/create-error/tsconfig.json b/types/create-error/tsconfig.json similarity index 100% rename from create-error/tsconfig.json rename to types/create-error/tsconfig.json diff --git a/createjs-lib/index.d.ts b/types/createjs-lib/index.d.ts similarity index 100% rename from createjs-lib/index.d.ts rename to types/createjs-lib/index.d.ts diff --git a/createjs-lib/tsconfig.json b/types/createjs-lib/tsconfig.json similarity index 100% rename from createjs-lib/tsconfig.json rename to types/createjs-lib/tsconfig.json diff --git a/createjs/index.d.ts b/types/createjs/index.d.ts similarity index 100% rename from createjs/index.d.ts rename to types/createjs/index.d.ts diff --git a/createjs/tsconfig.json b/types/createjs/tsconfig.json similarity index 100% rename from createjs/tsconfig.json rename to types/createjs/tsconfig.json diff --git a/credential/credential-tests.ts b/types/credential/credential-tests.ts similarity index 100% rename from credential/credential-tests.ts rename to types/credential/credential-tests.ts diff --git a/credential/index.d.ts b/types/credential/index.d.ts similarity index 100% rename from credential/index.d.ts rename to types/credential/index.d.ts diff --git a/credential/tsconfig.json b/types/credential/tsconfig.json similarity index 100% rename from credential/tsconfig.json rename to types/credential/tsconfig.json diff --git a/credit-card-type/credit-card-type-tests.ts b/types/credit-card-type/credit-card-type-tests.ts similarity index 100% rename from credit-card-type/credit-card-type-tests.ts rename to types/credit-card-type/credit-card-type-tests.ts diff --git a/credit-card-type/index.d.ts b/types/credit-card-type/index.d.ts similarity index 100% rename from credit-card-type/index.d.ts rename to types/credit-card-type/index.d.ts diff --git a/credit-card-type/tsconfig.json b/types/credit-card-type/tsconfig.json similarity index 100% rename from credit-card-type/tsconfig.json rename to types/credit-card-type/tsconfig.json diff --git a/cron/cron-tests.ts b/types/cron/cron-tests.ts similarity index 100% rename from cron/cron-tests.ts rename to types/cron/cron-tests.ts diff --git a/cron/index.d.ts b/types/cron/index.d.ts similarity index 100% rename from cron/index.d.ts rename to types/cron/index.d.ts diff --git a/cron/tsconfig.json b/types/cron/tsconfig.json similarity index 100% rename from cron/tsconfig.json rename to types/cron/tsconfig.json diff --git a/cropperjs/cropperjs-tests.ts b/types/cropperjs/cropperjs-tests.ts similarity index 100% rename from cropperjs/cropperjs-tests.ts rename to types/cropperjs/cropperjs-tests.ts diff --git a/cropperjs/index.d.ts b/types/cropperjs/index.d.ts similarity index 100% rename from cropperjs/index.d.ts rename to types/cropperjs/index.d.ts diff --git a/cropperjs/tsconfig.json b/types/cropperjs/tsconfig.json similarity index 100% rename from cropperjs/tsconfig.json rename to types/cropperjs/tsconfig.json diff --git a/croppie/croppie-tests.ts b/types/croppie/croppie-tests.ts similarity index 100% rename from croppie/croppie-tests.ts rename to types/croppie/croppie-tests.ts diff --git a/croppie/index.d.ts b/types/croppie/index.d.ts similarity index 100% rename from croppie/index.d.ts rename to types/croppie/index.d.ts diff --git a/croppie/tsconfig.json b/types/croppie/tsconfig.json similarity index 100% rename from croppie/tsconfig.json rename to types/croppie/tsconfig.json diff --git a/d3-ease/tslint.json b/types/croppie/tslint.json similarity index 100% rename from d3-ease/tslint.json rename to types/croppie/tslint.json diff --git a/cross-storage/cross-storage-tests.ts b/types/cross-storage/cross-storage-tests.ts similarity index 100% rename from cross-storage/cross-storage-tests.ts rename to types/cross-storage/cross-storage-tests.ts diff --git a/cross-storage/index.d.ts b/types/cross-storage/index.d.ts similarity index 100% rename from cross-storage/index.d.ts rename to types/cross-storage/index.d.ts diff --git a/cross-storage/tsconfig.json b/types/cross-storage/tsconfig.json similarity index 100% rename from cross-storage/tsconfig.json rename to types/cross-storage/tsconfig.json diff --git a/crossfilter/crossfilter-tests.ts b/types/crossfilter/crossfilter-tests.ts similarity index 100% rename from crossfilter/crossfilter-tests.ts rename to types/crossfilter/crossfilter-tests.ts diff --git a/crossfilter/index.d.ts b/types/crossfilter/index.d.ts similarity index 100% rename from crossfilter/index.d.ts rename to types/crossfilter/index.d.ts diff --git a/crossfilter/tsconfig.json b/types/crossfilter/tsconfig.json similarity index 100% rename from crossfilter/tsconfig.json rename to types/crossfilter/tsconfig.json diff --git a/crossroads/crossroads-tests.ts b/types/crossroads/crossroads-tests.ts similarity index 100% rename from crossroads/crossroads-tests.ts rename to types/crossroads/crossroads-tests.ts diff --git a/crossroads/index.d.ts b/types/crossroads/index.d.ts similarity index 100% rename from crossroads/index.d.ts rename to types/crossroads/index.d.ts diff --git a/crossroads/tsconfig.json b/types/crossroads/tsconfig.json similarity index 100% rename from crossroads/tsconfig.json rename to types/crossroads/tsconfig.json diff --git a/crypto-js/aes/index.d.ts b/types/crypto-js/aes/index.d.ts similarity index 100% rename from crypto-js/aes/index.d.ts rename to types/crypto-js/aes/index.d.ts diff --git a/crypto-js/core/index.d.ts b/types/crypto-js/core/index.d.ts similarity index 100% rename from crypto-js/core/index.d.ts rename to types/crypto-js/core/index.d.ts diff --git a/crypto-js/crypto-js-tests.ts b/types/crypto-js/crypto-js-tests.ts similarity index 100% rename from crypto-js/crypto-js-tests.ts rename to types/crypto-js/crypto-js-tests.ts diff --git a/crypto-js/enc-base64/index.d.ts b/types/crypto-js/enc-base64/index.d.ts similarity index 100% rename from crypto-js/enc-base64/index.d.ts rename to types/crypto-js/enc-base64/index.d.ts diff --git a/crypto-js/enc-hex/index.d.ts b/types/crypto-js/enc-hex/index.d.ts similarity index 100% rename from crypto-js/enc-hex/index.d.ts rename to types/crypto-js/enc-hex/index.d.ts diff --git a/crypto-js/enc-latin1/index.d.ts b/types/crypto-js/enc-latin1/index.d.ts similarity index 100% rename from crypto-js/enc-latin1/index.d.ts rename to types/crypto-js/enc-latin1/index.d.ts diff --git a/crypto-js/enc-utf16/index.d.ts b/types/crypto-js/enc-utf16/index.d.ts similarity index 100% rename from crypto-js/enc-utf16/index.d.ts rename to types/crypto-js/enc-utf16/index.d.ts diff --git a/crypto-js/enc-utf8/index.d.ts b/types/crypto-js/enc-utf8/index.d.ts similarity index 100% rename from crypto-js/enc-utf8/index.d.ts rename to types/crypto-js/enc-utf8/index.d.ts diff --git a/crypto-js/evpkdf/index.d.ts b/types/crypto-js/evpkdf/index.d.ts similarity index 100% rename from crypto-js/evpkdf/index.d.ts rename to types/crypto-js/evpkdf/index.d.ts diff --git a/crypto-js/format-hex/index.d.ts b/types/crypto-js/format-hex/index.d.ts similarity index 100% rename from crypto-js/format-hex/index.d.ts rename to types/crypto-js/format-hex/index.d.ts diff --git a/crypto-js/format-openssl/index.d.ts b/types/crypto-js/format-openssl/index.d.ts similarity index 100% rename from crypto-js/format-openssl/index.d.ts rename to types/crypto-js/format-openssl/index.d.ts diff --git a/crypto-js/hmac-md5/index.d.ts b/types/crypto-js/hmac-md5/index.d.ts similarity index 100% rename from crypto-js/hmac-md5/index.d.ts rename to types/crypto-js/hmac-md5/index.d.ts diff --git a/crypto-js/hmac-ripemd160/index.d.ts b/types/crypto-js/hmac-ripemd160/index.d.ts similarity index 100% rename from crypto-js/hmac-ripemd160/index.d.ts rename to types/crypto-js/hmac-ripemd160/index.d.ts diff --git a/crypto-js/hmac-sha1/index.d.ts b/types/crypto-js/hmac-sha1/index.d.ts similarity index 100% rename from crypto-js/hmac-sha1/index.d.ts rename to types/crypto-js/hmac-sha1/index.d.ts diff --git a/crypto-js/hmac-sha224/index.d.ts b/types/crypto-js/hmac-sha224/index.d.ts similarity index 100% rename from crypto-js/hmac-sha224/index.d.ts rename to types/crypto-js/hmac-sha224/index.d.ts diff --git a/crypto-js/hmac-sha256/index.d.ts b/types/crypto-js/hmac-sha256/index.d.ts similarity index 100% rename from crypto-js/hmac-sha256/index.d.ts rename to types/crypto-js/hmac-sha256/index.d.ts diff --git a/crypto-js/hmac-sha3/index.d.ts b/types/crypto-js/hmac-sha3/index.d.ts similarity index 100% rename from crypto-js/hmac-sha3/index.d.ts rename to types/crypto-js/hmac-sha3/index.d.ts diff --git a/crypto-js/hmac-sha384/index.d.ts b/types/crypto-js/hmac-sha384/index.d.ts similarity index 100% rename from crypto-js/hmac-sha384/index.d.ts rename to types/crypto-js/hmac-sha384/index.d.ts diff --git a/crypto-js/hmac-sha512/index.d.ts b/types/crypto-js/hmac-sha512/index.d.ts similarity index 100% rename from crypto-js/hmac-sha512/index.d.ts rename to types/crypto-js/hmac-sha512/index.d.ts diff --git a/crypto-js/index.d.ts b/types/crypto-js/index.d.ts similarity index 100% rename from crypto-js/index.d.ts rename to types/crypto-js/index.d.ts diff --git a/crypto-js/lib-typedarrays/index.d.ts b/types/crypto-js/lib-typedarrays/index.d.ts similarity index 100% rename from crypto-js/lib-typedarrays/index.d.ts rename to types/crypto-js/lib-typedarrays/index.d.ts diff --git a/crypto-js/md5/index.d.ts b/types/crypto-js/md5/index.d.ts similarity index 100% rename from crypto-js/md5/index.d.ts rename to types/crypto-js/md5/index.d.ts diff --git a/crypto-js/mode-cfb/index.d.ts b/types/crypto-js/mode-cfb/index.d.ts similarity index 100% rename from crypto-js/mode-cfb/index.d.ts rename to types/crypto-js/mode-cfb/index.d.ts diff --git a/crypto-js/mode-ctr-gladman/index.d.ts b/types/crypto-js/mode-ctr-gladman/index.d.ts similarity index 100% rename from crypto-js/mode-ctr-gladman/index.d.ts rename to types/crypto-js/mode-ctr-gladman/index.d.ts diff --git a/crypto-js/mode-ctr/index.d.ts b/types/crypto-js/mode-ctr/index.d.ts similarity index 100% rename from crypto-js/mode-ctr/index.d.ts rename to types/crypto-js/mode-ctr/index.d.ts diff --git a/crypto-js/mode-ecb/index.d.ts b/types/crypto-js/mode-ecb/index.d.ts similarity index 100% rename from crypto-js/mode-ecb/index.d.ts rename to types/crypto-js/mode-ecb/index.d.ts diff --git a/crypto-js/mode-ofb/index.d.ts b/types/crypto-js/mode-ofb/index.d.ts similarity index 100% rename from crypto-js/mode-ofb/index.d.ts rename to types/crypto-js/mode-ofb/index.d.ts diff --git a/crypto-js/pad-ansix923/index.d.ts b/types/crypto-js/pad-ansix923/index.d.ts similarity index 100% rename from crypto-js/pad-ansix923/index.d.ts rename to types/crypto-js/pad-ansix923/index.d.ts diff --git a/crypto-js/pad-iso10126/index.d.ts b/types/crypto-js/pad-iso10126/index.d.ts similarity index 100% rename from crypto-js/pad-iso10126/index.d.ts rename to types/crypto-js/pad-iso10126/index.d.ts diff --git a/crypto-js/pad-iso97971/index.d.ts b/types/crypto-js/pad-iso97971/index.d.ts similarity index 100% rename from crypto-js/pad-iso97971/index.d.ts rename to types/crypto-js/pad-iso97971/index.d.ts diff --git a/crypto-js/pad-nopadding/index.d.ts b/types/crypto-js/pad-nopadding/index.d.ts similarity index 100% rename from crypto-js/pad-nopadding/index.d.ts rename to types/crypto-js/pad-nopadding/index.d.ts diff --git a/crypto-js/pad-pkcs7/index.d.ts b/types/crypto-js/pad-pkcs7/index.d.ts similarity index 100% rename from crypto-js/pad-pkcs7/index.d.ts rename to types/crypto-js/pad-pkcs7/index.d.ts diff --git a/crypto-js/pad-zeropadding/index.d.ts b/types/crypto-js/pad-zeropadding/index.d.ts similarity index 100% rename from crypto-js/pad-zeropadding/index.d.ts rename to types/crypto-js/pad-zeropadding/index.d.ts diff --git a/crypto-js/pbkdf2/index.d.ts b/types/crypto-js/pbkdf2/index.d.ts similarity index 100% rename from crypto-js/pbkdf2/index.d.ts rename to types/crypto-js/pbkdf2/index.d.ts diff --git a/crypto-js/rabbit-legacy/index.d.ts b/types/crypto-js/rabbit-legacy/index.d.ts similarity index 100% rename from crypto-js/rabbit-legacy/index.d.ts rename to types/crypto-js/rabbit-legacy/index.d.ts diff --git a/crypto-js/rabbit/index.d.ts b/types/crypto-js/rabbit/index.d.ts similarity index 100% rename from crypto-js/rabbit/index.d.ts rename to types/crypto-js/rabbit/index.d.ts diff --git a/crypto-js/rc4/index.d.ts b/types/crypto-js/rc4/index.d.ts similarity index 100% rename from crypto-js/rc4/index.d.ts rename to types/crypto-js/rc4/index.d.ts diff --git a/crypto-js/ripemd160/index.d.ts b/types/crypto-js/ripemd160/index.d.ts similarity index 100% rename from crypto-js/ripemd160/index.d.ts rename to types/crypto-js/ripemd160/index.d.ts diff --git a/crypto-js/sha1/index.d.ts b/types/crypto-js/sha1/index.d.ts similarity index 100% rename from crypto-js/sha1/index.d.ts rename to types/crypto-js/sha1/index.d.ts diff --git a/crypto-js/sha224/index.d.ts b/types/crypto-js/sha224/index.d.ts similarity index 100% rename from crypto-js/sha224/index.d.ts rename to types/crypto-js/sha224/index.d.ts diff --git a/crypto-js/sha256/index.d.ts b/types/crypto-js/sha256/index.d.ts similarity index 100% rename from crypto-js/sha256/index.d.ts rename to types/crypto-js/sha256/index.d.ts diff --git a/crypto-js/sha3/index.d.ts b/types/crypto-js/sha3/index.d.ts similarity index 100% rename from crypto-js/sha3/index.d.ts rename to types/crypto-js/sha3/index.d.ts diff --git a/crypto-js/sha384/index.d.ts b/types/crypto-js/sha384/index.d.ts similarity index 100% rename from crypto-js/sha384/index.d.ts rename to types/crypto-js/sha384/index.d.ts diff --git a/crypto-js/sha512/index.d.ts b/types/crypto-js/sha512/index.d.ts similarity index 100% rename from crypto-js/sha512/index.d.ts rename to types/crypto-js/sha512/index.d.ts diff --git a/crypto-js/test/submodule-tests.ts b/types/crypto-js/test/submodule-tests.ts similarity index 100% rename from crypto-js/test/submodule-tests.ts rename to types/crypto-js/test/submodule-tests.ts diff --git a/crypto-js/tripledes/index.d.ts b/types/crypto-js/tripledes/index.d.ts similarity index 100% rename from crypto-js/tripledes/index.d.ts rename to types/crypto-js/tripledes/index.d.ts diff --git a/crypto-js/tsconfig.json b/types/crypto-js/tsconfig.json similarity index 100% rename from crypto-js/tsconfig.json rename to types/crypto-js/tsconfig.json diff --git a/crypto-js/x64-core/index.d.ts b/types/crypto-js/x64-core/index.d.ts similarity index 100% rename from crypto-js/x64-core/index.d.ts rename to types/crypto-js/x64-core/index.d.ts diff --git a/cryptojs/index.d.ts b/types/cryptojs/index.d.ts similarity index 100% rename from cryptojs/index.d.ts rename to types/cryptojs/index.d.ts diff --git a/cryptojs/test/aes-profile-tests.ts b/types/cryptojs/test/aes-profile-tests.ts similarity index 100% rename from cryptojs/test/aes-profile-tests.ts rename to types/cryptojs/test/aes-profile-tests.ts diff --git a/cryptojs/test/aes-tests.ts b/types/cryptojs/test/aes-tests.ts similarity index 100% rename from cryptojs/test/aes-tests.ts rename to types/cryptojs/test/aes-tests.ts diff --git a/cryptojs/test/des-profile-tests.ts b/types/cryptojs/test/des-profile-tests.ts similarity index 100% rename from cryptojs/test/des-profile-tests.ts rename to types/cryptojs/test/des-profile-tests.ts diff --git a/cryptojs/test/des-tests.ts b/types/cryptojs/test/des-tests.ts similarity index 100% rename from cryptojs/test/des-tests.ts rename to types/cryptojs/test/des-tests.ts diff --git a/cryptojs/test/enc-base64-tests.ts b/types/cryptojs/test/enc-base64-tests.ts similarity index 100% rename from cryptojs/test/enc-base64-tests.ts rename to types/cryptojs/test/enc-base64-tests.ts diff --git a/cryptojs/test/enc-hex-tests.ts b/types/cryptojs/test/enc-hex-tests.ts similarity index 100% rename from cryptojs/test/enc-hex-tests.ts rename to types/cryptojs/test/enc-hex-tests.ts diff --git a/cryptojs/test/enc-latin1-tests.ts b/types/cryptojs/test/enc-latin1-tests.ts similarity index 100% rename from cryptojs/test/enc-latin1-tests.ts rename to types/cryptojs/test/enc-latin1-tests.ts diff --git a/cryptojs/test/enc-utf16-tests.ts b/types/cryptojs/test/enc-utf16-tests.ts similarity index 100% rename from cryptojs/test/enc-utf16-tests.ts rename to types/cryptojs/test/enc-utf16-tests.ts diff --git a/cryptojs/test/enc-utf8-tests.ts b/types/cryptojs/test/enc-utf8-tests.ts similarity index 100% rename from cryptojs/test/enc-utf8-tests.ts rename to types/cryptojs/test/enc-utf8-tests.ts diff --git a/cryptojs/test/evpkdf-profile-tests.ts b/types/cryptojs/test/evpkdf-profile-tests.ts similarity index 100% rename from cryptojs/test/evpkdf-profile-tests.ts rename to types/cryptojs/test/evpkdf-profile-tests.ts diff --git a/cryptojs/test/evpkdf-tests.ts b/types/cryptojs/test/evpkdf-tests.ts similarity index 100% rename from cryptojs/test/evpkdf-tests.ts rename to types/cryptojs/test/evpkdf-tests.ts diff --git a/cryptojs/test/format-openssl-tests.ts b/types/cryptojs/test/format-openssl-tests.ts similarity index 100% rename from cryptojs/test/format-openssl-tests.ts rename to types/cryptojs/test/format-openssl-tests.ts diff --git a/cryptojs/test/hmac-profile-tests.ts b/types/cryptojs/test/hmac-profile-tests.ts similarity index 100% rename from cryptojs/test/hmac-profile-tests.ts rename to types/cryptojs/test/hmac-profile-tests.ts diff --git a/cryptojs/test/hmac-tests.ts b/types/cryptojs/test/hmac-tests.ts similarity index 100% rename from cryptojs/test/hmac-tests.ts rename to types/cryptojs/test/hmac-tests.ts diff --git a/cryptojs/test/kdf-openssl-tests.ts b/types/cryptojs/test/kdf-openssl-tests.ts similarity index 100% rename from cryptojs/test/kdf-openssl-tests.ts rename to types/cryptojs/test/kdf-openssl-tests.ts diff --git a/cryptojs/test/lib-base-tests.ts b/types/cryptojs/test/lib-base-tests.ts similarity index 100% rename from cryptojs/test/lib-base-tests.ts rename to types/cryptojs/test/lib-base-tests.ts diff --git a/cryptojs/test/lib-cipherparams-tests.ts b/types/cryptojs/test/lib-cipherparams-tests.ts similarity index 100% rename from cryptojs/test/lib-cipherparams-tests.ts rename to types/cryptojs/test/lib-cipherparams-tests.ts diff --git a/cryptojs/test/lib-passwordbasedcipher-tests.ts b/types/cryptojs/test/lib-passwordbasedcipher-tests.ts similarity index 100% rename from cryptojs/test/lib-passwordbasedcipher-tests.ts rename to types/cryptojs/test/lib-passwordbasedcipher-tests.ts diff --git a/cryptojs/test/lib-serializablecipher-tests.ts b/types/cryptojs/test/lib-serializablecipher-tests.ts similarity index 100% rename from cryptojs/test/lib-serializablecipher-tests.ts rename to types/cryptojs/test/lib-serializablecipher-tests.ts diff --git a/cryptojs/test/lib-typedarrays-tests.ts b/types/cryptojs/test/lib-typedarrays-tests.ts similarity index 100% rename from cryptojs/test/lib-typedarrays-tests.ts rename to types/cryptojs/test/lib-typedarrays-tests.ts diff --git a/cryptojs/test/lib-wordarray-tests.ts b/types/cryptojs/test/lib-wordarray-tests.ts similarity index 100% rename from cryptojs/test/lib-wordarray-tests.ts rename to types/cryptojs/test/lib-wordarray-tests.ts diff --git a/cryptojs/test/md5-profile-tests.ts b/types/cryptojs/test/md5-profile-tests.ts similarity index 100% rename from cryptojs/test/md5-profile-tests.ts rename to types/cryptojs/test/md5-profile-tests.ts diff --git a/cryptojs/test/md5-tests.ts b/types/cryptojs/test/md5-tests.ts similarity index 98% rename from cryptojs/test/md5-tests.ts rename to types/cryptojs/test/md5-tests.ts index d44496aae5..4063750d7d 100644 --- a/cryptojs/test/md5-tests.ts +++ b/types/cryptojs/test/md5-tests.ts @@ -1,6 +1,3 @@ -/// - - YUI.add('algo-md5-test', function (Y) { var C = CryptoJS; diff --git a/cryptojs/test/mode-cbc-tests.ts b/types/cryptojs/test/mode-cbc-tests.ts similarity index 100% rename from cryptojs/test/mode-cbc-tests.ts rename to types/cryptojs/test/mode-cbc-tests.ts diff --git a/cryptojs/test/mode-cfb-tests.ts b/types/cryptojs/test/mode-cfb-tests.ts similarity index 100% rename from cryptojs/test/mode-cfb-tests.ts rename to types/cryptojs/test/mode-cfb-tests.ts diff --git a/cryptojs/test/mode-ctr-tests.ts b/types/cryptojs/test/mode-ctr-tests.ts similarity index 100% rename from cryptojs/test/mode-ctr-tests.ts rename to types/cryptojs/test/mode-ctr-tests.ts diff --git a/cryptojs/test/mode-ecb-tests.ts b/types/cryptojs/test/mode-ecb-tests.ts similarity index 100% rename from cryptojs/test/mode-ecb-tests.ts rename to types/cryptojs/test/mode-ecb-tests.ts diff --git a/cryptojs/test/mode-ofb-tests.ts b/types/cryptojs/test/mode-ofb-tests.ts similarity index 100% rename from cryptojs/test/mode-ofb-tests.ts rename to types/cryptojs/test/mode-ofb-tests.ts diff --git a/cryptojs/test/pad-ansix923-tests.ts b/types/cryptojs/test/pad-ansix923-tests.ts similarity index 100% rename from cryptojs/test/pad-ansix923-tests.ts rename to types/cryptojs/test/pad-ansix923-tests.ts diff --git a/cryptojs/test/pad-iso10126-tests.ts b/types/cryptojs/test/pad-iso10126-tests.ts similarity index 100% rename from cryptojs/test/pad-iso10126-tests.ts rename to types/cryptojs/test/pad-iso10126-tests.ts diff --git a/cryptojs/test/pad-iso97971-tests.ts b/types/cryptojs/test/pad-iso97971-tests.ts similarity index 100% rename from cryptojs/test/pad-iso97971-tests.ts rename to types/cryptojs/test/pad-iso97971-tests.ts diff --git a/cryptojs/test/pad-pkcs7-tests.ts b/types/cryptojs/test/pad-pkcs7-tests.ts similarity index 100% rename from cryptojs/test/pad-pkcs7-tests.ts rename to types/cryptojs/test/pad-pkcs7-tests.ts diff --git a/cryptojs/test/pad-zeropadding-tests.ts b/types/cryptojs/test/pad-zeropadding-tests.ts similarity index 100% rename from cryptojs/test/pad-zeropadding-tests.ts rename to types/cryptojs/test/pad-zeropadding-tests.ts diff --git a/cryptojs/test/pbkdf2-profile-tests.ts b/types/cryptojs/test/pbkdf2-profile-tests.ts similarity index 100% rename from cryptojs/test/pbkdf2-profile-tests.ts rename to types/cryptojs/test/pbkdf2-profile-tests.ts diff --git a/cryptojs/test/pbkdf2-tests.ts b/types/cryptojs/test/pbkdf2-tests.ts similarity index 100% rename from cryptojs/test/pbkdf2-tests.ts rename to types/cryptojs/test/pbkdf2-tests.ts diff --git a/cryptojs/test/rabbit-legacy-tests.ts b/types/cryptojs/test/rabbit-legacy-tests.ts similarity index 100% rename from cryptojs/test/rabbit-legacy-tests.ts rename to types/cryptojs/test/rabbit-legacy-tests.ts diff --git a/cryptojs/test/rabbit-profile-tests.ts b/types/cryptojs/test/rabbit-profile-tests.ts similarity index 100% rename from cryptojs/test/rabbit-profile-tests.ts rename to types/cryptojs/test/rabbit-profile-tests.ts diff --git a/cryptojs/test/rabbit-tests.ts b/types/cryptojs/test/rabbit-tests.ts similarity index 100% rename from cryptojs/test/rabbit-tests.ts rename to types/cryptojs/test/rabbit-tests.ts diff --git a/cryptojs/test/rc4-profile-tests.ts b/types/cryptojs/test/rc4-profile-tests.ts similarity index 100% rename from cryptojs/test/rc4-profile-tests.ts rename to types/cryptojs/test/rc4-profile-tests.ts diff --git a/cryptojs/test/rc4-tests.ts b/types/cryptojs/test/rc4-tests.ts similarity index 100% rename from cryptojs/test/rc4-tests.ts rename to types/cryptojs/test/rc4-tests.ts diff --git a/cryptojs/test/ripemd160-tests.ts b/types/cryptojs/test/ripemd160-tests.ts similarity index 100% rename from cryptojs/test/ripemd160-tests.ts rename to types/cryptojs/test/ripemd160-tests.ts diff --git a/cryptojs/test/sha1-profile-tests.ts b/types/cryptojs/test/sha1-profile-tests.ts similarity index 100% rename from cryptojs/test/sha1-profile-tests.ts rename to types/cryptojs/test/sha1-profile-tests.ts diff --git a/cryptojs/test/sha1-tests.ts b/types/cryptojs/test/sha1-tests.ts similarity index 100% rename from cryptojs/test/sha1-tests.ts rename to types/cryptojs/test/sha1-tests.ts diff --git a/cryptojs/test/sha224-tests.ts b/types/cryptojs/test/sha224-tests.ts similarity index 100% rename from cryptojs/test/sha224-tests.ts rename to types/cryptojs/test/sha224-tests.ts diff --git a/cryptojs/test/sha256-profile-tests.ts b/types/cryptojs/test/sha256-profile-tests.ts similarity index 100% rename from cryptojs/test/sha256-profile-tests.ts rename to types/cryptojs/test/sha256-profile-tests.ts diff --git a/cryptojs/test/sha256-tests.ts b/types/cryptojs/test/sha256-tests.ts similarity index 100% rename from cryptojs/test/sha256-tests.ts rename to types/cryptojs/test/sha256-tests.ts diff --git a/cryptojs/test/sha3-profile-tests.ts b/types/cryptojs/test/sha3-profile-tests.ts similarity index 100% rename from cryptojs/test/sha3-profile-tests.ts rename to types/cryptojs/test/sha3-profile-tests.ts diff --git a/cryptojs/test/sha3-tests.ts b/types/cryptojs/test/sha3-tests.ts similarity index 100% rename from cryptojs/test/sha3-tests.ts rename to types/cryptojs/test/sha3-tests.ts diff --git a/cryptojs/test/sha384-tests.ts b/types/cryptojs/test/sha384-tests.ts similarity index 100% rename from cryptojs/test/sha384-tests.ts rename to types/cryptojs/test/sha384-tests.ts diff --git a/cryptojs/test/sha512-profile-tests.ts b/types/cryptojs/test/sha512-profile-tests.ts similarity index 100% rename from cryptojs/test/sha512-profile-tests.ts rename to types/cryptojs/test/sha512-profile-tests.ts diff --git a/cryptojs/test/sha512-tests.ts b/types/cryptojs/test/sha512-tests.ts similarity index 100% rename from cryptojs/test/sha512-tests.ts rename to types/cryptojs/test/sha512-tests.ts diff --git a/cryptojs/test/tripledes-profile-tests.ts b/types/cryptojs/test/tripledes-profile-tests.ts similarity index 100% rename from cryptojs/test/tripledes-profile-tests.ts rename to types/cryptojs/test/tripledes-profile-tests.ts diff --git a/cryptojs/test/tripledes-tests.ts b/types/cryptojs/test/tripledes-tests.ts similarity index 100% rename from cryptojs/test/tripledes-tests.ts rename to types/cryptojs/test/tripledes-tests.ts diff --git a/cryptojs/test/x64-word-tests.ts b/types/cryptojs/test/x64-word-tests.ts similarity index 100% rename from cryptojs/test/x64-word-tests.ts rename to types/cryptojs/test/x64-word-tests.ts diff --git a/cryptojs/test/x64-wordarray-tests.ts b/types/cryptojs/test/x64-wordarray-tests.ts similarity index 100% rename from cryptojs/test/x64-wordarray-tests.ts rename to types/cryptojs/test/x64-wordarray-tests.ts diff --git a/cryptojs/tsconfig.json b/types/cryptojs/tsconfig.json similarity index 100% rename from cryptojs/tsconfig.json rename to types/cryptojs/tsconfig.json diff --git a/cson/cson-tests.ts b/types/cson/cson-tests.ts similarity index 100% rename from cson/cson-tests.ts rename to types/cson/cson-tests.ts diff --git a/cson/index.d.ts b/types/cson/index.d.ts similarity index 100% rename from cson/index.d.ts rename to types/cson/index.d.ts diff --git a/cson/tsconfig.json b/types/cson/tsconfig.json similarity index 100% rename from cson/tsconfig.json rename to types/cson/tsconfig.json diff --git a/types/csprng/csprng-tests.ts b/types/csprng/csprng-tests.ts new file mode 100644 index 0000000000..aafddc4021 --- /dev/null +++ b/types/csprng/csprng-tests.ts @@ -0,0 +1,5 @@ +import csprng = require("csprng"); + +let rngStr: string; + +rngStr = csprng(32, 16); diff --git a/types/csprng/index.d.ts b/types/csprng/index.d.ts new file mode 100644 index 0000000000..90aa83b017 --- /dev/null +++ b/types/csprng/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for csprng 0.1 +// Project: https://github.com/jcoglan/node-csprng +// Definitions by: Wink Saville +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export = csprng; + +declare function csprng(bits: number, radix: number): string; diff --git a/types/csprng/tsconfig.json b/types/csprng/tsconfig.json new file mode 100644 index 0000000000..0877c1ab25 --- /dev/null +++ b/types/csprng/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", + "csprng-tests.ts" + ] +} diff --git a/types/csprng/tslint.json b/types/csprng/tslint.json new file mode 100644 index 0000000000..ec365f164b --- /dev/null +++ b/types/csprng/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} diff --git a/css-modules-require-hook/css-modules-require-hook-tests.ts b/types/css-modules-require-hook/css-modules-require-hook-tests.ts similarity index 97% rename from css-modules-require-hook/css-modules-require-hook-tests.ts rename to types/css-modules-require-hook/css-modules-require-hook-tests.ts index 0e2e366f96..93da1326bd 100644 --- a/css-modules-require-hook/css-modules-require-hook-tests.ts +++ b/types/css-modules-require-hook/css-modules-require-hook-tests.ts @@ -1,4 +1,3 @@ -/// /// import * as hook from 'css-modules-require-hook'; @@ -63,7 +62,7 @@ hook({ extensions: ['.scss', '.sass'] }); hook({ ignore: (file: string) => false }); hook({ ignore: 'unused' }); -hook({ ignore: /\.test\.(css|scss|sass)/$ }); +hook({ ignore: /\.test\.(css|scss|sass)$/ }); // // https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#preprocesscss-function diff --git a/css-modules-require-hook/index.d.ts b/types/css-modules-require-hook/index.d.ts similarity index 100% rename from css-modules-require-hook/index.d.ts rename to types/css-modules-require-hook/index.d.ts diff --git a/css-modules-require-hook/tsconfig.json b/types/css-modules-require-hook/tsconfig.json similarity index 100% rename from css-modules-require-hook/tsconfig.json rename to types/css-modules-require-hook/tsconfig.json diff --git a/css/css-tests.ts b/types/css/css-tests.ts similarity index 100% rename from css/css-tests.ts rename to types/css/css-tests.ts diff --git a/css/index.d.ts b/types/css/index.d.ts similarity index 100% rename from css/index.d.ts rename to types/css/index.d.ts diff --git a/css/tsconfig.json b/types/css/tsconfig.json similarity index 100% rename from css/tsconfig.json rename to types/css/tsconfig.json diff --git a/cssbeautify/cssbeautify-tests.ts b/types/cssbeautify/cssbeautify-tests.ts similarity index 100% rename from cssbeautify/cssbeautify-tests.ts rename to types/cssbeautify/cssbeautify-tests.ts diff --git a/cssbeautify/index.d.ts b/types/cssbeautify/index.d.ts similarity index 100% rename from cssbeautify/index.d.ts rename to types/cssbeautify/index.d.ts diff --git a/cssbeautify/tsconfig.json b/types/cssbeautify/tsconfig.json similarity index 100% rename from cssbeautify/tsconfig.json rename to types/cssbeautify/tsconfig.json diff --git a/csurf/index.d.ts b/types/csurf/index.d.ts similarity index 100% rename from csurf/index.d.ts rename to types/csurf/index.d.ts diff --git a/csurf/tsconfig.json b/types/csurf/tsconfig.json similarity index 100% rename from csurf/tsconfig.json rename to types/csurf/tsconfig.json diff --git a/csv-parse/csv-parse-tests.ts b/types/csv-parse/csv-parse-tests.ts similarity index 71% rename from csv-parse/csv-parse-tests.ts rename to types/csv-parse/csv-parse-tests.ts index 21df979d82..b0f13121fe 100644 --- a/csv-parse/csv-parse-tests.ts +++ b/types/csv-parse/csv-parse-tests.ts @@ -2,27 +2,27 @@ 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' ] ]); + parse(input, {comment: '#'}, (err, output) => { + output.should.eql([ [ '1', '2', '3', '4' ], [ 'a', 'b', 'c', 'd' ] ]); }); } function streamAPITest() { - let output:string[][] = []; + 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()){ + parser.on('readable', () => { + while (record = parser.read()) { output.push(record); } }); // Catch any error - parser.on('error', function(err: any){ + parser.on('error', (err: any) => { console.log(err.message); }); - parser.on('finish', function(){ + parser.on('finish', () => { console.log(output); }); // Now that setup is done, write data to the stream @@ -37,12 +37,12 @@ import fs = require('fs'); function pipeFunctionTest() { var transform = require('stream-transform'); - var output:any = []; + 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'); + var transformer = transform((record: any[], callback: any) => { + setTimeout(() => { + callback(null, record.join(' ') + '\n'); }, 500); }, {parallel: 10}); input.pipe(parser).pipe(transformer).pipe(process.stdout); diff --git a/types/csv-parse/index.d.ts b/types/csv-parse/index.d.ts new file mode 100644 index 0000000000..e780bac27d --- /dev/null +++ b/types/csv-parse/index.d.ts @@ -0,0 +1,120 @@ +// Type definitions for csv-parse 1.1 +// Project: https://github.com/wdavidw/node-csv-parse +// Definitions by: David Muller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as stream from "stream"; + +export = parse; + +declare function parse(input: string, options?: parse.Options, callback?: parse.Callback): any; +declare function parse(options?: parse.Options, callback?: parse.Callback): any; +declare function parse(callback?: parse.Callback): any; +declare namespace parse { + type Callback = (err: any, output: any) => void; + + interface Parser extends stream.Transform {} + class Parser { + constructor(options: Options); + __push(line: any): any ; + __write(chars: any, end: any, callback: any): any; + } + + 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 | ((line1: any[]) => boolean | string[]); + + /** + * 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 + } + + // TODO: what is this for? + interface ParserStream extends NodeJS.ReadWriteStream { + read(size?: number): any & string[]; + } +} diff --git a/types/csv-parse/lib/sync.d.ts b/types/csv-parse/lib/sync.d.ts new file mode 100644 index 0000000000..5a025f6dab --- /dev/null +++ b/types/csv-parse/lib/sync.d.ts @@ -0,0 +1,4 @@ +import { Options } from "csv-parse"; + +declare function parse(input: string, options?: Options): any; +export = parse; diff --git a/csv-parse/tsconfig.json b/types/csv-parse/tsconfig.json similarity index 94% rename from csv-parse/tsconfig.json rename to types/csv-parse/tsconfig.json index 36611c4d1d..b721ff4fe6 100644 --- a/csv-parse/tsconfig.json +++ b/types/csv-parse/tsconfig.json @@ -17,6 +17,7 @@ }, "files": [ "index.d.ts", + "lib/sync.d.ts", "csv-parse-tests.ts" ] } \ No newline at end of file diff --git a/line-by-line/tslint.json b/types/csv-parse/tslint.json similarity index 100% rename from line-by-line/tslint.json rename to types/csv-parse/tslint.json diff --git a/csv-stringify/csv-stringify-tests.ts b/types/csv-stringify/csv-stringify-tests.ts similarity index 93% rename from csv-stringify/csv-stringify-tests.ts rename to types/csv-stringify/csv-stringify-tests.ts index bd6873affb..a05f35d368 100644 --- a/csv-stringify/csv-stringify-tests.ts +++ b/types/csv-stringify/csv-stringify-tests.ts @@ -1,5 +1,3 @@ -/// - import stringify = require("csv-stringify"); let stream: stringify.Stringifier; diff --git a/csv-stringify/index.d.ts b/types/csv-stringify/index.d.ts similarity index 100% rename from csv-stringify/index.d.ts rename to types/csv-stringify/index.d.ts diff --git a/csv-stringify/tsconfig.json b/types/csv-stringify/tsconfig.json similarity index 100% rename from csv-stringify/tsconfig.json rename to types/csv-stringify/tsconfig.json diff --git a/d3/tslint.json b/types/csv-stringify/tslint.json similarity index 100% rename from d3/tslint.json rename to types/csv-stringify/tslint.json diff --git a/types/csvtojson/csvtojson-tests.ts b/types/csvtojson/csvtojson-tests.ts new file mode 100644 index 0000000000..a4ee3d76d4 --- /dev/null +++ b/types/csvtojson/csvtojson-tests.ts @@ -0,0 +1,114 @@ +import csv = require('csvtojson'); +import fs = require('fs'); + +// From documentation on project home page -> https://github.com/Keyang/node-csvtojson + +///////////////////////////// +// From CSV String +const csvStr: string = `1,2,3 +4,5,6 +7,8,9`; + +// event emitter version using factory function +csv({ noheader: true }) + .fromString(csvStr) + .on('csv', (csvRow: string[]) => { // this func will be called 3 times + console.log(csvRow); // => [1,2,3] , [4,5,6] , [7,8,9] + }) + .on('done', () => { + // parsing finished + }); + +// event emitter version using Converter class +new csv.Converter({ noheader: true }) + .fromString(csvStr) + .on('csv', (csvRow: string[]) => { // this func will be called 3 times + console.log(csvRow); // => [1,2,3] , [4,5,6] , [7,8,9] + }) + .on('done', () => { + // parsing finished + }); + +// callback version using Converter class +new csv.Converter({ noheader: true }) + .fromString(csvStr, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using factory function +csv({ noheader: true }) + .fromString(csvStr, (err, result) => { + console.log(JSON.stringify(result)); + }); + +///////////////////////////// +// From CSV File +const filePath = './test.csv'; + +// event emitter version using factory function +csv() + .fromFile(filePath) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// event emitter version using Converter class +new csv.Converter() + .fromFile(filePath) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// callback version using factory function +csv() + .fromFile(filePath, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using Converter class +new csv.Converter() + .fromFile(filePath, (err, result) => { + console.log(JSON.stringify(result)); + }); + +///////////////////////////// +// From CSV Stream + +const stream = fs.createReadStream(filePath); + +// event emitter version using factory function +csv().fromStream(stream) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// event emitter version using Converter class +new csv.Converter() + .fromStream(stream) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// callback version using factory function +csv() + .fromStream(stream, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using Converter class +new csv.Converter() + .fromStream(stream, (err, result) => { + console.log(JSON.stringify(result)); + }); diff --git a/types/csvtojson/index.d.ts b/types/csvtojson/index.d.ts new file mode 100644 index 0000000000..504311f47a --- /dev/null +++ b/types/csvtojson/index.d.ts @@ -0,0 +1,273 @@ +// Type definitions for csvtojson 1.1 +// Project: https://github.com/Keyang/node-csvtojson +// Definitions by: Eric Byers , Wayne Carson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as stream from 'stream'; + +declare namespace csvtojson { + /** + * Stream options + */ + type StreamOptions = stream.TransformOptions; + + /** + * Converter options + */ + interface ConverterOptions { + /** + * Delimiter used for seperating columns. Use "auto" if delimiter is unknown in advance, + * in this case, delimiter will be auto-detected (by best attempt). Use an array to give + * a list of potential delimiters e.g. [",","|","$"]. (default: ",") + */ + delimiter?: string | string[]; + + /** + * If a column contains delimiter, it is able to use quote character to surround the column + * content. e.g. "hello, world" wont be split into two columns while parsing. Set to "off" + * will ignore all quotes. (default: " (double quote)) + */ + quote?: string; + + /** + * Indicate if parser trim off spaces surrounding column content. e.g. " content " will be + * trimmed to "content". (default: true) + */ + trim?: boolean; + + /** + * This parameter turns on and off whether check field type. (default: true) + */ + checkType?: boolean; + + /** + * Stringify the stream output to JSON array. This is useful when pipe output to a file + * which expects stringified JSON array. (default: false and only stringified JSON (without []) + * will be pushed to downstream) + */ + toArrayString?: boolean; + + /** + * Ignore the empty value in CSV columns. If a column value is not giving, set this to true to + * skip them. (default: false) + */ + ignoreEmpty?: boolean; + + /** + * Number of worker processes. The worker process will use multi-cores to help process CSV data. + * Set to number of cores to improve the performance of processing large CSV file. Keep 1 for + * small csv files. (default: 1) + */ + workerNum?: number; + + /** + * Indicating CSV data has no header row and first row is data row. (default: false) + */ + noheader?: boolean; + + /** + * An array to specify the headers of CSV data. If noheader is false, this value will override + * CSV header row. Example: ["my field","name"] (default: null) + */ + headers?: string[]; + + /** + * Don't interpret dots (.) and square brackets in header fields as nested object or array identifiers + * at all (treat them like regular characters for JSON field identifiers). (default: false) + */ + flatKeys?: boolean; + + /** + * The max character a CSV row could have. 0 means infinite. If max number exceeded, parser will emit + * "error" of "row_exceed". if a possibly corrupted CSV data provided, give it a number like 65535 + * so the parser wont consume memory. (default: 0) + */ + maxRowLength?: number; + + /** + * Whether or not to check if the column number of a row is the same as headers. If column number + * mismatched headers number, an error of "mismatched_column" will be emitted. (default: false) + */ + checkColumn?: boolean; + + /** + * End of line character. If omitted, parser will attempt retrieve it from first chunk of CSV data. + * If no valid eol found, then operation system eol will be used. + */ + eol?: string; + + /** + * Escape character used in quoted column. Default is double quote (") according to RFC4108. Change + * to back slash (\) or other chars for your own case. (default: " (double quote)) + */ + escape?: string; + + /** + * This parameter instructs the parser to include only those columns as specified by an array of + * column indexes. Example: [0,2,3] will parse and include only columns 0, 2, and 3 in the JSON output. + */ + includeColumns?: number[]; + + /** + * This parameter instructs the parser to ignore columns as specified by an array of column indexes. + * Example: [1,3,5] will ignore columns 1, 3, and 5 and will not return them in the JSON output. + */ + ignoreColumns?: number[]; + + /** + * Deprecated. Use workerNum instead. + */ + fork?: number; + } + + /** + * Callback function for handling result of parse. + */ + type ParseResultHandler = (err: any, result: any) => void; + + /** + * Event handler for "json" events. + */ + type JsonEventHandler = (jsonObj: any, rowNumber: number) => void; + + /** + * Event handler for "csv" events. + */ + type CsvEventHandler = (csvRow: string[], rowNumber: number) => void; + + /** + * Event handler for "data" events. + */ + type DataEventHandler = (data: any) => void; + + /** + * Event handler for "error" events. + */ + type ErrorEventHandler = (err: any) => void; + + /** + * Event handler for "record_parsed" events. + */ + type RecordParsedEventHandler = (jsonObj: any, csvRoe: string[], rowNumber: number) => void; + + /** + * Event handler for "end" events. + */ + type EndEventHandler = () => void; + + /** + * Event handler for "end_parsed" events. + */ + type EndParsedEventHandler = (jsonObjArray: any[]) => void; + + /** + * Event handler for "done" events. + */ + type DoneEventHandler = (err: any) => void; + + /** + * Converts provided CSV input to a JSON object. + */ + class Converter extends stream.Transform { + /** + * Initializes a new instance of a Converter + * @param {ConverterOptions} options converter options + * @param {StreamOptions} streamOptions stream options + */ + constructor(options?: ConverterOptions, streamOptions?: StreamOptions); + + /** + * Reads in a CSV from a string. + * @param {string} str the string to convert + * @return {Converter} returns this object for chaining + */ + fromString(str: string): this + + /** + * Reads in a CSV from a string. + * @param {string} str the string to convert + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromString(str: string, callback: ParseResultHandler): void; + + /** + * Reads in a CSV from a file. + * @param {string} filePath the path to the CSV file + * @return {Converter} returns this object for chaining + */ + fromFile(filePath: string): this + + /** + * Reads in a CSV from a file. + * @param {string} filePath the path to the CSV file + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromFile(filePath: string, callback: ParseResultHandler): void; + + /** + * Reads in a CSV from a stream. + * @param {Stream} stream the stream + * @return {Converter} returns this object for chaining + */ + fromStream(stream: NodeJS.ReadableStream): this + + /** + * Reads in a CSV from a stream. + * @param {Stream} stream the stream + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromStream(stream: stream.Stream, callback: ParseResultHandler): void; + + /** + * Adds a listener function to the end of the listeners array for an event. + * Available events: + * - json + * - csv + * - data + * - error + * - record_parsed + * - end + * - end_parsed + * - done + * @param {Event} event name of event + * @param {Function} listener listener function + * @return {this} returns this object for chaining + */ + // tslint:disable-next-line:forbidden-types + on(event: string, listener: Function | JsonEventHandler | CsvEventHandler | DataEventHandler | ErrorEventHandler + | RecordParsedEventHandler | EndEventHandler | EndParsedEventHandler | DoneEventHandler): this; + + /** + * Transform objects after CSV parsing but before result being emitted or pushed downstream. + * @param {Function} callback transform function + * @return {this} returns this object for chaining + */ + transf(callback: (jsonObj: any, csvRow: string[], rowNumber: number) => void): this; + + /** + * The function in preRawData will be called directly with the string from upper stream. + * @param {Function} callback callback function + * @return {this} returns this object for chaining + */ + preRawData(callback: (csvRawData: string, cb: (newData: any) => void) => void): this; + + /** + * The function is called each time a file line being found in csv stream. + * @param {Function} callback callback function + * @return {this} returns this object for chaining + */ + preFileLine(callback: (line: string, rowNumber: number) => string): this; + } +} + +/** + * Factory function which creates an instance of a Converter object. + * @param {ConverterOptions} options converter options + * @param {StreamOptions} streamOptions stream options + * @return {csvtojson.Converter} Converter object + */ +declare function csvtojson(options?: csvtojson.ConverterOptions, streamOptions?: csvtojson.StreamOptions): csvtojson.Converter; + +export = csvtojson; diff --git a/types/csvtojson/tsconfig.json b/types/csvtojson/tsconfig.json new file mode 100644 index 0000000000..81ec6a66a2 --- /dev/null +++ b/types/csvtojson/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", + "csvtojson-tests.ts" + ] +} diff --git a/dagre-d3/tslint.json b/types/csvtojson/tslint.json similarity index 100% rename from dagre-d3/tslint.json rename to types/csvtojson/tslint.json diff --git a/types/cucumber/cucumber-tests.ts b/types/cucumber/cucumber-tests.ts new file mode 100644 index 0000000000..9b057a362c --- /dev/null +++ b/types/cucumber/cucumber-tests.ts @@ -0,0 +1,136 @@ +import * as assert from "power-assert"; +import cucumber = require("cucumber"); + +function StepSample() { + type Callback = cucumber.CallbackStepDefinition; + type Table = cucumber.TableDefinition; + type HookScenarioResult = cucumber.HookScenarioResult; + + cucumber.defineSupportCode(function ({setWorldConstructor, defineParameterType, After, Around, Before, registerHandler, Given, When, Then}) { + setWorldConstructor(function ({attach, parameters}) { + this.attach = attach; + this.parameters = parameters; + this.visit = function (url: string, callback: Callback) { + callback(null, 'pending'); + } + }); + + Before(function (scenarioResult: HookScenarioResult, callback: Callback) { + console.log(scenarioResult.status === "failed"); + callback(); + }); + + Before({ timeout: 1000 }, function (scenarioResult: HookScenarioResult, callback: Callback) { + console.log(scenarioResult.status === "failed"); + callback(); + }); + + Around(function (scenarioResult: HookScenarioResult, runScenario: (error: string, callback?: Function) => void) { + scenarioResult.status === "failed" && runScenario(null, function () { + console.log('finish tasks'); + }); + }); + + After((scenarioResult: HookScenarioResult, callback?: Callback) => { + console.log("After"); + callback(); + }); + + After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback?: Callback) => { + console.log("After"); + callback(); + }); + + registerHandler('AfterFeatures', function (event: any, callback: Function) { + callback(); + }); + + Given(/^a variable set to (\d+)$/, (x: string) => { + console.log("the number is: " + x); + }); + + Given(/^I am on the Cucumber.js GitHub repository$/, function (callback: Callback) { + this.visit('https://github.com/cucumber/cucumber-js', callback); + }); + + When(/^I go to the README file$/, function (title: string, callback: Callback) { + callback(null, 'pending'); + }); + + 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 + + Given(/^a table step with Table raw$/, function (table: Table) { + var expected = [ + ['Cucumber', 'Cucumis sativus'], + ['Burr Gherkin', 'Cucumis anguria'] + ]; + + assert.deepEqual(table.raw(), expected); + }); + + Given(/^a table step with Table rows$/, function (table: Table) { + var expected = [ + ['Apricot', '5'], + ['Brocolli', '2'], + ['Cucumber', '10'] + ]; + assert.deepEqual(table.rows(), expected) + }); + + Given(/^a table step with Table rowHash$/, function (table: Table) { + var expected = { + 'Cucumber': 'Cucumis sativus', + 'Burr Gherkin': 'Cucumis anguria' + }; + assert.deepEqual(table.rowsHash(), expected) + }); + + 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) + }); + + defineParameterType({ + regexp: /particular/, + transformer: s => s.toUpperCase(), + typeName: 'param' + }); + + Given('a {param} step', function (param) { + assert.equal(param, 'PARTICULAR') + }); + + }); + + 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; +} \ No newline at end of file diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts new file mode 100644 index 0000000000..04ed7289cb --- /dev/null +++ b/types/cucumber/index.d.ts @@ -0,0 +1,262 @@ +// Type definitions for cucumber-js v2.0.0 +// Project: https://github.com/cucumber/cucumber-js +// Definitions by: Abraão Alves , Jan Molak , Isaiah Soung +// 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 HookScenarioResult { + duration: number; + failureException: Error; + scenario: Scenario; + status: string; + stepsResults: any; + } + + interface HookCode { + (scenario: HookScenarioResult, callback?: CallbackStepDefinition): void; + } + + interface AroundCode { + (scenario: HookScenarioResult, runScenario?: (error: string, callback?: Function) => void): void; + } + + interface Transform { + regexp: RegExp; + transformer: (arg: string) => any; + typeName: string; + } + + interface HookOptions{ + timeout?: number; + } + + export interface Hooks { + Before(code: HookCode): void; + Before(options: HookOptions, code: HookCode): void; + After(code: HookCode): void; + After(options: HookOptions, 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; + defineParameterType(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 { + name: string; + data: any; + } + + 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 { + duration: number; + scenarioResults: any[]; + success: boolean; + stepsResults: any[]; + strict: boolean; + } + + interface FeaturePayload extends EventPayload { + description: string; + keyword: string; + line: number; + name: string; + tags: Tag[]; + uri: string; + scenarios: Scenario[]; + } + + interface ScenarioPayload extends EventPayload { + feature: Feature; + exception: Error; + keyword: string; + lines: number[]; + name: string; + tags: Tag[]; + uri: string; + line: number; + description: string; + steps: Step[]; + } + + interface ScenarioResultPayload extends EventPayload { + duration: any; + failureException: Error; + scenario: Scenario; + status: string; + stepResults: any[]; + } + + interface StepPayload extends EventPayload { + arguments: any; + line: number; + name: string; + scenario: Scenario; + uri: string; + isBackground: boolean; + keyword: string; + keywordType: string; + } + + interface StepResultPayload extends EventPayload { + ambiguousStepDefinitions: any; + attachments: any[]; + duration: any; + failureException: Error; + step: Step; + stepDefinition: StepDefinition; + status: string; + } + + } + + export interface StepDefinition { + code: Function; + line: number; + options: {}; + pattern: any; + uri: string; + } + + export interface Tag { + name: string; + line: number; + } + + export interface Step { + arguments: any; + line: number; + name: string; + scenario: Scenario; + uri: string; + isBackground: boolean; + keyword: string; + keywordType: string; + } + + export interface Scenario { + feature: Feature; + exception: Error; + keyword: string; + lines: number[]; + name: string; + tags: Tag[]; + uri: string; + line: number; + description: string; + steps: Step[]; + } + + export interface Feature { + description: string; + keyword: string; + line: number; + name: string; + tags: Tag[]; + uri: string; + scenarios: Scenario[]; + } + + 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; + + // https://github.com/cucumber/cucumber-js/commit/231183a8a11c985ef7ced1155b7a75f5120a34b6 + export class Formatter { + constructor(options?: any); + log(data: any): void; + } + + export class SummaryFormatter extends Formatter { + indent(text: string, numberOfSpaces: number): any; + } + export class PrettyFormatter extends SummaryFormatter { + formatTags(tags: Tag[]): any; + logIndented(text: string, level: number): void; + logStepResult(stepResult: any): void; + } + + export class ProgressFormatter extends SummaryFormatter{ + } + + export class RerunFormatter extends Formatter{ + } + + export class SnippetsFormatter extends Formatter{ + } + + export class UsageFormatter extends Formatter{ + } + + export class UsageJsonFormatter extends Formatter{ + } + + export class JsonFormatter extends Formatter { + } + +} \ No newline at end of file diff --git a/cucumber/tsconfig.json b/types/cucumber/tsconfig.json similarity index 100% rename from cucumber/tsconfig.json rename to types/cucumber/tsconfig.json diff --git a/types/cucumber/v1/cucumber-tests.ts b/types/cucumber/v1/cucumber-tests.ts new file mode 100644 index 0000000000..596772274f --- /dev/null +++ b/types/cucumber/v1/cucumber-tests.ts @@ -0,0 +1,102 @@ +import * as assert from "power-assert"; +import cucumber = require("cucumber"); + +function StepSample() { + type Callback = cucumber.CallbackStepDefinition; + type Table = cucumber.TableDefinition; + type HookScenario = cucumber.HookScenario; + var step = this; + var hook = this; + + hook.Before(function (scenario: HookScenario, callback: Callback) { + scenario.isFailed() && callback.pending(); + }); + + hook.Before({ timeout: 1000 }, function(scenario: HookScenario, callback: Callback) { + callback(); + }); + + hook.After({ timeout: 1000 }, function(scenario: HookScenario, callback: Callback) { + callback(); + }); + + 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) + }); + +} + +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/types/cucumber/v1/index.d.ts b/types/cucumber/v1/index.d.ts new file mode 100644 index 0000000000..5fb080ff5f --- /dev/null +++ b/types/cucumber/v1/index.d.ts @@ -0,0 +1,214 @@ +// Type definitions for cucumber-js v1.3.1 +// Project: https://github.com/cucumber/cucumber-js +// Definitions by: Abraão Alves , Jan Molak , Isaiah Soung +// 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 HookOptions{ + timeout?: number; + } + + export interface Hooks { + Before(code: HookCode): void; + Before(options: HookOptions, code: HookCode): void; + After(code: HookCode): void; + After(options: HookOptions, code: HookCode): void; + Around(code: AroundCode): void; + setDefaultTimeout(time: number): void; + registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; + registerListener(listener: EventListener): 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; + } +} diff --git a/types/cucumber/v1/tsconfig.json b/types/cucumber/v1/tsconfig.json new file mode 100644 index 0000000000..b467d8c4b4 --- /dev/null +++ b/types/cucumber/v1/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "cucumber": [ + "cucumber/v1" + ], + "cucumber/*": [ + "cucumber/v1/*" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cucumber-tests.ts" + ] +} diff --git a/cuid/cuid-tests.ts b/types/cuid/cuid-tests.ts similarity index 100% rename from cuid/cuid-tests.ts rename to types/cuid/cuid-tests.ts diff --git a/cuid/index.d.ts b/types/cuid/index.d.ts similarity index 100% rename from cuid/index.d.ts rename to types/cuid/index.d.ts diff --git a/cuid/tsconfig.json b/types/cuid/tsconfig.json similarity index 100% rename from cuid/tsconfig.json rename to types/cuid/tsconfig.json diff --git a/currency-formatter/currencies.d.ts b/types/currency-formatter/currencies.d.ts similarity index 100% rename from currency-formatter/currencies.d.ts rename to types/currency-formatter/currencies.d.ts diff --git a/currency-formatter/currency-formatter-tests.ts b/types/currency-formatter/currency-formatter-tests.ts similarity index 100% rename from currency-formatter/currency-formatter-tests.ts rename to types/currency-formatter/currency-formatter-tests.ts diff --git a/currency-formatter/index.d.ts b/types/currency-formatter/index.d.ts similarity index 100% rename from currency-formatter/index.d.ts rename to types/currency-formatter/index.d.ts diff --git a/currency-formatter/tsconfig.json b/types/currency-formatter/tsconfig.json similarity index 100% rename from currency-formatter/tsconfig.json rename to types/currency-formatter/tsconfig.json diff --git a/dagre/tslint.json b/types/currency-formatter/tslint.json similarity index 100% rename from dagre/tslint.json rename to types/currency-formatter/tslint.json diff --git a/custom-error-generator/custom-error-generator-tests.ts b/types/custom-error-generator/custom-error-generator-tests.ts similarity index 100% rename from custom-error-generator/custom-error-generator-tests.ts rename to types/custom-error-generator/custom-error-generator-tests.ts diff --git a/custom-error-generator/index.d.ts b/types/custom-error-generator/index.d.ts similarity index 100% rename from custom-error-generator/index.d.ts rename to types/custom-error-generator/index.d.ts diff --git a/custom-error-generator/tsconfig.json b/types/custom-error-generator/tsconfig.json similarity index 100% rename from custom-error-generator/tsconfig.json rename to types/custom-error-generator/tsconfig.json diff --git a/cybozulabs-md5/cybozulabs-md5-tests.ts b/types/cybozulabs-md5/cybozulabs-md5-tests.ts similarity index 84% rename from cybozulabs-md5/cybozulabs-md5-tests.ts rename to types/cybozulabs-md5/cybozulabs-md5-tests.ts index 7572ed9124..2163b6e8c9 100644 --- a/cybozulabs-md5/cybozulabs-md5-tests.ts +++ b/types/cybozulabs-md5/cybozulabs-md5-tests.ts @@ -1,5 +1,3 @@ -/// - var hash: string; hash = CybozuLabs.MD5.calc("abc"); hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII); diff --git a/cybozulabs-md5/index.d.ts b/types/cybozulabs-md5/index.d.ts similarity index 100% rename from cybozulabs-md5/index.d.ts rename to types/cybozulabs-md5/index.d.ts diff --git a/cybozulabs-md5/tsconfig.json b/types/cybozulabs-md5/tsconfig.json similarity index 100% rename from cybozulabs-md5/tsconfig.json rename to types/cybozulabs-md5/tsconfig.json diff --git a/d3-array/d3-array-tests.ts b/types/d3-array/d3-array-tests.ts similarity index 99% rename from d3-array/d3-array-tests.ts rename to types/d3-array/d3-array-tests.ts index 7dbe08bad0..bb713192e8 100644 --- a/d3-array/d3-array-tests.ts +++ b/types/d3-array/d3-array-tests.ts @@ -26,7 +26,6 @@ class NumCoercible { } class MixedObject { - num: number; str: string; numeric: NumCoercible; @@ -289,7 +288,6 @@ num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14 num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 1); num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 3, 4); - // ascending() ----------------------------------------------------------------- num = d3Array.ascending(undefined, 20); @@ -339,12 +337,11 @@ crossed = d3Array.cross(['x', 'y'], [1, 2]); let strArray: string[] = d3Array.cross([2, 3], [5, 6], (a, b) => (a + b) + 'px'); strArray = d3Array.cross([2, 3], [5, 6], (a, b) => { - let aa: number = a; - let bb: number = b; + const aa: number = a; + const bb: number = b; return (aa + bb) + 'px'; }); - // pairs() --------------------------------------------------------------------- let pairs: Array<[MixedObject, MixedObject]>; @@ -353,8 +350,8 @@ pairs = d3Array.pairs(mergedArray); numbersArray = d3Array.pairs(mergedArray, (a, b) => b.num - a.num); numbersArray = d3Array.pairs(mergedArray, (a, b) => { - let aa: MixedObject = a; - let bb: MixedObject = b; + const aa: MixedObject = a; + const bb: MixedObject = b; return bb.num - aa.num; }); @@ -374,7 +371,6 @@ const testObject = { const x: Array = d3Array.permute(testObject, ['name', 'val', 'when', 'more']); - // range() --------------------------------------------------------------------- numbersArray = d3Array.range(10); @@ -389,7 +385,6 @@ mergedArray = d3Array.shuffle(mergedArray, 1); mergedArray = d3Array.shuffle(mergedArray, 1, 3); - // ticks() --------------------------------------------------------------------- numbersArray = d3Array.ticks(1, 10, 5); @@ -519,8 +514,6 @@ const mixedObject: MixedObject = testBin[0]; // with element type MixedObject date = testBin.x0; // bin lower bound is Date date = testBin.x1; // bin upper bound is Date - - // Histogram Tresholds ========================================================= num = d3Array.thresholdFreedmanDiaconis([-1, 0, 1, 1, 3, 20, 234], -1, 234); diff --git a/d3-array/index.d.ts b/types/d3-array/index.d.ts similarity index 99% rename from d3-array/index.d.ts rename to types/d3-array/index.d.ts index d938a8c032..ccd2d568bb 100644 --- a/d3-array/index.d.ts +++ b/types/d3-array/index.d.ts @@ -9,7 +9,6 @@ // Shared Types and Interfaces // -------------------------------------------------------------------------- - /** * Administrivia: JavaScript primitive types and Date */ @@ -26,7 +25,6 @@ interface Numeric { // Descriptive Statistics // -------------------------------------------------------------------------------------- - /** * Return the maximum value in the array of strings using natural order. */ @@ -67,8 +65,6 @@ export function min(array: T[], accessor: (datum: T, index: number, array: T[ */ export function min(array: T[], accessor: (datum: T, index: number, array: T[]) => U | undefined | null): U | undefined; - - /** * Return the min and max simultaneously. */ @@ -139,7 +135,6 @@ export function variance(array: Array): */ export function variance(array: T[], accessor: (datum: T, index: number, array: T[]) => number | undefined | null): number | undefined; - // -------------------------------------------------------------------------------------- // Searching Arrays // -------------------------------------------------------------------------------------- @@ -155,7 +150,7 @@ export function bisectRight(array: number[], x: number, lo?: number, hi?: 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 const bisect: typeof bisectRight; export interface Bisector { left: (array: T[], x: U, lo?: number, hi?: number) => number; @@ -244,7 +239,6 @@ export function range(stop: number): number[]; */ export function range(start: number, stop: number, step?: number): number[]; - /** * Randomizes the order of the specified array using the Fisher–Yates shuffle. */ @@ -261,13 +255,11 @@ export function ticks(start: number, stop: number, count: number): number[]; */ 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 @@ -294,8 +286,6 @@ export type ThresholdCountGenerator = (values: number[], min?: number, max?: num */ export type ThresholdArrayGenerator = (values: Value[], min?: Value, max?: Value) => Value[]; - - export interface HistogramGenerator { (data: Datum[]): Array>; value(): (d: Datum, i: number, data: Datum[]) => Value; diff --git a/d3-array/tsconfig.json b/types/d3-array/tsconfig.json similarity index 100% rename from d3-array/tsconfig.json rename to types/d3-array/tsconfig.json diff --git a/d3-array/tslint.json b/types/d3-array/tslint.json similarity index 100% rename from d3-array/tslint.json rename to types/d3-array/tslint.json diff --git a/d3-axis/d3-axis-tests.ts b/types/d3-axis/d3-axis-tests.ts similarity index 99% rename from d3-axis/d3-axis-tests.ts rename to types/d3-axis/d3-axis-tests.ts index 1a4077d690..f2b47beaa8 100644 --- a/d3-axis/d3-axis-tests.ts +++ b/types/d3-axis/d3-axis-tests.ts @@ -26,8 +26,6 @@ import { Transition } from 'd3-transition'; import { timeMinute } from 'd3-time'; import { format } from 'd3-format'; - - // -------------------------------------------------------------------------- // Preparatory Steps // -------------------------------------------------------------------------- @@ -81,8 +79,6 @@ leftAxis = leftAxis.scale(scalePow()); const powerScale: ScalePower = leftAxis.scale>(); // powerScale = leftAxis.scale(); // fails, without casting as AxisScale is purposely generic - - bottomAxis = bottomAxis.scale(scaleOrdinal()); // bottomAxis = bottomAxis.scale(scalePow()) // fails, domain of scale incompatible with domain of axis diff --git a/d3-axis/index.d.ts b/types/d3-axis/index.d.ts similarity index 99% rename from d3-axis/index.d.ts rename to types/d3-axis/index.d.ts index cd8ed94714..4a65952070 100644 --- a/d3-axis/index.d.ts +++ b/types/d3-axis/index.d.ts @@ -11,7 +11,6 @@ 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 @@ -171,7 +170,6 @@ export interface Axis { */ tickValues(values: null): this; - /** * Returns the currently set tick format function, which defaults to null. */ @@ -258,7 +256,6 @@ export interface Axis { * @param padding Padding in pixels (Default is 3). */ tickPadding(padding: number): this; - } /** diff --git a/d3-axis/tsconfig.json b/types/d3-axis/tsconfig.json similarity index 100% rename from d3-axis/tsconfig.json rename to types/d3-axis/tsconfig.json diff --git a/d3-axis/tslint.json b/types/d3-axis/tslint.json similarity index 100% rename from d3-axis/tslint.json rename to types/d3-axis/tslint.json diff --git a/d3-box/d3-box-tests.ts b/types/d3-box/d3-box-tests.ts similarity index 100% rename from d3-box/d3-box-tests.ts rename to types/d3-box/d3-box-tests.ts diff --git a/d3-box/index.d.ts b/types/d3-box/index.d.ts similarity index 100% rename from d3-box/index.d.ts rename to types/d3-box/index.d.ts diff --git a/d3-box/tsconfig.json b/types/d3-box/tsconfig.json similarity index 100% rename from d3-box/tsconfig.json rename to types/d3-box/tsconfig.json diff --git a/d3-brush/d3-brush-tests.ts b/types/d3-brush/d3-brush-tests.ts similarity index 99% rename from d3-brush/d3-brush-tests.ts rename to types/d3-brush/d3-brush-tests.ts index 367cc05d1b..2d9ee319aa 100644 --- a/d3-brush/d3-brush-tests.ts +++ b/types/d3-brush/d3-brush-tests.ts @@ -19,7 +19,6 @@ interface BrushDatum { filterZoomEvent: boolean; } - // ----------------------------------------------------------------------------- // Test Define BrushBehavior // ----------------------------------------------------------------------------- @@ -48,7 +47,6 @@ brush = brush.extent(function(d, i, group) { // chainable brush = brush.filter(function(d, i, group) { - // Cast d3 event to D3ZoomEvent to be used in filter logic const e = > event; @@ -80,7 +78,6 @@ brush = brush.on('end', brushed); // brush = brush.on('end', wrongHandler1); // fails, wrongHandler event handler has wrong this // brush = brush.on('end', wrongHandler2); // fails, wrongHandler event handler has wrong datum type - brushed = brush.on('end'); // chainable remove handler @@ -97,8 +94,6 @@ brush.on('end', function(d, i, g) { // do anything }); - - // ----------------------------------------------------------------------------- // Test Attach Brush Behavior // ----------------------------------------------------------------------------- @@ -121,10 +116,8 @@ const gX = select('svg') filterZoomEvent: true }); - gX.call(brushX); - // ----------------------------------------------------------------------------- // Test Use Brush Behavior // ----------------------------------------------------------------------------- @@ -155,7 +148,6 @@ brush.move(gTransition, function(d, i, group) { return selection; }); - const gXTransition = gX.transition(); // 1d brush move with Selection @@ -178,15 +170,12 @@ brush.move(gXTransition, function(d, i, group) { return selection; }); - // ----------------------------------------------------------------------------- // Test Brush Event Interface // ----------------------------------------------------------------------------- - const e: d3Brush.D3BrushEvent = event; - const target: d3Brush.BrushBehavior = e.target; const type: 'start' | 'brush' | 'end' | string = e.type; const brushSelection: d3Brush.BrushSelection = e.selection; diff --git a/d3-brush/index.d.ts b/types/d3-brush/index.d.ts similarity index 99% rename from d3-brush/index.d.ts rename to types/d3-brush/index.d.ts index 5c89465bce..644e6c06f7 100644 --- a/d3-brush/index.d.ts +++ b/types/d3-brush/index.d.ts @@ -189,7 +189,6 @@ export interface BrushBehavior { * with this as the current DOM element. */ on(typenames: string, listener: ValueFn): this; - } /** diff --git a/d3-brush/tsconfig.json b/types/d3-brush/tsconfig.json similarity index 100% rename from d3-brush/tsconfig.json rename to types/d3-brush/tsconfig.json diff --git a/d3-brush/tslint.json b/types/d3-brush/tslint.json similarity index 100% rename from d3-brush/tslint.json rename to types/d3-brush/tslint.json diff --git a/d3-chord/d3-chord-tests.ts b/types/d3-chord/d3-chord-tests.ts similarity index 99% rename from d3-chord/d3-chord-tests.ts rename to types/d3-chord/d3-chord-tests.ts index c826c81fac..b66f39787a 100644 --- a/d3-chord/d3-chord-tests.ts +++ b/types/d3-chord/d3-chord-tests.ts @@ -10,7 +10,6 @@ import * as d3Chord from 'd3-chord'; import { select, Selection } from 'd3-selection'; import { ascending } from 'd3-array'; - // --------------------------------------------------------------------- // Preparatory Steps // --------------------------------------------------------------------- @@ -39,7 +38,6 @@ let numAccessor: (this: SVGPathElement, d: d3Chord.ChordSubgroup, ...args: any[] // Test Chord // --------------------------------------------------------------------- - // chord() create ChordLayout generator =============================== let chordLayout: d3Chord.ChordLayout; @@ -64,7 +62,6 @@ chordLayout = chordLayout.sortSubgroups(ascending); chordLayout = chordLayout.sortSubgroups(null); comparatorFn = chordLayout.sortSubgroups(); - // sortChords() -------------------------------------------------------- chordLayout = chordLayout.sortChords(ascending); @@ -75,10 +72,8 @@ comparatorFn = chordLayout.sortChords(); chords = chordLayout(matrix); - // Test supporting interfaces ========================================== - const length: number = chords.length; chordGroups = chords.groups; @@ -98,7 +93,6 @@ num = chordSubgroup.endAngle; num = chordSubgroup.value; num = chordSubgroup.index; - // --------------------------------------------------------------------- // Test Ribbon // --------------------------------------------------------------------- @@ -140,7 +134,6 @@ svgRibbon = svgRibbon.target(d => { subgroupAccessor = svgRibbon.target(); - // radius() ----------------------------------------------------------- canvasRibbon = canvasRibbon.radius(30); diff --git a/d3-chord/index.d.ts b/types/d3-chord/index.d.ts similarity index 100% rename from d3-chord/index.d.ts rename to types/d3-chord/index.d.ts diff --git a/d3-chord/tsconfig.json b/types/d3-chord/tsconfig.json similarity index 100% rename from d3-chord/tsconfig.json rename to types/d3-chord/tsconfig.json diff --git a/d3-chord/tslint.json b/types/d3-chord/tslint.json similarity index 100% rename from d3-chord/tslint.json rename to types/d3-chord/tslint.json diff --git a/d3-collection/d3-collection-tests.ts b/types/d3-collection/d3-collection-tests.ts similarity index 100% rename from d3-collection/d3-collection-tests.ts rename to types/d3-collection/d3-collection-tests.ts diff --git a/d3-collection/index.d.ts b/types/d3-collection/index.d.ts similarity index 100% rename from d3-collection/index.d.ts rename to types/d3-collection/index.d.ts diff --git a/d3-collection/tsconfig.json b/types/d3-collection/tsconfig.json similarity index 100% rename from d3-collection/tsconfig.json rename to types/d3-collection/tsconfig.json diff --git a/d3-color/d3-color-tests.ts b/types/d3-color/d3-color-tests.ts similarity index 100% rename from d3-color/d3-color-tests.ts rename to types/d3-color/d3-color-tests.ts diff --git a/d3-color/index.d.ts b/types/d3-color/index.d.ts similarity index 100% rename from d3-color/index.d.ts rename to types/d3-color/index.d.ts diff --git a/d3-color/tsconfig.json b/types/d3-color/tsconfig.json similarity index 100% rename from d3-color/tsconfig.json rename to types/d3-color/tsconfig.json diff --git a/d3-dispatch/d3-dispatch-tests.ts b/types/d3-dispatch/d3-dispatch-tests.ts similarity index 100% rename from d3-dispatch/d3-dispatch-tests.ts rename to types/d3-dispatch/d3-dispatch-tests.ts diff --git a/d3-dispatch/index.d.ts b/types/d3-dispatch/index.d.ts similarity index 100% rename from d3-dispatch/index.d.ts rename to types/d3-dispatch/index.d.ts diff --git a/d3-dispatch/tsconfig.json b/types/d3-dispatch/tsconfig.json similarity index 100% rename from d3-dispatch/tsconfig.json rename to types/d3-dispatch/tsconfig.json diff --git a/d3-drag/d3-drag-tests.ts b/types/d3-drag/d3-drag-tests.ts similarity index 100% rename from d3-drag/d3-drag-tests.ts rename to types/d3-drag/d3-drag-tests.ts diff --git a/d3-drag/index.d.ts b/types/d3-drag/index.d.ts similarity index 100% rename from d3-drag/index.d.ts rename to types/d3-drag/index.d.ts diff --git a/d3-drag/tsconfig.json b/types/d3-drag/tsconfig.json similarity index 100% rename from d3-drag/tsconfig.json rename to types/d3-drag/tsconfig.json diff --git a/d3-drag/tslint.json b/types/d3-drag/tslint.json similarity index 100% rename from d3-drag/tslint.json rename to types/d3-drag/tslint.json diff --git a/d3-dsv/d3-dsv-tests.ts b/types/d3-dsv/d3-dsv-tests.ts similarity index 100% rename from d3-dsv/d3-dsv-tests.ts rename to types/d3-dsv/d3-dsv-tests.ts diff --git a/d3-dsv/index.d.ts b/types/d3-dsv/index.d.ts similarity index 100% rename from d3-dsv/index.d.ts rename to types/d3-dsv/index.d.ts diff --git a/d3-dsv/tsconfig.json b/types/d3-dsv/tsconfig.json similarity index 100% rename from d3-dsv/tsconfig.json rename to types/d3-dsv/tsconfig.json diff --git a/d3-dsv/v0/d3-dsv-tests.ts b/types/d3-dsv/v0/d3-dsv-tests.ts similarity index 100% rename from d3-dsv/v0/d3-dsv-tests.ts rename to types/d3-dsv/v0/d3-dsv-tests.ts diff --git a/d3-dsv/v0/index.d.ts b/types/d3-dsv/v0/index.d.ts similarity index 100% rename from d3-dsv/v0/index.d.ts rename to types/d3-dsv/v0/index.d.ts diff --git a/d3-dsv/v0/tsconfig.json b/types/d3-dsv/v0/tsconfig.json similarity index 100% rename from d3-dsv/v0/tsconfig.json rename to types/d3-dsv/v0/tsconfig.json diff --git a/d3-dsv/v0/tslint.json b/types/d3-dsv/v0/tslint.json similarity index 100% rename from d3-dsv/v0/tslint.json rename to types/d3-dsv/v0/tslint.json diff --git a/d3-ease/d3-ease-tests.ts b/types/d3-ease/d3-ease-tests.ts similarity index 100% rename from d3-ease/d3-ease-tests.ts rename to types/d3-ease/d3-ease-tests.ts diff --git a/d3-ease/index.d.ts b/types/d3-ease/index.d.ts similarity index 100% rename from d3-ease/index.d.ts rename to types/d3-ease/index.d.ts diff --git a/d3-ease/tsconfig.json b/types/d3-ease/tsconfig.json similarity index 100% rename from d3-ease/tsconfig.json rename to types/d3-ease/tsconfig.json diff --git a/datatables.net-fixedheader/tslint.json b/types/d3-ease/tslint.json similarity index 100% rename from datatables.net-fixedheader/tslint.json rename to types/d3-ease/tslint.json diff --git a/d3-force/d3-force-tests.ts b/types/d3-force/d3-force-tests.ts similarity index 100% rename from d3-force/d3-force-tests.ts rename to types/d3-force/d3-force-tests.ts diff --git a/d3-force/index.d.ts b/types/d3-force/index.d.ts similarity index 100% rename from d3-force/index.d.ts rename to types/d3-force/index.d.ts diff --git a/d3-force/tsconfig.json b/types/d3-force/tsconfig.json similarity index 100% rename from d3-force/tsconfig.json rename to types/d3-force/tsconfig.json diff --git a/d3-force/tslint.json b/types/d3-force/tslint.json similarity index 100% rename from d3-force/tslint.json rename to types/d3-force/tslint.json diff --git a/d3-format/d3-format-tests.ts b/types/d3-format/d3-format-tests.ts similarity index 100% rename from d3-format/d3-format-tests.ts rename to types/d3-format/d3-format-tests.ts diff --git a/d3-format/index.d.ts b/types/d3-format/index.d.ts similarity index 100% rename from d3-format/index.d.ts rename to types/d3-format/index.d.ts diff --git a/d3-format/tsconfig.json b/types/d3-format/tsconfig.json similarity index 100% rename from d3-format/tsconfig.json rename to types/d3-format/tsconfig.json diff --git a/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts similarity index 80% rename from d3-geo/d3-geo-tests.ts rename to types/d3-geo/d3-geo-tests.ts index a29dce0e8b..b5ad28f3e2 100644 --- a/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -144,7 +144,7 @@ contained = d3Geo.geoContains(sampleExtendedFeatureCollection, [0, 0]); // geoDistance(...) ======================================================= -let distance: number = d3Geo.geoDistance([54, 2], [53, 1]); +const distance: number = d3Geo.geoDistance([54, 2], [53, 1]); // geoLength(...) ========================================================= @@ -160,19 +160,19 @@ length = d3Geo.geoLength(sampleExtendedFeatureCollection); // geoInterpolate(...) ==================================================== -let interpolateFct: (t: number) => [number, number] = d3Geo.geoInterpolate([54, 2], [53, 1]); +const interpolateFct: (t: number) => [number, number] = d3Geo.geoInterpolate([54, 2], [53, 1]); // geoRotation(...) ======================================================= // create rotation ----------------------------------------------------- -let rotation: d3Geo.GeoRotation = d3Geo.geoRotation([90, 45]); -let rotation2: d3Geo.GeoRotation = d3Geo.geoRotation([90, 45, 27.5]); +const rotation: d3Geo.GeoRotation = d3Geo.geoRotation([90, 45]); +const rotation2: d3Geo.GeoRotation = d3Geo.geoRotation([90, 45, 27.5]); // use rotation -------------------------------------------------------- -let point: [number, number] = rotation([54, 2]); -let inverted: [number, number] = rotation.invert([54, 2]); +const point: [number, number] = rotation([54, 2]); +const inverted: [number, number] = rotation.invert([54, 2]); // ---------------------------------------------------------------------- // Spherical Shapes - geoCircle @@ -185,24 +185,23 @@ let circleGeneratorSimple: d3Geo.GeoCircleGenerator = d3Geo.geoCircle( // complex use as part of object class Circulator { - constructor(radius: number, precision: number) { this.r = radius; this.p = precision; this.circleGenerator = d3Geo.geoCircle() - .radius(function (datum) { - let t: Circulator = this; - let d: [number, number] | undefined = datum; + .radius(function(datum) { + const t: Circulator = this; + const d: [number, number] | undefined = datum; return this.r; }) - .precision(function (datum) { - let t: Circulator = this; - let d: [number, number] | undefined = datum; + .precision(function(datum) { + const t: Circulator = this; + const d: [number, number] | undefined = datum; return this.p; }) - .center(function (datum) { - let t: Circulator = this; - let d: [number, number] | undefined = datum; + .center(function(datum) { + const t: Circulator = this; + const d: [number, number] | undefined = datum; return d ? d : [0, 0]; }); } @@ -219,28 +218,28 @@ class Circulator { } } -let circulator = new Circulator(50, 2); +const circulator = new Circulator(50, 2); // Configure CircleGenerator ============================================ // center(...) ---------------------------------------------------------- -let centerFctSimple: ((this: any, d: any, ...args: any[]) => [number, number]) = circleGeneratorSimple.center(); +const centerFctSimple: ((this: any, d: any, ...args: any[]) => [number, number]) = circleGeneratorSimple.center(); -let c: [number, number] = [54, 2]; +const c: [number, number] = [54, 2]; circleGeneratorSimple = circleGeneratorSimple.center(() => c); circleGeneratorSimple = circleGeneratorSimple.center(c); // radius(...) ----------------------------------------------------------- -let radius: ((...args: any[]) => number) = circleGeneratorSimple.radius(); +const radius: ((...args: any[]) => number) = circleGeneratorSimple.radius(); circleGeneratorSimple = circleGeneratorSimple.radius(() => 5); circleGeneratorSimple = circleGeneratorSimple.radius(2); // precision(...) -------------------------------------------------------- -let precision: ((...args: any[]) => number) = circleGeneratorSimple.precision(); +const precision: ((...args: any[]) => number) = circleGeneratorSimple.precision(); circleGeneratorSimple = circleGeneratorSimple.precision(() => 5); circleGeneratorSimple = circleGeneratorSimple.precision(2); @@ -253,7 +252,6 @@ let circlePolygon: GeoJSON.Polygon = circleGeneratorSimple(); circlePolygon = circulator.getCirclePolygon([5, 5]); circlePolygon = circulator.getCirclePolygon(); - // ---------------------------------------------------------------------- // Spherical Shapes - geoGraticule // ---------------------------------------------------------------------- @@ -266,44 +264,44 @@ let graticuleGenerator: d3Geo.GeoGraticuleGenerator = d3Geo.geoGraticule(); // extent(...) ----------------------------------------------------------- -let extent: [[number, number], [number, number]] = graticuleGenerator.extent(); +const extent: [[number, number], [number, number]] = graticuleGenerator.extent(); graticuleGenerator = graticuleGenerator.extent([[-180, -80], [180, 80]]); // extentMajor(...) --------------------------------------------------------- -let extentMajor: [[number, number], [number, number]] = graticuleGenerator.extentMajor(); +const extentMajor: [[number, number], [number, number]] = graticuleGenerator.extentMajor(); graticuleGenerator = graticuleGenerator.extentMajor([[-180, -80], [180, 80]]); // extentMinor(...) --------------------------------------------------------- -let extentMinor: [[number, number], [number, number]] = graticuleGenerator.extentMinor(); +const extentMinor: [[number, number], [number, number]] = graticuleGenerator.extentMinor(); graticuleGenerator = graticuleGenerator.extentMinor([[-180, -80], [180, 80]]); // step(...) ---------------------------------------------------------------- -let step: [number, number] = graticuleGenerator.step(); +const step: [number, number] = graticuleGenerator.step(); graticuleGenerator = graticuleGenerator.step([10, 10]); // stepMajor(...) ----------------------------------------------------------- -let stepMajor: [number, number] = graticuleGenerator.stepMajor(); +const stepMajor: [number, number] = graticuleGenerator.stepMajor(); graticuleGenerator = graticuleGenerator.stepMajor([10, 10]); // stepMinor(...) ------------------------------------------------------------ -let stepMinor: [number, number] = graticuleGenerator.stepMinor(); +const stepMinor: [number, number] = graticuleGenerator.stepMinor(); graticuleGenerator = graticuleGenerator.stepMinor([10, 10]); // precision(...) ------------------------------------------------------------- -let precision1: number = graticuleGenerator.precision(); +const precision1: number = graticuleGenerator.precision(); graticuleGenerator = graticuleGenerator.precision(5); // Use GeoGraticuleGenerator ============================================ let multiString: GeoJSON.MultiLineString = graticuleGenerator(); -let lines: GeoJSON.LineString[] = graticuleGenerator.lines(); -let polygon2: GeoJSON.Polygon = graticuleGenerator.outline(); +const lines: GeoJSON.LineString[] = graticuleGenerator.lines(); +const polygon2: GeoJSON.Polygon = graticuleGenerator.outline(); // geoGraticule10() ===================================================== @@ -317,24 +315,22 @@ multiString = d3Geo.geoGraticule10(); // Pre-Defined Raw Projection Factories ================================= -let azimuthalEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEqualAreaRaw(); -let azimuthalEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEquidistantRaw(); -let conicConformalRaw: d3Geo.GeoRawProjection = d3Geo.geoConicConformalRaw(0, 0); -let conicEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEqualAreaRaw(0, 0); -let conicEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEquidistantRaw(0, 0); -let equirectangularRaw: d3Geo.GeoRawProjection = d3Geo.geoEquirectangularRaw(); -let gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw(); -let mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw(); -let orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw(); -let stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw(); -let transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw(); +const azimuthalEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEqualAreaRaw(); +const azimuthalEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEquidistantRaw(); +const conicConformalRaw: d3Geo.GeoRawProjection = d3Geo.geoConicConformalRaw(0, 0); +const conicEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEqualAreaRaw(0, 0); +const conicEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEquidistantRaw(0, 0); +const equirectangularRaw: d3Geo.GeoRawProjection = d3Geo.geoEquirectangularRaw(); +const gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw(); +const mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw(); +const orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw(); +const stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw(); +const transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw(); // Use Raw Projection ===================================================== -let rawProjectionPoint: [number, number] = azimuthalEqualAreaRaw(54, 2); -let rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); - - +const rawProjectionPoint: [number, number] = azimuthalEqualAreaRaw(54, 2); +const rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); // ---------------------------------------------------------------------- // Pre-Defined Projections @@ -342,39 +338,38 @@ let rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert( // Create predefined Projection from factory ============================= -let albers: d3Geo.GeoConicProjection = d3Geo.geoAlbers(); -let albersUsa: d3Geo.GeoProjection = d3Geo.geoAlbersUsa(); -let azimuthalEqualArea: d3Geo.GeoProjection = d3Geo.geoAzimuthalEqualArea(); -let azimuthalEquidistant: d3Geo.GeoProjection = d3Geo.geoAzimuthalEquidistant(); +const albers: d3Geo.GeoConicProjection = d3Geo.geoAlbers(); +const albersUsa: d3Geo.GeoProjection = d3Geo.geoAlbersUsa(); +const azimuthalEqualArea: d3Geo.GeoProjection = d3Geo.geoAzimuthalEqualArea(); +const azimuthalEquidistant: d3Geo.GeoProjection = d3Geo.geoAzimuthalEquidistant(); let conicConformal: d3Geo.GeoConicProjection = d3Geo.geoConicConformal(); -let conicEqualArea: d3Geo.GeoConicProjection = d3Geo.geoConicEqualArea(); -let conicEquidistant: d3Geo.GeoConicProjection = d3Geo.geoConicEquidistant(); -let cquirectangular: d3Geo.GeoProjection = d3Geo.geoEquirectangular(); -let gnomonic: d3Geo.GeoProjection = d3Geo.geoGnomonic(); -let mercator: d3Geo.GeoProjection = d3Geo.geoMercator(); -let orthographic: d3Geo.GeoProjection = d3Geo.geoOrthographic(); -let stereographic: d3Geo.GeoProjection = d3Geo.geoStereographic(); -let transverseMercator: d3Geo.GeoProjection = d3Geo.geoTransverseMercator(); +const conicEqualArea: d3Geo.GeoConicProjection = d3Geo.geoConicEqualArea(); +const conicEquidistant: d3Geo.GeoConicProjection = d3Geo.geoConicEquidistant(); +const cquirectangular: d3Geo.GeoProjection = d3Geo.geoEquirectangular(); +const gnomonic: d3Geo.GeoProjection = d3Geo.geoGnomonic(); +const mercator: d3Geo.GeoProjection = d3Geo.geoMercator(); +const orthographic: d3Geo.GeoProjection = d3Geo.geoOrthographic(); +const stereographic: d3Geo.GeoProjection = d3Geo.geoStereographic(); +const transverseMercator: d3Geo.GeoProjection = d3Geo.geoTransverseMercator(); // ---------------------------------------------------------------------- // Create New Projections // ---------------------------------------------------------------------- +const geoProjection: d3Geo.GeoProjection = d3Geo.geoProjection(azimuthalEqualAreaRaw); -let geoProjection: d3Geo.GeoProjection = d3Geo.geoProjection(azimuthalEqualAreaRaw); - -let mutate: () => d3Geo.GeoProjection = d3Geo.geoProjectionMutator(() => azimuthalEqualAreaRaw); +const mutate: () => d3Geo.GeoProjection = d3Geo.geoProjectionMutator(() => azimuthalEqualAreaRaw); let constructedProjection: d3Geo.GeoProjection = mutate(); // Use Projection ========================================================== -let projected: [number, number] = constructedProjection([54, 2]); -let inverted2: [number, number] = constructedProjection.invert([54, 2]); +const projected: [number, number] = constructedProjection([54, 2]); +const inverted2: [number, number] = constructedProjection.invert([54, 2]); // TODO ????? // let stream: d3Geo.Stream = constructedProjection.stream([54, 2]); -let clipAngle: number = constructedProjection.clipAngle(); +const clipAngle: number = constructedProjection.clipAngle(); constructedProjection = constructedProjection.clipAngle(null); constructedProjection = constructedProjection.clipAngle(45); @@ -388,14 +383,14 @@ constructedProjection = constructedProjection.scale(45); let translate: [number, number] = constructedProjection.translate(); constructedProjection = constructedProjection.translate([480, 250]); -let center: [number, number] = constructedProjection.center(); +const center: [number, number] = constructedProjection.center(); constructedProjection = constructedProjection.center([0, 0]); -let rotate: [number, number, number] = constructedProjection.rotate(); +const rotate: [number, number, number] = constructedProjection.rotate(); constructedProjection = constructedProjection.rotate([0, 0]); constructedProjection = constructedProjection.rotate([0, 0, 0]); -let precision2: number = constructedProjection.precision(); +const precision2: number = constructedProjection.precision(); constructedProjection = constructedProjection.precision(0.707); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], samplePolygon); @@ -423,7 +418,7 @@ constructedProjection = constructedProjection.fitSize([960, 500], sampleExtended // ---------------------------------------------------------------------- // parallels(...) ------------------------------------------------------ -let parallels: [number, number] = conicConformal.parallels(); +const parallels: [number, number] = conicConformal.parallels(); conicConformal = conicConformal.parallels([20, 20]); // test method inheritance from GeoProjection --------------------------- @@ -434,7 +429,7 @@ conicConformal = conicConformal.fitSize([960, 500], samplePolygon); // inherited // GeoPath Generator // ---------------------------------------------------------------------- -let minimalRenderingContextMockUp: d3Geo.GeoContext = { +const minimalRenderingContextMockUp: d3Geo.GeoContext = { beginPath: () => { return; }, moveTo: (x: number, y: number) => { return; }, lineTo: (x: number, y: number) => { return; }, @@ -460,12 +455,12 @@ geoPathSVG = d3Geo.geoPath(); +const geoPathProjectionMinimal: d3Geo.GeoStreamWrapper = geoPathCanvas.projection(); +const geoPathProjectionUnion: d3Geo.GeoProjection | d3Geo.GeoConicProjection | d3Geo.GeoStreamWrapper = geoPathCanvas.projection(); +const geoPathProjection: d3Geo.GeoProjection = geoPathCanvas.projection(); geoPathSVG = geoPathSVG.projection(conicConformal); -let geoPathConicProjection: d3Geo.GeoConicProjection = geoPathSVG.projection(); +const geoPathConicProjection: d3Geo.GeoConicProjection = geoPathSVG.projection(); // geoPathConicProjection = geoPathSVG.projection(); // fails without casting to GeoConicProjection, or alternatively custom typeguard // geoPathConicProjection = geoPathSVG.projection(); // fails as SampleProperties does not extend minimal interface @@ -474,8 +469,7 @@ let geoPathConicProjection: d3Geo.GeoConicProjection = geoPathSVG.projection(); // pointRadius(...) ------------------------------------------------------ geoPathCanvas = geoPathCanvas.pointRadius(5); -let geoPathCanvasPointRadiusAccessor: ((this: any, d: d3Geo.GeoPermissibleObjects, ...args: any[]) => number) | number = geoPathCanvas.pointRadius(); +const geoPathCanvasPointRadiusAccessor: ((this: any, d: d3Geo.GeoPermissibleObjects, ...args: any[]) => number) | number = geoPathCanvas.pointRadius(); -geoPathSVG = geoPathSVG.pointRadius(function (datum) { - let that: SVGPathElement = this; - let d: d3Geo.ExtendedFeature = datum; +geoPathSVG = geoPathSVG.pointRadius(function(datum) { + const that: SVGPathElement = this; + const d: d3Geo.ExtendedFeature = datum; return datum.properties.name === 'Alabama' ? 10 : 15; }); -let geoPathSVGPointRadiusAccessor: number | ((this: SVGPathElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number) = geoPathSVG.pointRadius(); +const geoPathSVGPointRadiusAccessor: number | ((this: SVGPathElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number) = geoPathSVG.pointRadius(); // let geoPathSVGPointRadiusAccessorWrong1: number | ((this: SVGCircleElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number) // = geoPathSVG.pointRadius(); // fails, mismatch in this context // let geoPathSVGPointRadiusAccessorWrong2: number | ((this: SVGPathElement, d: d3Geo.GeoGeometryObjects, ...args: any[]) => number) = geoPathSVG.pointRadius(); // fails, mismatch in object datum type @@ -521,7 +515,6 @@ geoPathArea = geoPathCanvas.area(sampleExtendedFeatureCollection); // geoPathArea = geoPathSVG.area(sampleExtendedFeatureCollection); // fails, wrong data object type - // bounds(...) ------------------------------------------------------ let geoPathBounds: [[number, number], [number, number]] = geoPathCanvas.bounds(samplePolygon); @@ -550,7 +543,6 @@ geoPathCentroid = geoPathCanvas.centroid(sampleExtendedFeatureCollection); // geoPathCentroid = geoPathSVG.centroid(sampleExtendedFeatureCollection); // fails, wrong data object type - // measure(...) ------------------------------------------------------ let geoPathMeasure: number = geoPathCanvas.measure(samplePolygon); @@ -579,22 +571,19 @@ geoPathCanvas(sampleExtendedFeatureCollection); // Use path string generator for SVGPathElement -let svgPath: Selection, any, any>; +declare const svgPath: Selection, any, any>; svgPath.attr('d', geoPathSVG); -let svgCircleWrong: Selection, any, any>; +declare const svgCircleWrong: Selection, any, any>; // svgCircleWrong.attr('d', geoPathSVG); // fails, mismatch in `this` context -let svgPathWrong: Selection; +declare const svgPathWrong: Selection; // svgPathWrong.attr('d', geoPathSVG); // fails, mismatch in datum type - - - // ---------------------------------------------------------------------- // Context interface // ---------------------------------------------------------------------- -let context: d3Geo.GeoContext = { +const context: d3Geo.GeoContext = { beginPath: () => { return; }, moveTo: (x: number, y: number) => { return; }, lineTo: (x: number, y: number) => { return; }, @@ -608,7 +597,7 @@ let context: d3Geo.GeoContext = { // geoTransform(...) ==================================================== -let transformFunction: { stream: (s: d3Geo.GeoStream) => {} } = d3Geo.geoTransform({}); +const transformFunction: { stream: (s: d3Geo.GeoStream) => {} } = d3Geo.geoTransform({}); interface CustomTranformProto extends d3Geo.GeoTransformPrototype { a: number; @@ -617,14 +606,13 @@ interface CustomTranformProto extends d3Geo.GeoTransformPrototype { let customTransformProto: CustomTranformProto; customTransformProto = { - point: function (x, y) { + point(x, y) { return this.stream.point(x + this.a, -y); }, a: 10 }; -let t: { stream: (s: d3Geo.GeoStream) => (CustomTranformProto & d3Geo.GeoStream) } = d3Geo.geoTransform(customTransformProto); - +const t: { stream: (s: d3Geo.GeoStream) => (CustomTranformProto & d3Geo.GeoStream) } = d3Geo.geoTransform(customTransformProto); // geoIdentity() ======================================================== @@ -675,7 +663,7 @@ reflecting = identityTransform.reflectY(); // ---------------------------------------------------------------------- // Stream interface // ---------------------------------------------------------------------- -let stream: d3Geo.GeoStream; +declare const stream: d3Geo.GeoStream; stream.point(0, 0); stream.point(0, 0, 0); @@ -696,4 +684,3 @@ d3Geo.geoStream(sampleExtendedFeature1, stream); d3Geo.geoStream(sampleExtendedFeature2, stream); d3Geo.geoStream(sampleFeatureCollection, stream); d3Geo.geoStream(sampleExtendedFeatureCollection, stream); - diff --git a/d3-geo/index.d.ts b/types/d3-geo/index.d.ts similarity index 99% rename from d3-geo/index.d.ts rename to types/d3-geo/index.d.ts index dfc58a5f9e..1e9fed9b92 100644 --- a/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -274,7 +274,6 @@ export interface GeoRotation { */ export function geoRotation(angles: [number, number] | [number, number, number]): GeoRotation; - // ---------------------------------------------------------------------- // Spherical Shapes // ---------------------------------------------------------------------- @@ -535,8 +534,6 @@ export interface GeoStream { sphere?(): void; } - - // geoStream(...) ======================================================= /** @@ -575,15 +572,10 @@ export function geoStream(object: GeoGeometryObjects, stream: GeoStream): void; */ 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. @@ -737,7 +729,6 @@ export interface GeoProjection extends GeoStreamWrapper { */ 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. @@ -845,7 +836,6 @@ export interface GeoProjection extends GeoStreamWrapper { * A Conic Projection */ export interface GeoConicProjection extends GeoProjection { - /** * Return the standard parallels for the conic projection in degrees. */ @@ -856,10 +846,8 @@ export interface GeoConicProjection extends GeoProjection { * @param value A two-dimensional array representing the standard parallels in degrees. */ parallels(value: [number, number]): this; - } - // geoPath ============================================================== /** @@ -869,7 +857,6 @@ export interface GeoConicProjection extends GeoProjection { * 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. @@ -921,7 +908,6 @@ export interface GeoContext { * 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: * @@ -1084,7 +1070,6 @@ export interface GeoPath { * 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; - } /** @@ -1143,9 +1128,6 @@ export function geoPath(projection?: */ export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; - - - // geoProjection ========================================================== /** @@ -1366,7 +1348,6 @@ export function geoTransform(methods: T): { str * Geo Identity Transform */ export interface GeoIdentityTranform extends GeoStreamWrapper { - /** * Returns the current viewport clip extent which defaults to null. */ @@ -1431,7 +1412,6 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { */ 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. diff --git a/d3-geo/tsconfig.json b/types/d3-geo/tsconfig.json similarity index 100% rename from d3-geo/tsconfig.json rename to types/d3-geo/tsconfig.json diff --git a/d3-geo/tslint.json b/types/d3-geo/tslint.json similarity index 100% rename from d3-geo/tslint.json rename to types/d3-geo/tslint.json diff --git a/d3-hexbin/d3-hexbin-tests.ts b/types/d3-hexbin/d3-hexbin-tests.ts similarity index 100% rename from d3-hexbin/d3-hexbin-tests.ts rename to types/d3-hexbin/d3-hexbin-tests.ts diff --git a/d3-hexbin/index.d.ts b/types/d3-hexbin/index.d.ts similarity index 100% rename from d3-hexbin/index.d.ts rename to types/d3-hexbin/index.d.ts diff --git a/d3-hexbin/tsconfig.json b/types/d3-hexbin/tsconfig.json similarity index 100% rename from d3-hexbin/tsconfig.json rename to types/d3-hexbin/tsconfig.json diff --git a/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts similarity index 100% rename from d3-hierarchy/d3-hierarchy-tests.ts rename to types/d3-hierarchy/d3-hierarchy-tests.ts diff --git a/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts similarity index 100% rename from d3-hierarchy/index.d.ts rename to types/d3-hierarchy/index.d.ts diff --git a/d3-hierarchy/tsconfig.json b/types/d3-hierarchy/tsconfig.json similarity index 100% rename from d3-hierarchy/tsconfig.json rename to types/d3-hierarchy/tsconfig.json diff --git a/d3-hsv/d3-hsv-tests.ts b/types/d3-hsv/d3-hsv-tests.ts similarity index 100% rename from d3-hsv/d3-hsv-tests.ts rename to types/d3-hsv/d3-hsv-tests.ts diff --git a/d3-hsv/index.d.ts b/types/d3-hsv/index.d.ts similarity index 100% rename from d3-hsv/index.d.ts rename to types/d3-hsv/index.d.ts diff --git a/d3-hsv/tsconfig.json b/types/d3-hsv/tsconfig.json similarity index 100% rename from d3-hsv/tsconfig.json rename to types/d3-hsv/tsconfig.json diff --git a/d3-interpolate/d3-interpolate-tests.ts b/types/d3-interpolate/d3-interpolate-tests.ts similarity index 100% rename from d3-interpolate/d3-interpolate-tests.ts rename to types/d3-interpolate/d3-interpolate-tests.ts diff --git a/d3-interpolate/index.d.ts b/types/d3-interpolate/index.d.ts similarity index 100% rename from d3-interpolate/index.d.ts rename to types/d3-interpolate/index.d.ts diff --git a/d3-interpolate/tsconfig.json b/types/d3-interpolate/tsconfig.json similarity index 100% rename from d3-interpolate/tsconfig.json rename to types/d3-interpolate/tsconfig.json diff --git a/d3-path/d3-path-tests.ts b/types/d3-path/d3-path-tests.ts similarity index 100% rename from d3-path/d3-path-tests.ts rename to types/d3-path/d3-path-tests.ts diff --git a/d3-path/index.d.ts b/types/d3-path/index.d.ts similarity index 100% rename from d3-path/index.d.ts rename to types/d3-path/index.d.ts diff --git a/d3-path/tsconfig.json b/types/d3-path/tsconfig.json similarity index 100% rename from d3-path/tsconfig.json rename to types/d3-path/tsconfig.json diff --git a/d3-polygon/d3-polygon-tests.ts b/types/d3-polygon/d3-polygon-tests.ts similarity index 100% rename from d3-polygon/d3-polygon-tests.ts rename to types/d3-polygon/d3-polygon-tests.ts diff --git a/d3-polygon/index.d.ts b/types/d3-polygon/index.d.ts similarity index 100% rename from d3-polygon/index.d.ts rename to types/d3-polygon/index.d.ts diff --git a/d3-polygon/tsconfig.json b/types/d3-polygon/tsconfig.json similarity index 100% rename from d3-polygon/tsconfig.json rename to types/d3-polygon/tsconfig.json diff --git a/d3-quadtree/d3-quadtree-tests.ts b/types/d3-quadtree/d3-quadtree-tests.ts similarity index 100% rename from d3-quadtree/d3-quadtree-tests.ts rename to types/d3-quadtree/d3-quadtree-tests.ts diff --git a/d3-quadtree/index.d.ts b/types/d3-quadtree/index.d.ts similarity index 100% rename from d3-quadtree/index.d.ts rename to types/d3-quadtree/index.d.ts diff --git a/d3-quadtree/tsconfig.json b/types/d3-quadtree/tsconfig.json similarity index 100% rename from d3-quadtree/tsconfig.json rename to types/d3-quadtree/tsconfig.json diff --git a/d3-queue/d3-queue-tests.ts b/types/d3-queue/d3-queue-tests.ts similarity index 100% rename from d3-queue/d3-queue-tests.ts rename to types/d3-queue/d3-queue-tests.ts diff --git a/d3-queue/index.d.ts b/types/d3-queue/index.d.ts similarity index 100% rename from d3-queue/index.d.ts rename to types/d3-queue/index.d.ts diff --git a/d3-queue/tsconfig.json b/types/d3-queue/tsconfig.json similarity index 100% rename from d3-queue/tsconfig.json rename to types/d3-queue/tsconfig.json diff --git a/d3-random/d3-random-tests.ts b/types/d3-random/d3-random-tests.ts similarity index 100% rename from d3-random/d3-random-tests.ts rename to types/d3-random/d3-random-tests.ts diff --git a/d3-random/index.d.ts b/types/d3-random/index.d.ts similarity index 100% rename from d3-random/index.d.ts rename to types/d3-random/index.d.ts diff --git a/d3-random/tsconfig.json b/types/d3-random/tsconfig.json similarity index 100% rename from d3-random/tsconfig.json rename to types/d3-random/tsconfig.json diff --git a/d3-request/d3-request-tests.ts b/types/d3-request/d3-request-tests.ts similarity index 100% rename from d3-request/d3-request-tests.ts rename to types/d3-request/d3-request-tests.ts diff --git a/d3-request/index.d.ts b/types/d3-request/index.d.ts similarity index 100% rename from d3-request/index.d.ts rename to types/d3-request/index.d.ts diff --git a/d3-request/tsconfig.json b/types/d3-request/tsconfig.json similarity index 100% rename from d3-request/tsconfig.json rename to types/d3-request/tsconfig.json diff --git a/d3-scale-chromatic/d3-scale-chromatic-tests.ts b/types/d3-scale-chromatic/d3-scale-chromatic-tests.ts similarity index 100% rename from d3-scale-chromatic/d3-scale-chromatic-tests.ts rename to types/d3-scale-chromatic/d3-scale-chromatic-tests.ts diff --git a/d3-scale-chromatic/index.d.ts b/types/d3-scale-chromatic/index.d.ts similarity index 100% rename from d3-scale-chromatic/index.d.ts rename to types/d3-scale-chromatic/index.d.ts diff --git a/d3-scale-chromatic/tsconfig.json b/types/d3-scale-chromatic/tsconfig.json similarity index 100% rename from d3-scale-chromatic/tsconfig.json rename to types/d3-scale-chromatic/tsconfig.json diff --git a/d3-scale/d3-scale-tests.ts b/types/d3-scale/d3-scale-tests.ts similarity index 100% rename from d3-scale/d3-scale-tests.ts rename to types/d3-scale/d3-scale-tests.ts diff --git a/d3-scale/index.d.ts b/types/d3-scale/index.d.ts similarity index 100% rename from d3-scale/index.d.ts rename to types/d3-scale/index.d.ts diff --git a/d3-scale/tsconfig.json b/types/d3-scale/tsconfig.json similarity index 100% rename from d3-scale/tsconfig.json rename to types/d3-scale/tsconfig.json diff --git a/d3-scale/tslint.json b/types/d3-scale/tslint.json similarity index 100% rename from d3-scale/tslint.json rename to types/d3-scale/tslint.json diff --git a/d3-selection-multi/d3-selection-multi-tests.ts b/types/d3-selection-multi/d3-selection-multi-tests.ts similarity index 100% rename from d3-selection-multi/d3-selection-multi-tests.ts rename to types/d3-selection-multi/d3-selection-multi-tests.ts diff --git a/d3-selection-multi/index.d.ts b/types/d3-selection-multi/index.d.ts similarity index 96% rename from d3-selection-multi/index.d.ts rename to types/d3-selection-multi/index.d.ts index 30268ad3aa..da3c64e5e3 100644 --- a/d3-selection-multi/index.d.ts +++ b/types/d3-selection-multi/index.d.ts @@ -8,7 +8,6 @@ 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 * @@ -29,7 +28,7 @@ declare module 'd3-selection' { * 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 { + interface Selection { /** * Set multiple attributes on the given selection. Attribute values may be constant or derived from each node and its bound data. * @@ -85,7 +84,7 @@ declare module 'd3-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 { + 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. * diff --git a/d3-selection-multi/tsconfig.json b/types/d3-selection-multi/tsconfig.json similarity index 100% rename from d3-selection-multi/tsconfig.json rename to types/d3-selection-multi/tsconfig.json diff --git a/d3-selection-multi/tslint.json b/types/d3-selection-multi/tslint.json similarity index 100% rename from d3-selection-multi/tslint.json rename to types/d3-selection-multi/tslint.json diff --git a/d3-selection/d3-selection-tests.ts b/types/d3-selection/d3-selection-tests.ts similarity index 100% rename from d3-selection/d3-selection-tests.ts rename to types/d3-selection/d3-selection-tests.ts diff --git a/d3-selection/index.d.ts b/types/d3-selection/index.d.ts similarity index 100% rename from d3-selection/index.d.ts rename to types/d3-selection/index.d.ts diff --git a/d3-selection/tsconfig.json b/types/d3-selection/tsconfig.json similarity index 100% rename from d3-selection/tsconfig.json rename to types/d3-selection/tsconfig.json diff --git a/d3-selection/tslint.json b/types/d3-selection/tslint.json similarity index 100% rename from d3-selection/tslint.json rename to types/d3-selection/tslint.json diff --git a/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts similarity index 99% rename from d3-shape/d3-shape-tests.ts rename to types/d3-shape/d3-shape-tests.ts index 204f1e7eb1..3ac854df2b 100644 --- a/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -147,7 +147,6 @@ svgArc = svgArc.padRadius(null); accessorArcDatumNumberOrNull = svgArc.padRadius(); - // use Arc(...) generator ============================================================ // centroid(...) --------------------------------------------------------------------- @@ -160,7 +159,6 @@ const centroid: [number, number] = svgArc.centroid(arcDatum); // use with canvas canvasArc(arcDefaultDatum); - // use with svg const pArc: Selection = select('.arc-paths'); // mock @@ -171,7 +169,6 @@ pArc.attr('d', svgArc); // wrongArc1.attr('d', svgArc); // fails, incompatible this contexts // wrongArc2.attr('d', svgArc); // fails, incompatible datum types - // pathStringMaybe = svgArc(arcDatum); // fails, wrong this type for invocation // Use with custom object @@ -230,12 +227,10 @@ interface PieDatum { name: string; } - let accessorPieDatumNumber: (this: any, data: PieDatum[], ...args: any[]) => number; // PieArcDatum interface ============================================================= - const pieArcObject: d3Shape.PieArcDatum = { data: { val: 10, @@ -280,7 +275,6 @@ pie = pie.value((d, i, data) => { pieValueAccessor = pie.value(); - // sort(...) --------------------------------------------------------------------------- let pieSorter: ((a: PieDatum, b: PieDatum) => number) | null; @@ -332,7 +326,6 @@ defaultPie = defaultPie.padAngle(0.03); pie = pie.padAngle(d => { console.log(d.length > 0 ? d[0].val : 'no data'); // data type is Array return 0.03; - }); accessorPieDatumNumber = pie.padAngle(); @@ -351,7 +344,6 @@ let pieChart: Array>; pieChart = pie(pieData); - // ----------------------------------------------------------------------------------- // Test Line Generators // ----------------------------------------------------------------------------------- @@ -519,7 +511,6 @@ const radialLineData: RadialLineDatum[] = [ const radialLinePathStringMaybe: string | null = radialLine(radialLineData); - // ----------------------------------------------------------------------------------- // Test Area Generators // ----------------------------------------------------------------------------------- @@ -808,7 +799,6 @@ areaRadialLineGenerator = radialArea.lineInnerRadius(); areaRadialLineGenerator = radialArea.lineEndAngle(); areaRadialLineGenerator = radialArea.lineOuterRadius(); - // ----------------------------------------------------------------------------------- // Test Curve Factories // ----------------------------------------------------------------------------------- @@ -1002,7 +992,6 @@ pSymbol.attr('d', svgSymbol); // wrongSymbol1.attr('d', svgSymbol); // fails, incompatible this contexts // wrongSymbol2.attr('d', svgSymbol); // fails, incompatible datum types - // pathStringMaybe = svgSymbol(symbolDatum); // fails, wrong this type for invocation // Use with custom object @@ -1056,7 +1045,6 @@ const sym = new Symbolizer(100, 'square'); pathStringMaybe = sym.getPathString(); pathStringMaybe = sym.getPathString({ size: 10, type: 'circle' }); - // Test pre-fab symbols =============================================================== const symbolArray: d3Shape.SymbolType[] = d3Shape.symbols; @@ -1099,7 +1087,6 @@ const stackData: StackDatum[] = [ { values: { bananas: 12, apples: 10, oranges: 50 } } ]; - // Create stack generator ========================================================== let defaultStack: d3Shape.Stack; @@ -1110,7 +1097,6 @@ let overlyComplicatedStack: d3Shape.Stack; overlyComplicatedStack = d3Shape.stack(); - // Configure stack generator ======================================================= // keys(...) ---------------------------------------------------------------------- @@ -1181,8 +1167,6 @@ num = seriesPoint[0]; num = seriesPoint[1]; seriesDatum = seriesPoint.data; - - // Test stack orders =============================================================== let order: number[]; diff --git a/d3-shape/index.d.ts b/types/d3-shape/index.d.ts similarity index 99% rename from d3-shape/index.d.ts rename to types/d3-shape/index.d.ts index 367a9dee2b..e1d80b6786 100644 --- a/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -790,7 +790,6 @@ export function line(): Line<[number, number]>; */ export function line(): Line; - /** * The radial line generator produces a spline or polyline, as in a line chart. * @@ -1285,7 +1284,6 @@ export function area(): Area; * 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. * @@ -1670,7 +1668,7 @@ export interface CurveFactory { * 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; +export const curveBasis: CurveFactory; /** * A curve factory for closed cubic basis spline generators. @@ -1678,7 +1676,7 @@ export var curveBasis: CurveFactory; * 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; +export const curveBasisClosed: CurveFactory; /** * A curve factory for open cubic basis spline generators. @@ -1686,7 +1684,7 @@ export var curveBasisClosed: CurveFactory; * 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; +export const curveBasisOpen: CurveFactory; /** * A curve factory for straightened cubic basis spline generators. @@ -1719,8 +1717,7 @@ export interface CurveBundleFactory extends CurveFactoryLineOnly { * * 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; - +export const curveBundle: CurveBundleFactory; /** * A curve factory for cubic cardinal spline generators. @@ -1741,7 +1738,7 @@ export interface CurveCardinalFactory extends CurveFactory { * 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; +export const curveCardinal: CurveCardinalFactory; /** * A curve factory for closed cubic cardinal spline generators. @@ -1750,7 +1747,7 @@ export var curveCardinal: CurveCardinalFactory; * 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; +export const curveCardinalClosed: CurveCardinalFactory; /** * A curve factory for open cubic cardinal spline generators. @@ -1760,7 +1757,7 @@ export var curveCardinalClosed: CurveCardinalFactory; * and thus the curve starts at the second point and ends at the penultimate point. * The default tension is 0. */ -export var curveCardinalOpen: CurveCardinalFactory; +export const curveCardinalOpen: CurveCardinalFactory; /** * A curve factory for cubic Catmull–Rom spline generators. @@ -1784,7 +1781,7 @@ export interface CurveCatmullRomFactory extends CurveFactory { * 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; +export const curveCatmullRom: CurveCatmullRomFactory; /** * A curve factory for cubic Catmull–Rom spline generators. @@ -1793,7 +1790,7 @@ export var curveCatmullRom: CurveCatmullRomFactory; * 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; +export const curveCatmullRomClosed: CurveCatmullRomFactory; /** * A curve factory for cubic Catmull–Rom spline generators. @@ -1802,22 +1799,21 @@ export var curveCatmullRomClosed: CurveCatmullRomFactory; * 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; - +export const curveCatmullRomOpen: CurveCatmullRomFactory; /** * A curve factory for polyline generators. * * The curve generators produce a polyline through the specified points. */ -export var curveLinear: CurveFactory; +export const 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; +export const curveLinearClosed: CurveFactory; /** * A curve factory for cubic spline generators preserving monotonicity in y. @@ -1826,7 +1822,7 @@ export var curveLinearClosed: CurveFactory; * “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; +export const curveMonotoneX: CurveFactory; /** * A curve factory for cubic spline generators preserving monotonicity in x. @@ -1835,14 +1831,14 @@ export var curveMonotoneX: CurveFactory; * “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; +export const 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; +export const curveNatural: CurveFactory; /** * A curve factory for step function (midpoint) generators. @@ -1850,7 +1846,7 @@ export var curveNatural: CurveFactory; * 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; +export const curveStep: CurveFactory; /** * A curve factory for step function (after) generators. @@ -1858,7 +1854,7 @@ export var curveStep: CurveFactory; * 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; +export const curveStepAfter: CurveFactory; /** * A curve factory for step function (before) generators. @@ -1866,8 +1862,7 @@ export var curveStepAfter: CurveFactory; * 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; - +export const curveStepBefore: CurveFactory; // ----------------------------------------------------------------------------------- // SYMBOLS @@ -1990,7 +1985,6 @@ export interface Symbol { * @param context null, to remove rendering context. */ context(context: null): this; - } /** @@ -2017,43 +2011,42 @@ 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[]; +export const symbols: SymbolType[]; /** * The circle symbol type. */ -export var symbolCircle: SymbolType; +export const symbolCircle: SymbolType; /** * The Greek cross symbol type, with arms of equal length. */ -export var symbolCross: SymbolType; +export const symbolCross: SymbolType; /** * The rhombus symbol type. */ -export var symbolDiamond: SymbolType; +export const symbolDiamond: SymbolType; /** * The square symbol type. */ -export var symbolSquare: SymbolType; +export const symbolSquare: SymbolType; /** * The pentagonal star (pentagram) symbol type. */ -export var symbolStar: SymbolType; +export const symbolStar: SymbolType; /** * he up-pointing triangle symbol type. */ -export var symbolTriangle: SymbolType; +export const symbolTriangle: SymbolType; /** * The Y-shape symbol type. */ -export var symbolWye: SymbolType; - +export const symbolWye: SymbolType; // ----------------------------------------------------------------------------------- // STACKS @@ -2221,7 +2214,6 @@ export interface Stack { * 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; - } /** diff --git a/d3-shape/tsconfig.json b/types/d3-shape/tsconfig.json similarity index 100% rename from d3-shape/tsconfig.json rename to types/d3-shape/tsconfig.json diff --git a/d3-shape/tslint.json b/types/d3-shape/tslint.json similarity index 100% rename from d3-shape/tslint.json rename to types/d3-shape/tslint.json diff --git a/d3-time-format/d3-time-format-tests.ts b/types/d3-time-format/d3-time-format-tests.ts similarity index 100% rename from d3-time-format/d3-time-format-tests.ts rename to types/d3-time-format/d3-time-format-tests.ts diff --git a/d3-time-format/index.d.ts b/types/d3-time-format/index.d.ts similarity index 100% rename from d3-time-format/index.d.ts rename to types/d3-time-format/index.d.ts diff --git a/d3-time-format/tsconfig.json b/types/d3-time-format/tsconfig.json similarity index 100% rename from d3-time-format/tsconfig.json rename to types/d3-time-format/tsconfig.json diff --git a/d3-time/d3-time-tests.ts b/types/d3-time/d3-time-tests.ts similarity index 100% rename from d3-time/d3-time-tests.ts rename to types/d3-time/d3-time-tests.ts diff --git a/d3-time/index.d.ts b/types/d3-time/index.d.ts similarity index 100% rename from d3-time/index.d.ts rename to types/d3-time/index.d.ts diff --git a/d3-time/tsconfig.json b/types/d3-time/tsconfig.json similarity index 100% rename from d3-time/tsconfig.json rename to types/d3-time/tsconfig.json diff --git a/d3-timer/d3-timer-tests.ts b/types/d3-timer/d3-timer-tests.ts similarity index 100% rename from d3-timer/d3-timer-tests.ts rename to types/d3-timer/d3-timer-tests.ts diff --git a/d3-timer/index.d.ts b/types/d3-timer/index.d.ts similarity index 100% rename from d3-timer/index.d.ts rename to types/d3-timer/index.d.ts diff --git a/d3-timer/tsconfig.json b/types/d3-timer/tsconfig.json similarity index 100% rename from d3-timer/tsconfig.json rename to types/d3-timer/tsconfig.json diff --git a/d3-tip/d3-tip-tests.ts b/types/d3-tip/d3-tip-tests.ts similarity index 100% rename from d3-tip/d3-tip-tests.ts rename to types/d3-tip/d3-tip-tests.ts diff --git a/d3-tip/index.d.ts b/types/d3-tip/index.d.ts similarity index 100% rename from d3-tip/index.d.ts rename to types/d3-tip/index.d.ts diff --git a/d3-tip/tsconfig.json b/types/d3-tip/tsconfig.json similarity index 100% rename from d3-tip/tsconfig.json rename to types/d3-tip/tsconfig.json diff --git a/d3-transition/d3-transition-tests.ts b/types/d3-transition/d3-transition-tests.ts similarity index 99% rename from d3-transition/d3-transition-tests.ts rename to types/d3-transition/d3-transition-tests.ts index c2917aaf94..ba0ae99750 100644 --- a/d3-transition/d3-transition-tests.ts +++ b/types/d3-transition/d3-transition-tests.ts @@ -122,7 +122,6 @@ const enterCircles = circles .style('stroke', d => d.color) .style('fill', d => d.color); - const exitCircles = circles.exit(); // Note: need to re-type datum type, as the exit selection elements have the 'old data' // -------------------------------------------------------------------------- @@ -166,7 +165,6 @@ const duration: number = enterTransition.duration(); enterTransition = enterTransition.delay(500); // settable and chainable const delay: number = enterTransition.delay(); - // ease() --------------------------------------------------------------- let easingFn: (normalizedTime: number) => number; @@ -207,8 +205,6 @@ firstDivTransition = bodyTransition.select(function(d, i, g) { return this.querySelector('div')!; // 'this' type is HTMLElement, return type is HTMLDivElement }); - - // selectAll() --------------------------------------------------------------- // assume paragraphs were previously selected and their data were set to ParagraphDatum type @@ -323,7 +319,6 @@ select('body') .transition().duration(100) .text(d => d.test); // selection datum type - // test, when it is not certain, whether an element of the type to be selected exists let maybeG1: d3Transition.Transition; @@ -343,7 +338,6 @@ maybeG1 = selectAll('svg') } else { return null; } - }); // Tweening Function Use ===================================================== @@ -366,7 +360,6 @@ exitTransition = exitTransition.styleTween('fill', function(d, i, group) { let tweenFnAccessor: undefined | ((this: SVGCircleElement, datum?: CircleDatum, i?: number, group?: SVGCircleElement[] | ArrayLike) => ((t: number) => void)); - // chainable updateTransition = updateTransition.tween('fillColor', null); // remove named tween @@ -407,7 +400,6 @@ exitTransition.remove(); let listener: undefined | ((this: SVGCircleElement, datum: CircleDatum, index: number, group: SVGCircleElement[] | ArrayLike) => void); - enterTransition = enterTransition.on('end', function(d, i, g) { const that: SVGCircleElement = this; // const that2: HTMLElement = this; // fails, type mismatch @@ -433,7 +425,6 @@ enterTransition = enterTransition.on('end', null); // check chaining return type // Test Control Flow // -------------------------------------------------------------------------- - // each() ------------------------------------------------------------------------------- // each(valueFn: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => void): Transition; @@ -524,7 +515,3 @@ updateTransitionActive = d3Transition.active { + 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. @@ -88,7 +88,6 @@ export function interrupt(node: BaseType, name?: string): void; * The fourth generic "PDatum" refers to the type of the datum of the parent element(s) in the Transition. */ export interface Transition { - // Sub-selection ------------------------- /** diff --git a/d3-transition/tsconfig.json b/types/d3-transition/tsconfig.json similarity index 100% rename from d3-transition/tsconfig.json rename to types/d3-transition/tsconfig.json diff --git a/d3-transition/tslint.json b/types/d3-transition/tslint.json similarity index 100% rename from d3-transition/tslint.json rename to types/d3-transition/tslint.json diff --git a/d3-voronoi/d3-voronoi-tests.ts b/types/d3-voronoi/d3-voronoi-tests.ts similarity index 100% rename from d3-voronoi/d3-voronoi-tests.ts rename to types/d3-voronoi/d3-voronoi-tests.ts diff --git a/d3-voronoi/index.d.ts b/types/d3-voronoi/index.d.ts similarity index 100% rename from d3-voronoi/index.d.ts rename to types/d3-voronoi/index.d.ts diff --git a/d3-voronoi/tsconfig.json b/types/d3-voronoi/tsconfig.json similarity index 100% rename from d3-voronoi/tsconfig.json rename to types/d3-voronoi/tsconfig.json diff --git a/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts similarity index 99% rename from d3-zoom/d3-zoom-tests.ts rename to types/d3-zoom/d3-zoom-tests.ts index f4a1c0944e..b583bfc8b6 100644 --- a/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -52,7 +52,6 @@ function drawPointOnCanvas(radius: number) { }; } - // SVG Prep ------------------------------------------------------------------- interface SVGDatum { @@ -66,7 +65,6 @@ const svg = select('svg') .attr('width', d => d.width) .attr('height', d => d.height); - const g = svg.append('g'); g.selectAll() @@ -85,7 +83,6 @@ interface GroupDatum { toK: number; } - // -------------------------------------------------------------------------- // Test Define ZoomBehaviour // -------------------------------------------------------------------------- @@ -93,7 +90,6 @@ interface GroupDatum { // Canvas Example ----------------------------------------------------------- function zoomedCanvas(this: HTMLCanvasElement, d: CanvasDatum) { - // Cast d3 event to D3ZoomEvent to be used in zoom event handler const e = > event; if (context) { @@ -115,7 +111,6 @@ canvasZoom = d3Zoom.zoom() // SVG Example -------------------------------------------------------------- function zoomedSVGOverlay(this: SVGRectElement) { - // Cast d3 event to D3ZoomEvent to be used in zoom event handler const e = > event; @@ -126,7 +121,6 @@ let svgZoom: d3Zoom.ZoomBehavior; svgZoom = d3Zoom.zoom(); - // filter() ---------------------------------------------------------------- // chainable @@ -141,7 +135,6 @@ svgZoom = svgZoom.filter(function(d, i, group) { let filterFn: (this: SVGRectElement, d: SVGDatum, index: number, group: SVGRectElement[]) => boolean; filterFn = svgZoom.filter(); - // extent() --------------------------------------------------------------- let extentAccessor: (this: SVGRectElement, d: SVGDatum, index: number, group: SVGRectElement[]) => [[number, number], [number, number]]; @@ -172,7 +165,6 @@ svgZoom = svgZoom.translateExtent([[-500, -500], [500, 500]]); let translateExtent: [[number, number], [number, number]]; translateExtent = svgZoom.translateExtent(); - // duration() -------------------------------------------------------------- // chainable @@ -187,7 +179,6 @@ svgZoom = svgZoom.interpolate(interpolateZoom); svgZoom = svgZoom.interpolate(interpolate); svgZoom = svgZoom.interpolate(interpolateArray); - // getter let basicInterpolatorFactory: (a: ZoomView, b: ZoomView) => ((t: number) => ZoomView); @@ -220,7 +211,6 @@ if (zoomHandler) { // Test Attach ZoomBehaviour // -------------------------------------------------------------------------- - // Canvas Example ----------------------------------------------------------- // attach the zoom behavior to the canvas element diff --git a/d3-zoom/index.d.ts b/types/d3-zoom/index.d.ts similarity index 99% rename from d3-zoom/index.d.ts rename to types/d3-zoom/index.d.ts index 87a55e9b2a..904f7b8e62 100644 --- a/d3-zoom/index.d.ts +++ b/types/d3-zoom/index.d.ts @@ -8,7 +8,6 @@ import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; import { ZoomView, ZoomInterpolator } from 'd3-interpolate'; - // -------------------------------------------------------------------------- // Shared Type Definitions and Interfaces // -------------------------------------------------------------------------- diff --git a/d3-zoom/tsconfig.json b/types/d3-zoom/tsconfig.json similarity index 100% rename from d3-zoom/tsconfig.json rename to types/d3-zoom/tsconfig.json diff --git a/d3-zoom/tslint.json b/types/d3-zoom/tslint.json similarity index 100% rename from d3-zoom/tslint.json rename to types/d3-zoom/tslint.json diff --git a/types/d3.cloud.layout/d3.cloud.layout-tests.ts b/types/d3.cloud.layout/d3.cloud.layout-tests.ts new file mode 100644 index 0000000000..862b7f0d82 --- /dev/null +++ b/types/d3.cloud.layout/d3.cloud.layout-tests.ts @@ -0,0 +1,40 @@ +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.cloud.layout/index.d.ts b/types/d3.cloud.layout/index.d.ts similarity index 100% rename from d3.cloud.layout/index.d.ts rename to types/d3.cloud.layout/index.d.ts diff --git a/d3.cloud.layout/tsconfig.json b/types/d3.cloud.layout/tsconfig.json similarity index 100% rename from d3.cloud.layout/tsconfig.json rename to types/d3.cloud.layout/tsconfig.json diff --git a/d3.slider/d3.slider-tests.ts b/types/d3.slider/d3.slider-tests.ts similarity index 100% rename from d3.slider/d3.slider-tests.ts rename to types/d3.slider/d3.slider-tests.ts diff --git a/d3.slider/index.d.ts b/types/d3.slider/index.d.ts similarity index 100% rename from d3.slider/index.d.ts rename to types/d3.slider/index.d.ts diff --git a/d3.slider/tsconfig.json b/types/d3.slider/tsconfig.json similarity index 100% rename from d3.slider/tsconfig.json rename to types/d3.slider/tsconfig.json diff --git a/d3/d3-tests.ts b/types/d3/d3-tests.ts similarity index 99% rename from d3/d3-tests.ts rename to types/d3/d3-tests.ts index ca4932d27c..1efb46be8e 100644 --- a/d3/d3-tests.ts +++ b/types/d3/d3-tests.ts @@ -1,6 +1,5 @@ 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 @@ -8,5 +7,3 @@ import * as d3 from 'd3'; // Ability to access d3-select related properties const d: d3.Selection = d3.selection(); - - diff --git a/d3/index.d.ts b/types/d3/index.d.ts similarity index 100% rename from d3/index.d.ts rename to types/d3/index.d.ts diff --git a/d3/tsconfig.json b/types/d3/tsconfig.json similarity index 100% rename from d3/tsconfig.json rename to types/d3/tsconfig.json diff --git a/datatables.net-select/tslint.json b/types/d3/tslint.json similarity index 100% rename from datatables.net-select/tslint.json rename to types/d3/tslint.json diff --git a/d3/v3/d3-tests.ts b/types/d3/v3/d3-tests.ts similarity index 100% rename from d3/v3/d3-tests.ts rename to types/d3/v3/d3-tests.ts diff --git a/d3/v3/index.d.ts b/types/d3/v3/index.d.ts similarity index 100% rename from d3/v3/index.d.ts rename to types/d3/v3/index.d.ts diff --git a/d3/v3/tsconfig.json b/types/d3/v3/tsconfig.json similarity index 100% rename from d3/v3/tsconfig.json rename to types/d3/v3/tsconfig.json diff --git a/d3kit/d3kit-tests.ts b/types/d3kit/d3kit-tests.ts similarity index 98% rename from d3kit/d3kit-tests.ts rename to types/d3kit/d3kit-tests.ts index c8a447ecda..e1a92d41b9 100644 --- a/d3kit/d3kit-tests.ts +++ b/types/d3kit/d3kit-tests.ts @@ -1,5 +1,3 @@ -/// - function test_abstract_chart() { let el: Element, chart: d3kit.AbstractChart, @@ -86,8 +84,8 @@ function test_svgchart() { options: d3kit.ChartOptions, margins: d3kit.ChartMargin, offsets: [number, number], - svg: d3.Selection, - rootg: d3.Selection, + svg: d3.Selection, + rootg: d3.Selection, layers: d3kit.LayerOrganizer; // create a div, append to body, return Node as type Element diff --git a/d3kit/index.d.ts b/types/d3kit/index.d.ts similarity index 100% rename from d3kit/index.d.ts rename to types/d3kit/index.d.ts diff --git a/d3kit/tsconfig.json b/types/d3kit/tsconfig.json similarity index 100% rename from d3kit/tsconfig.json rename to types/d3kit/tsconfig.json diff --git a/d3kit/v1/d3kit-tests.ts b/types/d3kit/v1/d3kit-tests.ts similarity index 99% rename from d3kit/v1/d3kit-tests.ts rename to types/d3kit/v1/d3kit-tests.ts index d49891822b..9ffb7ca2ba 100644 --- a/d3kit/v1/d3kit-tests.ts +++ b/types/d3kit/v1/d3kit-tests.ts @@ -1,9 +1,6 @@ -/// /// /// -/* jshint expr: true */ - var expect = chai.expect; describe('Skeleton', function(){ var element: Element, $element: d3.Selection, $svg: d3.Selection, skeleton: d3kit.Skeleton; diff --git a/d3kit/v1/index.d.ts b/types/d3kit/v1/index.d.ts similarity index 100% rename from d3kit/v1/index.d.ts rename to types/d3kit/v1/index.d.ts diff --git a/d3kit/v1/tsconfig.json b/types/d3kit/v1/tsconfig.json similarity index 100% rename from d3kit/v1/tsconfig.json rename to types/d3kit/v1/tsconfig.json diff --git a/d3pie/d3pie-tests.ts b/types/d3pie/d3pie-tests.ts similarity index 100% rename from d3pie/d3pie-tests.ts rename to types/d3pie/d3pie-tests.ts diff --git a/d3pie/index.d.ts b/types/d3pie/index.d.ts similarity index 100% rename from d3pie/index.d.ts rename to types/d3pie/index.d.ts diff --git a/d3pie/tsconfig.json b/types/d3pie/tsconfig.json similarity index 100% rename from d3pie/tsconfig.json rename to types/d3pie/tsconfig.json diff --git a/dagre-d3/dagre-d3-tests.ts b/types/dagre-d3/dagre-d3-tests.ts similarity index 100% rename from dagre-d3/dagre-d3-tests.ts rename to types/dagre-d3/dagre-d3-tests.ts diff --git a/dagre-d3/index.d.ts b/types/dagre-d3/index.d.ts similarity index 100% rename from dagre-d3/index.d.ts rename to types/dagre-d3/index.d.ts diff --git a/dagre-d3/tsconfig.json b/types/dagre-d3/tsconfig.json similarity index 100% rename from dagre-d3/tsconfig.json rename to types/dagre-d3/tsconfig.json diff --git a/decay/tslint.json b/types/dagre-d3/tslint.json similarity index 100% rename from decay/tslint.json rename to types/dagre-d3/tslint.json diff --git a/dagre/dagre-tests.ts b/types/dagre/dagre-tests.ts similarity index 100% rename from dagre/dagre-tests.ts rename to types/dagre/dagre-tests.ts diff --git a/dagre/index.d.ts b/types/dagre/index.d.ts similarity index 100% rename from dagre/index.d.ts rename to types/dagre/index.d.ts diff --git a/dagre/tsconfig.json b/types/dagre/tsconfig.json similarity index 100% rename from dagre/tsconfig.json rename to types/dagre/tsconfig.json diff --git a/deep-freeze-strict/tslint.json b/types/dagre/tslint.json similarity index 100% rename from deep-freeze-strict/tslint.json rename to types/dagre/tslint.json diff --git a/dat-gui/dat-gui-tests.ts b/types/dat-gui/dat-gui-tests.ts similarity index 100% rename from dat-gui/dat-gui-tests.ts rename to types/dat-gui/dat-gui-tests.ts diff --git a/dat-gui/index.d.ts b/types/dat-gui/index.d.ts similarity index 100% rename from dat-gui/index.d.ts rename to types/dat-gui/index.d.ts diff --git a/dat-gui/tsconfig.json b/types/dat-gui/tsconfig.json similarity index 100% rename from dat-gui/tsconfig.json rename to types/dat-gui/tsconfig.json diff --git a/data-driven/data-driven-tests.ts b/types/data-driven/data-driven-tests.ts similarity index 100% rename from data-driven/data-driven-tests.ts rename to types/data-driven/data-driven-tests.ts diff --git a/data-driven/index.d.ts b/types/data-driven/index.d.ts similarity index 100% rename from data-driven/index.d.ts rename to types/data-driven/index.d.ts diff --git a/data-driven/tsconfig.json b/types/data-driven/tsconfig.json similarity index 100% rename from data-driven/tsconfig.json rename to types/data-driven/tsconfig.json diff --git a/datatables.net-buttons/datatables.net-buttons-tests.ts b/types/datatables.net-buttons/datatables.net-buttons-tests.ts similarity index 92% rename from datatables.net-buttons/datatables.net-buttons-tests.ts rename to types/datatables.net-buttons/datatables.net-buttons-tests.ts index 2dcdd26ff4..015917c456 100644 --- a/datatables.net-buttons/datatables.net-buttons-tests.ts +++ b/types/datatables.net-buttons/datatables.net-buttons-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - $(document).ready(function () { var config: DataTables.Settings = @@ -26,6 +22,7 @@ $(document).ready(function () { name: 'name', namespace: 'namespace', titleAttr: 'title', + title: 'title' } ], } diff --git a/datatables.net-buttons/index.d.ts b/types/datatables.net-buttons/index.d.ts similarity index 85% rename from datatables.net-buttons/index.d.ts rename to types/datatables.net-buttons/index.d.ts index b4ed4b0eb5..ba4aa75654 100644 --- a/datatables.net-buttons/index.d.ts +++ b/types/datatables.net-buttons/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for JQuery DataTables Buttons extension 1.1.0 // Project: http://datatables.net/extensions/buttons/ -// Definitions by: Sam Germano +// Definitions by: Sam Germano , Jim Hartford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -80,13 +80,18 @@ declare namespace DataTables { */ titleAttr?: string; + /** + * Button 'title' text + */ + title?: string; + exportOptions?: ButtonExportOptions; autoPrint?: boolean; customize?: FunctionButtonCustomize; } export interface FunctionButtonAvailable { - (dt: DataTables.DataTable, config: any): boolean + (dt: DataTables.Api, config: any): boolean } export interface ButtonExportOptions { columns?: string; @@ -101,14 +106,14 @@ declare namespace DataTables { } export interface ButtonText { - (dt: DataTables.DataTable, node: JQuery, config: any): string + (dt: DataTables.Api, node: JQuery, config: any): string } export interface FunctionButtonInit { - (dt: DataTables.DataTable, node: JQuery, config: any): void + (dt: DataTables.Api, node: JQuery, config: any): void } // api object? export interface FunctionButtonAction { - (e: any, dt: DataTables.DataTable, node: JQuery, config: any): void + (e: any, dt: DataTables.Api, node: JQuery, config: any): void } export interface FunctionButtonCustomize { diff --git a/datatables.net-buttons/tsconfig.json b/types/datatables.net-buttons/tsconfig.json similarity index 100% rename from datatables.net-buttons/tsconfig.json rename to types/datatables.net-buttons/tsconfig.json diff --git a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/types/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts similarity index 65% rename from datatables.net-fixedheader/datatables.net-fixedheader-tests.ts rename to types/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts index 949bca825c..72d8665838 100644 --- a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts +++ b/types/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts @@ -1,8 +1,5 @@ -/// -/// - $(document).ready(() => { - var config: DataTables.Settings = { + const config: DataTables.Settings = { // FixedHeader extension options fixedHeader: { footer: true, diff --git a/datatables.net-fixedheader/index.d.ts b/types/datatables.net-fixedheader/index.d.ts similarity index 96% rename from datatables.net-fixedheader/index.d.ts rename to types/datatables.net-fixedheader/index.d.ts index caf3987d35..cb0b363b65 100644 --- a/datatables.net-fixedheader/index.d.ts +++ b/types/datatables.net-fixedheader/index.d.ts @@ -6,7 +6,7 @@ /// declare namespace DataTables { - export interface Settings { + interface Settings { /* * FixedHeader extension options */ diff --git a/datatables.net-fixedheader/tsconfig.json b/types/datatables.net-fixedheader/tsconfig.json similarity index 100% rename from datatables.net-fixedheader/tsconfig.json rename to types/datatables.net-fixedheader/tsconfig.json diff --git a/deepmerge/tslint.json b/types/datatables.net-fixedheader/tslint.json similarity index 100% rename from deepmerge/tslint.json rename to types/datatables.net-fixedheader/tslint.json diff --git a/datatables.net-select/datatables.net-select-tests.ts b/types/datatables.net-select/datatables.net-select-tests.ts similarity index 71% rename from datatables.net-select/datatables.net-select-tests.ts rename to types/datatables.net-select/datatables.net-select-tests.ts index aa1851931c..9b7eb24c2a 100644 --- a/datatables.net-select/datatables.net-select-tests.ts +++ b/types/datatables.net-select/datatables.net-select-tests.ts @@ -1,8 +1,5 @@ -/// -/// - $(document).ready(() => { - var config: DataTables.Settings = { + const config: DataTables.Settings = { // Select extension options select: { blurable: true, diff --git a/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts similarity index 97% rename from datatables.net-select/index.d.ts rename to types/datatables.net-select/index.d.ts index 96529a10c1..201d00ba27 100644 --- a/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -6,7 +6,7 @@ /// declare namespace DataTables { - export interface Settings { + interface Settings { /* * Select extension options */ diff --git a/datatables.net-select/tsconfig.json b/types/datatables.net-select/tsconfig.json similarity index 100% rename from datatables.net-select/tsconfig.json rename to types/datatables.net-select/tsconfig.json diff --git a/del/tslint.json b/types/datatables.net-select/tslint.json similarity index 100% rename from del/tslint.json rename to types/datatables.net-select/tslint.json diff --git a/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts similarity index 98% rename from datatables.net/datatables.net-tests.ts rename to types/datatables.net/datatables.net-tests.ts index 0134581ee1..838ca9131c 100644 --- a/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -1,6 +1,3 @@ -/// - - $(document).ready(function () { //#region "Language" @@ -324,7 +321,7 @@ $(document).ready(function () { destroy = dt.destroy(true); destroy.$(""); - var draw: DataTables.DataTable = dt.draw(); + var draw: DataTables.Api = dt.draw(); draw = dt.draw(true); draw = dt.draw("page"); draw.$(""); @@ -790,8 +787,8 @@ $(document).ready(function () { var rows_13 = dt.rows.add([{}, {}]); dt.rows().every(function () { }); dt.rows().every(function (rowIdx, tableLoop, rowLoop) { }); - var rows_14: DataTables.DataTable = dt.rows("selector").ids(); - var rows_15: DataTables.DataTable = dt.rows("selector").ids(false); + var rows_14: DataTables.Api = dt.rows("selector").ids(); + var rows_15: DataTables.Api = dt.rows("selector").ids(false); var table3 = $('#example').DataTable(); table3.row.add({ @@ -912,11 +909,11 @@ $(document).ready(function () { var staticFn: DataTables.StaticFunctions; // With boolean parameter type, always returns DataTables.DataTable[]. - var static_1: DataTables.DataTable[] = staticFn.tables(true); + var static_1: DataTables.Api[] = staticFn.tables(true); // With object parameter type, returns DataTables.DataTable[] when "api" property is false. - static_1 = staticFn.tables({ "visible": true, "api": false }); + static_1 = staticFn.tables({ "visible": true, "api": false }); // With object parameter type, returns DataTables.DataTable when "api" property is true. - var static_2: DataTables.DataTable = staticFn.tables({ "visible": true, "api": true }); + var static_2: DataTables.Api = staticFn.tables({ "visible": true, "api": true }); //#endregion "Methods-Static" diff --git a/datatables.net/index.d.ts b/types/datatables.net/index.d.ts similarity index 93% rename from datatables.net/index.d.ts rename to types/datatables.net/index.d.ts index 2640dbabe6..c0aaf9cc6c 100644 --- a/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -11,7 +11,7 @@ /// interface JQuery { - DataTable(param?: DataTables.Settings): DataTables.DataTable; + DataTable(opts?: DataTables.Settings): DataTables.Api; } //TODO: Wrong, as jquery.d.ts has no interface for fn @@ -20,11 +20,11 @@ interface JQuery { //} declare namespace DataTables { - export interface DataTable extends DataTableCore { + export interface Api extends CoreMethods { /** * Get the data for the whole table. */ - data(): DataTable; + data(): Api; /** * Order Methods / Object @@ -127,8 +127,8 @@ declare namespace DataTables { //#endregion "Table/Tables" } - export interface DataTables extends DataTableCore { - [index: number]: DataTable; + export interface DataTables extends CoreMethods { + [index: number]: Api; } interface ObjectSelectorModifier { @@ -155,7 +155,7 @@ declare namespace DataTables { //#region "core-methods" - interface DataTableCore extends UtilityMethods { + interface CoreMethods extends UtilityMethods { /** * Get jquery object */ @@ -172,21 +172,21 @@ declare namespace DataTables { /** * Clear the table of all data. */ - clear(): DataTable; + clear(): Api; /** * 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; + destroy(remove?: boolean): Api; /** * 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; + draw(paging?: boolean | string): Api; /* * Look up a language token that was defined in the DataTables' language initialisation object. @@ -210,7 +210,7 @@ declare namespace DataTables { * @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; + off(event: string, callback?: Function): Api; /** * Table events listener. @@ -218,7 +218,7 @@ declare namespace DataTables { * @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; + on(event: string, callback: Function): Api; /** * Listen for a table event once and then remove the listener. @@ -226,7 +226,7 @@ declare namespace DataTables { * @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; + one(event: string, callback: Function): Api; /** * Page Methods / Object @@ -246,12 +246,12 @@ declare namespace DataTables { * @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; + search(input: string, regex?: boolean, smart?: boolean, caseInsen?: boolean): Api; /** * Obtain the table's settings object */ - settings(): DataTable; + settings(): Api; /** * Page Methods / Object @@ -261,14 +261,14 @@ declare namespace DataTables { //#region "ajax-methods" - interface AjaxMethods extends DataTable { + interface AjaxMethods extends Api { /** * 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; + load(callback?: Function, resetPaging?: boolean): Api; } interface AjaxMethodModel { @@ -288,7 +288,7 @@ declare namespace DataTables { * @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(callback?: Function, resetPaging?: boolean): Api; /** * Reload the table data from the Ajax data source @@ -318,9 +318,9 @@ declare namespace DataTables { * * @param order Order Model */ - (order?: (string | number)[]): DataTable; - (order?: (string | number)[][]): DataTable; - (order: (string | number)[], ...args: any[]): DataTable; + (order?: (string | number)[]): Api; + (order?: (string | number)[][]): Api; + (order: (string | number)[], ...args: any[]): Api; /** * Add an ordering listener to an element, for a given column. @@ -329,7 +329,7 @@ declare namespace DataTables { * @param column Column index * @param callback Callback function */ - listener(node: string | Node | JQuery, column: number, callback: Function): DataTable; + listener(node: string | Node | JQuery, column: number, callback: Function): Api; } //#endregion "order-methods" @@ -346,7 +346,7 @@ declare namespace DataTables { * * @param page Index or 'first', 'next', 'previous', 'last' */ - (page: number | string): DataTable; + (page: number | string): Api; /** * Get paging information about the table @@ -363,7 +363,7 @@ declare namespace DataTables { * * @param length Page length to set. use -1 to show all records. */ - len(length: number): DataTable; + len(length: number): Api; } interface PageMethodeModelInfoReturn { @@ -390,7 +390,7 @@ declare namespace DataTables { /** * Clear the saved state of the table. */ - clear(): DataTable; + clear(): Api; /** * Get the table state that was loaded during initialisation. @@ -400,7 +400,7 @@ declare namespace DataTables { /** * Trigger a state save. */ - save(): DataTable; + save(): Api; } interface StateReturnModel { @@ -435,7 +435,7 @@ declare namespace DataTables { * @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; + concat(a: Object, ...b: Object[]): Api; /** * 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 @@ -447,26 +447,26 @@ declare namespace DataTables { * * @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; + each(fn: Function): Api; /** * Reduce an Api instance to a single context and result set. * * @param idx Index to select */ - eq(idx: number): DataTable; + eq(idx: number): Api; /** * 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; + filter(fn: Function): Api; /** * Flatten a 2D array structured API instance to a 1D array structure. */ - flatten(): DataTable; + flatten(): Api; /** * Find the first instance of a value in the API instance's result set. @@ -499,14 +499,14 @@ declare namespace DataTables { * * @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; + map(fn: Function): Api; /** * 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; + pluck(property: number | string): Api; /** * Remove the last item from an API instance's result set. @@ -539,7 +539,7 @@ declare namespace DataTables { /** * Reverse the result set of the API instance and return the original array. */ - reverse(): DataTable; + reverse(): Api; /** * Remove the first item from an API instance's result set. @@ -551,7 +551,7 @@ declare namespace DataTables { * * @param fn This is a standard Javascript sort comparison function. It accepts two parameters. */ - sort(fn?: Function): DataTable; + sort(fn?: Function): Api; /** * Modify the contents of an Api instance's result set, adding or removing items from it as required. @@ -580,7 +580,7 @@ declare namespace DataTables { /** * Create a new API instance containing only the unique items from a the elements in an instance's result set. */ - unique(): DataTable; + unique(): Api; /** * Add one or more items to the start of an API instance's result set. @@ -598,7 +598,7 @@ declare namespace DataTables { * * @param t Specify which cache the data should be read from. Can take one of two values: search or order */ - cache(t: string): DataTable; + cache(t: string): Api; } //#region "cell-methods" @@ -609,7 +609,7 @@ declare namespace DataTables { * * @param source Data source to read the new data from. */ - invalidate(source?: string): DataTable; + invalidate(source?: string): Api; /** * Get data for the selected cell @@ -619,7 +619,7 @@ declare namespace DataTables { render(t: string): any; } - interface CellMethods extends DataTableCore, CommonCellMethods { + interface CellMethods extends CoreMethods, CommonCellMethods { /** * Get data for the selected cell */ @@ -630,7 +630,7 @@ declare namespace DataTables { * * @param data Value to assign to the data for the cell */ - data(data: any): DataTable; + data(data: any): Api; /** * Get index information about the selected cell @@ -649,28 +649,28 @@ declare namespace DataTables { columnVisible: number; } - interface CellsMethods extends DataTableCore, CommonCellMethods { + interface CellsMethods extends CoreMethods, CommonCellMethods { /** * Get data for the selected cells */ - data(): DataTable; + data(): Api; /** * 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; + every(fn: (cellRowIdx: number, cellColIdx: number, tableLoop: number, cellLoop: number) => void): Api; /** * Get index information about the selected cells */ - indexes(): DataTable; + indexes(): Api; /** * Get the DOM elements for the selected cells */ - nodes(): DataTable; + nodes(): Api; } //#endregion "cell-methods" @@ -692,7 +692,7 @@ declare namespace DataTables { * * @param direction Direction of sort to apply to the selected column - desc (descending) or asc (ascending). */ - order(direction: string): DataTable; + order(direction: string): Api; /** * Get the visibility of the selected column. @@ -705,7 +705,7 @@ declare namespace DataTables { * @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; + visible(show: boolean, redrawCalculations?: boolean): Api; } interface ColumnMethodsModel { @@ -726,11 +726,11 @@ declare namespace DataTables { index(t: string, index: number): number; } - interface ColumnMethods extends DataTableCore, CommonColumnMethod { + interface ColumnMethods extends CoreMethods, CommonColumnMethod { /** * Get the data for the cells in the selected column. */ - data(): DataTable; + data(): Api; /** * Get the data source property for the selected column @@ -742,12 +742,12 @@ declare namespace DataTables { * * @param t Specify if you want to get the column data index (default) or the visible index (visible). */ - index(t?: string): DataTable; + index(t?: string): Api; /** * Obtain the th / td nodes for the selected column */ - nodes(): DataTable[]; + nodes(): Api[]; } interface ColumnsMethodsModel { @@ -769,38 +769,38 @@ declare namespace DataTables { /** * Recalculate the column widths for layout. */ - adjust(): DataTable; + adjust(): Api; } - interface ColumnsMethods extends DataTableCore, CommonColumnMethod { + interface ColumnsMethods extends CoreMethods, CommonColumnMethod { /** * Obtain the data for the columns from the selector */ - data(): DataTable; + data(): Api; /** * Get the data source property for the selected columns. */ - dataSrc(): DataTable; + dataSrc(): Api; /** * 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; + every(fn: (colIdx: number, tableLoop: number, colLoop: number) => void): Api; /** * 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; + indexes(t?: string): Api; /** * Obtain the th / td nodes for the selected columns */ - nodes(): DataTable[][]; + nodes(): Api[][]; } //#endregion "column-methods" @@ -812,7 +812,7 @@ declare namespace DataTables { * * @param source Data source to read the new data from. Values: 'auto', 'data', 'dom' */ - invalidate(source?: string): DataTable; + invalidate(source?: string): Api; } interface RowChildMethodModel { @@ -839,39 +839,39 @@ declare namespace DataTables { /** * Hide the child row(s) of a parent row */ - hide(): DataTable; + hide(): Api; /** * Check if the child rows of a parent row are visible */ - isShown(): DataTable; + isShown(): Api; /** * Remove child row(s) from display and release any allocated memory */ - remove(): DataTable; + remove(): Api; /** * Show the child row(s) of a parent row */ - show(): DataTable; + show(): Api; } - interface RowChildMethods extends DataTableCore { + interface RowChildMethods extends CoreMethods { /** * Hide the child row(s) of a parent row */ - hide(): DataTable; + hide(): Api; /** * Remove child row(s) from display and release any allocated memory */ - remove(): DataTable; + remove(): Api; /** * Make newly defined child rows visible */ - show(): DataTable; + show(): Api; } interface RowMethodsModel { @@ -888,10 +888,10 @@ declare namespace DataTables { * * @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; + add(data: any[] | Object): Api; } - interface RowMethods extends DataTableCore, CommonRowMethod { + interface RowMethods extends CoreMethods, CommonRowMethod { /** * Order Methods / Object */ @@ -907,7 +907,7 @@ declare namespace DataTables { * * @param d Data to use for the row. */ - data(d: any[] | Object): DataTable; + data(d: any[] | Object): Api; /** @@ -956,28 +956,28 @@ declare namespace DataTables { * * @param data Array of data elements, with each one describing a new row to be added to the table */ - add(data: any[]): DataTable; + add(data: any[]): Api; } - interface RowsMethods extends DataTableCore, CommonRowMethod { + interface RowsMethods extends CoreMethods, CommonRowMethod { /** * Get the data for the rows from the selector */ - data(): DataTable; + data(): Api; /** * Set the data for the selected row * * @param d Data to use for the row. */ - data(d: any[] | Object): DataTable; + data(d: any[] | Object): Api; /** * 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; + every(fn: (rowIdx: number, tableLoop: number, rowLoop: number) => void): Api; /** * Get the ids of the selected rows. Since: 1.10.8 @@ -986,28 +986,28 @@ declare namespace DataTables { * 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; + ids(hash?: boolean): Api; /** * Get the row indexes of the selected rows. */ - indexes(): DataTable; + indexes(): Api; /** * Obtain the tr nodes for the selected rows */ - nodes(): DataTable; + nodes(): Api; /** * Delete the selected rows from the DataTable. */ - remove(): DataTable; + remove(): Api; } //#endregion "row-methods" //#region "table-methods" - interface TableMethods extends DataTableCore { + interface TableMethods extends CoreMethods { /** * Get the tfoot node for the table in the API's context */ @@ -1034,31 +1034,31 @@ declare namespace DataTables { node(): Node; } - interface TablesMethods extends DataTableCore { + interface TablesMethods extends CoreMethods { /** * Get the tfoot nodes for the tables in the API's context */ - footer(): DataTable; + footer(): Api; /** * Get the thead nodes for the tables in the API's context */ - header(): DataTable; + header(): Api; /** * Get the tbody nodes for the tables in the API's context */ - body(): DataTable; + body(): Api; /** * Get the div container nodes for the tables in the API's context */ - containers(): DataTable; + containers(): Api; /** * Get the table nodes for the tables in the API's context */ - nodes(): DataTable; + nodes(): Api; } //#endregion "table-methods" @@ -1080,7 +1080,7 @@ declare namespace DataTables { * @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; + tables(visible?: boolean | ObjectTablesStatic): DataTables.Api[] | DataTables.Api; /** * Version number compatibility check function @@ -1099,7 +1099,7 @@ declare namespace DataTables { * * @param table Selector string for table */ - Api(selector: string | Node | Node[] | JQuery): DataTables.DataTable; + Api(selector: string | Node | Node[] | JQuery): DataTables.Api; } export interface StaticUtilFunctions { diff --git a/datatables.net/tsconfig.json b/types/datatables.net/tsconfig.json similarity index 100% rename from datatables.net/tsconfig.json rename to types/datatables.net/tsconfig.json diff --git a/date.format.js/date.format.js-tests.ts b/types/date.format.js/date.format.js-tests.ts similarity index 100% rename from date.format.js/date.format.js-tests.ts rename to types/date.format.js/date.format.js-tests.ts diff --git a/date.format.js/index.d.ts b/types/date.format.js/index.d.ts similarity index 100% rename from date.format.js/index.d.ts rename to types/date.format.js/index.d.ts diff --git a/date.format.js/tsconfig.json b/types/date.format.js/tsconfig.json similarity index 100% rename from date.format.js/tsconfig.json rename to types/date.format.js/tsconfig.json diff --git a/dateformat/dateformat-tests.ts b/types/dateformat/dateformat-tests.ts similarity index 100% rename from dateformat/dateformat-tests.ts rename to types/dateformat/dateformat-tests.ts diff --git a/dateformat/index.d.ts b/types/dateformat/index.d.ts similarity index 100% rename from dateformat/index.d.ts rename to types/dateformat/index.d.ts diff --git a/dateformat/tsconfig.json b/types/dateformat/tsconfig.json similarity index 100% rename from dateformat/tsconfig.json rename to types/dateformat/tsconfig.json diff --git a/datejs/datejs-tests.ts b/types/datejs/datejs-tests.ts similarity index 100% rename from datejs/datejs-tests.ts rename to types/datejs/datejs-tests.ts diff --git a/datejs/index.d.ts b/types/datejs/index.d.ts similarity index 100% rename from datejs/index.d.ts rename to types/datejs/index.d.ts diff --git a/datejs/sugarpak.d.ts b/types/datejs/sugarpak.d.ts similarity index 100% rename from datejs/sugarpak.d.ts rename to types/datejs/sugarpak.d.ts diff --git a/datejs/tsconfig.json b/types/datejs/tsconfig.json similarity index 100% rename from datejs/tsconfig.json rename to types/datejs/tsconfig.json diff --git a/daterangepicker/daterangepicker-tests.ts b/types/daterangepicker/daterangepicker-tests.ts similarity index 100% rename from daterangepicker/daterangepicker-tests.ts rename to types/daterangepicker/daterangepicker-tests.ts diff --git a/daterangepicker/index.d.ts b/types/daterangepicker/index.d.ts similarity index 100% rename from daterangepicker/index.d.ts rename to types/daterangepicker/index.d.ts diff --git a/daterangepicker/package.json b/types/daterangepicker/package.json similarity index 100% rename from daterangepicker/package.json rename to types/daterangepicker/package.json diff --git a/daterangepicker/tsconfig.json b/types/daterangepicker/tsconfig.json similarity index 100% rename from daterangepicker/tsconfig.json rename to types/daterangepicker/tsconfig.json diff --git a/db-migrate-base/db-migrate-base-tests.ts b/types/db-migrate-base/db-migrate-base-tests.ts similarity index 100% rename from db-migrate-base/db-migrate-base-tests.ts rename to types/db-migrate-base/db-migrate-base-tests.ts diff --git a/db-migrate-base/index.d.ts b/types/db-migrate-base/index.d.ts similarity index 100% rename from db-migrate-base/index.d.ts rename to types/db-migrate-base/index.d.ts diff --git a/db-migrate-base/tsconfig.json b/types/db-migrate-base/tsconfig.json similarity index 100% rename from db-migrate-base/tsconfig.json rename to types/db-migrate-base/tsconfig.json diff --git a/db-migrate-pg/db-migrate-pg-tests.ts b/types/db-migrate-pg/db-migrate-pg-tests.ts similarity index 100% rename from db-migrate-pg/db-migrate-pg-tests.ts rename to types/db-migrate-pg/db-migrate-pg-tests.ts diff --git a/db-migrate-pg/index.d.ts b/types/db-migrate-pg/index.d.ts similarity index 100% rename from db-migrate-pg/index.d.ts rename to types/db-migrate-pg/index.d.ts diff --git a/db-migrate-pg/tsconfig.json b/types/db-migrate-pg/tsconfig.json similarity index 100% rename from db-migrate-pg/tsconfig.json rename to types/db-migrate-pg/tsconfig.json diff --git a/db.js/db.js-tests.ts b/types/db.js/db.js-tests.ts similarity index 100% rename from db.js/db.js-tests.ts rename to types/db.js/db.js-tests.ts diff --git a/db.js/index.d.ts b/types/db.js/index.d.ts similarity index 100% rename from db.js/index.d.ts rename to types/db.js/index.d.ts diff --git a/db.js/tsconfig.json b/types/db.js/tsconfig.json similarity index 100% rename from db.js/tsconfig.json rename to types/db.js/tsconfig.json diff --git a/dc/dc-tests.ts b/types/dc/dc-tests.ts similarity index 100% rename from dc/dc-tests.ts rename to types/dc/dc-tests.ts diff --git a/dc/index.d.ts b/types/dc/index.d.ts similarity index 100% rename from dc/index.d.ts rename to types/dc/index.d.ts diff --git a/dc/tsconfig.json b/types/dc/tsconfig.json similarity index 100% rename from dc/tsconfig.json rename to types/dc/tsconfig.json diff --git a/debounce/debounce-tests.ts b/types/debounce/debounce-tests.ts similarity index 100% rename from debounce/debounce-tests.ts rename to types/debounce/debounce-tests.ts diff --git a/debounce/index.d.ts b/types/debounce/index.d.ts similarity index 100% rename from debounce/index.d.ts rename to types/debounce/index.d.ts diff --git a/debounce/tsconfig.json b/types/debounce/tsconfig.json similarity index 100% rename from debounce/tsconfig.json rename to types/debounce/tsconfig.json diff --git a/debug/debug-tests.ts b/types/debug/debug-tests.ts similarity index 100% rename from debug/debug-tests.ts rename to types/debug/debug-tests.ts diff --git a/debug/index.d.ts b/types/debug/index.d.ts similarity index 100% rename from debug/index.d.ts rename to types/debug/index.d.ts diff --git a/debug/tsconfig.json b/types/debug/tsconfig.json similarity index 100% rename from debug/tsconfig.json rename to types/debug/tsconfig.json diff --git a/decamelize/decamelize-tests.ts b/types/decamelize/decamelize-tests.ts similarity index 100% rename from decamelize/decamelize-tests.ts rename to types/decamelize/decamelize-tests.ts diff --git a/decamelize/index.d.ts b/types/decamelize/index.d.ts similarity index 100% rename from decamelize/index.d.ts rename to types/decamelize/index.d.ts diff --git a/decamelize/tsconfig.json b/types/decamelize/tsconfig.json similarity index 100% rename from decamelize/tsconfig.json rename to types/decamelize/tsconfig.json diff --git a/decay/decay-tests.ts b/types/decay/decay-tests.ts similarity index 100% rename from decay/decay-tests.ts rename to types/decay/decay-tests.ts diff --git a/decay/index.d.ts b/types/decay/index.d.ts similarity index 100% rename from decay/index.d.ts rename to types/decay/index.d.ts diff --git a/decay/tsconfig.json b/types/decay/tsconfig.json similarity index 100% rename from decay/tsconfig.json rename to types/decay/tsconfig.json diff --git a/discontinuous-range/tslint.json b/types/decay/tslint.json similarity index 100% rename from discontinuous-range/tslint.json rename to types/decay/tslint.json diff --git a/decimal.js/decimal.js-tests.ts b/types/decimal.js/decimal.js-tests.ts similarity index 100% rename from decimal.js/decimal.js-tests.ts rename to types/decimal.js/decimal.js-tests.ts diff --git a/decimal.js/index.d.ts b/types/decimal.js/index.d.ts similarity index 100% rename from decimal.js/index.d.ts rename to types/decimal.js/index.d.ts diff --git a/decimal.js/tsconfig.json b/types/decimal.js/tsconfig.json similarity index 100% rename from decimal.js/tsconfig.json rename to types/decimal.js/tsconfig.json diff --git a/decorum/decorum-tests.ts b/types/decorum/decorum-tests.ts similarity index 100% rename from decorum/decorum-tests.ts rename to types/decorum/decorum-tests.ts diff --git a/decorum/index.d.ts b/types/decorum/index.d.ts similarity index 100% rename from decorum/index.d.ts rename to types/decorum/index.d.ts diff --git a/decorum/tsconfig.json b/types/decorum/tsconfig.json similarity index 100% rename from decorum/tsconfig.json rename to types/decorum/tsconfig.json diff --git a/deep-assign/deep-assign-tests.ts b/types/deep-assign/deep-assign-tests.ts similarity index 100% rename from deep-assign/deep-assign-tests.ts rename to types/deep-assign/deep-assign-tests.ts diff --git a/deep-assign/index.d.ts b/types/deep-assign/index.d.ts similarity index 100% rename from deep-assign/index.d.ts rename to types/deep-assign/index.d.ts diff --git a/deep-assign/tsconfig.json b/types/deep-assign/tsconfig.json similarity index 100% rename from deep-assign/tsconfig.json rename to types/deep-assign/tsconfig.json diff --git a/deep-diff/deep-diff-tests.ts b/types/deep-diff/deep-diff-tests.ts similarity index 100% rename from deep-diff/deep-diff-tests.ts rename to types/deep-diff/deep-diff-tests.ts diff --git a/deep-diff/index.d.ts b/types/deep-diff/index.d.ts similarity index 100% rename from deep-diff/index.d.ts rename to types/deep-diff/index.d.ts diff --git a/deep-diff/tsconfig.json b/types/deep-diff/tsconfig.json similarity index 100% rename from deep-diff/tsconfig.json rename to types/deep-diff/tsconfig.json diff --git a/deep-equal/deep-equal-tests.ts b/types/deep-equal/deep-equal-tests.ts similarity index 100% rename from deep-equal/deep-equal-tests.ts rename to types/deep-equal/deep-equal-tests.ts diff --git a/deep-equal/index.d.ts b/types/deep-equal/index.d.ts similarity index 100% rename from deep-equal/index.d.ts rename to types/deep-equal/index.d.ts diff --git a/deep-equal/tsconfig.json b/types/deep-equal/tsconfig.json similarity index 100% rename from deep-equal/tsconfig.json rename to types/deep-equal/tsconfig.json diff --git a/deep-equal/tslint.json b/types/deep-equal/tslint.json similarity index 100% rename from deep-equal/tslint.json rename to types/deep-equal/tslint.json diff --git a/deep-extend/deep-extend-tests.ts b/types/deep-extend/deep-extend-tests.ts similarity index 100% rename from deep-extend/deep-extend-tests.ts rename to types/deep-extend/deep-extend-tests.ts diff --git a/deep-extend/index.d.ts b/types/deep-extend/index.d.ts similarity index 100% rename from deep-extend/index.d.ts rename to types/deep-extend/index.d.ts diff --git a/deep-extend/tsconfig.json b/types/deep-extend/tsconfig.json similarity index 100% rename from deep-extend/tsconfig.json rename to types/deep-extend/tsconfig.json diff --git a/deep-freeze-strict/index.d.ts b/types/deep-freeze-strict/index.d.ts similarity index 100% rename from deep-freeze-strict/index.d.ts rename to types/deep-freeze-strict/index.d.ts diff --git a/deep-freeze-strict/tsconfig.json b/types/deep-freeze-strict/tsconfig.json similarity index 100% rename from deep-freeze-strict/tsconfig.json rename to types/deep-freeze-strict/tsconfig.json diff --git a/dockerode/tslint.json b/types/deep-freeze-strict/tslint.json similarity index 100% rename from dockerode/tslint.json rename to types/deep-freeze-strict/tslint.json diff --git a/deep-freeze/deep-freeze-tests.ts b/types/deep-freeze/deep-freeze-tests.ts similarity index 100% rename from deep-freeze/deep-freeze-tests.ts rename to types/deep-freeze/deep-freeze-tests.ts diff --git a/deep-freeze/index.d.ts b/types/deep-freeze/index.d.ts similarity index 100% rename from deep-freeze/index.d.ts rename to types/deep-freeze/index.d.ts diff --git a/deep-freeze/tsconfig.json b/types/deep-freeze/tsconfig.json similarity index 100% rename from deep-freeze/tsconfig.json rename to types/deep-freeze/tsconfig.json diff --git a/deepmerge/deepmerge-tests.ts b/types/deepmerge/deepmerge-tests.ts similarity index 100% rename from deepmerge/deepmerge-tests.ts rename to types/deepmerge/deepmerge-tests.ts diff --git a/deepmerge/index.d.ts b/types/deepmerge/index.d.ts similarity index 100% rename from deepmerge/index.d.ts rename to types/deepmerge/index.d.ts diff --git a/deepmerge/tsconfig.json b/types/deepmerge/tsconfig.json similarity index 100% rename from deepmerge/tsconfig.json rename to types/deepmerge/tsconfig.json diff --git a/dookie/tslint.json b/types/deepmerge/tslint.json similarity index 100% rename from dookie/tslint.json rename to types/deepmerge/tslint.json diff --git a/defaults/defaults-tests.ts b/types/defaults/defaults-tests.ts similarity index 100% rename from defaults/defaults-tests.ts rename to types/defaults/defaults-tests.ts diff --git a/defaults/index.d.ts b/types/defaults/index.d.ts similarity index 100% rename from defaults/index.d.ts rename to types/defaults/index.d.ts diff --git a/defaults/tsconfig.json b/types/defaults/tsconfig.json similarity index 100% rename from defaults/tsconfig.json rename to types/defaults/tsconfig.json diff --git a/deku/deku-tests.ts b/types/deku/deku-tests.ts similarity index 100% rename from deku/deku-tests.ts rename to types/deku/deku-tests.ts diff --git a/deku/index.d.ts b/types/deku/index.d.ts similarity index 100% rename from deku/index.d.ts rename to types/deku/index.d.ts diff --git a/deku/tsconfig.json b/types/deku/tsconfig.json similarity index 100% rename from deku/tsconfig.json rename to types/deku/tsconfig.json diff --git a/del/del-tests.ts b/types/del/del-tests.ts similarity index 100% rename from del/del-tests.ts rename to types/del/del-tests.ts diff --git a/del/index.d.ts b/types/del/index.d.ts similarity index 100% rename from del/index.d.ts rename to types/del/index.d.ts diff --git a/del/tsconfig.json b/types/del/tsconfig.json similarity index 100% rename from del/tsconfig.json rename to types/del/tsconfig.json diff --git a/dot/tslint.json b/types/del/tslint.json similarity index 100% rename from dot/tslint.json rename to types/del/tslint.json diff --git a/denodeify/denodeify-tests.ts b/types/denodeify/denodeify-tests.ts similarity index 100% rename from denodeify/denodeify-tests.ts rename to types/denodeify/denodeify-tests.ts diff --git a/denodeify/index.d.ts b/types/denodeify/index.d.ts similarity index 100% rename from denodeify/index.d.ts rename to types/denodeify/index.d.ts diff --git a/denodeify/tsconfig.json b/types/denodeify/tsconfig.json similarity index 100% rename from denodeify/tsconfig.json rename to types/denodeify/tsconfig.json diff --git a/deoxxa-content-type/deoxxa-content-type-tests.ts b/types/deoxxa-content-type/deoxxa-content-type-tests.ts similarity index 100% rename from deoxxa-content-type/deoxxa-content-type-tests.ts rename to types/deoxxa-content-type/deoxxa-content-type-tests.ts diff --git a/deoxxa-content-type/index.d.ts b/types/deoxxa-content-type/index.d.ts similarity index 100% rename from deoxxa-content-type/index.d.ts rename to types/deoxxa-content-type/index.d.ts diff --git a/deoxxa-content-type/tsconfig.json b/types/deoxxa-content-type/tsconfig.json similarity index 100% rename from deoxxa-content-type/tsconfig.json rename to types/deoxxa-content-type/tsconfig.json diff --git a/depd/depd-tests.ts b/types/depd/depd-tests.ts similarity index 100% rename from depd/depd-tests.ts rename to types/depd/depd-tests.ts diff --git a/depd/index.d.ts b/types/depd/index.d.ts similarity index 100% rename from depd/index.d.ts rename to types/depd/index.d.ts diff --git a/depd/tsconfig.json b/types/depd/tsconfig.json similarity index 100% rename from depd/tsconfig.json rename to types/depd/tsconfig.json diff --git a/deployjava/deployjava-tests.ts b/types/deployjava/deployjava-tests.ts similarity index 100% rename from deployjava/deployjava-tests.ts rename to types/deployjava/deployjava-tests.ts diff --git a/deployjava/index.d.ts b/types/deployjava/index.d.ts similarity index 100% rename from deployjava/index.d.ts rename to types/deployjava/index.d.ts diff --git a/deployjava/tsconfig.json b/types/deployjava/tsconfig.json similarity index 100% rename from deployjava/tsconfig.json rename to types/deployjava/tsconfig.json diff --git a/detect-browser/detect-browser-tests.ts b/types/detect-browser/detect-browser-tests.ts similarity index 100% rename from detect-browser/detect-browser-tests.ts rename to types/detect-browser/detect-browser-tests.ts diff --git a/detect-browser/index.d.ts b/types/detect-browser/index.d.ts similarity index 60% rename from detect-browser/index.d.ts rename to types/detect-browser/index.d.ts index 0f845cd781..57ed80c411 100644 --- a/detect-browser/index.d.ts +++ b/types/detect-browser/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for detect-browser v1.3.3 +// Type definitions for detect-browser v1.6.2 // Project: https://github.com/DamonOehlman/detect-browser // Definitions by: Rogier Schouten // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,7 +6,7 @@ /** * Browser name */ -export const name: string; +export const name: "edge" | "yandexbrowser" | "chrome" | "crios" | "firefox" | "opera" | "ie" | "bb10" | "android" | "ios" | "safari"; /** * Browser version diff --git a/detect-browser/tsconfig.json b/types/detect-browser/tsconfig.json similarity index 100% rename from detect-browser/tsconfig.json rename to types/detect-browser/tsconfig.json diff --git a/detect-indent/detect-indent-tests.ts b/types/detect-indent/detect-indent-tests.ts similarity index 100% rename from detect-indent/detect-indent-tests.ts rename to types/detect-indent/detect-indent-tests.ts diff --git a/detect-indent/index.d.ts b/types/detect-indent/index.d.ts similarity index 100% rename from detect-indent/index.d.ts rename to types/detect-indent/index.d.ts diff --git a/detect-indent/tsconfig.json b/types/detect-indent/tsconfig.json similarity index 100% rename from detect-indent/tsconfig.json rename to types/detect-indent/tsconfig.json diff --git a/devexpress-web/README.md b/types/devexpress-web/README.md similarity index 100% rename from devexpress-web/README.md rename to types/devexpress-web/README.md diff --git a/devexpress-web/devexpress-web-tests.ts b/types/devexpress-web/devexpress-web-tests.ts similarity index 100% rename from devexpress-web/devexpress-web-tests.ts rename to types/devexpress-web/devexpress-web-tests.ts diff --git a/devexpress-web/index.d.ts b/types/devexpress-web/index.d.ts similarity index 100% rename from devexpress-web/index.d.ts rename to types/devexpress-web/index.d.ts diff --git a/devexpress-web/tsconfig.json b/types/devexpress-web/tsconfig.json similarity index 100% rename from devexpress-web/tsconfig.json rename to types/devexpress-web/tsconfig.json diff --git a/devextreme/README.md b/types/devextreme/README.md similarity index 100% rename from devextreme/README.md rename to types/devextreme/README.md diff --git a/devextreme/devextreme-tests.ts b/types/devextreme/devextreme-tests.ts similarity index 100% rename from devextreme/devextreme-tests.ts rename to types/devextreme/devextreme-tests.ts diff --git a/devextreme/index.d.ts b/types/devextreme/index.d.ts similarity index 100% rename from devextreme/index.d.ts rename to types/devextreme/index.d.ts diff --git a/devextreme/tsconfig.json b/types/devextreme/tsconfig.json similarity index 100% rename from devextreme/tsconfig.json rename to types/devextreme/tsconfig.json diff --git a/devextreme/v15/devextreme-tests.ts b/types/devextreme/v15/devextreme-tests.ts similarity index 100% rename from devextreme/v15/devextreme-tests.ts rename to types/devextreme/v15/devextreme-tests.ts diff --git a/devextreme/v15/index.d.ts b/types/devextreme/v15/index.d.ts similarity index 100% rename from devextreme/v15/index.d.ts rename to types/devextreme/v15/index.d.ts diff --git a/devextreme/v15/tsconfig.json b/types/devextreme/v15/tsconfig.json similarity index 100% rename from devextreme/v15/tsconfig.json rename to types/devextreme/v15/tsconfig.json diff --git a/devtools-detect/devtools-detect-tests.ts b/types/devtools-detect/devtools-detect-tests.ts similarity index 100% rename from devtools-detect/devtools-detect-tests.ts rename to types/devtools-detect/devtools-detect-tests.ts diff --git a/devtools-detect/index.d.ts b/types/devtools-detect/index.d.ts similarity index 100% rename from devtools-detect/index.d.ts rename to types/devtools-detect/index.d.ts diff --git a/devtools-detect/tsconfig.json b/types/devtools-detect/tsconfig.json similarity index 100% rename from devtools-detect/tsconfig.json rename to types/devtools-detect/tsconfig.json diff --git a/df-visible/df-visible-tests.ts b/types/df-visible/df-visible-tests.ts similarity index 100% rename from df-visible/df-visible-tests.ts rename to types/df-visible/df-visible-tests.ts diff --git a/df-visible/index.d.ts b/types/df-visible/index.d.ts similarity index 100% rename from df-visible/index.d.ts rename to types/df-visible/index.d.ts diff --git a/df-visible/tsconfig.json b/types/df-visible/tsconfig.json similarity index 100% rename from df-visible/tsconfig.json rename to types/df-visible/tsconfig.json diff --git a/dhtmlxgantt/dhtmlxgantt-tests.ts b/types/dhtmlxgantt/dhtmlxgantt-tests.ts similarity index 100% rename from dhtmlxgantt/dhtmlxgantt-tests.ts rename to types/dhtmlxgantt/dhtmlxgantt-tests.ts diff --git a/dhtmlxgantt/index.d.ts b/types/dhtmlxgantt/index.d.ts similarity index 100% rename from dhtmlxgantt/index.d.ts rename to types/dhtmlxgantt/index.d.ts diff --git a/dhtmlxgantt/tsconfig.json b/types/dhtmlxgantt/tsconfig.json similarity index 100% rename from dhtmlxgantt/tsconfig.json rename to types/dhtmlxgantt/tsconfig.json diff --git a/dhtmlxscheduler/dhtmlxscheduler-tests.ts b/types/dhtmlxscheduler/dhtmlxscheduler-tests.ts similarity index 100% rename from dhtmlxscheduler/dhtmlxscheduler-tests.ts rename to types/dhtmlxscheduler/dhtmlxscheduler-tests.ts diff --git a/dhtmlxscheduler/index.d.ts b/types/dhtmlxscheduler/index.d.ts similarity index 100% rename from dhtmlxscheduler/index.d.ts rename to types/dhtmlxscheduler/index.d.ts diff --git a/dhtmlxscheduler/tsconfig.json b/types/dhtmlxscheduler/tsconfig.json similarity index 100% rename from dhtmlxscheduler/tsconfig.json rename to types/dhtmlxscheduler/tsconfig.json diff --git a/di-lite/di-lite-tests.ts b/types/di-lite/di-lite-tests.ts similarity index 100% rename from di-lite/di-lite-tests.ts rename to types/di-lite/di-lite-tests.ts diff --git a/di-lite/index.d.ts b/types/di-lite/index.d.ts similarity index 100% rename from di-lite/index.d.ts rename to types/di-lite/index.d.ts diff --git a/di-lite/tsconfig.json b/types/di-lite/tsconfig.json similarity index 100% rename from di-lite/tsconfig.json rename to types/di-lite/tsconfig.json diff --git a/diff-match-patch/diff-match-patch-tests.ts b/types/diff-match-patch/diff-match-patch-tests.ts similarity index 100% rename from diff-match-patch/diff-match-patch-tests.ts rename to types/diff-match-patch/diff-match-patch-tests.ts diff --git a/diff-match-patch/index.d.ts b/types/diff-match-patch/index.d.ts similarity index 100% rename from diff-match-patch/index.d.ts rename to types/diff-match-patch/index.d.ts diff --git a/diff-match-patch/tsconfig.json b/types/diff-match-patch/tsconfig.json similarity index 100% rename from diff-match-patch/tsconfig.json rename to types/diff-match-patch/tsconfig.json diff --git a/diff/diff-tests.ts b/types/diff/diff-tests.ts similarity index 100% rename from diff/diff-tests.ts rename to types/diff/diff-tests.ts diff --git a/diff/index.d.ts b/types/diff/index.d.ts similarity index 100% rename from diff/index.d.ts rename to types/diff/index.d.ts diff --git a/diff/tsconfig.json b/types/diff/tsconfig.json similarity index 100% rename from diff/tsconfig.json rename to types/diff/tsconfig.json diff --git a/diff2html/diff2html-tests.ts b/types/diff2html/diff2html-tests.ts similarity index 100% rename from diff2html/diff2html-tests.ts rename to types/diff2html/diff2html-tests.ts diff --git a/diff2html/index.d.ts b/types/diff2html/index.d.ts similarity index 100% rename from diff2html/index.d.ts rename to types/diff2html/index.d.ts diff --git a/diff2html/tsconfig.json b/types/diff2html/tsconfig.json similarity index 100% rename from diff2html/tsconfig.json rename to types/diff2html/tsconfig.json diff --git a/types/dir-resolve/dir-resolve-tests.ts b/types/dir-resolve/dir-resolve-tests.ts new file mode 100644 index 0000000000..d84f9d0efc --- /dev/null +++ b/types/dir-resolve/dir-resolve-tests.ts @@ -0,0 +1,3 @@ +import resolve = require("dir-resolve"); + +resolve("module/package"); diff --git a/types/dir-resolve/index.d.ts b/types/dir-resolve/index.d.ts new file mode 100644 index 0000000000..0b8f425b0b --- /dev/null +++ b/types/dir-resolve/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for dir-resolve 1.0 +// Project: https://github.com/mwinche/dir-resolve +// Definitions by: Andy Hanson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function resolve(path: string): string; +export = resolve; diff --git a/gulp-cache/tsconfig.json b/types/dir-resolve/tsconfig.json similarity index 93% rename from gulp-cache/tsconfig.json rename to types/dir-resolve/tsconfig.json index 3126e1ef38..1748792b1d 100644 --- a/gulp-cache/tsconfig.json +++ b/types/dir-resolve/tsconfig.json @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "gulp-cache-tests.ts" + "dir-resolve-tests.ts" ] } \ No newline at end of file diff --git a/dotenv/tslint.json b/types/dir-resolve/tslint.json similarity index 100% rename from dotenv/tslint.json rename to types/dir-resolve/tslint.json diff --git a/discontinuous-range/discontinuous-range-tests.ts b/types/discontinuous-range/discontinuous-range-tests.ts similarity index 100% rename from discontinuous-range/discontinuous-range-tests.ts rename to types/discontinuous-range/discontinuous-range-tests.ts diff --git a/discontinuous-range/index.d.ts b/types/discontinuous-range/index.d.ts similarity index 100% rename from discontinuous-range/index.d.ts rename to types/discontinuous-range/index.d.ts diff --git a/discontinuous-range/tsconfig.json b/types/discontinuous-range/tsconfig.json similarity index 100% rename from discontinuous-range/tsconfig.json rename to types/discontinuous-range/tsconfig.json diff --git a/dragster/tslint.json b/types/discontinuous-range/tslint.json similarity index 100% rename from dragster/tslint.json rename to types/discontinuous-range/tslint.json diff --git a/disposable-email-domains/disposable-email-domains-tests.ts b/types/disposable-email-domains/disposable-email-domains-tests.ts similarity index 100% rename from disposable-email-domains/disposable-email-domains-tests.ts rename to types/disposable-email-domains/disposable-email-domains-tests.ts diff --git a/disposable-email-domains/index.d.ts b/types/disposable-email-domains/index.d.ts similarity index 100% rename from disposable-email-domains/index.d.ts rename to types/disposable-email-domains/index.d.ts diff --git a/disposable-email-domains/tsconfig.json b/types/disposable-email-domains/tsconfig.json similarity index 100% rename from disposable-email-domains/tsconfig.json rename to types/disposable-email-domains/tsconfig.json diff --git a/doccookies/doccookies-tests.ts b/types/doccookies/doccookies-tests.ts similarity index 100% rename from doccookies/doccookies-tests.ts rename to types/doccookies/doccookies-tests.ts diff --git a/doccookies/index.d.ts b/types/doccookies/index.d.ts similarity index 100% rename from doccookies/index.d.ts rename to types/doccookies/index.d.ts diff --git a/doccookies/tsconfig.json b/types/doccookies/tsconfig.json similarity index 100% rename from doccookies/tsconfig.json rename to types/doccookies/tsconfig.json diff --git a/dock-spawn/dock-spawn-tests.ts b/types/dock-spawn/dock-spawn-tests.ts similarity index 100% rename from dock-spawn/dock-spawn-tests.ts rename to types/dock-spawn/dock-spawn-tests.ts diff --git a/dock-spawn/index.d.ts b/types/dock-spawn/index.d.ts similarity index 100% rename from dock-spawn/index.d.ts rename to types/dock-spawn/index.d.ts diff --git a/dock-spawn/tsconfig.json b/types/dock-spawn/tsconfig.json similarity index 100% rename from dock-spawn/tsconfig.json rename to types/dock-spawn/tsconfig.json diff --git a/dockerode/dockerode-tests.ts b/types/dockerode/dockerode-tests.ts similarity index 100% rename from dockerode/dockerode-tests.ts rename to types/dockerode/dockerode-tests.ts diff --git a/dockerode/index.d.ts b/types/dockerode/index.d.ts similarity index 100% rename from dockerode/index.d.ts rename to types/dockerode/index.d.ts diff --git a/dockerode/tsconfig.json b/types/dockerode/tsconfig.json similarity index 100% rename from dockerode/tsconfig.json rename to types/dockerode/tsconfig.json diff --git a/dropkickjs/tslint.json b/types/dockerode/tslint.json similarity index 100% rename from dropkickjs/tslint.json rename to types/dockerode/tslint.json diff --git a/docopt/docopt-tests.ts b/types/docopt/docopt-tests.ts similarity index 100% rename from docopt/docopt-tests.ts rename to types/docopt/docopt-tests.ts diff --git a/docopt/index.d.ts b/types/docopt/index.d.ts similarity index 100% rename from docopt/index.d.ts rename to types/docopt/index.d.ts diff --git a/docopt/tsconfig.json b/types/docopt/tsconfig.json similarity index 100% rename from docopt/tsconfig.json rename to types/docopt/tsconfig.json diff --git a/doctrine/doctrine-tests.ts b/types/doctrine/doctrine-tests.ts similarity index 100% rename from doctrine/doctrine-tests.ts rename to types/doctrine/doctrine-tests.ts diff --git a/doctrine/index.d.ts b/types/doctrine/index.d.ts similarity index 100% rename from doctrine/index.d.ts rename to types/doctrine/index.d.ts diff --git a/doctrine/tsconfig.json b/types/doctrine/tsconfig.json similarity index 100% rename from doctrine/tsconfig.json rename to types/doctrine/tsconfig.json diff --git a/documentdb-server/documentdb-server-tests.ts b/types/documentdb-server/documentdb-server-tests.ts similarity index 100% rename from documentdb-server/documentdb-server-tests.ts rename to types/documentdb-server/documentdb-server-tests.ts diff --git a/documentdb-server/index.d.ts b/types/documentdb-server/index.d.ts similarity index 100% rename from documentdb-server/index.d.ts rename to types/documentdb-server/index.d.ts diff --git a/documentdb-server/tsconfig.json b/types/documentdb-server/tsconfig.json similarity index 100% rename from documentdb-server/tsconfig.json rename to types/documentdb-server/tsconfig.json diff --git a/documentdb/documentdb-tests.ts b/types/documentdb/documentdb-tests.ts similarity index 100% rename from documentdb/documentdb-tests.ts rename to types/documentdb/documentdb-tests.ts diff --git a/documentdb/index.d.ts b/types/documentdb/index.d.ts similarity index 100% rename from documentdb/index.d.ts rename to types/documentdb/index.d.ts diff --git a/documentdb/tsconfig.json b/types/documentdb/tsconfig.json similarity index 100% rename from documentdb/tsconfig.json rename to types/documentdb/tsconfig.json diff --git a/dojo/README.md b/types/dojo/README.md similarity index 100% rename from dojo/README.md rename to types/dojo/README.md diff --git a/dojo/dijit.d.ts b/types/dojo/dijit.d.ts similarity index 100% rename from dojo/dijit.d.ts rename to types/dojo/dijit.d.ts diff --git a/dojo/doh.d.ts b/types/dojo/doh.d.ts similarity index 100% rename from dojo/doh.d.ts rename to types/dojo/doh.d.ts diff --git a/dojo/dojox.NodeList.d.ts b/types/dojo/dojox.NodeList.d.ts similarity index 100% rename from dojo/dojox.NodeList.d.ts rename to types/dojo/dojox.NodeList.d.ts diff --git a/dojo/dojox.analytics.d.ts b/types/dojo/dojox.analytics.d.ts similarity index 100% rename from dojo/dojox.analytics.d.ts rename to types/dojo/dojox.analytics.d.ts diff --git a/dojo/dojox.app.d.ts b/types/dojo/dojox.app.d.ts similarity index 100% rename from dojo/dojox.app.d.ts rename to types/dojo/dojox.app.d.ts diff --git a/dojo/dojox.atom.d.ts b/types/dojo/dojox.atom.d.ts similarity index 100% rename from dojo/dojox.atom.d.ts rename to types/dojo/dojox.atom.d.ts diff --git a/dojo/dojox.av.d.ts b/types/dojo/dojox.av.d.ts similarity index 100% rename from dojo/dojox.av.d.ts rename to types/dojo/dojox.av.d.ts diff --git a/dojo/dojox.calc.d.ts b/types/dojo/dojox.calc.d.ts similarity index 100% rename from dojo/dojox.calc.d.ts rename to types/dojo/dojox.calc.d.ts diff --git a/dojo/dojox.calendar.d.ts b/types/dojo/dojox.calendar.d.ts similarity index 100% rename from dojo/dojox.calendar.d.ts rename to types/dojo/dojox.calendar.d.ts diff --git a/dojo/dojox.charting.d.ts b/types/dojo/dojox.charting.d.ts similarity index 100% rename from dojo/dojox.charting.d.ts rename to types/dojo/dojox.charting.d.ts diff --git a/dojo/dojox.collections.d.ts b/types/dojo/dojox.collections.d.ts similarity index 100% rename from dojo/dojox.collections.d.ts rename to types/dojo/dojox.collections.d.ts diff --git a/dojo/dojox.color.d.ts b/types/dojo/dojox.color.d.ts similarity index 100% rename from dojo/dojox.color.d.ts rename to types/dojo/dojox.color.d.ts diff --git a/dojo/dojox.css3.d.ts b/types/dojo/dojox.css3.d.ts similarity index 100% rename from dojo/dojox.css3.d.ts rename to types/dojo/dojox.css3.d.ts diff --git a/dojo/dojox.data.d.ts b/types/dojo/dojox.data.d.ts similarity index 100% rename from dojo/dojox.data.d.ts rename to types/dojo/dojox.data.d.ts diff --git a/dojo/dojox.date.d.ts b/types/dojo/dojox.date.d.ts similarity index 100% rename from dojo/dojox.date.d.ts rename to types/dojo/dojox.date.d.ts diff --git a/dojo/dojox.dgauges.d.ts b/types/dojo/dojox.dgauges.d.ts similarity index 100% rename from dojo/dojox.dgauges.d.ts rename to types/dojo/dojox.dgauges.d.ts diff --git a/dojo/dojox.dnd.d.ts b/types/dojo/dojox.dnd.d.ts similarity index 100% rename from dojo/dojox.dnd.d.ts rename to types/dojo/dojox.dnd.d.ts diff --git a/dojo/dojox.drawing.d.ts b/types/dojo/dojox.drawing.d.ts similarity index 100% rename from dojo/dojox.drawing.d.ts rename to types/dojo/dojox.drawing.d.ts diff --git a/dojo/dojox.dtl.d.ts b/types/dojo/dojox.dtl.d.ts similarity index 100% rename from dojo/dojox.dtl.d.ts rename to types/dojo/dojox.dtl.d.ts diff --git a/dojo/dojox.editor.d.ts b/types/dojo/dojox.editor.d.ts similarity index 100% rename from dojo/dojox.editor.d.ts rename to types/dojo/dojox.editor.d.ts diff --git a/dojo/dojox.embed.d.ts b/types/dojo/dojox.embed.d.ts similarity index 100% rename from dojo/dojox.embed.d.ts rename to types/dojo/dojox.embed.d.ts diff --git a/dojo/dojox.encoding.d.ts b/types/dojo/dojox.encoding.d.ts similarity index 100% rename from dojo/dojox.encoding.d.ts rename to types/dojo/dojox.encoding.d.ts diff --git a/dojo/dojox.flash.d.ts b/types/dojo/dojox.flash.d.ts similarity index 100% rename from dojo/dojox.flash.d.ts rename to types/dojo/dojox.flash.d.ts diff --git a/dojo/dojox.form.d.ts b/types/dojo/dojox.form.d.ts similarity index 100% rename from dojo/dojox.form.d.ts rename to types/dojo/dojox.form.d.ts diff --git a/dojo/dojox.fx.d.ts b/types/dojo/dojox.fx.d.ts similarity index 100% rename from dojo/dojox.fx.d.ts rename to types/dojo/dojox.fx.d.ts diff --git a/dojo/dojox.gantt.d.ts b/types/dojo/dojox.gantt.d.ts similarity index 100% rename from dojo/dojox.gantt.d.ts rename to types/dojo/dojox.gantt.d.ts diff --git a/dojo/dojox.gauges.d.ts b/types/dojo/dojox.gauges.d.ts similarity index 100% rename from dojo/dojox.gauges.d.ts rename to types/dojo/dojox.gauges.d.ts diff --git a/dojo/dojox.geo.d.ts b/types/dojo/dojox.geo.d.ts similarity index 100% rename from dojo/dojox.geo.d.ts rename to types/dojo/dojox.geo.d.ts diff --git a/dojo/dojox.gesture.d.ts b/types/dojo/dojox.gesture.d.ts similarity index 100% rename from dojo/dojox.gesture.d.ts rename to types/dojo/dojox.gesture.d.ts diff --git a/dojo/dojox.gfx.d.ts b/types/dojo/dojox.gfx.d.ts similarity index 100% rename from dojo/dojox.gfx.d.ts rename to types/dojo/dojox.gfx.d.ts diff --git a/dojo/dojox.gfx3d.d.ts b/types/dojo/dojox.gfx3d.d.ts similarity index 100% rename from dojo/dojox.gfx3d.d.ts rename to types/dojo/dojox.gfx3d.d.ts diff --git a/dojo/dojox.grid.d.ts b/types/dojo/dojox.grid.d.ts similarity index 100% rename from dojo/dojox.grid.d.ts rename to types/dojo/dojox.grid.d.ts diff --git a/dojo/dojox.help.d.ts b/types/dojo/dojox.help.d.ts similarity index 100% rename from dojo/dojox.help.d.ts rename to types/dojo/dojox.help.d.ts diff --git a/dojo/dojox.highlight.d.ts b/types/dojo/dojox.highlight.d.ts similarity index 100% rename from dojo/dojox.highlight.d.ts rename to types/dojo/dojox.highlight.d.ts diff --git a/dojo/dojox.html.d.ts b/types/dojo/dojox.html.d.ts similarity index 100% rename from dojo/dojox.html.d.ts rename to types/dojo/dojox.html.d.ts diff --git a/dojo/dojox.image.d.ts b/types/dojo/dojox.image.d.ts similarity index 100% rename from dojo/dojox.image.d.ts rename to types/dojo/dojox.image.d.ts diff --git a/dojo/dojox.io.d.ts b/types/dojo/dojox.io.d.ts similarity index 100% rename from dojo/dojox.io.d.ts rename to types/dojo/dojox.io.d.ts diff --git a/dojo/dojox.jq.d.ts b/types/dojo/dojox.jq.d.ts similarity index 100% rename from dojo/dojox.jq.d.ts rename to types/dojo/dojox.jq.d.ts diff --git a/dojo/dojox.json.d.ts b/types/dojo/dojox.json.d.ts similarity index 100% rename from dojo/dojox.json.d.ts rename to types/dojo/dojox.json.d.ts diff --git a/dojo/dojox.jsonPath.d.ts b/types/dojo/dojox.jsonPath.d.ts similarity index 100% rename from dojo/dojox.jsonPath.d.ts rename to types/dojo/dojox.jsonPath.d.ts diff --git a/dojo/dojox.lang.d.ts b/types/dojo/dojox.lang.d.ts similarity index 100% rename from dojo/dojox.lang.d.ts rename to types/dojo/dojox.lang.d.ts diff --git a/dojo/dojox.layout.d.ts b/types/dojo/dojox.layout.d.ts similarity index 100% rename from dojo/dojox.layout.d.ts rename to types/dojo/dojox.layout.d.ts diff --git a/dojo/dojox.main.d.ts b/types/dojo/dojox.main.d.ts similarity index 100% rename from dojo/dojox.main.d.ts rename to types/dojo/dojox.main.d.ts diff --git a/dojo/dojox.math.d.ts b/types/dojo/dojox.math.d.ts similarity index 100% rename from dojo/dojox.math.d.ts rename to types/dojo/dojox.math.d.ts diff --git a/dojo/dojox.mdnd.d.ts b/types/dojo/dojox.mdnd.d.ts similarity index 100% rename from dojo/dojox.mdnd.d.ts rename to types/dojo/dojox.mdnd.d.ts diff --git a/dojo/dojox.mobile.d.ts b/types/dojo/dojox.mobile.d.ts similarity index 100% rename from dojo/dojox.mobile.d.ts rename to types/dojo/dojox.mobile.d.ts diff --git a/dojo/dojox.mvc.d.ts b/types/dojo/dojox.mvc.d.ts similarity index 100% rename from dojo/dojox.mvc.d.ts rename to types/dojo/dojox.mvc.d.ts diff --git a/dojo/dojox.rails.d.ts b/types/dojo/dojox.rails.d.ts similarity index 100% rename from dojo/dojox.rails.d.ts rename to types/dojo/dojox.rails.d.ts diff --git a/dojo/dojox.robot.d.ts b/types/dojo/dojox.robot.d.ts similarity index 100% rename from dojo/dojox.robot.d.ts rename to types/dojo/dojox.robot.d.ts diff --git a/dojo/dojox.rpc.d.ts b/types/dojo/dojox.rpc.d.ts similarity index 100% rename from dojo/dojox.rpc.d.ts rename to types/dojo/dojox.rpc.d.ts diff --git a/dojo/dojox.secure.d.ts b/types/dojo/dojox.secure.d.ts similarity index 100% rename from dojo/dojox.secure.d.ts rename to types/dojo/dojox.secure.d.ts diff --git a/dojo/dojox.sketch.d.ts b/types/dojo/dojox.sketch.d.ts similarity index 100% rename from dojo/dojox.sketch.d.ts rename to types/dojo/dojox.sketch.d.ts diff --git a/dojo/dojox.socket.d.ts b/types/dojo/dojox.socket.d.ts similarity index 100% rename from dojo/dojox.socket.d.ts rename to types/dojo/dojox.socket.d.ts diff --git a/dojo/dojox.sql.d.ts b/types/dojo/dojox.sql.d.ts similarity index 100% rename from dojo/dojox.sql.d.ts rename to types/dojo/dojox.sql.d.ts diff --git a/dojo/dojox.storage.d.ts b/types/dojo/dojox.storage.d.ts similarity index 100% rename from dojo/dojox.storage.d.ts rename to types/dojo/dojox.storage.d.ts diff --git a/dojo/dojox.string.d.ts b/types/dojo/dojox.string.d.ts similarity index 100% rename from dojo/dojox.string.d.ts rename to types/dojo/dojox.string.d.ts diff --git a/dojo/dojox.testing.d.ts b/types/dojo/dojox.testing.d.ts similarity index 100% rename from dojo/dojox.testing.d.ts rename to types/dojo/dojox.testing.d.ts diff --git a/dojo/dojox.timing.d.ts b/types/dojo/dojox.timing.d.ts similarity index 100% rename from dojo/dojox.timing.d.ts rename to types/dojo/dojox.timing.d.ts diff --git a/dojo/dojox.treemap.d.ts b/types/dojo/dojox.treemap.d.ts similarity index 100% rename from dojo/dojox.treemap.d.ts rename to types/dojo/dojox.treemap.d.ts diff --git a/dojo/dojox.uuid.d.ts b/types/dojo/dojox.uuid.d.ts similarity index 100% rename from dojo/dojox.uuid.d.ts rename to types/dojo/dojox.uuid.d.ts diff --git a/dojo/dojox.validate.d.ts b/types/dojo/dojox.validate.d.ts similarity index 100% rename from dojo/dojox.validate.d.ts rename to types/dojo/dojox.validate.d.ts diff --git a/dojo/dojox.widget.d.ts b/types/dojo/dojox.widget.d.ts similarity index 100% rename from dojo/dojox.widget.d.ts rename to types/dojo/dojox.widget.d.ts diff --git a/dojo/dojox.xml.d.ts b/types/dojo/dojox.xml.d.ts similarity index 100% rename from dojo/dojox.xml.d.ts rename to types/dojo/dojox.xml.d.ts diff --git a/dojo/index.d.ts b/types/dojo/index.d.ts similarity index 100% rename from dojo/index.d.ts rename to types/dojo/index.d.ts diff --git a/dojo/tsconfig.json b/types/dojo/tsconfig.json similarity index 100% rename from dojo/tsconfig.json rename to types/dojo/tsconfig.json diff --git a/dom4/dom4-tests.ts b/types/dom4/dom4-tests.ts similarity index 100% rename from dom4/dom4-tests.ts rename to types/dom4/dom4-tests.ts diff --git a/dom4/index.d.ts b/types/dom4/index.d.ts similarity index 100% rename from dom4/index.d.ts rename to types/dom4/index.d.ts diff --git a/dom4/tsconfig.json b/types/dom4/tsconfig.json similarity index 100% rename from dom4/tsconfig.json rename to types/dom4/tsconfig.json diff --git a/domo/domo-tests.ts b/types/domo/domo-tests.ts similarity index 100% rename from domo/domo-tests.ts rename to types/domo/domo-tests.ts diff --git a/domo/index.d.ts b/types/domo/index.d.ts similarity index 100% rename from domo/index.d.ts rename to types/domo/index.d.ts diff --git a/domo/tsconfig.json b/types/domo/tsconfig.json similarity index 100% rename from domo/tsconfig.json rename to types/domo/tsconfig.json diff --git a/dompurify/dompurify-tests.ts b/types/dompurify/dompurify-tests.ts similarity index 100% rename from dompurify/dompurify-tests.ts rename to types/dompurify/dompurify-tests.ts diff --git a/dompurify/index.d.ts b/types/dompurify/index.d.ts similarity index 100% rename from dompurify/index.d.ts rename to types/dompurify/index.d.ts diff --git a/dompurify/tsconfig.json b/types/dompurify/tsconfig.json similarity index 100% rename from dompurify/tsconfig.json rename to types/dompurify/tsconfig.json diff --git a/domready/domready-tests.ts b/types/domready/domready-tests.ts similarity index 100% rename from domready/domready-tests.ts rename to types/domready/domready-tests.ts diff --git a/domready/index.d.ts b/types/domready/index.d.ts similarity index 100% rename from domready/index.d.ts rename to types/domready/index.d.ts diff --git a/domready/tsconfig.json b/types/domready/tsconfig.json similarity index 100% rename from domready/tsconfig.json rename to types/domready/tsconfig.json diff --git a/domurl/domurl-tests.ts b/types/domurl/domurl-tests.ts similarity index 100% rename from domurl/domurl-tests.ts rename to types/domurl/domurl-tests.ts diff --git a/domurl/index.d.ts b/types/domurl/index.d.ts similarity index 100% rename from domurl/index.d.ts rename to types/domurl/index.d.ts diff --git a/domurl/tsconfig.json b/types/domurl/tsconfig.json similarity index 100% rename from domurl/tsconfig.json rename to types/domurl/tsconfig.json diff --git a/donna/donna-tests.ts b/types/donna/donna-tests.ts similarity index 100% rename from donna/donna-tests.ts rename to types/donna/donna-tests.ts diff --git a/donna/index.d.ts b/types/donna/index.d.ts similarity index 100% rename from donna/index.d.ts rename to types/donna/index.d.ts diff --git a/donna/tsconfig.json b/types/donna/tsconfig.json similarity index 100% rename from donna/tsconfig.json rename to types/donna/tsconfig.json diff --git a/dookie/dookie-tests.ts b/types/dookie/dookie-tests.ts similarity index 71% rename from dookie/dookie-tests.ts rename to types/dookie/dookie-tests.ts index 44cd6ec7ac..476538b8de 100644 --- a/dookie/dookie-tests.ts +++ b/types/dookie/dookie-tests.ts @@ -1,8 +1,5 @@ - -import {push, pull} from './index'; +import {push, pull} from 'dookie'; (async () => { - await push('mongodb://localhost:27017/test', {test: [{ok: 1}, {ok: 2}]}); - })(); diff --git a/dookie/index.d.ts b/types/dookie/index.d.ts similarity index 100% rename from dookie/index.d.ts rename to types/dookie/index.d.ts diff --git a/dookie/tsconfig.json b/types/dookie/tsconfig.json similarity index 100% rename from dookie/tsconfig.json rename to types/dookie/tsconfig.json diff --git a/duplexer2/tslint.json b/types/dookie/tslint.json similarity index 100% rename from duplexer2/tslint.json rename to types/dookie/tslint.json diff --git a/dot-object/dot-object-tests.ts b/types/dot-object/dot-object-tests.ts similarity index 100% rename from dot-object/dot-object-tests.ts rename to types/dot-object/dot-object-tests.ts diff --git a/dot-object/index.d.ts b/types/dot-object/index.d.ts similarity index 100% rename from dot-object/index.d.ts rename to types/dot-object/index.d.ts diff --git a/dot-object/tsconfig.json b/types/dot-object/tsconfig.json similarity index 100% rename from dot-object/tsconfig.json rename to types/dot-object/tsconfig.json diff --git a/dot-prop/dot-prop-tests.ts b/types/dot-prop/dot-prop-tests.ts similarity index 100% rename from dot-prop/dot-prop-tests.ts rename to types/dot-prop/dot-prop-tests.ts diff --git a/dot-prop/index.d.ts b/types/dot-prop/index.d.ts similarity index 100% rename from dot-prop/index.d.ts rename to types/dot-prop/index.d.ts diff --git a/dot-prop/tsconfig.json b/types/dot-prop/tsconfig.json similarity index 100% rename from dot-prop/tsconfig.json rename to types/dot-prop/tsconfig.json diff --git a/dot/dot-tests.ts b/types/dot/dot-tests.ts similarity index 100% rename from dot/dot-tests.ts rename to types/dot/dot-tests.ts diff --git a/dot/index.d.ts b/types/dot/index.d.ts similarity index 100% rename from dot/index.d.ts rename to types/dot/index.d.ts diff --git a/dot/tsconfig.json b/types/dot/tsconfig.json similarity index 100% rename from dot/tsconfig.json rename to types/dot/tsconfig.json diff --git a/ecurve/tslint.json b/types/dot/tslint.json similarity index 100% rename from ecurve/tslint.json rename to types/dot/tslint.json diff --git a/dotdotdot/dotdotdot-tests.ts b/types/dotdotdot/dotdotdot-tests.ts similarity index 100% rename from dotdotdot/dotdotdot-tests.ts rename to types/dotdotdot/dotdotdot-tests.ts diff --git a/dotdotdot/index.d.ts b/types/dotdotdot/index.d.ts similarity index 100% rename from dotdotdot/index.d.ts rename to types/dotdotdot/index.d.ts diff --git a/dotdotdot/tsconfig.json b/types/dotdotdot/tsconfig.json similarity index 100% rename from dotdotdot/tsconfig.json rename to types/dotdotdot/tsconfig.json diff --git a/dotenv/dotenv-tests.ts b/types/dotenv/dotenv-tests.ts similarity index 100% rename from dotenv/dotenv-tests.ts rename to types/dotenv/dotenv-tests.ts diff --git a/dotenv/index.d.ts b/types/dotenv/index.d.ts similarity index 100% rename from dotenv/index.d.ts rename to types/dotenv/index.d.ts diff --git a/dotenv/tsconfig.json b/types/dotenv/tsconfig.json similarity index 100% rename from dotenv/tsconfig.json rename to types/dotenv/tsconfig.json diff --git a/emojione/tslint.json b/types/dotenv/tslint.json similarity index 100% rename from emojione/tslint.json rename to types/dotenv/tslint.json diff --git a/doublearray/doublearray-tests.ts b/types/doublearray/doublearray-tests.ts similarity index 100% rename from doublearray/doublearray-tests.ts rename to types/doublearray/doublearray-tests.ts diff --git a/doublearray/index.d.ts b/types/doublearray/index.d.ts similarity index 100% rename from doublearray/index.d.ts rename to types/doublearray/index.d.ts diff --git a/doublearray/tsconfig.json b/types/doublearray/tsconfig.json similarity index 100% rename from doublearray/tsconfig.json rename to types/doublearray/tsconfig.json diff --git a/doubleclick-gpt/doubleclick-gpt-tests.ts b/types/doubleclick-gpt/doubleclick-gpt-tests.ts similarity index 100% rename from doubleclick-gpt/doubleclick-gpt-tests.ts rename to types/doubleclick-gpt/doubleclick-gpt-tests.ts diff --git a/doubleclick-gpt/index.d.ts b/types/doubleclick-gpt/index.d.ts similarity index 100% rename from doubleclick-gpt/index.d.ts rename to types/doubleclick-gpt/index.d.ts diff --git a/doubleclick-gpt/tsconfig.json b/types/doubleclick-gpt/tsconfig.json similarity index 100% rename from doubleclick-gpt/tsconfig.json rename to types/doubleclick-gpt/tsconfig.json diff --git a/draft-js/draft-js-tests.tsx b/types/draft-js/draft-js-tests.tsx similarity index 100% rename from draft-js/draft-js-tests.tsx rename to types/draft-js/draft-js-tests.tsx diff --git a/draft-js/index.d.ts b/types/draft-js/index.d.ts similarity index 98% rename from draft-js/index.d.ts rename to types/draft-js/index.d.ts index 1805a17ab0..a79de31e70 100644 --- a/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Draft.js v0.9.0 +// Type definitions for Draft.js v0.10.0 // Project: https://facebook.github.io/draft-js/ // Definitions by: Dmitry Rogozhny , Eelco Lempsink // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -357,7 +357,7 @@ declare namespace Draft { * - "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; + strategy: (block: ContentBlock, callback: (start: number, end: number) => void, contentState: ContentState) => void; component: Function; props?: Object; } @@ -564,6 +564,9 @@ declare namespace Draft { import DraftBlockType = Draft.Model.Constants.DraftBlockType; import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType; + import DraftEntityType = Draft.Model.Entity.DraftEntityType; + import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability; + type DraftInlineStyle = Immutable.OrderedSet; type BlockMap = Immutable.OrderedMap; @@ -701,6 +704,10 @@ declare namespace Draft { static createFromBlockArray(blocks: Array): ContentState; static createFromText(text: string, delimiter?: string): ContentState; + createEntity(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): ContentState; + getEntity(key: string): EntityInstance; + getLastCreatedEntityKey(): string; + getBlockMap(): BlockMap; getSelectionBefore(): SelectionState; getSelectionAfter(): SelectionState; diff --git a/draft-js/package.json b/types/draft-js/package.json similarity index 100% rename from draft-js/package.json rename to types/draft-js/package.json diff --git a/draft-js/tsconfig.json b/types/draft-js/tsconfig.json similarity index 100% rename from draft-js/tsconfig.json rename to types/draft-js/tsconfig.json diff --git a/dragster/dragster-tests.ts b/types/dragster/dragster-tests.ts similarity index 100% rename from dragster/dragster-tests.ts rename to types/dragster/dragster-tests.ts diff --git a/dragster/index.d.ts b/types/dragster/index.d.ts similarity index 100% rename from dragster/index.d.ts rename to types/dragster/index.d.ts diff --git a/dragster/tsconfig.json b/types/dragster/tsconfig.json similarity index 100% rename from dragster/tsconfig.json rename to types/dragster/tsconfig.json diff --git a/env-to-object/tslint.json b/types/dragster/tslint.json similarity index 100% rename from env-to-object/tslint.json rename to types/dragster/tslint.json diff --git a/dragula/dragula-tests.ts b/types/dragula/dragula-tests.ts similarity index 100% rename from dragula/dragula-tests.ts rename to types/dragula/dragula-tests.ts diff --git a/dragula/index.d.ts b/types/dragula/index.d.ts similarity index 100% rename from dragula/index.d.ts rename to types/dragula/index.d.ts diff --git a/dragula/tsconfig.json b/types/dragula/tsconfig.json similarity index 100% rename from dragula/tsconfig.json rename to types/dragula/tsconfig.json diff --git a/dropboxjs/dropboxjs-tests.ts b/types/dropboxjs/dropboxjs-tests.ts similarity index 100% rename from dropboxjs/dropboxjs-tests.ts rename to types/dropboxjs/dropboxjs-tests.ts diff --git a/dropboxjs/index.d.ts b/types/dropboxjs/index.d.ts similarity index 100% rename from dropboxjs/index.d.ts rename to types/dropboxjs/index.d.ts diff --git a/dropboxjs/tsconfig.json b/types/dropboxjs/tsconfig.json similarity index 100% rename from dropboxjs/tsconfig.json rename to types/dropboxjs/tsconfig.json diff --git a/dropkickjs/dropkickjs-tests.ts b/types/dropkickjs/dropkickjs-tests.ts similarity index 100% rename from dropkickjs/dropkickjs-tests.ts rename to types/dropkickjs/dropkickjs-tests.ts diff --git a/dropkickjs/index.d.ts b/types/dropkickjs/index.d.ts similarity index 100% rename from dropkickjs/index.d.ts rename to types/dropkickjs/index.d.ts diff --git a/dropkickjs/tsconfig.json b/types/dropkickjs/tsconfig.json similarity index 100% rename from dropkickjs/tsconfig.json rename to types/dropkickjs/tsconfig.json diff --git a/enzyme/tslint.json b/types/dropkickjs/tslint.json similarity index 100% rename from enzyme/tslint.json rename to types/dropkickjs/tslint.json diff --git a/dropzone/dropzone-tests.ts b/types/dropzone/dropzone-tests.ts old mode 100755 new mode 100644 similarity index 100% rename from dropzone/dropzone-tests.ts rename to types/dropzone/dropzone-tests.ts diff --git a/dropzone/index.d.ts b/types/dropzone/index.d.ts old mode 100755 new mode 100644 similarity index 100% rename from dropzone/index.d.ts rename to types/dropzone/index.d.ts diff --git a/dropzone/tsconfig.json b/types/dropzone/tsconfig.json similarity index 100% rename from dropzone/tsconfig.json rename to types/dropzone/tsconfig.json diff --git a/dsv/dsv-tests.ts b/types/dsv/dsv-tests.ts similarity index 100% rename from dsv/dsv-tests.ts rename to types/dsv/dsv-tests.ts diff --git a/dsv/index.d.ts b/types/dsv/index.d.ts similarity index 100% rename from dsv/index.d.ts rename to types/dsv/index.d.ts diff --git a/dsv/tsconfig.json b/types/dsv/tsconfig.json similarity index 100% rename from dsv/tsconfig.json rename to types/dsv/tsconfig.json diff --git a/dts-bundle/dts-bundle-tests.ts b/types/dts-bundle/dts-bundle-tests.ts similarity index 100% rename from dts-bundle/dts-bundle-tests.ts rename to types/dts-bundle/dts-bundle-tests.ts diff --git a/dts-bundle/index.d.ts b/types/dts-bundle/index.d.ts similarity index 100% rename from dts-bundle/index.d.ts rename to types/dts-bundle/index.d.ts diff --git a/dts-bundle/tsconfig.json b/types/dts-bundle/tsconfig.json similarity index 100% rename from dts-bundle/tsconfig.json rename to types/dts-bundle/tsconfig.json diff --git a/duplexer2/duplexer2-tests.ts b/types/duplexer2/duplexer2-tests.ts similarity index 100% rename from duplexer2/duplexer2-tests.ts rename to types/duplexer2/duplexer2-tests.ts diff --git a/duplexer2/index.d.ts b/types/duplexer2/index.d.ts similarity index 100% rename from duplexer2/index.d.ts rename to types/duplexer2/index.d.ts diff --git a/duplexer2/tsconfig.json b/types/duplexer2/tsconfig.json similarity index 100% rename from duplexer2/tsconfig.json rename to types/duplexer2/tsconfig.json diff --git a/es6-weak-map/tslint.json b/types/duplexer2/tslint.json similarity index 100% rename from es6-weak-map/tslint.json rename to types/duplexer2/tslint.json diff --git a/durandal/index.d.ts b/types/durandal/index.d.ts similarity index 100% rename from durandal/index.d.ts rename to types/durandal/index.d.ts diff --git a/durandal/tsconfig.json b/types/durandal/tsconfig.json similarity index 100% rename from durandal/tsconfig.json rename to types/durandal/tsconfig.json diff --git a/durandal/v1/index.d.ts b/types/durandal/v1/index.d.ts similarity index 100% rename from durandal/v1/index.d.ts rename to types/durandal/v1/index.d.ts diff --git a/durandal/v1/tsconfig.json b/types/durandal/v1/tsconfig.json similarity index 100% rename from durandal/v1/tsconfig.json rename to types/durandal/v1/tsconfig.json diff --git a/dustjs-linkedin/dustjs-linkedin-tests.ts b/types/dustjs-linkedin/dustjs-linkedin-tests.ts similarity index 100% rename from dustjs-linkedin/dustjs-linkedin-tests.ts rename to types/dustjs-linkedin/dustjs-linkedin-tests.ts diff --git a/dustjs-linkedin/index.d.ts b/types/dustjs-linkedin/index.d.ts similarity index 100% rename from dustjs-linkedin/index.d.ts rename to types/dustjs-linkedin/index.d.ts diff --git a/dustjs-linkedin/tsconfig.json b/types/dustjs-linkedin/tsconfig.json similarity index 100% rename from dustjs-linkedin/tsconfig.json rename to types/dustjs-linkedin/tsconfig.json diff --git a/dw-bxslider-4/dw-bxslider-4-tests.ts b/types/dw-bxslider-4/dw-bxslider-4-tests.ts similarity index 99% rename from dw-bxslider-4/dw-bxslider-4-tests.ts rename to types/dw-bxslider-4/dw-bxslider-4-tests.ts index e20f748a5d..57092d642f 100644 --- a/dw-bxslider-4/dw-bxslider-4-tests.ts +++ b/types/dw-bxslider-4/dw-bxslider-4-tests.ts @@ -1,6 +1,3 @@ -/// - - // examples from http://bxslider.com/examples $(document).ready(function() { diff --git a/dw-bxslider-4/index.d.ts b/types/dw-bxslider-4/index.d.ts similarity index 100% rename from dw-bxslider-4/index.d.ts rename to types/dw-bxslider-4/index.d.ts diff --git a/dw-bxslider-4/tsconfig.json b/types/dw-bxslider-4/tsconfig.json similarity index 100% rename from dw-bxslider-4/tsconfig.json rename to types/dw-bxslider-4/tsconfig.json diff --git a/dygraphs/dygraphs-tests.ts b/types/dygraphs/dygraphs-tests.ts similarity index 100% rename from dygraphs/dygraphs-tests.ts rename to types/dygraphs/dygraphs-tests.ts diff --git a/dygraphs/index.d.ts b/types/dygraphs/index.d.ts similarity index 100% rename from dygraphs/index.d.ts rename to types/dygraphs/index.d.ts diff --git a/dygraphs/tsconfig.json b/types/dygraphs/tsconfig.json similarity index 100% rename from dygraphs/tsconfig.json rename to types/dygraphs/tsconfig.json diff --git a/dymo-label-framework/dymo-label-framework-tests.ts b/types/dymo-label-framework/dymo-label-framework-tests.ts similarity index 100% rename from dymo-label-framework/dymo-label-framework-tests.ts rename to types/dymo-label-framework/dymo-label-framework-tests.ts diff --git a/dymo-label-framework/index.d.ts b/types/dymo-label-framework/index.d.ts similarity index 100% rename from dymo-label-framework/index.d.ts rename to types/dymo-label-framework/index.d.ts diff --git a/dymo-label-framework/tsconfig.json b/types/dymo-label-framework/tsconfig.json similarity index 100% rename from dymo-label-framework/tsconfig.json rename to types/dymo-label-framework/tsconfig.json diff --git a/dynatable/dynatable-tests.ts b/types/dynatable/dynatable-tests.ts similarity index 99% rename from dynatable/dynatable-tests.ts rename to types/dynatable/dynatable-tests.ts index acba41092a..e727c209c1 100644 --- a/dynatable/dynatable-tests.ts +++ b/types/dynatable/dynatable-tests.ts @@ -1,5 +1,3 @@ -/// - // Using the global setup option // ============================= $.dynatableSetup({ features: { pushState: false }, dataset: { perPageDefault: 5, perPageOptions: [2, 5, 10] } }); diff --git a/dynatable/index.d.ts b/types/dynatable/index.d.ts similarity index 100% rename from dynatable/index.d.ts rename to types/dynatable/index.d.ts diff --git a/dynatable/tsconfig.json b/types/dynatable/tsconfig.json similarity index 100% rename from dynatable/tsconfig.json rename to types/dynatable/tsconfig.json diff --git a/each/each-tests.ts b/types/each/each-tests.ts similarity index 100% rename from each/each-tests.ts rename to types/each/each-tests.ts diff --git a/each/index.d.ts b/types/each/index.d.ts similarity index 100% rename from each/index.d.ts rename to types/each/index.d.ts diff --git a/each/tsconfig.json b/types/each/tsconfig.json similarity index 100% rename from each/tsconfig.json rename to types/each/tsconfig.json diff --git a/easeljs/easeljs-tests.ts b/types/easeljs/easeljs-tests.ts similarity index 100% rename from easeljs/easeljs-tests.ts rename to types/easeljs/easeljs-tests.ts diff --git a/easeljs/index.d.ts b/types/easeljs/index.d.ts similarity index 100% rename from easeljs/index.d.ts rename to types/easeljs/index.d.ts diff --git a/easeljs/tsconfig.json b/types/easeljs/tsconfig.json similarity index 100% rename from easeljs/tsconfig.json rename to types/easeljs/tsconfig.json diff --git a/easy-api-request/easy-api-request-tests.ts b/types/easy-api-request/easy-api-request-tests.ts similarity index 100% rename from easy-api-request/easy-api-request-tests.ts rename to types/easy-api-request/easy-api-request-tests.ts diff --git a/easy-api-request/index.d.ts b/types/easy-api-request/index.d.ts similarity index 99% rename from easy-api-request/index.d.ts rename to types/easy-api-request/index.d.ts index 8f4ca0d553..f04b68be3a 100644 --- a/easy-api-request/index.d.ts +++ b/types/easy-api-request/index.d.ts @@ -3,7 +3,6 @@ // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// import stream = require('stream'); diff --git a/types/easy-api-request/tsconfig.json b/types/easy-api-request/tsconfig.json new file mode 100644 index 0000000000..0f8b3873e0 --- /dev/null +++ b/types/easy-api-request/tsconfig.json @@ -0,0 +1,25 @@ +{ + "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", + "easy-api-request-tests.ts" + ] +} \ No newline at end of file diff --git a/easy-jsend/easy-jsend-tests.ts b/types/easy-jsend/easy-jsend-tests.ts similarity index 100% rename from easy-jsend/easy-jsend-tests.ts rename to types/easy-jsend/easy-jsend-tests.ts diff --git a/easy-jsend/index.d.ts b/types/easy-jsend/index.d.ts similarity index 100% rename from easy-jsend/index.d.ts rename to types/easy-jsend/index.d.ts diff --git a/easy-jsend/tsconfig.json b/types/easy-jsend/tsconfig.json similarity index 100% rename from easy-jsend/tsconfig.json rename to types/easy-jsend/tsconfig.json diff --git a/easy-session/easy-session-tests.ts b/types/easy-session/easy-session-tests.ts similarity index 100% rename from easy-session/easy-session-tests.ts rename to types/easy-session/easy-session-tests.ts diff --git a/easy-session/index.d.ts b/types/easy-session/index.d.ts similarity index 100% rename from easy-session/index.d.ts rename to types/easy-session/index.d.ts diff --git a/easy-session/tsconfig.json b/types/easy-session/tsconfig.json similarity index 100% rename from easy-session/tsconfig.json rename to types/easy-session/tsconfig.json diff --git a/easy-table/easy-table-tests.ts b/types/easy-table/easy-table-tests.ts similarity index 100% rename from easy-table/easy-table-tests.ts rename to types/easy-table/easy-table-tests.ts diff --git a/easy-table/index.d.ts b/types/easy-table/index.d.ts similarity index 100% rename from easy-table/index.d.ts rename to types/easy-table/index.d.ts diff --git a/easy-table/tsconfig.json b/types/easy-table/tsconfig.json similarity index 100% rename from easy-table/tsconfig.json rename to types/easy-table/tsconfig.json diff --git a/easy-x-headers/easy-x-headers-tests.ts b/types/easy-x-headers/easy-x-headers-tests.ts similarity index 100% rename from easy-x-headers/easy-x-headers-tests.ts rename to types/easy-x-headers/easy-x-headers-tests.ts diff --git a/easy-x-headers/index.d.ts b/types/easy-x-headers/index.d.ts similarity index 100% rename from easy-x-headers/index.d.ts rename to types/easy-x-headers/index.d.ts diff --git a/easy-x-headers/tsconfig.json b/types/easy-x-headers/tsconfig.json similarity index 100% rename from easy-x-headers/tsconfig.json rename to types/easy-x-headers/tsconfig.json diff --git a/easy-xapi-supertest/easy-xapi-supertest-tests.ts b/types/easy-xapi-supertest/easy-xapi-supertest-tests.ts similarity index 100% rename from easy-xapi-supertest/easy-xapi-supertest-tests.ts rename to types/easy-xapi-supertest/easy-xapi-supertest-tests.ts diff --git a/easy-xapi-supertest/index.d.ts b/types/easy-xapi-supertest/index.d.ts similarity index 100% rename from easy-xapi-supertest/index.d.ts rename to types/easy-xapi-supertest/index.d.ts diff --git a/easy-xapi-supertest/tsconfig.json b/types/easy-xapi-supertest/tsconfig.json similarity index 100% rename from easy-xapi-supertest/tsconfig.json rename to types/easy-xapi-supertest/tsconfig.json diff --git a/easy-xapi-utils/easy-xapi-utils-tests.ts b/types/easy-xapi-utils/easy-xapi-utils-tests.ts similarity index 100% rename from easy-xapi-utils/easy-xapi-utils-tests.ts rename to types/easy-xapi-utils/easy-xapi-utils-tests.ts diff --git a/easy-xapi-utils/index.d.ts b/types/easy-xapi-utils/index.d.ts similarity index 100% rename from easy-xapi-utils/index.d.ts rename to types/easy-xapi-utils/index.d.ts diff --git a/easy-xapi-utils/tsconfig.json b/types/easy-xapi-utils/tsconfig.json similarity index 100% rename from easy-xapi-utils/tsconfig.json rename to types/easy-xapi-utils/tsconfig.json diff --git a/easy-xapi/easy-xapi-tests.ts b/types/easy-xapi/easy-xapi-tests.ts similarity index 100% rename from easy-xapi/easy-xapi-tests.ts rename to types/easy-xapi/easy-xapi-tests.ts diff --git a/easy-xapi/index.d.ts b/types/easy-xapi/index.d.ts similarity index 100% rename from easy-xapi/index.d.ts rename to types/easy-xapi/index.d.ts diff --git a/easy-xapi/tsconfig.json b/types/easy-xapi/tsconfig.json similarity index 100% rename from easy-xapi/tsconfig.json rename to types/easy-xapi/tsconfig.json diff --git a/easystarjs/easystarjs-tests.ts b/types/easystarjs/easystarjs-tests.ts similarity index 100% rename from easystarjs/easystarjs-tests.ts rename to types/easystarjs/easystarjs-tests.ts diff --git a/easystarjs/index.d.ts b/types/easystarjs/index.d.ts similarity index 100% rename from easystarjs/index.d.ts rename to types/easystarjs/index.d.ts diff --git a/easystarjs/tsconfig.json b/types/easystarjs/tsconfig.json similarity index 100% rename from easystarjs/tsconfig.json rename to types/easystarjs/tsconfig.json diff --git a/echarts/index.d.ts b/types/echarts/index.d.ts similarity index 100% rename from echarts/index.d.ts rename to types/echarts/index.d.ts diff --git a/echarts/tsconfig.json b/types/echarts/tsconfig.json similarity index 100% rename from echarts/tsconfig.json rename to types/echarts/tsconfig.json diff --git a/ecurve/ecurve-tests.ts b/types/ecurve/ecurve-tests.ts similarity index 98% rename from ecurve/ecurve-tests.ts rename to types/ecurve/ecurve-tests.ts index c2214c6905..ced84ef8aa 100644 --- a/ecurve/ecurve-tests.ts +++ b/types/ecurve/ecurve-tests.ts @@ -1,5 +1,3 @@ -/// - import ecurve = require('ecurve'); import crypto = require('crypto'); diff --git a/ecurve/index.d.ts b/types/ecurve/index.d.ts similarity index 100% rename from ecurve/index.d.ts rename to types/ecurve/index.d.ts diff --git a/ecurve/tsconfig.json b/types/ecurve/tsconfig.json similarity index 100% rename from ecurve/tsconfig.json rename to types/ecurve/tsconfig.json diff --git a/expect/tslint.json b/types/ecurve/tslint.json similarity index 100% rename from expect/tslint.json rename to types/ecurve/tslint.json diff --git a/egg.js/egg.js-tests.ts b/types/egg.js/egg.js-tests.ts similarity index 100% rename from egg.js/egg.js-tests.ts rename to types/egg.js/egg.js-tests.ts diff --git a/egg.js/index.d.ts b/types/egg.js/index.d.ts similarity index 100% rename from egg.js/index.d.ts rename to types/egg.js/index.d.ts diff --git a/egg.js/tsconfig.json b/types/egg.js/tsconfig.json similarity index 100% rename from egg.js/tsconfig.json rename to types/egg.js/tsconfig.json diff --git a/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts similarity index 99% rename from ej.web.all/ej.web.all-tests.ts rename to types/ej.web.all/ej.web.all-tests.ts index 63928f47cc..50b4c117e4 100644 --- a/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - /* tslint:disable */ module AccordionComponent { @@ -24,7 +20,7 @@ module AccordionComponent { }); } - + module AutocompleteComponent{ var carList = [ @@ -48,15 +44,15 @@ module AutocompleteComponent{ "Triumph Spitfire", "Toyota 2000GT", "Volvo P1800", "Volkswagen Shirako" ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -154,7 +150,7 @@ module ButtonComponent { }); }); } - + @@ -170,7 +166,7 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: { @@ -185,28 +181,28 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: + border : {width: 2} + }, + series: [ { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], name: 'India' - }, + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], name: 'Germany' }, { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], name: 'England' - }, + }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], name: 'France' } ], @@ -294,7 +290,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -381,7 +377,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -406,7 +402,7 @@ function createLabel(options : any) { return options; } - + module DialogComponent { $(function () { @@ -456,7 +452,7 @@ module digitalgaugecomponent { } - + @@ -476,12 +472,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -517,7 +513,7 @@ module GanttComponent { dataSource: (window).projectData, allowColumnResize: true, allowSorting: true, - allowSelection: true, + allowSelection: true, enableContextMenu: true, taskIdMapping: "taskID", allowDragAndDrop: true, @@ -558,7 +554,7 @@ module GanttComponent { treeColumnIndex: 1, isResponsive: true, }); -}); +}); } @@ -674,7 +670,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -700,14 +696,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } - - + + module ListBoxComponent { $(function () { @@ -717,12 +713,12 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, + enableCheckMark: true, width: 400 }); }); @@ -987,7 +983,7 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { @@ -1027,7 +1023,7 @@ module PivotChartOlap { $(function () { var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", + data: "http://bi.syncfusion.com/olap/msmdpump.dll", catalog: "Adventure Works DW 2008 SE", cube: "Adventure Works", rows: [ @@ -1195,7 +1191,7 @@ module PivotGaugeOlap { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1224,7 +1220,7 @@ module PivotGaugeOlap { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1242,7 +1238,7 @@ module PivotGaugeOlap { }] }] }); - }); + }); } @@ -1316,7 +1312,7 @@ module PivotGaugeRelational { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1345,7 +1341,7 @@ module PivotGaugeRelational { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1363,7 +1359,7 @@ module PivotGaugeRelational { }] }] }); - }); + }); } @@ -1398,7 +1394,7 @@ module PivotGridOlap { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); @@ -1449,7 +1445,7 @@ module PivotGridRelational { fieldCaption: "State" } ], - columns: + columns: [{ fieldName: "Product", fieldCaption: "Product" @@ -1467,10 +1463,10 @@ module PivotGridRelational { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1611,7 +1607,7 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { @@ -1644,7 +1640,7 @@ module rangecomponent { fill: '#69D2E7' } ]; - } + } }); }); @@ -1696,7 +1692,7 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, @@ -1727,7 +1723,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1760,7 +1756,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1837,7 +1833,7 @@ module RibbonComponent { width: 60, isBig: false } - }] + }] }, { text: "Font", alignType: "rows", content: [{ @@ -2116,7 +2112,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, contentType: ej.ContentType.TextAndImage, @@ -2127,7 +2123,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, contentType: ej.ContentType.TextAndImage, @@ -2138,7 +2134,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, contentType: ej.ContentType.TextAndImage, @@ -2367,7 +2363,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2383,7 +2379,7 @@ function colorHandler(args:any) { - + module RotatorComponent { $(function () { @@ -2546,7 +2542,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2729,9 +2725,9 @@ module piesparkline4 { }); } - - + + module SplitterComponent { @@ -2766,7 +2762,7 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { + loadComplete: () => { var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; if (!(spreadsheet).isImport) { spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); @@ -2790,13 +2786,13 @@ var default_data: Array = [ { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, @@ -2805,13 +2801,13 @@ var default_data: Array = [ { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, @@ -2821,7 +2817,7 @@ var default_data: Array = [ module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ {groupMemberPath: "Country"}, {groupMemberPath: "JobDescription"}, @@ -2860,8 +2856,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -2892,7 +2888,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -2932,7 +2928,7 @@ module EditorComponent { - + module TileViewComponent { $(function () { @@ -2943,38 +2939,38 @@ module TileViewComponent { imageUrl:'content/images/tile/windows/people_1.png' }); var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + imageUrl:'content/images/tile/windows/alerts.png', + }); var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + imageUrl:'content/images/tile/windows/bing.png', }); var tile4 = new ej.Tile($("#tile4"), { tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + imageUrl:'content/images/tile/windows/camera.png', }); var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + imageUrl:'content/images/tile/windows/messages.png', }); var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", + imagePosition:"center", tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', + imageUrl:'content/images/tile/windows/games.png', caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { + var tile7 = new ej.Tile($("#tile7"), { tileSize:"medium", imageUrl:'content/images/tile/windows/map.png', caption:{text:"Maps"} }); var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", + imagePosition:"fill", tileSize:"wide", imageUrl:'content/images/tile/windows/sports.png', caption:{text:"Sports"} @@ -3026,7 +3022,7 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", @@ -3045,7 +3041,7 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { var sample1 = new ej.Tooltip($("#link1"),{ @@ -3140,7 +3136,7 @@ module TreeGridComponent { isResponsive: true, }); }); -} +} @@ -3185,7 +3181,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3202,7 +3198,7 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: "uploadbox/saveFiles.ashx", @@ -3236,4 +3232,4 @@ module WaitingPopupComponent { }); }); -} +} \ No newline at end of file diff --git a/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts similarity index 98% rename from ej.web.all/index.d.ts rename to types/ej.web.all/index.d.ts index 356eb6af40..ca17c06c5a 100644 --- a/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -3,11 +3,11 @@ // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts -* version : 15.1.0.33 +* version : 15.1.0.37 * 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 @@ -1358,7 +1358,7 @@ export interface Model { */ cssClass?: string; - /** Allows you to set the custom header Icon. It accepts two key values “header”, ”selectedHeader”. + /** Allows you to set the custom header Icon. It accepts two key values “header”, ”selectedHeader”. * @Default {{ header: e-collapse, selectedHeader: e-expand }} */ customIcon?: CustomIcon; @@ -1827,7 +1827,7 @@ export interface Model { 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. + * Normally, when there are no suggestions it will display “No suggestions” label in the popup. * @Default {false} */ allowAddNew?: boolean; @@ -1853,7 +1853,7 @@ export interface Model { caseSensitiveSearch?: boolean; /** The root class for the Autocomplete textbox widget which helps in customizing its theme. - * @Default {””} + * @Default {””} */ cssClass?: string; @@ -1868,12 +1868,12 @@ export interface Model { 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 {’,’} + * @Default {’,’} */ delimiterChar?: string; /** The text to be displayed in the popup when there are no suggestions available for the entered text. - * @Default {“No suggestions”} + * @Default {“No suggestions”} */ emptyResultText?: string; @@ -1899,7 +1899,7 @@ export interface Model { */ enablePersistence?: boolean; - /** Displays the Autocomplete widget’s content from right to left when enabled. + /** Displays the Autocomplete widget’s content from right to left when enabled. * @Default {false} */ enableRTL?: boolean; @@ -1910,9 +1910,9 @@ export interface Model { 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’. + * 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; @@ -1951,12 +1951,12 @@ export interface Model { multiSelectMode?: ej.Autocomplete.MultiSelectMode|string; /** The height of the suggestion list. - * @Default {“152px”} + * @Default {“152px”} */ popupHeight?: string; /** The width of the suggestion list. - * @Default {“auto”} + * @Default {“auto”} */ popupWidth?: string; @@ -2281,14 +2281,14 @@ export interface MultiColumnSettingsColumn { */ cssClass?: string; - /** Specifies the search data type. There are four types of data types available such as string, ‘number’, ‘boolean’ and ‘date’. + /** 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’. + /** 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; @@ -2892,29 +2892,29 @@ class ListBox extends ej.Widget { */ getSelectedItems(): any; - /** Returns an item’s index based on the given text. + /** 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 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 an item’s text (label) based on the index given. * @returns {string} */ getTextByIndex(): string; - /** Returns a list item’s object using its index. + /** Returns a list item’s object using its index. * @returns {any} */ getItemByIndex(): any; - /** Returns a list item’s object based on the text given. + /** Returns a list item’s object based on the text given. * @param {string} The list item text. * @returns {any} */ @@ -3131,7 +3131,7 @@ export interface Model { */ 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. + /** 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; @@ -3154,7 +3154,7 @@ export interface Model { checkedIndices?: any[]; /** The root class for the ListBox widget to customize the existing theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; @@ -3178,7 +3178,7 @@ export interface Model { */ enablePersistence?: boolean; - /** Displays the ListBox widget’s content from right to left when enabled. + /** Displays the ListBox widget’s content from right to left when enabled. * @Default {false} */ enableRTL?: boolean; @@ -3253,7 +3253,7 @@ export interface Model { template?: string; /** Holds the selected items values and used to bind value to the list item using AngularJS and KnockoutJS. - * @Default {“”} + * @Default {“”} */ value?: number; @@ -3395,7 +3395,7 @@ export interface ChangeEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3415,11 +3415,11 @@ export interface ChangeEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -3442,7 +3442,7 @@ export interface CheckChangeEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3462,11 +3462,11 @@ export interface CheckChangeEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -3549,7 +3549,7 @@ export interface ItemDragEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3565,11 +3565,11 @@ export interface ItemDragEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -3592,7 +3592,7 @@ export interface ItemDragStartEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3608,11 +3608,11 @@ export interface ItemDragStartEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -3635,7 +3635,7 @@ export interface ItemDragStopEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3651,11 +3651,11 @@ export interface ItemDragStopEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -3678,7 +3678,7 @@ export interface ItemDropEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3694,11 +3694,11 @@ export interface ItemDropEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -3721,7 +3721,7 @@ export interface SelectEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3741,11 +3741,11 @@ export interface SelectEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -3768,7 +3768,7 @@ export interface UnselectEventArgs { */ data?: any; - /** List item’s index. + /** List item’s index. */ index?: number; @@ -3788,11 +3788,11 @@ export interface UnselectEventArgs { */ isEnabled?: boolean; - /** List item’s text (label). + /** List item’s text (label). */ text?: string; - /** List item’s value. + /** List item’s value. */ value?: string; } @@ -5673,6 +5673,10 @@ export interface UnselectEventArgs { */ name?: string; + /** Returns the name of unselected items. + */ + names?: string[]; + /** Returns the type of unselected item. */ nodeType?: string; @@ -5688,6 +5692,10 @@ export interface UnselectEventArgs { /** Returns the unselected item details. */ unselectedItem?: any; + + /** Returns the unselected items details. + */ + unselectedItems?: any[]; } export interface ContextMenuSettings { @@ -6430,6 +6438,11 @@ export namespace DateTimePicker { export interface Model { + /** Used to allow or restrict the editing in DateTimePicker input field directly. By setting false to this API, You can only pick the date and time values from DateTimePicker popup. + * @Default {true} + */ + allowEdit?: boolean; + /** 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 }} */ @@ -6519,7 +6532,7 @@ export interface Model { */ popupPosition?: string | ej.popupPosition; - /** Indicates that the DateTimePicker value can only be read and can’t change. + /** Indicates that the DateTimePicker value can only be read and can’t change. * @Default {false} */ readOnly?: boolean; @@ -7303,7 +7316,7 @@ export interface Model { 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. + * In order to customize animation effects, you need to set “enableAnimation” as true. It contains the following sub properties. */ animation?: any; @@ -7320,7 +7333,7 @@ export interface Model { */ 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’. + /** 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; @@ -7352,12 +7365,12 @@ export interface Model { */ 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. + /** 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. + /** 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; @@ -7370,7 +7383,7 @@ export interface Model { */ isResponsive?: boolean; - /** Default Value:{:.param}“en-US” + /** Default Value:{:.param}“en-US” */ locale?: number; @@ -7418,8 +7431,8 @@ export interface Model { */ 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. + /** 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; @@ -7860,149 +7873,6 @@ export interface AjaxSettings { } } -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); @@ -8135,7 +8005,7 @@ export interface Model { */ 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. + /** 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; @@ -8316,7 +8186,7 @@ export interface Model { */ sortOrder?: ej.SortOrder|string; - /** Specifies the targetID for the DropDownList’s items. + /** Specifies the targetID for the DropDownList’s items. * @Default {null} */ targetID?: string; @@ -8384,7 +8254,7 @@ export interface Model { /** 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. */ + /** 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. */ @@ -9481,6 +9351,11 @@ export namespace Editor { export interface Model { + /** Specifies the currency symbol of currency textbox, used when the user wants to overwrite the currency symbol commonly instead of the current culture symbol. + * @Default {Based on the culture} + */ + currencySymbol?: string; + /** Sets the root CSS class for Editors which allow us to customize the appearance. */ cssClass?: string; @@ -11130,7 +11005,7 @@ export interface Fields { */ dataSource?: any; - /** Specifies the HTML attributes to “LI” item list. + /** Specifies the HTML attributes to “LI” item list. */ htmlAttribute?: string; @@ -11138,11 +11013,11 @@ export interface Fields { */ id?: string; - /** Specifies the image attribute to “img” tag inside items list. + /** Specifies the image attribute to “img” tag inside items list. */ imageAttribute?: string; - /** Specifies the image URL to “img” tag inside item list. + /** Specifies the image URL to “img” tag inside item list. */ imageUrl?: string; @@ -11158,7 +11033,7 @@ export interface Fields { */ query?: any; - /** Specifies the sprite CSS class to “LI” item list. + /** Specifies the sprite CSS class to “LI” item list. */ spriteCssClass?: string; @@ -13061,10 +12936,10 @@ export interface Tab { enum ItemType { - ///To render the button for ribbon backstage page’s contents + ///To render the button for ribbon backstage page’s contents Button, - ///To render the tab for ribbon backstage page’s contents + ///To render the tab for ribbon backstage page’s contents Tab } @@ -14384,6 +14259,14 @@ export interface ContextMenuSettings { customMenuItems?: ContextMenuSettingsCustomMenuItem[]; } +export interface ColumnsTotalCount { + + /** To customize the totalCount text properties. + * @Default {null} + */ + text?: string; +} + export interface ColumnsConstraints { /** It is used to specify the type of constraints as column or swimlane. @@ -14410,9 +14293,9 @@ export interface Column { headerText?: string; /** To customize the totalCount properties. - * @Default {false} + * @Default {Object} */ - totalCount?: string; + totalCount?: ColumnsTotalCount; /** Gets or sets an object that indicates to render the Kanban with specified columns key. * @Default {null} @@ -15276,14 +15159,14 @@ class RTE extends ej.Widget { 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 {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 {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} */ @@ -15397,7 +15280,7 @@ export interface Model { */ cssClass?: string; - /** Enables/disables the RTE control’s accessibility or interaction. + /** Enables/disables the RTE control’s accessibility or interaction. * @Default {True} */ enabled?: boolean; @@ -15615,7 +15498,7 @@ export interface Model { /** 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]} + * addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreen”,zoomIn,zoomOut],print:[print]} */ tools?: Tools; @@ -16425,7 +16308,7 @@ export interface Model { enableRTL?: boolean; /** Specifies the height of the Split Button. - * @Default {“”} + * @Default {“”} */ height?: string|number; @@ -16466,7 +16349,7 @@ export interface Model { text?: string; /** Specifies the width of the Split Button. - * @Default {“”} + * @Default {“”} */ width?: string|number; @@ -16745,7 +16628,7 @@ export interface Model { animationSpeed?: number; /** Specify the CSS class to splitter control to achieve custom theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; @@ -16775,7 +16658,7 @@ export interface Model { isResponsive?: boolean; /** Specify the orientation for splitter control. See orientation - * @Default {ej.orientation.Horizontal or “horizontal”} + * @Default {ej.orientation.Horizontal or “horizontal”} */ orientation?: ej.Orientation|string; @@ -16924,7 +16807,7 @@ class Tab extends ej.Widget { 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. + /** 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. @@ -17069,7 +16952,7 @@ export interface Model { */ htmlAttributes?: any; - /** The idPrefix property appends the given string on the added tab item id’s in runtime. + /** The idPrefix property appends the given string on the added tab item id’s in runtime. * @Default {ej-tab-} */ idPrefix?: string; @@ -17094,7 +16977,7 @@ export interface Model { */ showRoundedCorner?: boolean; - /** Set the width for outer panel element, if not it’s take parent width. + /** Set the width for outer panel element, if not it’s take parent width. * @Default {null} */ width?: string|number; @@ -20443,7 +20326,7 @@ export interface Fields { */ id?: string; - /** Specifies the image attribute to “img” tag inside items list + /** Specifies the image attribute to “img” tag inside items list */ imageAttribute?: any; @@ -20455,7 +20338,7 @@ export interface Fields { */ isChecked?: string; - /** Specifies the link attribute to “a” tag in item list. + /** Specifies the link attribute to “a” tag in item list. */ linkAttribute?: any; @@ -20981,14 +20864,14 @@ export interface DialogAction { */ drag?: boolean; - /** Enables or disables the Uploadbox dialog’s modal property to the dialog popup. + /** 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. + /** Sets the uploaded file’s Name (header text) to the Dialog popup. */ name?: string; @@ -21226,6 +21109,12 @@ class Grid extends ej.Widget { */ deleteRecord(fieldName: string, data: any[]): void; + /** Delete the row based on the given tr element in grid. + * @param {JQuery} Pass the tr element in grid content to get its row index + * @returns {HTMLElement} + */ + deleteRow($tr: JQuery): HTMLElement; + /** Destroy the grid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} */ @@ -21238,6 +21127,11 @@ class Grid extends ej.Widget { */ editCell(index: number, fieldName: string): void; + /** It returns a value and if the input field values of edit form is not based on the validation rules then it will show the validation message. + * @returns {Boolean} + */ + editFormValidate(): boolean; + /** Send a save request in grid. * @returns {void} */ @@ -21324,6 +21218,13 @@ class Grid extends ej.Widget { */ getColumnIndexByField(fieldName: string): number; + /** Get the column index of the given headerText of column in grid. + * @param {string} Pass the headerText of the column to get that column index + * @param {string} optionalOptional Pass the field name of the column. + * @returns {number} + */ + getColumnIndexByHeaderText(headerText: string, field?: string): number; + /** Get the content div element of grid. * @returns {HTMLElement} */ @@ -21349,6 +21250,11 @@ class Grid extends ej.Widget { */ getCurrentViewData(): any[]; + /** Get the data of given row index in grid. + * @returns {any} + */ + getDataByIndex(): 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} @@ -21439,6 +21345,17 @@ class Grid extends ej.Widget { */ getSelectedRecords(): any[]; + /** Get the selected row element details in grid. + * @returns {Array} + */ + getSelectedRows(): any[]; + + /** It accepts the string value and returns the field and sorted direction of the column in grid. + * @param {string} Pass the field of the column to get the sorted direction of the corresponding column in Grid. + * @returns {number} + */ + getsortColumnByField(field: string): number; + /** 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 @@ -21518,6 +21435,13 @@ class Grid extends ej.Widget { */ reorderColumns(fromFieldName: string, toFieldName: string): void; + /** Re-order the row in grid + * @param {Array} Pass the indexes of the rows needs to reorder. + * @param {number} Pass the index of a row where to be reorderd. + * @returns {void} + */ + reorderRows(indexes: any[], toindex: number): void; + /** Reset the model collections like pageSettings, groupSettings, filterSettings, sortSettings and summaryRows. * @returns {void} */ @@ -21617,6 +21541,11 @@ class Grid extends ej.Widget { */ setCellValue(Index: number, fieldName: string, value: any): void; + /** It sets the default data to the column in grid during adding record in batch edit mode. + * @returns {void} + */ + setDefaultData(): 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} @@ -21676,20 +21605,20 @@ export interface Model { */ 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. + /** 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 + /** 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 + * this can be further customized through “filterSettings” property * @Default {false} */ allowFiltering?: boolean; @@ -21705,7 +21634,7 @@ export interface Model { 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. + * Paging can be further customized through “pageSettings” property. * @Default {false} */ allowPaging?: boolean; @@ -21736,7 +21665,7 @@ export interface Model { */ 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” + /** 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; @@ -21842,6 +21771,11 @@ export interface Model { */ enableTouch?: boolean; + /** It sets a value that indicates whether to enable toolbar items, when allowEditing, allowAdding and allowDeleting property set as false in the grid. + * @Default {false} + */ + enableToolbarItems?: boolean; + /** Act as mapper for the excel exporting URL. * @Default {ExportToExcel} */ @@ -21914,7 +21848,7 @@ export interface Model { 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 + * or multiple selected records using “selectedRecords” property * @Default {null} */ selectedRecords?: any[]; @@ -21947,12 +21881,12 @@ export interface Model { */ showColumnChooser?: boolean; - /** Gets or sets a value that indicates stacked header should be shown on grid layout when the property “stackedHeaderRows” is set. + /** 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 + /** 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; @@ -22003,6 +21937,12 @@ export interface Model { /** Triggered before the batch save. */ beforeBatchSave?(e: BeforeBatchSaveEventArgs): void; + /** Triggered before the print. */ + beforePrint?(e: BeforePrintEventArgs): void; + + /** Triggered before row drop in the grid */ + beforeRowDrop?(e: BeforeRowDropEventArgs): void; + /** Triggered before the record is going to be edited. */ beginEdit?(e: BeginEditEventArgs): void; @@ -22600,6 +22540,48 @@ export interface BeforeBatchSaveEventArgs { batchChanges?: any; } +export interface BeforePrintEventArgs { + + /** Returns the grid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the Grid element. + */ + element?: any; + + /** Returns the selected records. + */ + selectedRows?: any; +} + +export interface BeforeRowDropEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the targeted row. + */ + target?: any; + + /** Returns the targeted row index. + */ + targetIndex?: any; + + /** Returns the dragged record details + */ + draggedRecords?: any; + + /** Returns the drop details + */ + dropDetails?: any; +} + export interface BeginEditEventArgs { /** Returns the cancel option value. @@ -24060,6 +24042,11 @@ export interface Column { */ filterBarTemplate?: any; + /** Gets or sets a value that indicates to render the excel or menu filter dialog to the grid columns. See filterType + * @Default {null} + */ + filterType?: ej.Grid.FilterType|string; + /** Gets or sets a value that indicates to define foreign key field name of the grid datasource. * @Default {null} */ @@ -24088,6 +24075,11 @@ export interface Column { */ headerTextAlign?: ej.TextAlign|string; + /** It accepts the string value and shows the tooltip for the Grid column header. + * @Default {null} + */ + headerTooltip?: string; + /** You can use this property to freeze selected columns in grid at the time of scrolling. * @Default {false} */ @@ -24104,7 +24096,7 @@ export interface Column { 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} + * @Default {-1} */ priority?: number; @@ -24265,7 +24257,11 @@ export interface FilterSettingsFilteredColumn { */ field?: string; - /** Gets or sets a value that indicates whether to define the filter condition to filtered column. + /** Gets or sets a value that indicates whether to define the matchCase of given value to be filter. + */ + matchCase?: boolean; + + /** Gets or sets a value that indicates whether to define the filter condition to filtered column. See operator */ operator?: ej.FilterOperators|string; @@ -24285,7 +24281,12 @@ export interface FilterSettings { */ 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 + /** Gets or sets a value that indicates to define the interDeterminateState of checkbox in excel filter dialog. + * @Default {true} + */ + enableInterDeterminateState?: 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; @@ -24300,6 +24301,11 @@ export interface FilterSettings { */ filterType?: ej.Grid.FilterType|string; + /** This specifies the grid to delay the filter action while typing in the filterBar. + * @Default {1500} + */ + immediateModeDelay?: number; + /** 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} */ @@ -24458,6 +24464,11 @@ export interface SearchSettings { export interface SelectionSettings { + /** Gets or sets a value that indicates the cell selection actions based on the cell selection mode. + * @Default {flow} + */ + cellSelectionMode?: string; + /** Gets or sets a value that indicates whether to enable the toggle selection behavior for row, cell and column. * @Default {false} */ @@ -24476,6 +24487,16 @@ export interface ScrollSettings { */ allowVirtualScrolling?: boolean; + /** It accepts the boolean value and shows or hides the scrollbar while focus in or focus out of the Grid. + * @Default {false} + */ + autoHide?: boolean; + + /** Specifies the height and width of button in the scrollbar. + * @Default {18} + */ + buttonSize?: number; + /** This specify the grid to enable/disable touch control for scrolling. * @Default {true} */ @@ -24496,6 +24517,11 @@ export interface ScrollSettings { */ height?: string|number; + /** It accepts the integer value and sets the width of scrollbar. + * @Default {18} + */ + scrollerSize?: number; + /** This is used to define the mode of virtual scrolling in grid. See virtualScrollMode * @Default {ej.Grid.VirtualScrollMode.Normal} */ @@ -24556,6 +24582,11 @@ export interface StackedHeaderRowsStackedHeaderColumn { * @Default {ej.TextAlign.Left} */ textAlign?: string; + + /** Sets the template for tooltip for the Grid stackedHeaderColumns. + * @Default {null} + */ + tooltip?: string; } export interface StackedHeaderRow { @@ -24744,6 +24775,16 @@ enum EditingType { } +enum FilterType { + + ///Specifies the filter type as menu. + Menu, + + ///Specifies the filter type as excel. + Excel +} + + enum EditMode { ///Edit mode is normal. @@ -24802,19 +24843,6 @@ enum FilterBarMode { } -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. @@ -25583,7 +25611,7 @@ export interface Model { */ yName?: string; - /** Controls wheather sunburst has to be responsive or not. + /** Controls whether sunburst has to be responsive or not. * @Default {true} */ isResponsive?: boolean; @@ -25703,7 +25731,7 @@ export interface Model { pointRegionClick?(e: PointRegionClickEventArgs): void; /** Fires while moving the mouse over sunburst points */ - pointRegionMousemove?(e: PointRegionMousemoveEventArgs): void; + pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; /** Fires when clicking the point to perform drilldown. */ drillDownClick?(e: DrillDownClickEventArgs): void; @@ -25867,7 +25895,7 @@ export interface PointRegionClickEventArgs { type?: string; } -export interface PointRegionMousemoveEventArgs { +export interface PointRegionMouseMoveEventArgs { /** Includes data of mouse moved region */ @@ -26117,7 +26145,7 @@ export interface DataLabelSettings { */ visible?: boolean; - /** Alginment of sunburst datalabel + /** Alignment of sunburst datalabel * @Default {Angle. See DatalabelAlignment} */ labelRotationMode?: ej.datavisualization.Sunburst.SunburstLabelRotationMode|string; @@ -26126,12 +26154,12 @@ export interface DataLabelSettings { */ font?: DataLabelSettingsFont; - /** Custome template for datalabel + /** Custom template for datalabel * @Default {null} */ template?: string; - /** Fill color for the datalable + /** Fill color for the datalabel * @Default {null} */ fill?: string; @@ -26778,12 +26806,12 @@ export interface Model { analysisMode?: ej.Pivot.AnalysisMode|string; /** Specifies the CSS class to PivotGrid to achieve custom theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; /** Connects the PivotSchemaDesigner with the specified ID to the PivotGrid Control. - * @Default {“”} + * @Default {“”} */ pivotTableFieldListID?: string; @@ -26852,6 +26880,11 @@ export interface Model { */ enableConditionalFormatting?: boolean; + /** Enables the advanced filtering options Value Filtering, Label Filtering and Sorting for each fields in server mode. + * @Default {false} + */ + enableAdvancedFilter?: boolean; + /** Allows the user to refresh the control on-demand and not during every UI operation. * @Default {false} */ @@ -26917,7 +26950,7 @@ export interface Model { */ hyperlinkSettings?: HyperlinkSettings; - /** Allows the user to enable PivotGrid’s responsiveness in the browser layout. + /** Allows the user to enable PivotGrid’s responsiveness in the browser layout. * @Default {false} */ isResponsive?: boolean; @@ -26947,7 +26980,7 @@ export interface Model { serviceMethodSettings?: ServiceMethodSettings; /** Connects the service using the specified URL for any server updates. - * @Default {“”} + * @Default {“”} */ url?: string; @@ -27579,7 +27612,7 @@ export interface DataSource { filters?: DataSourceFilter[]; /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} + * @Default {“”} */ cube?: string; @@ -27589,7 +27622,7 @@ export interface DataSource { 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 {“”} + * @Default {“”} */ catalog?: string; @@ -27845,7 +27878,7 @@ export namespace PivotSchemaDesigner { export interface Model { /** Specifies the CSS class to PivotSchemaDesigner to achieve custom theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; @@ -27855,7 +27888,7 @@ export interface Model { 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”. + * PivotSchemaDesigner will just be populated with data source by setting this property to “true”. * @Default {false} */ enableWrapper?: boolean; @@ -27876,7 +27909,7 @@ export interface Model { enableDragDrop?: boolean; /** Sets the height for PivotSchemaDesigner. - * @Default {“”} + * @Default {“”} */ height?: string; @@ -27896,12 +27929,12 @@ export interface Model { serviceMethod?: ServiceMethod; /** Connects the service using the specified URL for any server updates. - * @Default {“”} + * @Default {“”} */ url?: string; /** Sets the width for PivotSchemaDesigner. - * @Default {“”} + * @Default {“”} */ width?: string; @@ -28076,7 +28109,7 @@ export interface Model { seriesPageCount?: number; /** Contains the ID of the target element for which paging needs to be done. - * @Default {“”} + * @Default {“”} */ targetControlID?: string; } @@ -28182,7 +28215,7 @@ export interface Model { analysisMode?: ej.Pivot.AnalysisMode|string; /** Specifies the CSS class to PivotChart to achieve custom theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; @@ -28216,7 +28249,7 @@ export interface Model { */ enableRTL?: boolean; - /** Allows the user to enable PivotChart’s responsiveness in the browser layout. + /** Allows the user to enable PivotChart’s responsiveness in the browser layout. * @Default {false} */ isResponsive?: boolean; @@ -28238,14 +28271,14 @@ export interface Model { /** 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. + * 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. + * Then, assign the name to the series’s yAxisName property to link both axis and series. * @Default {{}} */ primaryYAxis?: any; @@ -28266,7 +28299,7 @@ export interface Model { size?: any; /** Connects the service using the specified URL for any server updates on operating the control in server mode. - * @Default {“”} + * @Default {“”} */ url?: string; @@ -28570,7 +28603,7 @@ export interface DataSourceFilter { export interface DataSource { /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} + * @Default {“”} */ cube?: string; @@ -28580,7 +28613,7 @@ export interface DataSource { 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 {“”} + * @Default {“”} */ catalog?: string; @@ -28761,7 +28794,7 @@ export interface Model { clientExportMode?: ej.PivotClient.ClientExportMode|string; /** Specifies the CSS class to PivotClient to achieve custom theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; @@ -29339,7 +29372,7 @@ export interface DataSource { filters?: DataSourceFilter[]; /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} + * @Default {“”} */ cube?: string; @@ -29349,11 +29382,11 @@ export interface DataSource { 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 {“”} + * @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. + /** Allows user to filter the members (by its name and values) through advanced filtering (excel-like) option in client-mode. * @Default {false} */ enableAdvancedFilter?: boolean; @@ -29390,7 +29423,7 @@ export interface DisplaySettings { */ enableTogglePanel?: boolean; - /** Allows the user to enable PivotClient’s responsiveness in the browser layout. + /** Allows the user to enable PivotClient’s responsiveness in the browser layout. * @Default {false} */ isResponsive?: boolean; @@ -29598,7 +29631,7 @@ export interface Model { columnsCount?: number; /** Specifies the CSS class to PivotGauge to achieve custom theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; @@ -29627,7 +29660,7 @@ export interface Model { */ enableRTL?: boolean; - /** Allows the user to enable PivotGauge’s responsiveness in the browser layout. + /** Allows the user to enable PivotGauge’s responsiveness in the browser layout. * @Default {false} */ isResponsive?: boolean; @@ -29663,7 +29696,7 @@ export interface Model { showHeaderLabel?: boolean; /** Connects the service using the specified URL for any server updates on server mode operation. - * @Default {“”} + * @Default {“”} */ url?: string; @@ -29899,7 +29932,7 @@ export interface DataSourceFilter { export interface DataSource { /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} + * @Default {“”} */ cube?: string; @@ -29909,7 +29942,7 @@ export interface DataSource { 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 {“”} + * @Default {“”} */ catalog?: string; @@ -30041,7 +30074,7 @@ export namespace PivotTreeMap { export interface Model { /** Specifies the CSS class to PivotTreeMap to achieve custom theme. - * @Default {“”} + * @Default {“”} */ cssClass?: string; @@ -30055,7 +30088,7 @@ export interface Model { */ customObject?: any; - /** Allows the user to enable PivotTreeMap’s responsiveness in the browser layout. + /** Allows the user to enable PivotTreeMap’s responsiveness in the browser layout. * @Default {false} */ isResponsive?: boolean; @@ -30076,7 +30109,7 @@ export interface Model { serviceMethodSettings?: ServiceMethodSettings; /** Connects the service using the specified URL for any server updates. - * @Default {“”} + * @Default {“”} */ url?: string; @@ -30311,12 +30344,12 @@ export interface DataSource { data?: any; /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} + * @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 {“”} + * @Default {“”} */ catalog?: string; @@ -33630,6 +33663,11 @@ export interface EditSettings { * @Default {normal} */ editMode?: string; + + /** Specifies the position where the new row has to be added. + * @Default {ej.Gantt.RowPosition.BelowSelectedRow} + */ + rowPosition?: ej.Gantt.RowPosition|string; } export interface ScheduleHeaderSettings { @@ -33679,10 +33717,10 @@ export interface ScheduleHeaderSettings { */ 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. + /** Specifies the size of the lowest time unit along the timescale, with minimum value as "50%" and maximum value as "500%". It is also possible to set the value in pixels. * @Default {100%} */ - timscaleUnitSize?: string; + timescaleUnitSize?: string; /** Specifies the start day of the week in week timescale mode * @Default {0} @@ -33759,6 +33797,25 @@ enum BeginEditAction { } +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. + AboveSelectedRow, + + ///you can add a new row to below selected row. + BelowSelectedRow, + + ///you can add a new row as a child for selected row. + Child +} + + enum TaskType { ///Resource unit remains constant while editing the work and duration values. @@ -34759,7 +34816,7 @@ export interface Model { */ 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. + /** Enables or disables internal parsing of a row. When disabled this property, row will be displayed using the defined template without any internal event bindings. * @Default {true} */ parseRowTemplate?: boolean; @@ -36276,7 +36333,7 @@ export interface Model { */ query?: any; - /** Sets the list of button elements to be selected. To enable this option groupButtonMode should be in “checkbox” mode. + /** Sets the list of button elements to be selected. To enable this option groupButtonMode should be in “checkbox” mode. * @Default {[]} */ selectedItemIndex?: number[]|string[]; @@ -37141,7 +37198,7 @@ export interface Badge { value?: number; /** Sets position for tile badge. - * @Default {“bottomright”} + * @Default {“bottomright”} */ position?: ej.Tile.BadgePosition|string; } @@ -42367,8 +42424,152 @@ export interface IgnoreSettings { } } +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; +} +} + } declare namespace ej.datavisualization { + class SymbolPalette extends ej.Widget { static fn: SymbolPalette; constructor(element: JQuery | Element, options?: SymbolPalette.Model); @@ -47062,18 +47263,18 @@ export interface Model { /** 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. + * 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. + * 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. + * Then, assign the name to the series’s yAxisName property to link both axis and series. */ primaryYAxis?: PrimaryYAxis; @@ -47511,7 +47712,7 @@ export interface LegendItemClickEventArgs { */ LegendItem?: any; - /** Options to customize the legend item styles such as border, color, size, etc…, + /** Options to customize the legend item styles such as border, color, size, etc…, */ style?: any; @@ -47554,11 +47755,11 @@ export interface LegendItemMouseMoveEventArgs { */ LegendItem?: any; - /** Options to customize the legend item styles such as border, color, size, etc…, + /** 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…, + /** Options to customize the legend item styles such as border, color, size, etc…, */ Bounds?: any; @@ -48676,7 +48877,7 @@ export interface CommonSeriesOptionsMarkerDataLabel { */ 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. + /** 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; @@ -48728,7 +48929,7 @@ export interface CommonSeriesOptionsMarker { */ 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’. + /** 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; @@ -48854,7 +49055,7 @@ export interface CommonSeriesOptionsTooltip { */ 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. + /** 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; @@ -48959,7 +49160,7 @@ export interface CommonSeriesOptionsErrorBarCap { length?: number; /** Color of the error bar cap. - * @Default {“#000000”} + * @Default {“#000000”} */ fill?: string; } @@ -49319,7 +49520,7 @@ export interface CommonSeriesOptions { */ isTransposed?: boolean; - /** Render the x mark in the center of the boxplot series type.x represents the average value of the boxplot series. + /** Render the x mark in the center of the box and whisker series type.x represents the average value of the box and whisker series. * @Default {true} */ showMedian?: boolean; @@ -49329,7 +49530,7 @@ export interface CommonSeriesOptions { */ labelPosition?: ej.datavisualization.Chart.LabelPosition|string; - /** Quartile calculation has been performed in three different formulas to render the boxplot series. + /** Quartile calculation has been performed in three different formulas to render the box and whisker series. * @Default {exclusive} */ boxPlotMode?: ej.datavisualization.Chart.boxPlotMode|string; @@ -49701,7 +49902,7 @@ export interface IndicatorsTooltip { */ 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. + /** 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; @@ -50446,8 +50647,8 @@ export interface PrimaryXAxisStripLine { */ 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. + /** 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; @@ -50553,7 +50754,7 @@ export interface PrimaryXAxis { */ 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. + /** 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; @@ -51129,7 +51330,7 @@ export interface AxesStripLine { */ 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”, + /** 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} */ @@ -51230,7 +51431,7 @@ export interface Axis { */ 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. + /** 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; @@ -51781,7 +51982,7 @@ export interface PrimaryYAxisStripLine { */ 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. + /** 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; @@ -51806,8 +52007,8 @@ export interface PrimaryYAxisStripLine { */ 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. + /** 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; @@ -52322,7 +52523,7 @@ export interface SeriesMarkerDataLabel { opacity?: number; /** Background shape of the data label. - * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} */ shape?: ej.datavisualization.Chart.Shape|string; @@ -52345,7 +52546,7 @@ export interface SeriesMarkerDataLabel { */ 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. + /** 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; @@ -52383,7 +52584,7 @@ export interface SeriesMarker { */ 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’. + /** 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; @@ -52740,7 +52941,7 @@ export interface SeriesPointsMarkerDataLabel { opacity?: number; /** Background shape of the data label. - * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} */ shape?: ej.datavisualization.Chart.Shape|string; @@ -52759,7 +52960,7 @@ export interface SeriesPointsMarkerDataLabel { */ 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. + /** 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; @@ -52797,7 +52998,7 @@ export interface SeriesPointsMarker { */ 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’. + /** 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; @@ -52969,7 +53170,7 @@ export interface SeriesTooltip { */ 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. + /** 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; @@ -53273,7 +53474,7 @@ export interface Series { */ isTransposed?: boolean; - /** Render the x mark in the center of the boxplot series type.x represents the average value of the boxplot series. + /** Render the x mark in the center of the box and whisker series type.x represents the average value of the box and whisker series. * @Default {true} */ showMedian?: boolean; @@ -57128,6 +57329,11 @@ export interface Layer { */ labelSettings?: LayersLabelSettings; + /** Specifies the map view type. + * @Default {'geographic'} + */ + geometryType?: ej.datavisualization.Map.GeometryType|string; + /** Specifies the map type. * @Default {'geometry'} */ @@ -57240,6 +57446,14 @@ Default, } } namespace Map { +enum GeometryType { +//specifies the geographic view of map +Geographic, +//specifies the normal land view of map +Normal, +} +} +namespace Map { enum LayerType { //specifies the geometry type Geometry, @@ -59684,6 +59898,16 @@ export interface Connector { export interface ContextMenuItem { + /** Defines the text for the collection of context menu item + * @Default {null} + */ + text?: string; + + /** Defines the name for the collection of context menu items + * @Default {null} + */ + name?: string; + /** Defines the image url for the collection of context menu items * @Default {null} */ @@ -59693,6 +59917,11 @@ export interface ContextMenuItem { * @Default {null} */ cssClass?: string; + + /** Defines the collection of sub items for the context menu items + * @Default {[]} + */ + subItems?: any[]; } export interface ContextMenu { @@ -63490,7 +63719,7 @@ export interface Model { */ yName?: string; - /** Controls wheather sunburst has to be responsive or not. + /** Controls whether sunburst has to be responsive or not. * @Default {true} */ isResponsive?: boolean; @@ -63610,7 +63839,7 @@ export interface Model { pointRegionClick?(e: PointRegionClickEventArgs): void; /** Fires while moving the mouse over sunburst points */ - pointRegionMousemove?(e: PointRegionMousemoveEventArgs): void; + pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; /** Fires when clicking the point to perform drilldown. */ drillDownClick?(e: DrillDownClickEventArgs): void; @@ -63774,7 +64003,7 @@ export interface PointRegionClickEventArgs { type?: string; } -export interface PointRegionMousemoveEventArgs { +export interface PointRegionMouseMoveEventArgs { /** Includes data of mouse moved region */ @@ -64024,7 +64253,7 @@ export interface DataLabelSettings { */ visible?: boolean; - /** Alginment of sunburst datalabel + /** Alignment of sunburst datalabel * @Default {Angle. See DatalabelAlignment} */ labelRotationMode?: ej.datavisualization.Sunburst.SunburstLabelRotationMode|string; @@ -64033,12 +64262,12 @@ export interface DataLabelSettings { */ font?: DataLabelSettingsFont; - /** Custome template for datalabel + /** Custom template for datalabel * @Default {null} */ template?: string; - /** Fill color for the datalable + /** Fill color for the datalabel * @Default {null} */ fill?: string; @@ -64969,4 +65198,4 @@ 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/tsconfig.json b/types/ej.web.all/tsconfig.json similarity index 100% rename from ej.web.all/tsconfig.json rename to types/ej.web.all/tsconfig.json diff --git a/types/ej.web.all/tslint.json b/types/ej.web.all/tslint.json new file mode 100644 index 0000000000..845d9d8168 --- /dev/null +++ b/types/ej.web.all/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "../tslint.json", + "rules": { + "comment-format": false, + "no-consecutive-blank-lines": false, + "no-padding": false, + "no-redundant-modifiers": false + } +} diff --git a/ejs-locals/ejs-locals-tests.ts b/types/ejs-locals/ejs-locals-tests.ts similarity index 100% rename from ejs-locals/ejs-locals-tests.ts rename to types/ejs-locals/ejs-locals-tests.ts diff --git a/ejs-locals/index.d.ts b/types/ejs-locals/index.d.ts similarity index 100% rename from ejs-locals/index.d.ts rename to types/ejs-locals/index.d.ts diff --git a/ejs-locals/tsconfig.json b/types/ejs-locals/tsconfig.json similarity index 100% rename from ejs-locals/tsconfig.json rename to types/ejs-locals/tsconfig.json diff --git a/ejs/ejs-tests.ts b/types/ejs/ejs-tests.ts similarity index 100% rename from ejs/ejs-tests.ts rename to types/ejs/ejs-tests.ts diff --git a/ejs/index.d.ts b/types/ejs/index.d.ts similarity index 100% rename from ejs/index.d.ts rename to types/ejs/index.d.ts diff --git a/ejs/tsconfig.json b/types/ejs/tsconfig.json similarity index 100% rename from ejs/tsconfig.json rename to types/ejs/tsconfig.json diff --git a/ejson/ejson-tests.ts b/types/ejson/ejson-tests.ts similarity index 100% rename from ejson/ejson-tests.ts rename to types/ejson/ejson-tests.ts diff --git a/ejson/index.d.ts b/types/ejson/index.d.ts similarity index 100% rename from ejson/index.d.ts rename to types/ejson/index.d.ts diff --git a/ejson/tsconfig.json b/types/ejson/tsconfig.json similarity index 100% rename from ejson/tsconfig.json rename to types/ejson/tsconfig.json diff --git a/elastic.js/elastic.js-tests.ts b/types/elastic.js/elastic.js-tests.ts similarity index 100% rename from elastic.js/elastic.js-tests.ts rename to types/elastic.js/elastic.js-tests.ts diff --git a/elastic.js/index.d.ts b/types/elastic.js/index.d.ts similarity index 100% rename from elastic.js/index.d.ts rename to types/elastic.js/index.d.ts diff --git a/elastic.js/tsconfig.json b/types/elastic.js/tsconfig.json similarity index 100% rename from elastic.js/tsconfig.json rename to types/elastic.js/tsconfig.json diff --git a/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts similarity index 100% rename from elasticsearch/elasticsearch-tests.ts rename to types/elasticsearch/elasticsearch-tests.ts diff --git a/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts similarity index 100% rename from elasticsearch/index.d.ts rename to types/elasticsearch/index.d.ts diff --git a/elasticsearch/tsconfig.json b/types/elasticsearch/tsconfig.json similarity index 100% rename from elasticsearch/tsconfig.json rename to types/elasticsearch/tsconfig.json diff --git a/electron-builder/electron-builder-tests.ts b/types/electron-builder/electron-builder-tests.ts similarity index 100% rename from electron-builder/electron-builder-tests.ts rename to types/electron-builder/electron-builder-tests.ts diff --git a/electron-builder/index.d.ts b/types/electron-builder/index.d.ts similarity index 100% rename from electron-builder/index.d.ts rename to types/electron-builder/index.d.ts diff --git a/electron-builder/tsconfig.json b/types/electron-builder/tsconfig.json similarity index 100% rename from electron-builder/tsconfig.json rename to types/electron-builder/tsconfig.json diff --git a/electron-debug/electron-debug-tests.ts b/types/electron-debug/electron-debug-tests.ts similarity index 100% rename from electron-debug/electron-debug-tests.ts rename to types/electron-debug/electron-debug-tests.ts diff --git a/electron-debug/index.d.ts b/types/electron-debug/index.d.ts similarity index 100% rename from electron-debug/index.d.ts rename to types/electron-debug/index.d.ts diff --git a/electron-debug/tsconfig.json b/types/electron-debug/tsconfig.json similarity index 100% rename from electron-debug/tsconfig.json rename to types/electron-debug/tsconfig.json diff --git a/electron-devtools-installer/electron-devtools-installer-tests.ts b/types/electron-devtools-installer/electron-devtools-installer-tests.ts similarity index 90% rename from electron-devtools-installer/electron-devtools-installer-tests.ts rename to types/electron-devtools-installer/electron-devtools-installer-tests.ts index a923e2b20e..a453221698 100644 --- a/electron-devtools-installer/electron-devtools-installer-tests.ts +++ b/types/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -1,5 +1,3 @@ -/// - import installExtension, { EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS, BACKBONE_DEBUGGER, JQUERY_DEBUGGER, diff --git a/electron-devtools-installer/index.d.ts b/types/electron-devtools-installer/index.d.ts similarity index 100% rename from electron-devtools-installer/index.d.ts rename to types/electron-devtools-installer/index.d.ts diff --git a/electron-devtools-installer/tsconfig.json b/types/electron-devtools-installer/tsconfig.json similarity index 100% rename from electron-devtools-installer/tsconfig.json rename to types/electron-devtools-installer/tsconfig.json diff --git a/electron-json-storage/electron-json-storage-tests.ts b/types/electron-json-storage/electron-json-storage-tests.ts similarity index 100% rename from electron-json-storage/electron-json-storage-tests.ts rename to types/electron-json-storage/electron-json-storage-tests.ts diff --git a/electron-json-storage/index.d.ts b/types/electron-json-storage/index.d.ts similarity index 100% rename from electron-json-storage/index.d.ts rename to types/electron-json-storage/index.d.ts diff --git a/electron-json-storage/tsconfig.json b/types/electron-json-storage/tsconfig.json similarity index 100% rename from electron-json-storage/tsconfig.json rename to types/electron-json-storage/tsconfig.json diff --git a/electron-notifications/electron-notifications-tests.ts b/types/electron-notifications/electron-notifications-tests.ts similarity index 100% rename from electron-notifications/electron-notifications-tests.ts rename to types/electron-notifications/electron-notifications-tests.ts diff --git a/electron-notifications/index.d.ts b/types/electron-notifications/index.d.ts similarity index 100% rename from electron-notifications/index.d.ts rename to types/electron-notifications/index.d.ts diff --git a/electron-notifications/tsconfig.json b/types/electron-notifications/tsconfig.json similarity index 100% rename from electron-notifications/tsconfig.json rename to types/electron-notifications/tsconfig.json diff --git a/electron-notify/electron-notify-tests.ts b/types/electron-notify/electron-notify-tests.ts similarity index 100% rename from electron-notify/electron-notify-tests.ts rename to types/electron-notify/electron-notify-tests.ts diff --git a/electron-notify/index.d.ts b/types/electron-notify/index.d.ts similarity index 100% rename from electron-notify/index.d.ts rename to types/electron-notify/index.d.ts diff --git a/electron-notify/tsconfig.json b/types/electron-notify/tsconfig.json similarity index 100% rename from electron-notify/tsconfig.json rename to types/electron-notify/tsconfig.json diff --git a/electron-packager/electron-packager-tests.ts b/types/electron-packager/electron-packager-tests.ts similarity index 100% rename from electron-packager/electron-packager-tests.ts rename to types/electron-packager/electron-packager-tests.ts diff --git a/electron-packager/index.d.ts b/types/electron-packager/index.d.ts similarity index 100% rename from electron-packager/index.d.ts rename to types/electron-packager/index.d.ts diff --git a/electron-packager/tsconfig.json b/types/electron-packager/tsconfig.json similarity index 100% rename from electron-packager/tsconfig.json rename to types/electron-packager/tsconfig.json diff --git a/electron-window-state/electron-window-state-tests.ts b/types/electron-window-state/electron-window-state-tests.ts similarity index 100% rename from electron-window-state/electron-window-state-tests.ts rename to types/electron-window-state/electron-window-state-tests.ts diff --git a/electron-window-state/index.d.ts b/types/electron-window-state/index.d.ts similarity index 100% rename from electron-window-state/index.d.ts rename to types/electron-window-state/index.d.ts diff --git a/electron-window-state/tsconfig.json b/types/electron-window-state/tsconfig.json similarity index 100% rename from electron-window-state/tsconfig.json rename to types/electron-window-state/tsconfig.json diff --git a/electron/.editorconfig b/types/electron/.editorconfig similarity index 100% rename from electron/.editorconfig rename to types/electron/.editorconfig diff --git a/electron/index.d.ts b/types/electron/index.d.ts similarity index 99% rename from electron/index.d.ts rename to types/electron/index.d.ts index 0b98ae1944..11103b3a18 100644 --- a/electron/index.d.ts +++ b/types/electron/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Electron v1.4.8 // Project: http://electron.atom.io/ -// Definitions by: jedmao , rhysd , Milan Burda , aliib , Daniel Perez Alvarez +// Definitions by: jedmao , rhysd , Milan Burda , aliib , Daniel Perez Alvarez , Markus Olsson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -2455,7 +2455,11 @@ declare namespace Electron { */ constructor(options: MenuItemOptions); - click: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; + /** + * A function that is fired when the MenuItem receives a click event + */ + click: (event: Event, browserWindow: BrowserWindow, webContents: WebContents) => void; + /** * Read-only property. */ @@ -2492,7 +2496,7 @@ declare namespace Electron { /** * Callback when the menu item is clicked. */ - click?: (menuItem: MenuItem, browserWindow: BrowserWindow) => void; + click?: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; /** * Can be normal, separator, submenu, checkbox or radio. */ diff --git a/electron/test/index.ts b/types/electron/test/index.ts similarity index 100% rename from electron/test/index.ts rename to types/electron/test/index.ts diff --git a/electron/test/main.ts b/types/electron/test/main.ts similarity index 98% rename from electron/test/main.ts rename to types/electron/test/main.ts index 276a15d851..35a85a81dc 100644 --- a/electron/test/main.ts +++ b/types/electron/test/main.ts @@ -531,12 +531,19 @@ var winWindows = new BrowserWindow({ // menu-item // https://github.com/atom/electron/blob/master/docs/api/menu-item.md -var menuItem = new MenuItem({}); +var menuItem = new MenuItem({ + click: (menuItem: Electron.MenuItem, browserWindow: Electron.BrowserWindow, event: Electron.Event) => { + console.log('click', menuItem, browserWindow, event); + } +}); + +const fakeEvent: Electron.Event = { + preventDefault: () => { }, + sender: winWindows.webContents, +} menuItem.label = 'Hello World!'; -menuItem.click = (menuItem, browserWindow) => { - console.log('click', menuItem, browserWindow); -}; +menuItem.click(fakeEvent, winWindows, winWindows.webContents) // menu // https://github.com/atom/electron/blob/master/docs/api/menu.md diff --git a/electron/test/renderer.ts b/types/electron/test/renderer.ts similarity index 100% rename from electron/test/renderer.ts rename to types/electron/test/renderer.ts diff --git a/electron/tsconfig.json b/types/electron/tsconfig.json similarity index 100% rename from electron/tsconfig.json rename to types/electron/tsconfig.json diff --git a/element-resize-event/element-resize-event-tests.ts b/types/element-resize-event/element-resize-event-tests.ts similarity index 100% rename from element-resize-event/element-resize-event-tests.ts rename to types/element-resize-event/element-resize-event-tests.ts diff --git a/element-resize-event/index.d.ts b/types/element-resize-event/index.d.ts similarity index 100% rename from element-resize-event/index.d.ts rename to types/element-resize-event/index.d.ts diff --git a/element-resize-event/tsconfig.json b/types/element-resize-event/tsconfig.json similarity index 100% rename from element-resize-event/tsconfig.json rename to types/element-resize-event/tsconfig.json diff --git a/elm/elm-tests.ts b/types/elm/elm-tests.ts similarity index 100% rename from elm/elm-tests.ts rename to types/elm/elm-tests.ts diff --git a/elm/index.d.ts b/types/elm/index.d.ts similarity index 100% rename from elm/index.d.ts rename to types/elm/index.d.ts diff --git a/elm/tsconfig.json b/types/elm/tsconfig.json similarity index 100% rename from elm/tsconfig.json rename to types/elm/tsconfig.json diff --git a/email-addresses/email-addresses-tests.ts b/types/email-addresses/email-addresses-tests.ts similarity index 100% rename from email-addresses/email-addresses-tests.ts rename to types/email-addresses/email-addresses-tests.ts diff --git a/email-addresses/index.d.ts b/types/email-addresses/index.d.ts similarity index 100% rename from email-addresses/index.d.ts rename to types/email-addresses/index.d.ts diff --git a/email-addresses/tsconfig.json b/types/email-addresses/tsconfig.json similarity index 100% rename from email-addresses/tsconfig.json rename to types/email-addresses/tsconfig.json diff --git a/email-templates/email-templates-tests.ts b/types/email-templates/email-templates-tests.ts similarity index 100% rename from email-templates/email-templates-tests.ts rename to types/email-templates/email-templates-tests.ts diff --git a/email-templates/index.d.ts b/types/email-templates/index.d.ts similarity index 100% rename from email-templates/index.d.ts rename to types/email-templates/index.d.ts diff --git a/email-templates/tsconfig.json b/types/email-templates/tsconfig.json similarity index 100% rename from email-templates/tsconfig.json rename to types/email-templates/tsconfig.json diff --git a/email-validator/email-validator-tests.ts b/types/email-validator/email-validator-tests.ts similarity index 100% rename from email-validator/email-validator-tests.ts rename to types/email-validator/email-validator-tests.ts diff --git a/email-validator/index.d.ts b/types/email-validator/index.d.ts similarity index 100% rename from email-validator/index.d.ts rename to types/email-validator/index.d.ts diff --git a/email-validator/tsconfig.json b/types/email-validator/tsconfig.json similarity index 100% rename from email-validator/tsconfig.json rename to types/email-validator/tsconfig.json diff --git a/ember/ember-tests.ts b/types/ember/ember-tests.ts similarity index 82% rename from ember/ember-tests.ts rename to types/ember/ember-tests.ts index 91e1f61f6f..99f00aae6f 100644 --- a/ember/ember-tests.ts +++ b/types/ember/ember-tests.ts @@ -1,4 +1,4 @@ -var App: any; +let App: any; App = Em.Application.create(); @@ -22,7 +22,7 @@ declare class MyPerson extends Em.Object { static createMan(): MyPerson; } -var Person1 = Em.Object.extend({ +const Person1 = Em.Object.extend({ say: (thing: string) => { alert(thing); } @@ -31,7 +31,7 @@ var Person1 = Em.Object.extend({ declare class MyPerson2 extends Em.Object { helloWorld(): void; } -var tom = Person1.create({ +const tom = Person1.create({ name: 'Tom Dale', helloWorld() { this.say('Hi my name is ' + this.get('name')); @@ -48,10 +48,9 @@ Person1.reopenClass({ } }); // ReSharper disable once DuplicatingLocalDeclaration -declare var Person1: typeof MyPerson; Person1.createMan().get('isMan'); -var person = Person1.create({ +const person = Person1.create({ firstName: 'Yehuda', lastName: 'Katz' }); @@ -63,13 +62,13 @@ App.todosController = Em.Object.create({ Em.Object.create({ isDone: false }) ], remaining: (function() { - var todos = this.get('todos'); + const 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); +const todos = App.todosController.get('todos'); +let todo = todos.objectAt(0); todo.set('isDone', true); App.todosController.get('remaining'); todo = Em.Object.create({ isDone: false }); @@ -109,29 +108,29 @@ App.userController = Em.Object.create({ Handlebars.registerHelper('highlight', (property: string, options: any) => new Handlebars.SafeString('' + "some value" + '')); -var coolView = App.CoolView.create(); +const coolView = App.CoolView.create(); -var Person2 = Em.Object.extend({ +const Person2 = Em.Object.extend({ sayHello() { console.log('Hello from ' + this.get('name')); } }); -var people = [ +const people = [ Person2.create({ name: 'Juan' }), Person2.create({ name: 'Charles' }), Person2.create({ name: 'Majd' }) ]; people.invoke('sayHello'); -var arr = [Em.Object.create(), Em.Object.create()]; +const arr = [Em.Object.create(), Em.Object.create()]; arr.setEach('name', 'unknown'); arr.getEach('name'); -var Person3 = Em.Object.extend({ +const Person3 = Em.Object.extend({ name: null, isHappy: false }); -var people2 = [ +const people2 = [ Person3.create({ name: 'Yehuda', isHappy: true }), Person3.create({ name: 'Majd', isHappy: false }) ]; @@ -145,7 +144,7 @@ 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) => { +const promise = new Em.RSVP.Promise((resolve: Function, reject: Function) => { // on success resolve('ok!'); @@ -159,15 +158,15 @@ promise.then((value: any) => { // on rejection }); -var mix1 = Ember.Mixin.create({ +const mix1 = Ember.Mixin.create({ foo: 1 }); -var mix2 = Ember.Mixin.create({ +const mix2 = Ember.Mixin.create({ bar: 2 }); -var component1 = Ember.Component.extend( mix1, mix2, { +const component1 = Ember.Component.extend( mix1, mix2, { lyft: Ember.inject.service(), cars: Ember.computed.readOnly('lyft.cars') }); diff --git a/ember/index.d.ts b/types/ember/index.d.ts similarity index 98% rename from ember/index.d.ts rename to types/ember/index.d.ts index dca7004163..1e014759cc 100644 --- a/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -7,7 +7,6 @@ /// declare namespace EmberStates { - interface Transition { targetName: string; urlMethod: string; @@ -151,16 +150,13 @@ declare namespace EmberStates { */ 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; @@ -168,9 +164,7 @@ declare namespace EmberTesting { } class QUnitAdapter extends Adapter { } - } - } interface Function { @@ -349,13 +343,10 @@ interface EnumerableConfigurationOptions { 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[]; @@ -388,7 +379,7 @@ declare namespace Ember { Alias for jQuery. **/ // ReSharper disable once DuplicatingLocalDeclaration - var $: JQueryStatic; + const $: 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 @@ -651,7 +642,7 @@ declare namespace Ember { removeObject(object: any): any; removeObjects(objects: Enumerable): MutableEnumberable; } - var BOOTED: boolean; + const BOOTED: boolean; /** Connects the properties of two objects so that whenever the value of one property changes, the other property will be changed also. @@ -967,17 +958,17 @@ declare namespace Ember { **/ 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; + const EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; + const LOG_BINDINGS: boolean; + const LOG_STACKTRACE_ON_DEPRECATION: boolean; + const LOG_VERSION: boolean; + const MODEL_FACTORY_INJECTIONS: boolean; + const RAISE_ON_DEPRECATION: boolean; } namespace EXTEND_PROTOTYPES { - export var Array: boolean; - export var Function: boolean; - export var String: boolean; + const Array: boolean; + const Function: boolean; + const String: boolean; } /** This is the object instance returned when you get the @each property on an array. It uses @@ -1049,7 +1040,7 @@ declare namespace 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; + const 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. @@ -1082,12 +1073,12 @@ declare namespace Ember { one(name: string, target: any, method: Function): Evented; trigger(name: string, ...args: string[]): void; } - var FROZEN_ERROR: string; + const FROZEN_ERROR: string; class Freezable { freeze(): Freezable; isFrozen: boolean; } - var GUID_KEY: string; + const GUID_KEY: string; namespace Handlebars { function compile(string: string): Function; function compile(environment: any, options?: any, context?: any, asObject?: any): any; @@ -1104,7 +1095,7 @@ declare namespace Ember { } function parse(string: string): any; function print(ast: any): void; - var logger: typeof Ember.Logger; + const logger: typeof Ember.Logger; function log(level: string, str: string): void; } class HashLocation extends Object { @@ -1140,8 +1131,8 @@ declare namespace Ember { static isMethod: boolean; rootURL: string; } - var IS_BINDING: RegExp; - var inject: { + const IS_BINDING: RegExp; + const inject: { controller(name?: string): Controller; service(name?: string): Service; }; @@ -1158,15 +1149,15 @@ declare namespace Ember { 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; + const K: Function; + const LOG_BINDINGS: boolean; + const LOG_STACKTRACE_ON_DEPRECATION: boolean; + const LOG_VERSION: boolean; class Location { create(options?: {}): any; registerImplementation(name: string, implementation: any): void; } - var Logger: { + const Logger: { assert(param: any): void; debug(...args: any[]): void; error(...args: any[]): void; @@ -1175,7 +1166,7 @@ declare namespace Ember { warn(...args: any[]): void; }; function MANDATORY_SETTER_FUNCTION(value: string): void; - var META_KEY: string; + const META_KEY: string; class Map { copy(): Map; static create(): Map; @@ -1305,7 +1296,7 @@ declare namespace Ember { hasEnumerableObservers: boolean; lastObject: any; } - var NAME_KEY: string; + const NAME_KEY: string; class Namespace extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; @@ -1425,7 +1416,7 @@ declare namespace Ember { static isClass: boolean; static isMethod: boolean; } - var ORDER_DEFINITION: string[]; + const ORDER_DEFINITION: string[]; class Object extends CoreObject implements Observable { addObserver: ModifyObserver; beginPropertyChanges(): Observable; @@ -1530,7 +1521,6 @@ declare namespace Ember { } 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 @@ -1591,7 +1581,6 @@ declare namespace Ember { the [routing guide](http://emberjs.com/guides/routing/) for documentation. */ class Route extends Object implements ActionHandlerMixin, Evented { - static isClass: boolean; static isMethod: boolean; @@ -1817,7 +1806,6 @@ declare namespace Ember { */ redirect(): EmberStates.Transition; - /** Refresh the model on this route and any child routes, firing the `beforeModel`, `model`, and `afterModel` hooks in a similar fashion @@ -2157,7 +2145,7 @@ declare namespace Ember { toggleProperty(keyName: string): boolean; /* /Observable */ } - var STRINGS: boolean; + const STRINGS: boolean; class State extends Object implements Evented { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; @@ -2236,7 +2224,7 @@ declare namespace Ember { function underscore(str: string): string; function w(str: string): string[]; } - var TEMPLATES: {}; + const TEMPLATES: {}; class TargetActionSupport { triggerAction(opts: {}): boolean; } @@ -2253,8 +2241,8 @@ declare namespace Ember { function registerHelper(name: string, helperMethod: Function): void; function registerAsyncHelper(name: string, helperMethod: Function): void; - var adapter: Object; - var QUnitAdapter: Object; + const adapter: Object; + const QUnitAdapter: Object; function registerWaiter(callback: Function): void; function registerWaiter(context: any, callback: Function): void; @@ -2325,18 +2313,18 @@ declare namespace Ember { bubbles: boolean; onEvent: string; } - var VERSION: string; + const VERSION: string; class ViewTargetActionSupport extends Mixin { target: any; actionContext: any; } - var ViewUtils: {}; // TODO: define interface + const ViewUtils: {}; // TODO: define interface function addListener(obj: any, eventName: string, target: Function | any, method: Function | string, once?: boolean): void; - var addObserver: ModifyObserver; + const addObserver: ModifyObserver; /** Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. **/ - var alias: typeof deprecateFunc; + const alias: typeof deprecateFunc; function aliasMethod(methodName: string): Descriptor; function assert(desc: string, test: boolean): void; function beginPropertyChanges(): void; @@ -2346,7 +2334,7 @@ declare namespace Ember { function changeProperties(callback: Function, binding?: any): void; function compare(v: any, w: any): number; // ReSharper disable once DuplicatingLocalDeclaration - var computed: { + const computed: { (...args: any[]): ComputedProperty; alias(dependentKey: string): ComputedProperty; and(...args: string[]): ComputedProperty; @@ -2385,7 +2373,7 @@ declare namespace Ember { Ember.empty is deprecated. Please use Ember.isEmpty instead. **/ // ReSharper disable once DuplicatingLocalDeclaration - var empty: typeof deprecateFunc; + const empty: typeof deprecateFunc; function endPropertyChanges(): void; function finishChains(obj: any): void; function generateController(container: Container, controllerName: string, context: any): Controller; @@ -2394,7 +2382,7 @@ declare namespace Ember { /** getPath is deprecated since get now supports paths. **/ - var getPath: typeof deprecateFunc; + const getPath: typeof deprecateFunc; function getWithDefault(root: string, key: string, defaultValue: any): any; function guidFor(obj: any): string; function handleErrors(func: Function, context: any): any; @@ -2407,7 +2395,7 @@ declare namespace Ember { function isEmpty(obj: any): boolean; function isEqual(a: any, b: any): boolean; function isGlobalPath(path: string): boolean; - var isNamespace: boolean; + const isNamespace: boolean; function isNone(obj: any): boolean; function isPrototypeOf(obj: {}): boolean; function isWatching(obj: any, key: string): boolean; @@ -2416,7 +2404,7 @@ declare namespace Ember { 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 + const lookup: {}; // TODO: define interface function makeArray(obj: any): any[]; function merge(original: any, updates: any): any; function meta(obj: any): {}; @@ -2424,14 +2412,14 @@ declare namespace Ember { /** Ember.none is deprecated. Please use Ember.isNone instead. **/ - var none: typeof deprecateFunc; + const 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; + const onError: Error; function overrideChains(obj: any, keyName: string, m: any): boolean; // ReSharper disable once DuplicatingLocalDeclaration - var platform: { + const platform: { defineProperty: boolean; hasPropertyAccessors: boolean; }; @@ -2443,7 +2431,7 @@ declare namespace Ember { function removeObserver(obj: any, path: string, target: any, method: Function): any; function required(): Descriptor; function rewatch(obj: any): void; - var run: { + const run: { (method: Function): void; (target: any, method: Function): void; begin(): void; @@ -2466,7 +2454,7 @@ declare namespace Ember { /** setPath is deprecated since set now supports paths. **/ - var setPath: typeof deprecateFunc; + const setPath: typeof deprecateFunc; function setProperties(self: any, hash: {}): any; function subscribe(pattern: string, object: any): void; function toLocaleString(): string; @@ -2477,13 +2465,13 @@ declare namespace Ember { /** trySetPath has been renamed to trySet. **/ - var trySetPath: typeof deprecateFunc; + const 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; + const uuid: number; function valueOf(): {}; function warn(message: string, test?: boolean): void; function watch(obj: any, keyPath: string): void; @@ -2491,18 +2479,17 @@ declare namespace Ember { function watchPath(obj: any, keyPath: string): void; function watchedEvents(obj: {}): any[]; function wrap(func: Function, superFunc: Function): Function; - var _ContainerProxyMixin: Mixin; - var _RegistryProxyMixin: Mixin; + const _ContainerProxyMixin: Mixin; + const _RegistryProxyMixin: Mixin; function getOwner(object: any): any; function setOwner(object: any, owner: any): void; - var testing: boolean; - var MODEL_FACTORY_INJECTIONS: boolean; + const testing: boolean; + const 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 */ diff --git a/ember/tsconfig.json b/types/ember/tsconfig.json similarity index 100% rename from ember/tsconfig.json rename to types/ember/tsconfig.json diff --git a/ember/tslint.json b/types/ember/tslint.json similarity index 100% rename from ember/tslint.json rename to types/ember/tslint.json diff --git a/ember/v1/ember-tests.ts b/types/ember/v1/ember-tests.ts similarity index 99% rename from ember/v1/ember-tests.ts rename to types/ember/v1/ember-tests.ts index 25ca3e3cc5..103fb0146e 100644 --- a/ember/v1/ember-tests.ts +++ b/types/ember/v1/ember-tests.ts @@ -1,6 +1,3 @@ -/// - - var App : any; App = Em.Application.create(); diff --git a/ember/v1/index.d.ts b/types/ember/v1/index.d.ts similarity index 100% rename from ember/v1/index.d.ts rename to types/ember/v1/index.d.ts diff --git a/ember/v1/tsconfig.json b/types/ember/v1/tsconfig.json similarity index 100% rename from ember/v1/tsconfig.json rename to types/ember/v1/tsconfig.json diff --git a/emissary/emissary-tests.ts b/types/emissary/emissary-tests.ts similarity index 100% rename from emissary/emissary-tests.ts rename to types/emissary/emissary-tests.ts diff --git a/emissary/index.d.ts b/types/emissary/index.d.ts similarity index 100% rename from emissary/index.d.ts rename to types/emissary/index.d.ts diff --git a/emissary/tsconfig.json b/types/emissary/tsconfig.json similarity index 100% rename from emissary/tsconfig.json rename to types/emissary/tsconfig.json diff --git a/emojione/emojione-tests.ts b/types/emojione/emojione-tests.ts similarity index 100% rename from emojione/emojione-tests.ts rename to types/emojione/emojione-tests.ts diff --git a/emojione/index.d.ts b/types/emojione/index.d.ts similarity index 100% rename from emojione/index.d.ts rename to types/emojione/index.d.ts diff --git a/emojione/tsconfig.json b/types/emojione/tsconfig.json similarity index 100% rename from emojione/tsconfig.json rename to types/emojione/tsconfig.json diff --git a/expr-eval/tslint.json b/types/emojione/tslint.json similarity index 100% rename from expr-eval/tslint.json rename to types/emojione/tslint.json diff --git a/empower/empower-tests.ts b/types/empower/empower-tests.ts similarity index 100% rename from empower/empower-tests.ts rename to types/empower/empower-tests.ts diff --git a/empower/index.d.ts b/types/empower/index.d.ts similarity index 100% rename from empower/index.d.ts rename to types/empower/index.d.ts diff --git a/empower/tsconfig.json b/types/empower/tsconfig.json similarity index 100% rename from empower/tsconfig.json rename to types/empower/tsconfig.json diff --git a/emscripten/emscripten-tests.ts b/types/emscripten/emscripten-tests.ts similarity index 100% rename from emscripten/emscripten-tests.ts rename to types/emscripten/emscripten-tests.ts diff --git a/emscripten/index.d.ts b/types/emscripten/index.d.ts similarity index 100% rename from emscripten/index.d.ts rename to types/emscripten/index.d.ts diff --git a/emscripten/tsconfig.json b/types/emscripten/tsconfig.json similarity index 100% rename from emscripten/tsconfig.json rename to types/emscripten/tsconfig.json diff --git a/encoding-japanese/encoding-japanese-tests.ts b/types/encoding-japanese/encoding-japanese-tests.ts similarity index 100% rename from encoding-japanese/encoding-japanese-tests.ts rename to types/encoding-japanese/encoding-japanese-tests.ts diff --git a/encoding-japanese/index.d.ts b/types/encoding-japanese/index.d.ts similarity index 100% rename from encoding-japanese/index.d.ts rename to types/encoding-japanese/index.d.ts diff --git a/encoding-japanese/tsconfig.json b/types/encoding-japanese/tsconfig.json similarity index 100% rename from encoding-japanese/tsconfig.json rename to types/encoding-japanese/tsconfig.json diff --git a/enhanced-resolve/index.d.ts b/types/enhanced-resolve/index.d.ts similarity index 100% rename from enhanced-resolve/index.d.ts rename to types/enhanced-resolve/index.d.ts diff --git a/enhanced-resolve/lib/AliasFieldPlugin.d.ts b/types/enhanced-resolve/lib/AliasFieldPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/AliasFieldPlugin.d.ts rename to types/enhanced-resolve/lib/AliasFieldPlugin.d.ts diff --git a/enhanced-resolve/lib/AliasPlugin.d.ts b/types/enhanced-resolve/lib/AliasPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/AliasPlugin.d.ts rename to types/enhanced-resolve/lib/AliasPlugin.d.ts diff --git a/enhanced-resolve/lib/AppendPlugin.d.ts b/types/enhanced-resolve/lib/AppendPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/AppendPlugin.d.ts rename to types/enhanced-resolve/lib/AppendPlugin.d.ts diff --git a/enhanced-resolve/lib/CloneBasenamePlugin.d.ts b/types/enhanced-resolve/lib/CloneBasenamePlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/CloneBasenamePlugin.d.ts rename to types/enhanced-resolve/lib/CloneBasenamePlugin.d.ts diff --git a/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts b/types/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts rename to types/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts diff --git a/enhanced-resolve/lib/ConcordMainPlugin.d.ts b/types/enhanced-resolve/lib/ConcordMainPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ConcordMainPlugin.d.ts rename to types/enhanced-resolve/lib/ConcordMainPlugin.d.ts diff --git a/enhanced-resolve/lib/ConcordModulesPlugin.d.ts b/types/enhanced-resolve/lib/ConcordModulesPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ConcordModulesPlugin.d.ts rename to types/enhanced-resolve/lib/ConcordModulesPlugin.d.ts diff --git a/enhanced-resolve/lib/DescriptionFilePlugin.d.ts b/types/enhanced-resolve/lib/DescriptionFilePlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/DescriptionFilePlugin.d.ts rename to types/enhanced-resolve/lib/DescriptionFilePlugin.d.ts diff --git a/enhanced-resolve/lib/DescriptionFileUtils.d.ts b/types/enhanced-resolve/lib/DescriptionFileUtils.d.ts similarity index 100% rename from enhanced-resolve/lib/DescriptionFileUtils.d.ts rename to types/enhanced-resolve/lib/DescriptionFileUtils.d.ts diff --git a/enhanced-resolve/lib/DirectoryExistsPlugin.d.ts b/types/enhanced-resolve/lib/DirectoryExistsPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/DirectoryExistsPlugin.d.ts rename to types/enhanced-resolve/lib/DirectoryExistsPlugin.d.ts diff --git a/enhanced-resolve/lib/FileExistsPlugin.d.ts b/types/enhanced-resolve/lib/FileExistsPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/FileExistsPlugin.d.ts rename to types/enhanced-resolve/lib/FileExistsPlugin.d.ts diff --git a/enhanced-resolve/lib/FileKindPlugin.d.ts b/types/enhanced-resolve/lib/FileKindPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/FileKindPlugin.d.ts rename to types/enhanced-resolve/lib/FileKindPlugin.d.ts diff --git a/enhanced-resolve/lib/JoinRequestPlugin.d.ts b/types/enhanced-resolve/lib/JoinRequestPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/JoinRequestPlugin.d.ts rename to types/enhanced-resolve/lib/JoinRequestPlugin.d.ts diff --git a/enhanced-resolve/lib/LogInfoPlugin.d.ts b/types/enhanced-resolve/lib/LogInfoPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/LogInfoPlugin.d.ts rename to types/enhanced-resolve/lib/LogInfoPlugin.d.ts diff --git a/enhanced-resolve/lib/MainFieldPlugin.d.ts b/types/enhanced-resolve/lib/MainFieldPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/MainFieldPlugin.d.ts rename to types/enhanced-resolve/lib/MainFieldPlugin.d.ts diff --git a/enhanced-resolve/lib/ModuleAppendPlugin.d.ts b/types/enhanced-resolve/lib/ModuleAppendPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ModuleAppendPlugin.d.ts rename to types/enhanced-resolve/lib/ModuleAppendPlugin.d.ts diff --git a/enhanced-resolve/lib/ModuleKindPlugin.d.ts b/types/enhanced-resolve/lib/ModuleKindPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ModuleKindPlugin.d.ts rename to types/enhanced-resolve/lib/ModuleKindPlugin.d.ts diff --git a/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts b/types/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts rename to types/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts diff --git a/enhanced-resolve/lib/ModulesInRootPlugin.d.ts b/types/enhanced-resolve/lib/ModulesInRootPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ModulesInRootPlugin.d.ts rename to types/enhanced-resolve/lib/ModulesInRootPlugin.d.ts diff --git a/enhanced-resolve/lib/NextPlugin.d.ts b/types/enhanced-resolve/lib/NextPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/NextPlugin.d.ts rename to types/enhanced-resolve/lib/NextPlugin.d.ts diff --git a/enhanced-resolve/lib/ParsePlugin.d.ts b/types/enhanced-resolve/lib/ParsePlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ParsePlugin.d.ts rename to types/enhanced-resolve/lib/ParsePlugin.d.ts diff --git a/enhanced-resolve/lib/Resolver.d.ts b/types/enhanced-resolve/lib/Resolver.d.ts similarity index 100% rename from enhanced-resolve/lib/Resolver.d.ts rename to types/enhanced-resolve/lib/Resolver.d.ts diff --git a/enhanced-resolve/lib/ResultPlugin.d.ts b/types/enhanced-resolve/lib/ResultPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/ResultPlugin.d.ts rename to types/enhanced-resolve/lib/ResultPlugin.d.ts diff --git a/enhanced-resolve/lib/Storage.d.ts b/types/enhanced-resolve/lib/Storage.d.ts similarity index 100% rename from enhanced-resolve/lib/Storage.d.ts rename to types/enhanced-resolve/lib/Storage.d.ts diff --git a/enhanced-resolve/lib/SymlinkPlugin.d.ts b/types/enhanced-resolve/lib/SymlinkPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/SymlinkPlugin.d.ts rename to types/enhanced-resolve/lib/SymlinkPlugin.d.ts diff --git a/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts b/types/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts similarity index 100% rename from enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts rename to types/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts diff --git a/enhanced-resolve/lib/TryNextPlugin.d.ts b/types/enhanced-resolve/lib/TryNextPlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/TryNextPlugin.d.ts rename to types/enhanced-resolve/lib/TryNextPlugin.d.ts diff --git a/enhanced-resolve/lib/UnsafeCachePlugin.d.ts b/types/enhanced-resolve/lib/UnsafeCachePlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/UnsafeCachePlugin.d.ts rename to types/enhanced-resolve/lib/UnsafeCachePlugin.d.ts diff --git a/enhanced-resolve/lib/UseFilePlugin.d.ts b/types/enhanced-resolve/lib/UseFilePlugin.d.ts similarity index 100% rename from enhanced-resolve/lib/UseFilePlugin.d.ts rename to types/enhanced-resolve/lib/UseFilePlugin.d.ts diff --git a/enhanced-resolve/lib/common-types.d.ts b/types/enhanced-resolve/lib/common-types.d.ts similarity index 100% rename from enhanced-resolve/lib/common-types.d.ts rename to types/enhanced-resolve/lib/common-types.d.ts diff --git a/enhanced-resolve/lib/concord.d.ts b/types/enhanced-resolve/lib/concord.d.ts similarity index 100% rename from enhanced-resolve/lib/concord.d.ts rename to types/enhanced-resolve/lib/concord.d.ts diff --git a/enhanced-resolve/lib/getPaths.d.ts b/types/enhanced-resolve/lib/getPaths.d.ts similarity index 100% rename from enhanced-resolve/lib/getPaths.d.ts rename to types/enhanced-resolve/lib/getPaths.d.ts diff --git a/enhanced-resolve/lib/globToRegExp.d.ts b/types/enhanced-resolve/lib/globToRegExp.d.ts similarity index 100% rename from enhanced-resolve/lib/globToRegExp.d.ts rename to types/enhanced-resolve/lib/globToRegExp.d.ts diff --git a/enhanced-resolve/test/index.ts b/types/enhanced-resolve/test/index.ts similarity index 100% rename from enhanced-resolve/test/index.ts rename to types/enhanced-resolve/test/index.ts diff --git a/enhanced-resolve/test/lib.ts b/types/enhanced-resolve/test/lib.ts similarity index 100% rename from enhanced-resolve/test/lib.ts rename to types/enhanced-resolve/test/lib.ts diff --git a/enhanced-resolve/tsconfig.json b/types/enhanced-resolve/tsconfig.json similarity index 100% rename from enhanced-resolve/tsconfig.json rename to types/enhanced-resolve/tsconfig.json diff --git a/ent/ent-tests.ts b/types/ent/ent-tests.ts similarity index 100% rename from ent/ent-tests.ts rename to types/ent/ent-tests.ts diff --git a/ent/index.d.ts b/types/ent/index.d.ts similarity index 100% rename from ent/index.d.ts rename to types/ent/index.d.ts diff --git a/ent/tsconfig.json b/types/ent/tsconfig.json similarity index 100% rename from ent/tsconfig.json rename to types/ent/tsconfig.json diff --git a/env-to-object/env-to-object-tests.ts b/types/env-to-object/env-to-object-tests.ts similarity index 100% rename from env-to-object/env-to-object-tests.ts rename to types/env-to-object/env-to-object-tests.ts diff --git a/env-to-object/index.d.ts b/types/env-to-object/index.d.ts similarity index 75% rename from env-to-object/index.d.ts rename to types/env-to-object/index.d.ts index 1ec7a3c994..8bbca83f48 100644 --- a/env-to-object/index.d.ts +++ b/types/env-to-object/index.d.ts @@ -4,11 +4,11 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace env { - export interface Mappings { + interface Mappings { [enviromentVariableName: string]: Mapping; } - export type Mapping = IntegerMapping | BooleanMapping | GenericMapping; + type Mapping = IntegerMapping | BooleanMapping | GenericMapping; interface GenericMapping { keypath: string; @@ -26,14 +26,14 @@ declare namespace env { strict: boolean; } - export interface Parsers { + interface Parsers { [parserName: string]: (str: string, opts: any) => any; } - export interface Options { + interface Options { parsers: Parsers; } } -declare function env(map: env.Mappings, options?: env.Options): any; +declare function env(map: env.Mappings, options?: env.Options): any; export = env; diff --git a/env-to-object/tsconfig.json b/types/env-to-object/tsconfig.json similarity index 100% rename from env-to-object/tsconfig.json rename to types/env-to-object/tsconfig.json diff --git a/express-mysql-session/tslint.json b/types/env-to-object/tslint.json similarity index 100% rename from express-mysql-session/tslint.json rename to types/env-to-object/tslint.json diff --git a/envify/envify-tests.ts b/types/envify/envify-tests.ts similarity index 100% rename from envify/envify-tests.ts rename to types/envify/envify-tests.ts diff --git a/envify/index.d.ts b/types/envify/index.d.ts similarity index 100% rename from envify/index.d.ts rename to types/envify/index.d.ts diff --git a/envify/tsconfig.json b/types/envify/tsconfig.json similarity index 100% rename from envify/tsconfig.json rename to types/envify/tsconfig.json diff --git a/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx similarity index 97% rename from enzyme/enzyme-tests.tsx rename to types/enzyme/enzyme-tests.tsx index 82a8dc9822..c7323766f7 100644 --- a/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -37,6 +37,13 @@ namespace ShallowWrapperTest { elementWrapper: ShallowWrapper, {}>, statelessWrapper: ShallowWrapper; + function test_props_state_inferring() { + let wrapper: ShallowWrapper; + wrapper = shallow(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_shallow_options() { shallow(, { context: { @@ -337,6 +344,13 @@ namespace ReactWrapperTest { elementWrapper: ReactWrapper, {}>, statelessWrapper: ReactWrapper; + function test_prop_state_inferring() { + let wrapper: ReactWrapper; + wrapper = mount(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_unmount() { reactWrapper = reactWrapper.unmount(); } diff --git a/enzyme/index.d.ts b/types/enzyme/index.d.ts similarity index 99% rename from enzyme/index.d.ts rename to types/enzyme/index.d.ts index fc498ca78a..abb57e36ef 100644 --- a/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -546,6 +546,7 @@ export interface MountRendererProps { * @param node * @param [options] */ +export function shallow

    (node: ReactElement

    , options?: ShallowRendererProps): ShallowWrapper; export function shallow(node: ReactElement

    , options?: ShallowRendererProps): ShallowWrapper; /** @@ -553,6 +554,7 @@ export function shallow(node: ReactElement

    , options?: ShallowRendererPr * @param node * @param [options] */ +export function mount

    (node: ReactElement

    , options?: MountRendererProps): ReactWrapper; export function mount(node: ReactElement

    , options?: MountRendererProps): ReactWrapper; /** diff --git a/enzyme/tsconfig.json b/types/enzyme/tsconfig.json similarity index 100% rename from enzyme/tsconfig.json rename to types/enzyme/tsconfig.json diff --git a/express-rate-limit/tslint.json b/types/enzyme/tslint.json similarity index 100% rename from express-rate-limit/tslint.json rename to types/enzyme/tslint.json diff --git a/eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts b/types/eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts similarity index 100% rename from eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts rename to types/eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker-tests.ts diff --git a/eonasdan-bootstrap-datetimepicker/index.d.ts b/types/eonasdan-bootstrap-datetimepicker/index.d.ts similarity index 100% rename from eonasdan-bootstrap-datetimepicker/index.d.ts rename to types/eonasdan-bootstrap-datetimepicker/index.d.ts diff --git a/eonasdan-bootstrap-datetimepicker/package.json b/types/eonasdan-bootstrap-datetimepicker/package.json similarity index 100% rename from eonasdan-bootstrap-datetimepicker/package.json rename to types/eonasdan-bootstrap-datetimepicker/package.json diff --git a/eonasdan-bootstrap-datetimepicker/tsconfig.json b/types/eonasdan-bootstrap-datetimepicker/tsconfig.json similarity index 100% rename from eonasdan-bootstrap-datetimepicker/tsconfig.json rename to types/eonasdan-bootstrap-datetimepicker/tsconfig.json diff --git a/epiceditor/epiceditor-tests.ts b/types/epiceditor/epiceditor-tests.ts similarity index 100% rename from epiceditor/epiceditor-tests.ts rename to types/epiceditor/epiceditor-tests.ts diff --git a/epiceditor/index.d.ts b/types/epiceditor/index.d.ts similarity index 100% rename from epiceditor/index.d.ts rename to types/epiceditor/index.d.ts diff --git a/epiceditor/tsconfig.json b/types/epiceditor/tsconfig.json similarity index 100% rename from epiceditor/tsconfig.json rename to types/epiceditor/tsconfig.json diff --git a/epub/epub-tests.ts b/types/epub/epub-tests.ts similarity index 100% rename from epub/epub-tests.ts rename to types/epub/epub-tests.ts diff --git a/epub/index.d.ts b/types/epub/index.d.ts similarity index 100% rename from epub/index.d.ts rename to types/epub/index.d.ts diff --git a/epub/tsconfig.json b/types/epub/tsconfig.json similarity index 100% rename from epub/tsconfig.json rename to types/epub/tsconfig.json diff --git a/eq.js/eq.js-tests.ts b/types/eq.js/eq.js-tests.ts similarity index 100% rename from eq.js/eq.js-tests.ts rename to types/eq.js/eq.js-tests.ts diff --git a/eq.js/index.d.ts b/types/eq.js/index.d.ts similarity index 100% rename from eq.js/index.d.ts rename to types/eq.js/index.d.ts diff --git a/eq.js/tsconfig.json b/types/eq.js/tsconfig.json similarity index 100% rename from eq.js/tsconfig.json rename to types/eq.js/tsconfig.json diff --git a/error-stack-parser/error-stack-parser-tests.ts b/types/error-stack-parser/error-stack-parser-tests.ts similarity index 100% rename from error-stack-parser/error-stack-parser-tests.ts rename to types/error-stack-parser/error-stack-parser-tests.ts diff --git a/error-stack-parser/index.d.ts b/types/error-stack-parser/index.d.ts similarity index 100% rename from error-stack-parser/index.d.ts rename to types/error-stack-parser/index.d.ts diff --git a/error-stack-parser/tsconfig.json b/types/error-stack-parser/tsconfig.json similarity index 100% rename from error-stack-parser/tsconfig.json rename to types/error-stack-parser/tsconfig.json diff --git a/errorhandler/errorhandler-tests.ts b/types/errorhandler/errorhandler-tests.ts similarity index 100% rename from errorhandler/errorhandler-tests.ts rename to types/errorhandler/errorhandler-tests.ts diff --git a/errorhandler/index.d.ts b/types/errorhandler/index.d.ts similarity index 100% rename from errorhandler/index.d.ts rename to types/errorhandler/index.d.ts diff --git a/errorhandler/tsconfig.json b/types/errorhandler/tsconfig.json similarity index 100% rename from errorhandler/tsconfig.json rename to types/errorhandler/tsconfig.json diff --git a/es6-collections/es6-collections-tests.ts b/types/es6-collections/es6-collections-tests.ts similarity index 100% rename from es6-collections/es6-collections-tests.ts rename to types/es6-collections/es6-collections-tests.ts diff --git a/es6-collections/index.d.ts b/types/es6-collections/index.d.ts similarity index 100% rename from es6-collections/index.d.ts rename to types/es6-collections/index.d.ts diff --git a/es6-collections/tsconfig.json b/types/es6-collections/tsconfig.json similarity index 100% rename from es6-collections/tsconfig.json rename to types/es6-collections/tsconfig.json diff --git a/es6-error/es6-error-tests.ts b/types/es6-error/es6-error-tests.ts similarity index 100% rename from es6-error/es6-error-tests.ts rename to types/es6-error/es6-error-tests.ts diff --git a/es6-error/index.d.ts b/types/es6-error/index.d.ts similarity index 100% rename from es6-error/index.d.ts rename to types/es6-error/index.d.ts diff --git a/es6-error/tsconfig.json b/types/es6-error/tsconfig.json similarity index 100% rename from es6-error/tsconfig.json rename to types/es6-error/tsconfig.json diff --git a/es6-promise/es6-promise-tests.ts b/types/es6-promise/es6-promise-tests.ts similarity index 100% rename from es6-promise/es6-promise-tests.ts rename to types/es6-promise/es6-promise-tests.ts diff --git a/es6-promise/index.d.ts b/types/es6-promise/index.d.ts similarity index 100% rename from es6-promise/index.d.ts rename to types/es6-promise/index.d.ts diff --git a/es6-promise/tsconfig.json b/types/es6-promise/tsconfig.json similarity index 100% rename from es6-promise/tsconfig.json rename to types/es6-promise/tsconfig.json diff --git a/es6-shim/es6-shim-tests.ts b/types/es6-shim/es6-shim-tests.ts similarity index 100% rename from es6-shim/es6-shim-tests.ts rename to types/es6-shim/es6-shim-tests.ts diff --git a/es6-shim/index.d.ts b/types/es6-shim/index.d.ts similarity index 100% rename from es6-shim/index.d.ts rename to types/es6-shim/index.d.ts diff --git a/es6-shim/tsconfig.json b/types/es6-shim/tsconfig.json similarity index 100% rename from es6-shim/tsconfig.json rename to types/es6-shim/tsconfig.json diff --git a/es6-weak-map/es6-weak-map-tests.ts b/types/es6-weak-map/es6-weak-map-tests.ts similarity index 100% rename from es6-weak-map/es6-weak-map-tests.ts rename to types/es6-weak-map/es6-weak-map-tests.ts diff --git a/es6-weak-map/index.d.ts b/types/es6-weak-map/index.d.ts similarity index 100% rename from es6-weak-map/index.d.ts rename to types/es6-weak-map/index.d.ts diff --git a/es6-weak-map/tsconfig.json b/types/es6-weak-map/tsconfig.json similarity index 100% rename from es6-weak-map/tsconfig.json rename to types/es6-weak-map/tsconfig.json diff --git a/extract-zip/tslint.json b/types/es6-weak-map/tslint.json similarity index 100% rename from extract-zip/tslint.json rename to types/es6-weak-map/tslint.json diff --git a/escape-html/escape-html-tests.ts b/types/escape-html/escape-html-tests.ts similarity index 100% rename from escape-html/escape-html-tests.ts rename to types/escape-html/escape-html-tests.ts diff --git a/escape-html/index.d.ts b/types/escape-html/index.d.ts similarity index 100% rename from escape-html/index.d.ts rename to types/escape-html/index.d.ts diff --git a/escape-html/tsconfig.json b/types/escape-html/tsconfig.json similarity index 100% rename from escape-html/tsconfig.json rename to types/escape-html/tsconfig.json diff --git a/escape-latex/escape-latex-tests.ts b/types/escape-latex/escape-latex-tests.ts similarity index 100% rename from escape-latex/escape-latex-tests.ts rename to types/escape-latex/escape-latex-tests.ts diff --git a/escape-latex/index.d.ts b/types/escape-latex/index.d.ts similarity index 100% rename from escape-latex/index.d.ts rename to types/escape-latex/index.d.ts diff --git a/escape-latex/tsconfig.json b/types/escape-latex/tsconfig.json similarity index 100% rename from escape-latex/tsconfig.json rename to types/escape-latex/tsconfig.json diff --git a/escape-string-regexp/escape-string-regexp-tests.ts b/types/escape-string-regexp/escape-string-regexp-tests.ts similarity index 100% rename from escape-string-regexp/escape-string-regexp-tests.ts rename to types/escape-string-regexp/escape-string-regexp-tests.ts diff --git a/escape-string-regexp/index.d.ts b/types/escape-string-regexp/index.d.ts similarity index 100% rename from escape-string-regexp/index.d.ts rename to types/escape-string-regexp/index.d.ts diff --git a/escape-string-regexp/tsconfig.json b/types/escape-string-regexp/tsconfig.json similarity index 100% rename from escape-string-regexp/tsconfig.json rename to types/escape-string-regexp/tsconfig.json diff --git a/escodegen/escodegen-tests.ts b/types/escodegen/escodegen-tests.ts similarity index 100% rename from escodegen/escodegen-tests.ts rename to types/escodegen/escodegen-tests.ts diff --git a/escodegen/index.d.ts b/types/escodegen/index.d.ts similarity index 100% rename from escodegen/index.d.ts rename to types/escodegen/index.d.ts diff --git a/escodegen/tsconfig.json b/types/escodegen/tsconfig.json similarity index 100% rename from escodegen/tsconfig.json rename to types/escodegen/tsconfig.json diff --git a/esprima-walk/esprima-walk-tests.ts b/types/esprima-walk/esprima-walk-tests.ts similarity index 100% rename from esprima-walk/esprima-walk-tests.ts rename to types/esprima-walk/esprima-walk-tests.ts diff --git a/esprima-walk/index.d.ts b/types/esprima-walk/index.d.ts similarity index 100% rename from esprima-walk/index.d.ts rename to types/esprima-walk/index.d.ts diff --git a/esprima-walk/tsconfig.json b/types/esprima-walk/tsconfig.json similarity index 100% rename from esprima-walk/tsconfig.json rename to types/esprima-walk/tsconfig.json diff --git a/esprima/esprima-tests.ts b/types/esprima/esprima-tests.ts similarity index 95% rename from esprima/esprima-tests.ts rename to types/esprima/esprima-tests.ts index d7c748d3b8..60b54e0679 100644 --- a/esprima/esprima-tests.ts +++ b/types/esprima/esprima-tests.ts @@ -1,6 +1,3 @@ -/// - - import esprima = require('esprima'); import * as ESTree from 'estree'; diff --git a/esprima/index.d.ts b/types/esprima/index.d.ts similarity index 100% rename from esprima/index.d.ts rename to types/esprima/index.d.ts diff --git a/esprima/tsconfig.json b/types/esprima/tsconfig.json similarity index 100% rename from esprima/tsconfig.json rename to types/esprima/tsconfig.json diff --git a/estraverse/estraverse-tests.ts b/types/estraverse/estraverse-tests.ts similarity index 100% rename from estraverse/estraverse-tests.ts rename to types/estraverse/estraverse-tests.ts diff --git a/estraverse/index.d.ts b/types/estraverse/index.d.ts similarity index 100% rename from estraverse/index.d.ts rename to types/estraverse/index.d.ts diff --git a/estraverse/tsconfig.json b/types/estraverse/tsconfig.json similarity index 100% rename from estraverse/tsconfig.json rename to types/estraverse/tsconfig.json diff --git a/estree/UNUSED_FILES.txt b/types/estree/UNUSED_FILES.txt similarity index 100% rename from estree/UNUSED_FILES.txt rename to types/estree/UNUSED_FILES.txt diff --git a/estree/estree-tests.ts b/types/estree/estree-tests.ts similarity index 100% rename from estree/estree-tests.ts rename to types/estree/estree-tests.ts diff --git a/estree/flow.d.ts b/types/estree/flow.d.ts similarity index 100% rename from estree/flow.d.ts rename to types/estree/flow.d.ts diff --git a/estree/index.d.ts b/types/estree/index.d.ts similarity index 100% rename from estree/index.d.ts rename to types/estree/index.d.ts diff --git a/estree/tsconfig.json b/types/estree/tsconfig.json similarity index 100% rename from estree/tsconfig.json rename to types/estree/tsconfig.json diff --git a/evaporate/evaporate-tests.ts b/types/evaporate/evaporate-tests.ts similarity index 100% rename from evaporate/evaporate-tests.ts rename to types/evaporate/evaporate-tests.ts diff --git a/evaporate/index.d.ts b/types/evaporate/index.d.ts similarity index 100% rename from evaporate/index.d.ts rename to types/evaporate/index.d.ts diff --git a/evaporate/tsconfig.json b/types/evaporate/tsconfig.json similarity index 100% rename from evaporate/tsconfig.json rename to types/evaporate/tsconfig.json diff --git a/event-kit/.editorconfig b/types/event-kit/.editorconfig similarity index 100% rename from event-kit/.editorconfig rename to types/event-kit/.editorconfig diff --git a/event-kit/event-kit-tests.ts b/types/event-kit/event-kit-tests.ts similarity index 100% rename from event-kit/event-kit-tests.ts rename to types/event-kit/event-kit-tests.ts diff --git a/event-kit/index.d.ts b/types/event-kit/index.d.ts similarity index 100% rename from event-kit/index.d.ts rename to types/event-kit/index.d.ts diff --git a/event-kit/tsconfig.json b/types/event-kit/tsconfig.json similarity index 100% rename from event-kit/tsconfig.json rename to types/event-kit/tsconfig.json diff --git a/event-loop-lag/event-loop-lag-tests.ts b/types/event-loop-lag/event-loop-lag-tests.ts similarity index 100% rename from event-loop-lag/event-loop-lag-tests.ts rename to types/event-loop-lag/event-loop-lag-tests.ts diff --git a/event-loop-lag/index.d.ts b/types/event-loop-lag/index.d.ts similarity index 100% rename from event-loop-lag/index.d.ts rename to types/event-loop-lag/index.d.ts diff --git a/event-loop-lag/tsconfig.json b/types/event-loop-lag/tsconfig.json similarity index 100% rename from event-loop-lag/tsconfig.json rename to types/event-loop-lag/tsconfig.json diff --git a/event-stream/event-stream-tests.ts b/types/event-stream/event-stream-tests.ts similarity index 100% rename from event-stream/event-stream-tests.ts rename to types/event-stream/event-stream-tests.ts diff --git a/event-stream/index.d.ts b/types/event-stream/index.d.ts similarity index 100% rename from event-stream/index.d.ts rename to types/event-stream/index.d.ts diff --git a/types/event-stream/tsconfig.json b/types/event-stream/tsconfig.json new file mode 100644 index 0000000000..768497bcd8 --- /dev/null +++ b/types/event-stream/tsconfig.json @@ -0,0 +1,25 @@ +{ + "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", + "event-stream-tests.ts" + ] +} \ No newline at end of file diff --git a/event-to-promise/event-to-promise-tests.ts b/types/event-to-promise/event-to-promise-tests.ts similarity index 100% rename from event-to-promise/event-to-promise-tests.ts rename to types/event-to-promise/event-to-promise-tests.ts diff --git a/event-to-promise/index.d.ts b/types/event-to-promise/index.d.ts similarity index 100% rename from event-to-promise/index.d.ts rename to types/event-to-promise/index.d.ts diff --git a/event-to-promise/tsconfig.json b/types/event-to-promise/tsconfig.json similarity index 100% rename from event-to-promise/tsconfig.json rename to types/event-to-promise/tsconfig.json diff --git a/eventemitter2/eventemitter2-tests.ts b/types/eventemitter2/eventemitter2-tests.ts similarity index 100% rename from eventemitter2/eventemitter2-tests.ts rename to types/eventemitter2/eventemitter2-tests.ts diff --git a/eventemitter2/index.d.ts b/types/eventemitter2/index.d.ts similarity index 100% rename from eventemitter2/index.d.ts rename to types/eventemitter2/index.d.ts diff --git a/eventemitter2/tsconfig.json b/types/eventemitter2/tsconfig.json similarity index 100% rename from eventemitter2/tsconfig.json rename to types/eventemitter2/tsconfig.json diff --git a/eventemitter3/eventemitter3-tests.ts b/types/eventemitter3/eventemitter3-tests.ts similarity index 100% rename from eventemitter3/eventemitter3-tests.ts rename to types/eventemitter3/eventemitter3-tests.ts diff --git a/eventemitter3/index.d.ts b/types/eventemitter3/index.d.ts similarity index 100% rename from eventemitter3/index.d.ts rename to types/eventemitter3/index.d.ts diff --git a/eventemitter3/tsconfig.json b/types/eventemitter3/tsconfig.json similarity index 100% rename from eventemitter3/tsconfig.json rename to types/eventemitter3/tsconfig.json diff --git a/evernote/evernote-tests.ts b/types/evernote/evernote-tests.ts similarity index 100% rename from evernote/evernote-tests.ts rename to types/evernote/evernote-tests.ts diff --git a/evernote/index.d.ts b/types/evernote/index.d.ts similarity index 100% rename from evernote/index.d.ts rename to types/evernote/index.d.ts diff --git a/evernote/tsconfig.json b/types/evernote/tsconfig.json similarity index 100% rename from evernote/tsconfig.json rename to types/evernote/tsconfig.json diff --git a/exit/exit-tests.ts b/types/exit/exit-tests.ts similarity index 100% rename from exit/exit-tests.ts rename to types/exit/exit-tests.ts diff --git a/exit/index.d.ts b/types/exit/index.d.ts similarity index 100% rename from exit/index.d.ts rename to types/exit/index.d.ts diff --git a/exit/tsconfig.json b/types/exit/tsconfig.json similarity index 100% rename from exit/tsconfig.json rename to types/exit/tsconfig.json diff --git a/exorcist/exorcist-tests.ts b/types/exorcist/exorcist-tests.ts similarity index 100% rename from exorcist/exorcist-tests.ts rename to types/exorcist/exorcist-tests.ts diff --git a/exorcist/index.d.ts b/types/exorcist/index.d.ts similarity index 100% rename from exorcist/index.d.ts rename to types/exorcist/index.d.ts diff --git a/exorcist/tsconfig.json b/types/exorcist/tsconfig.json similarity index 100% rename from exorcist/tsconfig.json rename to types/exorcist/tsconfig.json diff --git a/expect.js/expect.js-tests.ts b/types/expect.js/expect.js-tests.ts similarity index 100% rename from expect.js/expect.js-tests.ts rename to types/expect.js/expect.js-tests.ts diff --git a/expect.js/index.d.ts b/types/expect.js/index.d.ts similarity index 100% rename from expect.js/index.d.ts rename to types/expect.js/index.d.ts diff --git a/expect.js/tsconfig.json b/types/expect.js/tsconfig.json similarity index 100% rename from expect.js/tsconfig.json rename to types/expect.js/tsconfig.json diff --git a/expect/expect-tests.ts b/types/expect/expect-tests.ts similarity index 99% rename from expect/expect-tests.ts rename to types/expect/expect-tests.ts index 3e08e0d747..c4312d1ada 100644 --- a/expect/expect-tests.ts +++ b/types/expect/expect-tests.ts @@ -1,4 +1,3 @@ - /// import {Expectation, Extension, Spy, createSpy, isSpy, assert, spyOn, extend, restoreSpies} from 'expect'; diff --git a/expect/index.d.ts b/types/expect/index.d.ts similarity index 85% rename from expect/index.d.ts rename to types/expect/index.d.ts index 7b4e95e2b5..8e3422a4d9 100644 --- a/expect/index.d.ts +++ b/types/expect/index.d.ts @@ -4,11 +4,11 @@ // 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; + type CompareValues = (a: T, b: T) => boolean; + type Comparator = (target: {}, key: string) => boolean; + type KeyType = string | number; - export class Expectation { + class Expectation { constructor(actual: any); toExist(message?: string): Expectation; toBeTruthy(message?: string): Expectation; @@ -61,16 +61,16 @@ declare namespace expect { withArgs(...args: any[]): Expectation; } - export interface Extension { + interface Extension { [name: string]: (args?: any[]) => void; } - export interface Call { + interface Call { context: T; arguments: any[]; } - export interface Spy { + interface Spy { (...args: any[]): void; __isSpy: boolean; calls: Array>; @@ -84,14 +84,12 @@ declare namespace expect { 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; - + function createSpy(fn?: (...args: any[]) => any, restore?: (...args: any[]) => any): Spy; + function spyOn(object: T, methodName: string): Spy; + function isSpy(object: {}): boolean; + function restoreSpies(): void; + function assert(condition: boolean, messageFormat: string, ...extraArgs: any[]): void; + function extend(extension: Extension): void; } declare function expect(actual: T): expect.Expectation; diff --git a/expect/tsconfig.json b/types/expect/tsconfig.json similarity index 100% rename from expect/tsconfig.json rename to types/expect/tsconfig.json diff --git a/f1/tslint.json b/types/expect/tslint.json similarity index 100% rename from f1/tslint.json rename to types/expect/tslint.json diff --git a/expectations/expectations-tests.ts b/types/expectations/expectations-tests.ts similarity index 100% rename from expectations/expectations-tests.ts rename to types/expectations/expectations-tests.ts diff --git a/expectations/index.d.ts b/types/expectations/index.d.ts similarity index 100% rename from expectations/index.d.ts rename to types/expectations/index.d.ts diff --git a/expectations/tsconfig.json b/types/expectations/tsconfig.json similarity index 100% rename from expectations/tsconfig.json rename to types/expectations/tsconfig.json diff --git a/expr-eval/expr-eval-tests.ts b/types/expr-eval/expr-eval-tests.ts similarity index 100% rename from expr-eval/expr-eval-tests.ts rename to types/expr-eval/expr-eval-tests.ts diff --git a/expr-eval/index.d.ts b/types/expr-eval/index.d.ts similarity index 100% rename from expr-eval/index.d.ts rename to types/expr-eval/index.d.ts diff --git a/expr-eval/tsconfig.json b/types/expr-eval/tsconfig.json similarity index 100% rename from expr-eval/tsconfig.json rename to types/expr-eval/tsconfig.json diff --git a/falcor/tslint.json b/types/expr-eval/tslint.json similarity index 100% rename from falcor/tslint.json rename to types/expr-eval/tslint.json diff --git a/express-brute-memcached/express-brute-memcached-tests.ts b/types/express-brute-memcached/express-brute-memcached-tests.ts similarity index 100% rename from express-brute-memcached/express-brute-memcached-tests.ts rename to types/express-brute-memcached/express-brute-memcached-tests.ts diff --git a/express-brute-memcached/index.d.ts b/types/express-brute-memcached/index.d.ts similarity index 100% rename from express-brute-memcached/index.d.ts rename to types/express-brute-memcached/index.d.ts diff --git a/express-brute-memcached/tsconfig.json b/types/express-brute-memcached/tsconfig.json similarity index 100% rename from express-brute-memcached/tsconfig.json rename to types/express-brute-memcached/tsconfig.json diff --git a/express-brute-mongo/express-brute-mongo-tests.ts b/types/express-brute-mongo/express-brute-mongo-tests.ts similarity index 100% rename from express-brute-mongo/express-brute-mongo-tests.ts rename to types/express-brute-mongo/express-brute-mongo-tests.ts diff --git a/express-brute-mongo/index.d.ts b/types/express-brute-mongo/index.d.ts similarity index 100% rename from express-brute-mongo/index.d.ts rename to types/express-brute-mongo/index.d.ts diff --git a/express-brute-mongo/tsconfig.json b/types/express-brute-mongo/tsconfig.json similarity index 100% rename from express-brute-mongo/tsconfig.json rename to types/express-brute-mongo/tsconfig.json diff --git a/express-brute/express-brute-tests.ts b/types/express-brute/express-brute-tests.ts similarity index 100% rename from express-brute/express-brute-tests.ts rename to types/express-brute/express-brute-tests.ts diff --git a/express-brute/index.d.ts b/types/express-brute/index.d.ts similarity index 100% rename from express-brute/index.d.ts rename to types/express-brute/index.d.ts diff --git a/express-brute/tsconfig.json b/types/express-brute/tsconfig.json similarity index 100% rename from express-brute/tsconfig.json rename to types/express-brute/tsconfig.json diff --git a/express-debug/express-debug-tests.ts b/types/express-debug/express-debug-tests.ts similarity index 100% rename from express-debug/express-debug-tests.ts rename to types/express-debug/express-debug-tests.ts diff --git a/express-debug/index.d.ts b/types/express-debug/index.d.ts similarity index 100% rename from express-debug/index.d.ts rename to types/express-debug/index.d.ts diff --git a/express-debug/tsconfig.json b/types/express-debug/tsconfig.json similarity index 100% rename from express-debug/tsconfig.json rename to types/express-debug/tsconfig.json diff --git a/express-domain-middleware/express-domain-middleware-tests.ts b/types/express-domain-middleware/express-domain-middleware-tests.ts similarity index 100% rename from express-domain-middleware/express-domain-middleware-tests.ts rename to types/express-domain-middleware/express-domain-middleware-tests.ts diff --git a/express-domain-middleware/index.d.ts b/types/express-domain-middleware/index.d.ts similarity index 100% rename from express-domain-middleware/index.d.ts rename to types/express-domain-middleware/index.d.ts diff --git a/express-domain-middleware/tsconfig.json b/types/express-domain-middleware/tsconfig.json similarity index 100% rename from express-domain-middleware/tsconfig.json rename to types/express-domain-middleware/tsconfig.json diff --git a/express-formidable/express-formidable-tests.ts b/types/express-formidable/express-formidable-tests.ts similarity index 100% rename from express-formidable/express-formidable-tests.ts rename to types/express-formidable/express-formidable-tests.ts diff --git a/express-formidable/index.d.ts b/types/express-formidable/index.d.ts similarity index 100% rename from express-formidable/index.d.ts rename to types/express-formidable/index.d.ts diff --git a/express-formidable/tsconfig.json b/types/express-formidable/tsconfig.json similarity index 100% rename from express-formidable/tsconfig.json rename to types/express-formidable/tsconfig.json diff --git a/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts similarity index 100% rename from express-graphql/express-graphql-tests.ts rename to types/express-graphql/express-graphql-tests.ts diff --git a/express-graphql/index.d.ts b/types/express-graphql/index.d.ts similarity index 100% rename from express-graphql/index.d.ts rename to types/express-graphql/index.d.ts diff --git a/express-graphql/tsconfig.json b/types/express-graphql/tsconfig.json similarity index 100% rename from express-graphql/tsconfig.json rename to types/express-graphql/tsconfig.json diff --git a/express-handlebars/express-handlebars-tests.ts b/types/express-handlebars/express-handlebars-tests.ts similarity index 100% rename from express-handlebars/express-handlebars-tests.ts rename to types/express-handlebars/express-handlebars-tests.ts diff --git a/express-handlebars/index.d.ts b/types/express-handlebars/index.d.ts similarity index 100% rename from express-handlebars/index.d.ts rename to types/express-handlebars/index.d.ts diff --git a/express-handlebars/tsconfig.json b/types/express-handlebars/tsconfig.json similarity index 100% rename from express-handlebars/tsconfig.json rename to types/express-handlebars/tsconfig.json diff --git a/express-jwt/express-jwt-tests.ts b/types/express-jwt/express-jwt-tests.ts similarity index 100% rename from express-jwt/express-jwt-tests.ts rename to types/express-jwt/express-jwt-tests.ts diff --git a/express-jwt/index.d.ts b/types/express-jwt/index.d.ts similarity index 100% rename from express-jwt/index.d.ts rename to types/express-jwt/index.d.ts diff --git a/express-jwt/tsconfig.json b/types/express-jwt/tsconfig.json similarity index 100% rename from express-jwt/tsconfig.json rename to types/express-jwt/tsconfig.json diff --git a/express-less/express-less-tests.ts b/types/express-less/express-less-tests.ts similarity index 100% rename from express-less/express-less-tests.ts rename to types/express-less/express-less-tests.ts diff --git a/express-less/index.d.ts b/types/express-less/index.d.ts similarity index 100% rename from express-less/index.d.ts rename to types/express-less/index.d.ts diff --git a/express-less/tsconfig.json b/types/express-less/tsconfig.json similarity index 100% rename from express-less/tsconfig.json rename to types/express-less/tsconfig.json diff --git a/express-minify/express-minify-tests.ts b/types/express-minify/express-minify-tests.ts similarity index 100% rename from express-minify/express-minify-tests.ts rename to types/express-minify/express-minify-tests.ts diff --git a/express-minify/index.d.ts b/types/express-minify/index.d.ts similarity index 100% rename from express-minify/index.d.ts rename to types/express-minify/index.d.ts diff --git a/express-minify/tsconfig.json b/types/express-minify/tsconfig.json similarity index 100% rename from express-minify/tsconfig.json rename to types/express-minify/tsconfig.json diff --git a/express-mung/express-mung-tests.ts b/types/express-mung/express-mung-tests.ts similarity index 100% rename from express-mung/express-mung-tests.ts rename to types/express-mung/express-mung-tests.ts diff --git a/express-mung/index.d.ts b/types/express-mung/index.d.ts similarity index 100% rename from express-mung/index.d.ts rename to types/express-mung/index.d.ts diff --git a/express-mung/tsconfig.json b/types/express-mung/tsconfig.json similarity index 100% rename from express-mung/tsconfig.json rename to types/express-mung/tsconfig.json diff --git a/express-myconnection/express-myconnection-tests.ts b/types/express-myconnection/express-myconnection-tests.ts similarity index 100% rename from express-myconnection/express-myconnection-tests.ts rename to types/express-myconnection/express-myconnection-tests.ts diff --git a/express-myconnection/index.d.ts b/types/express-myconnection/index.d.ts similarity index 100% rename from express-myconnection/index.d.ts rename to types/express-myconnection/index.d.ts diff --git a/express-myconnection/tsconfig.json b/types/express-myconnection/tsconfig.json similarity index 100% rename from express-myconnection/tsconfig.json rename to types/express-myconnection/tsconfig.json diff --git a/express-mysql-session/express-mysql-session-tests.ts b/types/express-mysql-session/express-mysql-session-tests.ts similarity index 100% rename from express-mysql-session/express-mysql-session-tests.ts rename to types/express-mysql-session/express-mysql-session-tests.ts diff --git a/express-mysql-session/index.d.ts b/types/express-mysql-session/index.d.ts similarity index 100% rename from express-mysql-session/index.d.ts rename to types/express-mysql-session/index.d.ts diff --git a/express-mysql-session/tsconfig.json b/types/express-mysql-session/tsconfig.json similarity index 100% rename from express-mysql-session/tsconfig.json rename to types/express-mysql-session/tsconfig.json diff --git a/fetch-mock/tslint.json b/types/express-mysql-session/tslint.json similarity index 100% rename from fetch-mock/tslint.json rename to types/express-mysql-session/tslint.json diff --git a/express-openapi/express-openapi-tests.ts b/types/express-openapi/express-openapi-tests.ts similarity index 100% rename from express-openapi/express-openapi-tests.ts rename to types/express-openapi/express-openapi-tests.ts diff --git a/express-openapi/index.d.ts b/types/express-openapi/index.d.ts similarity index 100% rename from express-openapi/index.d.ts rename to types/express-openapi/index.d.ts diff --git a/express-openapi/tsconfig.json b/types/express-openapi/tsconfig.json similarity index 100% rename from express-openapi/tsconfig.json rename to types/express-openapi/tsconfig.json diff --git a/express-partials/express-partials-tests.ts b/types/express-partials/express-partials-tests.ts similarity index 100% rename from express-partials/express-partials-tests.ts rename to types/express-partials/express-partials-tests.ts diff --git a/express-partials/index.d.ts b/types/express-partials/index.d.ts similarity index 100% rename from express-partials/index.d.ts rename to types/express-partials/index.d.ts diff --git a/express-partials/tsconfig.json b/types/express-partials/tsconfig.json similarity index 100% rename from express-partials/tsconfig.json rename to types/express-partials/tsconfig.json diff --git a/express-rate-limit/express-rate-limit-tests.ts b/types/express-rate-limit/express-rate-limit-tests.ts similarity index 84% rename from express-rate-limit/express-rate-limit-tests.ts rename to types/express-rate-limit/express-rate-limit-tests.ts index 761a6d23f8..624a2da10d 100644 --- a/express-rate-limit/express-rate-limit-tests.ts +++ b/types/express-rate-limit/express-rate-limit-tests.ts @@ -1,12 +1,12 @@ import RateLimit = require("express-rate-limit"); -var apiLimiter = new RateLimit({ +const apiLimiter = new RateLimit({ windowMs: 15 * 60 * 1000, // 15 minutes max: 100, delayMs: 0 // disabled }); -var createAccountLimiter = new RateLimit({ +const createAccountLimiter = new RateLimit({ windowMs: 60 * 60 * 1000, // 1 hour window delayAfter: 1, // begin slowing down responses after the first request delayMs: 3 * 1000, // slow down subsequent responses by 3 seconds per request @@ -20,6 +20,6 @@ class SomeStore implements RateLimit.Store { resetKey(key: string) { }; }; -var limiterWithStore = new RateLimit({ +const limiterWithStore = new RateLimit({ store: new SomeStore() }); diff --git a/express-rate-limit/index.d.ts b/types/express-rate-limit/index.d.ts similarity index 81% rename from express-rate-limit/index.d.ts rename to types/express-rate-limit/index.d.ts index 38ef8f8b29..ce09dbbf51 100644 --- a/express-rate-limit/index.d.ts +++ b/types/express-rate-limit/index.d.ts @@ -8,13 +8,13 @@ import express = require("express"); declare namespace RateLimit { type StoreIncrementCallback = (err?: {}, hits?: number) => void; - export interface Store { + interface Store { incr: (key: string, cb: StoreIncrementCallback) => void; resetAll: () => void; resetKey: (key: string) => void; } - export interface Options { + interface Options { delayAfter?: number; delayMs?: number; handlers?: () => any; @@ -29,9 +29,5 @@ declare namespace RateLimit { } } -interface RateLimitStatic { - new(options: RateLimit.Options): express.RequestHandler; -} - -declare var RateLimit: RateLimitStatic; +declare var RateLimit: new (options: RateLimit.Options) => express.RequestHandler; export = RateLimit; diff --git a/express-rate-limit/tsconfig.json b/types/express-rate-limit/tsconfig.json similarity index 100% rename from express-rate-limit/tsconfig.json rename to types/express-rate-limit/tsconfig.json diff --git a/fetch.io/tslint.json b/types/express-rate-limit/tslint.json similarity index 100% rename from fetch.io/tslint.json rename to types/express-rate-limit/tslint.json diff --git a/express-route-fs/express-route-fs-tests.ts b/types/express-route-fs/express-route-fs-tests.ts similarity index 100% rename from express-route-fs/express-route-fs-tests.ts rename to types/express-route-fs/express-route-fs-tests.ts diff --git a/express-route-fs/index.d.ts b/types/express-route-fs/index.d.ts similarity index 100% rename from express-route-fs/index.d.ts rename to types/express-route-fs/index.d.ts diff --git a/express-route-fs/tsconfig.json b/types/express-route-fs/tsconfig.json similarity index 100% rename from express-route-fs/tsconfig.json rename to types/express-route-fs/tsconfig.json diff --git a/express-serve-static-core/express-serve-static-core-tests.ts b/types/express-serve-static-core/express-serve-static-core-tests.ts similarity index 100% rename from express-serve-static-core/express-serve-static-core-tests.ts rename to types/express-serve-static-core/express-serve-static-core-tests.ts diff --git a/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts similarity index 99% rename from express-serve-static-core/index.d.ts rename to types/express-serve-static-core/index.d.ts index a4ce9612e7..a54481027d 100644 --- a/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -96,6 +96,7 @@ interface IRouter extends RequestHandler { head: IRouterMatcher; checkout: IRouterMatcher; + connect: IRouterMatcher; copy: IRouterMatcher; lock: IRouterMatcher; merge: IRouterMatcher; @@ -104,6 +105,8 @@ interface IRouter extends RequestHandler { move: IRouterMatcher; "m-search": IRouterMatcher; notify: IRouterMatcher; + propfind: IRouterMatcher; + proppatch: IRouterMatcher; purge: IRouterMatcher; report: IRouterMatcher; search: IRouterMatcher; @@ -161,6 +164,8 @@ interface CookieOptions { path?: string; domain?: string; secure?: boolean | 'auto'; + encode?: (val: string) => void; + sameSite?: boolean | string; } interface Errback { (err: Error): void; } @@ -858,7 +863,7 @@ interface RequestParamHandler { (req: Request, res: Response, next: NextFunction, value: any, name: string): any; } -type ApplicaitonRequestHandler = IRouterHandler & IRouterMatcher & { +type ApplicationRequestHandler = IRouterHandler & IRouterMatcher & { (...handlers: RequestHandlerParams[]): T; }; @@ -1103,7 +1108,7 @@ interface Application extends IRouter, Express.Application { */ _router: any; - use: ApplicaitonRequestHandler; + use: ApplicationRequestHandler; } interface Express extends Application { diff --git a/express-serve-static-core/tsconfig.json b/types/express-serve-static-core/tsconfig.json similarity index 100% rename from express-serve-static-core/tsconfig.json rename to types/express-serve-static-core/tsconfig.json diff --git a/express-session/express-session-tests.ts b/types/express-session/express-session-tests.ts similarity index 100% rename from express-session/express-session-tests.ts rename to types/express-session/express-session-tests.ts diff --git a/express-session/index.d.ts b/types/express-session/index.d.ts similarity index 100% rename from express-session/index.d.ts rename to types/express-session/index.d.ts diff --git a/express-session/tsconfig.json b/types/express-session/tsconfig.json similarity index 100% rename from express-session/tsconfig.json rename to types/express-session/tsconfig.json diff --git a/express-unless/express-unless-tests.ts b/types/express-unless/express-unless-tests.ts similarity index 100% rename from express-unless/express-unless-tests.ts rename to types/express-unless/express-unless-tests.ts diff --git a/express-unless/index.d.ts b/types/express-unless/index.d.ts similarity index 100% rename from express-unless/index.d.ts rename to types/express-unless/index.d.ts diff --git a/express-unless/tsconfig.json b/types/express-unless/tsconfig.json similarity index 100% rename from express-unless/tsconfig.json rename to types/express-unless/tsconfig.json diff --git a/express-useragent/express-useragent-tests.ts b/types/express-useragent/express-useragent-tests.ts similarity index 100% rename from express-useragent/express-useragent-tests.ts rename to types/express-useragent/express-useragent-tests.ts diff --git a/express-useragent/index.d.ts b/types/express-useragent/index.d.ts similarity index 100% rename from express-useragent/index.d.ts rename to types/express-useragent/index.d.ts diff --git a/express-useragent/tsconfig.json b/types/express-useragent/tsconfig.json similarity index 100% rename from express-useragent/tsconfig.json rename to types/express-useragent/tsconfig.json diff --git a/express-validator/express-validator-tests.ts b/types/express-validator/express-validator-tests.ts similarity index 100% rename from express-validator/express-validator-tests.ts rename to types/express-validator/express-validator-tests.ts diff --git a/express-validator/index.d.ts b/types/express-validator/index.d.ts similarity index 100% rename from express-validator/index.d.ts rename to types/express-validator/index.d.ts diff --git a/express-validator/tsconfig.json b/types/express-validator/tsconfig.json similarity index 100% rename from express-validator/tsconfig.json rename to types/express-validator/tsconfig.json diff --git a/express/express-tests.ts b/types/express/express-tests.ts similarity index 100% rename from express/express-tests.ts rename to types/express/express-tests.ts diff --git a/express/index.d.ts b/types/express/index.d.ts similarity index 100% rename from express/index.d.ts rename to types/express/index.d.ts diff --git a/express/tsconfig.json b/types/express/tsconfig.json similarity index 100% rename from express/tsconfig.json rename to types/express/tsconfig.json diff --git a/extend/extend-tests.ts b/types/extend/extend-tests.ts similarity index 100% rename from extend/extend-tests.ts rename to types/extend/extend-tests.ts diff --git a/extend/index.d.ts b/types/extend/index.d.ts similarity index 100% rename from extend/index.d.ts rename to types/extend/index.d.ts diff --git a/extend/tsconfig.json b/types/extend/tsconfig.json similarity index 100% rename from extend/tsconfig.json rename to types/extend/tsconfig.json diff --git a/extended-listbox/extended-listbox-tests.ts b/types/extended-listbox/extended-listbox-tests.ts similarity index 73% rename from extended-listbox/extended-listbox-tests.ts rename to types/extended-listbox/extended-listbox-tests.ts index 0ca2f862b1..dfa51ffebf 100644 --- a/extended-listbox/extended-listbox-tests.ts +++ b/types/extended-listbox/extended-listbox-tests.ts @@ -1,5 +1,4 @@ - - +/// var $test = $("#test"); @@ -126,54 +125,3 @@ instance.onItemEnterPressed((event: ListboxEvent) => { 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/types/extended-listbox/index.d.ts similarity index 77% rename from extended-listbox/index.d.ts rename to types/extended-listbox/index.d.ts index eb5f0eec04..3f3527b903 100644 --- a/extended-listbox/index.d.ts +++ b/types/extended-listbox/index.d.ts @@ -1,10 +1,8 @@ -// Type definitions for extended-listbox 1.1.x +// Type definitions for extended-listbox 2.0.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; @@ -147,37 +145,4 @@ interface JQuery { /** 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/extended-listbox/tsconfig.json b/types/extended-listbox/tsconfig.json similarity index 100% rename from extended-listbox/tsconfig.json rename to types/extended-listbox/tsconfig.json diff --git a/extjs/extjs-tests.ts b/types/extjs/extjs-tests.ts similarity index 100% rename from extjs/extjs-tests.ts rename to types/extjs/extjs-tests.ts diff --git a/extjs/index.d.ts b/types/extjs/index.d.ts similarity index 100% rename from extjs/index.d.ts rename to types/extjs/index.d.ts diff --git a/extjs/tsconfig.json b/types/extjs/tsconfig.json similarity index 100% rename from extjs/tsconfig.json rename to types/extjs/tsconfig.json diff --git a/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts b/types/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts similarity index 100% rename from extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts rename to types/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts diff --git a/extract-text-webpack-plugin/index.d.ts b/types/extract-text-webpack-plugin/index.d.ts similarity index 100% rename from extract-text-webpack-plugin/index.d.ts rename to types/extract-text-webpack-plugin/index.d.ts diff --git a/extract-text-webpack-plugin/tsconfig.json b/types/extract-text-webpack-plugin/tsconfig.json similarity index 100% rename from extract-text-webpack-plugin/tsconfig.json rename to types/extract-text-webpack-plugin/tsconfig.json diff --git a/extract-zip/extract-zip-tests.ts b/types/extract-zip/extract-zip-tests.ts similarity index 100% rename from extract-zip/extract-zip-tests.ts rename to types/extract-zip/extract-zip-tests.ts diff --git a/extract-zip/index.d.ts b/types/extract-zip/index.d.ts similarity index 94% rename from extract-zip/index.d.ts rename to types/extract-zip/index.d.ts index 52ce40094f..9edd2fcb31 100644 --- a/extract-zip/index.d.ts +++ b/types/extract-zip/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace extract { - export interface Options { + interface Options { dir?: string; defaultDirMode?: number; defaultFileMode?: number; diff --git a/extract-zip/tsconfig.json b/types/extract-zip/tsconfig.json similarity index 100% rename from extract-zip/tsconfig.json rename to types/extract-zip/tsconfig.json diff --git a/fine-uploader/tslint.json b/types/extract-zip/tslint.json similarity index 100% rename from fine-uploader/tslint.json rename to types/extract-zip/tslint.json diff --git a/eyes/eyes-tests.ts b/types/eyes/eyes-tests.ts similarity index 100% rename from eyes/eyes-tests.ts rename to types/eyes/eyes-tests.ts diff --git a/eyes/index.d.ts b/types/eyes/index.d.ts similarity index 100% rename from eyes/index.d.ts rename to types/eyes/index.d.ts diff --git a/eyes/tsconfig.json b/types/eyes/tsconfig.json similarity index 100% rename from eyes/tsconfig.json rename to types/eyes/tsconfig.json diff --git a/f1/f1-tests.ts b/types/f1/f1-tests.ts similarity index 100% rename from f1/f1-tests.ts rename to types/f1/f1-tests.ts diff --git a/f1/index.d.ts b/types/f1/index.d.ts similarity index 100% rename from f1/index.d.ts rename to types/f1/index.d.ts diff --git a/f1/tsconfig.json b/types/f1/tsconfig.json similarity index 100% rename from f1/tsconfig.json rename to types/f1/tsconfig.json diff --git a/flatpickr/tslint.json b/types/f1/tslint.json similarity index 100% rename from flatpickr/tslint.json rename to types/f1/tslint.json diff --git a/fabric/fabric-tests.ts b/types/fabric/fabric-tests.ts similarity index 78% rename from fabric/fabric-tests.ts rename to types/fabric/fabric-tests.ts index 923b29d896..e94b676104 100644 --- a/fabric/fabric-tests.ts +++ b/types/fabric/fabric-tests.ts @@ -1,7 +1,7 @@ import * as fabric from "fabric"; function sample1() { - var canvas = new fabric.Canvas('c', { + const canvas = new fabric.Canvas('c', { hoverCursor: 'pointer', selection: false, }); @@ -13,7 +13,7 @@ function sample1() { e.target.opacity = 1; }); - for (var i = 0, len = 15; i < len; i++) { + for (let i = 0; i < 15; i++) { fabric.Image.fromURL('../assets/ladybug.png', img => { img.set({ left: fabric.util.getRandomInt(0, 600), @@ -33,17 +33,16 @@ function sample1() { } 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; - }, + let dot: fabric.Circle, i: number; + let t1: number, t2: number; + const startTimer = () => { + t1 = new Date().getTime(); + return t1; + }; + const stopTimer = () => { + t2 = new Date().getTime(); + return t2 - t1; + }, getRandomInt = fabric.util.getRandomInt, rainbow = ["#ffcc66", "#ccff66", "#66ccff", "#ff6fcf", "#ff6666"], rainbowEnd = rainbow.length - 1; @@ -51,7 +50,7 @@ function sample2() { // // Rendering canvas #1 // - var canvas1 = new fabric.Canvas('c1', { backgroundColor: "#000" }), + const canvas1 = new fabric.Canvas('c1', { backgroundColor: "#000" }), results1 = document.getElementById('results-c1'); startTimer(); @@ -66,11 +65,10 @@ function sample2() { } results1.innerHTML = 'Regular rendering of 100 elements in ' + stopTimer() + 'ms'; - // // Rendering canvas #2 // - var canvas2 = new fabric.Canvas('c2', { backgroundColor: "#000", renderOnAddRemove: false }), + const canvas2 = new fabric.Canvas('c2', { backgroundColor: "#000", renderOnAddRemove: false }), results2 = document.getElementById('results-c2'); startTimer(); @@ -88,35 +86,34 @@ function sample2() { } function sample3() { - - var $: (id: string) => HTMLElement = (id: string) => document.getElementById(id); + const $: (id: string) => HTMLElement = (id: string) => document.getElementById(id); function applyFilter(index: number, filter: any) { - var obj: fabric.Image = canvas.getActiveObject(); + const 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(); + const 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' }), + const 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', + const 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(); + for (let i = 0; i < filters.length; i++) { + const checkBox = $(filters[i]); + const image = canvas.getActiveObject(); checkBox.checked = !!image.filters[i]; } }, @@ -126,7 +123,7 @@ function sample3() { }); fabric.Image.fromURL('../assets/printio.png', img => { - var oImg = img.set({ left: 300, top: 300, angle: -15 }).scale(0.9); + const oImg = img.set({ left: 300, top: 300, angle: -15 }).scale(0.9); canvas.add(oImg).renderAll(); canvas.setActiveObject(oImg); }); @@ -211,11 +208,10 @@ function sample3() { } function sample4() { + const canvas = new fabric.Canvas('c'); + const $: (id: string) => HTMLElement = id => document.getElementById(id); - var canvas = new fabric.Canvas('c'); - var $: (id: string) => HTMLElement = id => document.getElementById(id); - - var rect = new fabric.Rect({ + const rect = new fabric.Rect({ width: 100, height: 100, top: 150, @@ -225,32 +221,31 @@ function sample4() { canvas.add(rect); - var angleControl = $('angle-control'); + const angleControl = $('angle-control'); angleControl.onchange = function(this: HTMLInputElement) { rect.setAngle(+this.value).setCoords(); canvas.renderAll(); }; - var scaleControl = $('scale-control'); + const scaleControl = $('scale-control'); scaleControl.onchange = function(this: HTMLInputElement) { rect.scale(+this.value).setCoords(); canvas.renderAll(); }; - var topControl = $('top-control'); + const topControl = $('top-control'); topControl.onchange = function(this: HTMLInputElement) { rect.setTop(+this.value).setCoords(); canvas.renderAll(); }; - var leftControl = $('left-control'); + const 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(); @@ -263,7 +258,6 @@ function sample4() { }); } - declare module "fabric" { export interface CircleWithLineInfos extends Circle { line1?: Line; @@ -274,8 +268,8 @@ declare module "fabric" { } 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({ + const makeCircle = (left: number, top: number, line1?: fabric.Line, line2?: fabric.Line, line3?: fabric.Line, line4?: fabric.Line): fabric.Circle => { + const c = new fabric.Circle({ left, top, strokeWidth: 5, @@ -300,9 +294,9 @@ function sample5() { }); } - var canvas = new fabric.Canvas('c', { selection: false }); + const canvas = new fabric.Canvas('c', { selection: false }); - var line = makeLine([250, 125, 250, 175]), + const line = makeLine([250, 125, 250, 175]), line2 = makeLine([250, 175, 250, 250]), line3 = makeLine([250, 250, 300, 350]), line4 = makeLine([250, 250, 200, 350]), @@ -322,7 +316,7 @@ function sample5() { ); canvas.on('object:moving', e => { - var p = e.target; + const 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 }); @@ -332,9 +326,9 @@ function sample5() { } function sample6() { - var canvas = new fabric.Canvas('c'); + const canvas = new fabric.Canvas('c'); fabric.loadSVGFromURL('../assets/135.svg', objects => { - var obj = objects[0].scale(0.25); + const obj = objects[0].scale(0.25); canvas.centerObject(obj); canvas.add(obj); @@ -344,17 +338,15 @@ function sample6() { canvas.add(obj.clone(() => { }).set({ left: 480, top: 400, angle: 15 })); canvas.on('mouse:move', options => { - var p = canvas.getPointer(options.e); + const p = canvas.getPointer(options.e); canvas.forEachObject(obj => { - var distX = Math.abs(p.x - obj.left), + const 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)); }); - }); - }); } @@ -365,22 +357,20 @@ declare module "fabric" { } function sample7() { - - var canvas = new fabric.Canvas('c', { selection: false }); + const canvas = new fabric.Canvas('c', { selection: false }); setInterval(() => { fabric.Image.fromURL('../assets/ladybug.png', obj => { - var img = obj; + const 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() { + const animate = (function animate() { canvas.forEachObject(obj => { - var img = obj; + const img = obj; img.left += (img.movingLeft ? -1 : 1); img.top += 1; if (img.left > 900 || img.top > 500) { @@ -397,7 +387,6 @@ function sample7() { } function sample8() { - function pad(str: string, length: number): string { while (str.length < length) { str = '0' + str; @@ -405,7 +394,7 @@ function sample8() { return str; } - var getRandomInt = fabric.util.getRandomInt; + const getRandomInt = fabric.util.getRandomInt; function getRandomColor() { return ( @@ -423,18 +412,18 @@ function sample8() { (fabric.Object.prototype as any).cornersize = 30; } - var canvas = new fabric.Canvas('canvas'); + const canvas = new fabric.Canvas('canvas'); // canvas.controlsAboveOverlay = true; function updateComplexity() { setTimeout(() => { - var element = document.getElementById('complexity').childNodes[1]; + const element = document.getElementById('complexity').childNodes[1]; element.innerHTML = ' ' + canvas.complexity(); }, 100); } document.getElementById('commands').onclick = (ev: any) => { - var ev: any = ev || window.event; + ev = ev || window.event; if (ev.preventDefault) { ev.preventDefault(); @@ -442,12 +431,12 @@ function sample8() { ev.returnValue = false; } - var element: any = ev.target || ev.srcElement; + let element: any = ev.target || ev.srcElement; if (element.nodeName.toLowerCase() === 'strong') { element = element.parentNode; } - var className = element.className, + const className = element.className, offset = 50, left = fabric.util.getRandomInt(0 + offset, 700 - offset), top = fabric.util.getRandomInt(0 + offset, 500 - offset), @@ -455,7 +444,6 @@ function sample8() { 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({ @@ -519,11 +507,11 @@ function sample8() { break; case 'shape': - var id: any = element.id; + const 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); + const loadedObject = fabric.util.groupSVGElements(objects, options); loadedObject.set({ left, @@ -552,13 +540,12 @@ function sample8() { }; document.getElementById('execute').onclick = () => { - var code = ( document.getElementById('canvas-console')).value; + const 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'); @@ -567,14 +554,14 @@ function sample8() { } }; - var removeSelectedEl = document.getElementById('remove-selected'); + const removeSelectedEl = document.getElementById('remove-selected'); removeSelectedEl.onclick = () => { - var activeObject = canvas.getActiveObject(), + const activeObject = canvas.getActiveObject(), activeGroup = canvas.getActiveGroup(); if (activeObject) { canvas.remove(activeObject); } else if (activeGroup) { - var objectsInGroup = activeGroup.getObjects(); + const objectsInGroup = activeGroup.getObjects(); canvas.discardActiveGroup(); objectsInGroup.forEach(object => { canvas.remove(object); @@ -582,9 +569,9 @@ function sample8() { } }; - var supportsInputOfType = (type: string) => { + const supportsInputOfType = (type: string) => { return () => { - var el = document.createElement('input'); + const el = document.createElement('input'); try { el.type = type; } catch (err) { } @@ -592,18 +579,18 @@ function sample8() { }; }; - var supportsSlider = supportsInputOfType('range'), + const supportsSlider = supportsInputOfType('range'), supportsColorpicker = supportsInputOfType('color'); if (supportsSlider()) { (() => { - var controls = document.getElementById('controls'); + const controls = document.getElementById('controls'); - var sliderLabel = document.createElement('label'); + const sliderLabel = document.createElement('label'); sliderLabel.htmlFor = 'opacity'; sliderLabel.innerHTML = 'Opacity: '; - var slider = document.createElement('input'); + const slider = document.createElement('input'); try { slider.type = 'range'; } catch (err) { } @@ -616,7 +603,7 @@ function sample8() { canvas.calcOffset(); slider.onchange = function() { - var activeObject = canvas.getActiveObject(), + const activeObject = canvas.getActiveObject(), activeGroup = canvas.getActiveGroup(); if (activeObject || activeGroup) { @@ -629,14 +616,14 @@ function sample8() { if (supportsColorpicker()) { (() => { - var controls = document.getElementById('controls'); + const controls = document.getElementById('controls'); - var label = document.createElement('label'); + const label = document.createElement('label'); label.htmlFor = 'color'; label.innerHTML = 'Color: '; label.style.marginLeft = '10px'; - var colorpicker = document.createElement('input'); + const colorpicker = document.createElement('input'); colorpicker.type = 'color'; colorpicker.id = 'color'; colorpicker.style.width = '40px'; @@ -647,7 +634,7 @@ function sample8() { canvas.calcOffset(); colorpicker.onchange = function() { - var activeObject = canvas.getActiveObject(), + const activeObject = canvas.getActiveObject(), activeGroup = canvas.getActiveGroup(); if (activeObject || activeGroup) { @@ -658,9 +645,9 @@ function sample8() { })(); } - var lockHorizontallyEl = document.getElementById('lock-horizontally'); + const lockHorizontallyEl = document.getElementById('lock-horizontally'); lockHorizontallyEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); + const activeObject: any = canvas.getActiveObject(); if (activeObject) { activeObject.lockMovementX = !activeObject.lockMovementX; lockHorizontallyEl.innerHTML = activeObject.lockMovementX @@ -669,9 +656,9 @@ function sample8() { } }; - var lockVerticallyEl = document.getElementById('lock-vertically'); + const lockVerticallyEl = document.getElementById('lock-vertically'); lockVerticallyEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); + const activeObject: any = canvas.getActiveObject(); if (activeObject) { activeObject.lockMovementY = !activeObject.lockMovementY; lockVerticallyEl.innerHTML = activeObject.lockMovementY @@ -680,9 +667,9 @@ function sample8() { } }; - var lockScalingXEl = document.getElementById('lock-scaling-x'); + const lockScalingXEl = document.getElementById('lock-scaling-x'); lockScalingXEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); + const activeObject: any = canvas.getActiveObject(); if (activeObject) { activeObject.lockScalingX = !activeObject.lockScalingX; lockScalingXEl.innerHTML = activeObject.lockScalingX @@ -691,9 +678,9 @@ function sample8() { } }; - var lockScalingYEl = document.getElementById('lock-scaling-y'); + const lockScalingYEl = document.getElementById('lock-scaling-y'); lockScalingYEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); + const activeObject: any = canvas.getActiveObject(); if (activeObject) { activeObject.lockScalingY = !activeObject.lockScalingY; lockScalingYEl.innerHTML = activeObject.lockScalingY @@ -702,9 +689,9 @@ function sample8() { } }; - var lockRotationEl = document.getElementById('lock-rotation'); + const lockRotationEl = document.getElementById('lock-rotation'); lockRotationEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); + const activeObject: any = canvas.getActiveObject(); if (activeObject) { activeObject.lockRotation = !activeObject.lockRotation; lockRotationEl.innerHTML = activeObject.lockRotation @@ -713,9 +700,9 @@ function sample8() { } }; - var gradientifyBtn = document.getElementById('gradientify'); + const gradientifyBtn = document.getElementById('gradientify'); - var activeObjectButtons = [ + const activeObjectButtons = [ lockHorizontallyEl, lockVerticallyEl, lockScalingXEl, @@ -725,16 +712,16 @@ function sample8() { gradientifyBtn ]; - var opacityEl = document.getElementById('opacity'); + const opacityEl = document.getElementById('opacity'); if (opacityEl) { activeObjectButtons.push(opacityEl); } - var colorEl = document.getElementById('color'); + const colorEl = document.getElementById('color'); if (colorEl) { activeObjectButtons.push(colorEl); } - for (var i = activeObjectButtons.length; i--; ) { + for (let i = activeObjectButtons.length; i--; ) { activeObjectButtons[i]; } @@ -742,9 +729,9 @@ function sample8() { canvas.on('group:selected', onObjectSelected); function onObjectSelected(e: fabric.IEvent) { - var selectedObject = e.target; + const selectedObject = e.target; - for (var i = activeObjectButtons.length; i--; ) { + for (let i = activeObjectButtons.length; i--; ) { activeObjectButtons[i]; } @@ -756,18 +743,18 @@ function sample8() { } canvas.on('selection:cleared', e => { - for (var i = activeObjectButtons.length; i--; ) { + for (let i = activeObjectButtons.length; i--; ) { activeObjectButtons[i]; } }); - var drawingModeEl = document.getElementById('drawing-mode'), + const 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; + const canvasWithDrawingMode: any = canvas; canvasWithDrawingMode.isDrawingMode = !canvasWithDrawingMode.isDrawingMode; if (canvasWithDrawingMode.isDrawingMode) { drawingModeEl.innerHTML = 'Cancel drawing mode'; @@ -794,12 +781,11 @@ function sample8() { 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' + + const 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)), { + const textSample = new fabric.Text(text.slice(0, getRandomInt(0, text.length)), { left: getRandomInt(350, 400), top: getRandomInt(350, 400), fontFamily: 'helvetica', @@ -813,13 +799,12 @@ function sample8() { updateComplexity(); }; - document.onkeydown = e => { - var obj = canvas.getActiveObject() || canvas.getActiveGroup(); + const 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(); + // const groupObjects = obj.getObjects(); // canvas.discardActiveGroup(); // groupObjects.forEach(function(obj) { // canvas.remove(obj); @@ -842,7 +827,7 @@ function sample8() { } gradientifyBtn.onclick = () => { - var obj = canvas.getActiveObject(); + const obj = canvas.getActiveObject(); if (obj) { obj.setGradient("fill", { x2: (getRandomInt(0, 1) ? 0 : obj.width), @@ -856,17 +841,17 @@ function sample8() { } }; - var textEl = document.getElementById('text'); + const textEl = document.getElementById('text'); if (textEl) { textEl.onfocus = function() { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { this.value = ( activeObject).text; } }; textEl.onkeyup = function(e) { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject) { if (!this.value) { canvas.discardActiveObject(); @@ -878,11 +863,11 @@ function sample8() { }; } - var cmdUnderlineBtn = document.getElementById('text-cmd-underline'); + const cmdUnderlineBtn = document.getElementById('text-cmd-underline'); if (cmdUnderlineBtn) { activeObjectButtons.push(cmdUnderlineBtn); cmdUnderlineBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration === 'underline' ? '' : 'underline'); this.className = activeObject.textDecoration ? 'selected' : ''; @@ -891,11 +876,11 @@ function sample8() { }; } - var cmdLinethroughBtn = document.getElementById('text-cmd-linethrough'); + const cmdLinethroughBtn = document.getElementById('text-cmd-linethrough'); if (cmdLinethroughBtn) { activeObjectButtons.push(cmdLinethroughBtn); cmdLinethroughBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration === 'line-through' ? '' : 'line-through'); this.className = activeObject.textDecoration ? 'selected' : ''; @@ -904,11 +889,11 @@ function sample8() { }; } - var cmdOverlineBtn = document.getElementById('text-cmd-overline'); + const cmdOverlineBtn = document.getElementById('text-cmd-overline'); if (cmdOverlineBtn) { activeObjectButtons.push(cmdOverlineBtn); cmdOverlineBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration === 'overline' ? '' : 'overline'); this.className = activeObject.textDecoration ? 'selected' : ''; @@ -917,11 +902,11 @@ function sample8() { }; } - var cmdBoldBtn = document.getElementById('text-cmd-bold'); + const cmdBoldBtn = document.getElementById('text-cmd-bold'); if (cmdBoldBtn) { activeObjectButtons.push(cmdBoldBtn); cmdBoldBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontWeight = (activeObject.fontWeight === 'bold' ? '' : 'bold'); this.className = activeObject.fontWeight ? 'selected' : ''; @@ -930,11 +915,11 @@ function sample8() { }; } - var cmdItalicBtn = document.getElementById('text-cmd-italic'); + const cmdItalicBtn = document.getElementById('text-cmd-italic'); if (cmdItalicBtn) { activeObjectButtons.push(cmdItalicBtn); cmdItalicBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontStyle = (activeObject.fontStyle === 'italic' ? '' : 'italic'); this.className = activeObject.fontStyle ? 'selected' : ''; @@ -943,11 +928,11 @@ function sample8() { }; } - var cmdShadowBtn = document.getElementById('text-cmd-shadow'); + const cmdShadowBtn = document.getElementById('text-cmd-shadow'); if (cmdShadowBtn) { activeObjectButtons.push(cmdShadowBtn); cmdShadowBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + const 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' : ''; @@ -956,11 +941,11 @@ function sample8() { }; } - var textAlignSwitch = document.getElementById('text-align'); + const textAlignSwitch = document.getElementById('text-align'); if (textAlignSwitch) { activeObjectButtons.push(textAlignSwitch); textAlignSwitch.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textAlign = this.value.toLowerCase(); canvas.renderAll(); @@ -968,11 +953,11 @@ function sample8() { }; } - var fontFamilySwitch = document.getElementById('font-family'); + const fontFamilySwitch = document.getElementById('font-family'); if (fontFamilySwitch) { activeObjectButtons.push(fontFamilySwitch); fontFamilySwitch.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontFamily = this.value; canvas.renderAll(); @@ -980,10 +965,10 @@ function sample8() { }; } - var bgColorField = document.getElementById('text-bg-color'); + const bgColorField = document.getElementById('text-bg-color'); if (bgColorField) { bgColorField.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.backgroundColor = this.value; canvas.renderAll(); @@ -991,10 +976,10 @@ function sample8() { }; } - var strokeColorField = document.getElementById('text-stroke-color'); + const strokeColorField = document.getElementById('text-stroke-color'); if (strokeColorField) { strokeColorField.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.stroke = this.value; canvas.renderAll(); @@ -1004,9 +989,9 @@ function sample8() { if (supportsSlider) { (() => { - var container = document.getElementById('text-controls'); - var slider = document.createElement('input'); - var label = document.createElement('label'); + const container = document.getElementById('text-controls'); + const slider = document.createElement('input'); + const label = document.createElement('label'); label.innerHTML = 'Line height: '; try { slider.type = 'range'; } catch (err) { } slider.min = "0"; @@ -1017,7 +1002,7 @@ function sample8() { label.appendChild(slider); slider.title = "Line height"; slider.onchange = function() { - var activeObject = canvas.getActiveObject(); + const activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.lineHeight = +this.value; canvas.renderAll(); @@ -1031,9 +1016,9 @@ function sample8() { } document.getElementById('load-svg').onclick = () => { - var svg = ( document.getElementById('svg-console')).value; + const svg = ( document.getElementById('svg-console')).value; fabric.loadSVGFromString(svg, (objects, options) => { - var obj = fabric.util.groupSVGElements(objects, options); + const obj = fabric.util.groupSVGElements(objects, options); canvas.add(obj).centerObject(obj).renderAll(); obj.setCoords(); }); @@ -1041,7 +1026,7 @@ function sample8() { } function sample9() { - var canvas = new fabric.Canvas('c'); + const 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/types/fabric/index.d.ts similarity index 99% rename from fabric/index.d.ts rename to types/fabric/index.d.ts index 881be190bd..27a4188f52 100644 --- a/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -5,8 +5,8 @@ export as namespace fabric; -export var isLikelyNode: boolean; -export var isTouchSupported: boolean; +export const isLikelyNode: boolean; +export const isTouchSupported: boolean; ///////////////////////////////////////////////////////////// // farbic Functions @@ -1289,7 +1289,6 @@ export class StaticCanvas { */ fxStraightenObject(object: Object): StaticCanvas - static EMPTY_JSON: string; /** * Provides a way to check support of some of the canvas methods @@ -2997,8 +2996,8 @@ interface IRectOptions extends IObjectOptions { * Vertical border radius */ ry?: number; - } + export interface Rect extends IRectOptions {} export class Rect extends Object { /** @@ -3950,8 +3949,8 @@ export class BaseBrush { * @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 @@ -3969,6 +3968,7 @@ export class CircleBrush extends BaseBrush { */ addPoint(pointer: any): Point } + export class SprayBrush extends BaseBrush { /** * Width of a brush @@ -4147,7 +4147,6 @@ interface IUtilArc { * @param {Number} y3 */ getBoundsOfCurve(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): Point[]; - } interface IUtilDomEvent { @@ -4298,7 +4297,6 @@ interface IUtilClass { * (be careful modifying objects defined here as this would affect all instances) */ createClass(properties?: any): void; - } interface IUtilObject { @@ -4517,7 +4515,7 @@ interface IUtilMisc { isTransparent(ctx: CanvasRenderingContext2D, x: number, y: number, tolerance: number): boolean; } -export var util: IUtil; +export const util: IUtil; interface IUtil extends IUtilAnimation, IUtilArc, IObservable, IUtilDomEvent, IUtilDomMisc, IUtilDomRequest, IUtilDomStyle, IUtilClass, IUtilMisc { ease: IUtilAnimEase; diff --git a/fabric/tsconfig.json b/types/fabric/tsconfig.json similarity index 100% rename from fabric/tsconfig.json rename to types/fabric/tsconfig.json diff --git a/fabric/tslint.json b/types/fabric/tslint.json similarity index 100% rename from fabric/tslint.json rename to types/fabric/tslint.json diff --git a/facebook-js-sdk/facebook-js-sdk-tests.ts b/types/facebook-js-sdk/facebook-js-sdk-tests.ts similarity index 100% rename from facebook-js-sdk/facebook-js-sdk-tests.ts rename to types/facebook-js-sdk/facebook-js-sdk-tests.ts diff --git a/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts similarity index 99% rename from facebook-js-sdk/index.d.ts rename to types/facebook-js-sdk/index.d.ts index a7b78e73b0..cb1981580a 100644 --- a/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -172,6 +172,7 @@ declare namespace facebook { authResponse: { accessToken: string; expiresIn: number; + grantedScopes: string; signedRequest: string; userID: string; }; diff --git a/facebook-js-sdk/tsconfig.json b/types/facebook-js-sdk/tsconfig.json similarity index 100% rename from facebook-js-sdk/tsconfig.json rename to types/facebook-js-sdk/tsconfig.json diff --git a/facebook-pixel/facebook-pixel-tests.ts b/types/facebook-pixel/facebook-pixel-tests.ts similarity index 100% rename from facebook-pixel/facebook-pixel-tests.ts rename to types/facebook-pixel/facebook-pixel-tests.ts diff --git a/facebook-pixel/index.d.ts b/types/facebook-pixel/index.d.ts similarity index 100% rename from facebook-pixel/index.d.ts rename to types/facebook-pixel/index.d.ts diff --git a/facebook-pixel/tsconfig.json b/types/facebook-pixel/tsconfig.json similarity index 100% rename from facebook-pixel/tsconfig.json rename to types/facebook-pixel/tsconfig.json diff --git a/types/faker/faker-tests.ts b/types/faker/faker-tests.ts new file mode 100644 index 0000000000..5fb6a53746 --- /dev/null +++ b/types/faker/faker-tests.ts @@ -0,0 +1,205 @@ + + +let resultStr: string; +let resultBool: boolean; +let resultNum: number; +let resultStrArr: string[]; +let resultDate: Date; + +import faker = require('faker'); +faker.locale = 'en'; + +resultStr = faker.address.zipCode(); +resultStr = faker.address.zipCode('###'); +resultStr = faker.address.city(); +resultStr = faker.address.city(0); +resultStr = faker.address.cityPrefix(); +resultStr = faker.address.citySuffix(); +resultStr = faker.address.streetName(); +resultStr = faker.address.streetAddress(); +resultStr = faker.address.streetAddress(false);; +resultStr = faker.address.streetSuffix(); +resultStr = faker.address.streetPrefix(); +resultStr = faker.address.secondaryAddress(); +resultStr = faker.address.county(); +resultStr = faker.address.country(); +resultStr = faker.address.countryCode(); +resultStr = faker.address.state(); +resultStr = faker.address.state(false); +resultStr = faker.address.stateAbbr(); +resultStr = faker.address.latitude(); +resultStr = faker.address.longitude(); + +resultStr = faker.commerce.color(); +resultStr = faker.commerce.department(); +resultStr = faker.commerce.productName(); +resultStr = faker.commerce.price(); +resultStr = faker.commerce.price(0, 0, 0, '#'); +resultStr = faker.commerce.productAdjective(); +resultStr = faker.commerce.productMaterial(); +resultStr = faker.commerce.product(); + +resultStrArr = faker.company.suffixes(); +resultStr = faker.company.companyName(); +resultStr = faker.company.companyName(0); +resultStr = faker.company.companySuffix(); +resultStr = faker.company.catchPhrase(); +resultStr = faker.company.bs(); +resultStr = faker.company.catchPhraseAdjective(); +resultStr = faker.company.catchPhraseDescriptor(); +resultStr = faker.company.catchPhraseNoun(); +resultStr = faker.company.bsAdjective(); +resultStr = faker.company.bsBuzz(); +resultStr = faker.company.bsNoun(); + +resultStr = faker.database.column(); +resultStr = faker.database.type(); +resultStr = faker.database.collation(); +resultStr = faker.database.engine(); + +resultDate = faker.date.past(); +resultDate = faker.date.future(); +resultDate = faker.date.between('foo', 'bar'); +resultDate = faker.date.between(new Date(), new Date()); +resultDate = faker.date.recent(); +resultDate = faker.date.recent(100); +resultStr = faker.date.month(); +resultStr = faker.date.month({ + abbr: true, + context: true +}); +resultStr = faker.date.weekday(); +resultStr = faker.date.weekday({ + abbr: true, + context: true +}); + +resultStr = faker.finance.account(); +resultStr = faker.finance.account(0); +resultStr = faker.finance.accountName(); +resultStr = faker.finance.mask(); +resultStr = faker.finance.mask(0, false, false); +resultStr = faker.finance.amount(); +resultStr = faker.finance.amount(0, 0, 0, '#'); +resultStr = faker.finance.transactionType(); +resultStr = faker.finance.currencyCode(); +resultStr = faker.finance.currencyName(); +resultStr = faker.finance.currencySymbol(); +resultStr = faker.finance.bitcoinAddress(); +resultStr = faker.finance.bic(); + +resultStr = faker.hacker.abbreviation(); +resultStr = faker.hacker.adjective(); +resultStr = faker.hacker.noun(); +resultStr = faker.hacker.verb(); +resultStr = faker.hacker.ingverb(); +resultStr = faker.hacker.phrase(); + +resultStr = faker.helpers.randomize(); +resultNum = faker.helpers.randomize([1,2,3,4]); +resultStr = faker.helpers.randomize(['foo', 'bar', 'quux']); +resultStr = faker.helpers.slugify('foo bar quux'); +resultStr = faker.helpers.replaceSymbolWithNumber('foo# bar#'); +resultStr = faker.helpers.replaceSymbols('foo# bar? quux#'); +resultStrArr = faker.helpers.shuffle(['foo', 'bar', 'quux']); +resultStr = faker.helpers.mustache('{{foo}}{{bar}}', {foo: 'x', bar: 'y'}); + +const card = faker.helpers.createCard(); +resultStr = card.name; +resultStr = card.address.streetA; +const contextualCard = faker.helpers.contextualCard(); +resultStr = contextualCard.name; +resultStr = contextualCard.address.suite; +const userCard = faker.helpers.userCard(); +resultStr = userCard.name; +resultStr = userCard.address.suite; + +resultStr = faker.internet.avatar(); +resultStr = faker.internet.email(); +resultStr = faker.internet.email('foo', 'bar', 'quux'); +resultStr = faker.internet.exampleEmail(); +resultStr = faker.internet.exampleEmail('foo', 'bar'); +resultStr = faker.internet.protocol(); +resultStr = faker.internet.url(); +resultStr = faker.internet.domainName(); +resultStr = faker.internet.domainSuffix(); +resultStr = faker.internet.domainWord(); +resultStr = faker.internet.ip(); +resultStr = faker.internet.userAgent(); +resultStr = faker.internet.color(); +resultStr = faker.internet.color(0, 0, 0); +resultStr = faker.internet.mac(); +resultStr = faker.internet.password(); +resultStr = faker.internet.password(0, false, '#', 'foo'); + +resultStr = faker.lorem.word(); +resultStr = faker.lorem.words(); +resultStr = faker.lorem.words(0); +resultStr = faker.lorem.sentence(); +resultStr = faker.lorem.sentence(0, 0); +resultStr = faker.lorem.slug(); +resultStr = faker.lorem.slug(0); +resultStr = faker.lorem.sentences(); +resultStr = faker.lorem.sentences(0); +resultStr = faker.lorem.paragraph(); +resultStr = faker.lorem.paragraph(0); +resultStr = faker.lorem.paragraphs(); +resultStr = faker.lorem.paragraphs(0, ''); +resultStr = faker.lorem.text(); +resultStr = faker.lorem.text(0); +resultStr = faker.lorem.lines(); +resultStr = faker.lorem.lines(0); + +resultStr = faker.name.firstName(); +resultStr = faker.name.firstName(0); +resultStr = faker.name.lastName(); +resultStr = faker.name.lastName(0); +resultStr = faker.name.findName(); +resultStr = faker.name.findName('', '', 0); +resultStr = faker.name.jobTitle(); +resultStr = faker.name.prefix(); +resultStr = faker.name.suffix(); +resultStr = faker.name.title(); +resultStr = faker.name.jobDescriptor(); +resultStr = faker.name.jobArea(); +resultStr = faker.name.jobType(); + +resultStr = faker.phone.phoneNumber(); +resultStr = faker.phone.phoneNumber('#'); +resultStr = faker.phone.phoneNumberFormat(); +// https://github.com/Marak/faker.js/blob/master/lib/phone_number.js#L9-L13 +resultStr = faker.phone.phoneNumberFormat(0); +resultStr = faker.phone.phoneFormats(); + +resultNum = faker.random.number(); +resultNum = faker.random.number(0); +resultNum = faker.random.number({ + min: 0, + max: 0, + precision: 0 +}); +resultStr = faker.random.arrayElement(); +resultStr = faker.random.arrayElement(['foo', 'bar', 'quux']) +resultStr = faker.random.objectElement(); +resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'}); +resultStr = faker.random.uuid(); +resultBool = faker.random.boolean(); +resultStr = faker.random.word(); +resultStr = faker.random.words(); +resultStr = faker.random.words(0); +resultStr = faker.random.image(); +resultStr = faker.random.locale(); +resultStr = faker.random.alphaNumeric(); +resultStr = faker.random.alphaNumeric(0); + +resultStr = faker.system.fileName( "foo", "bar" ); +resultStr = faker.system.commonFileName( "foo", "bar" ); +resultStr = faker.system.mimeType(); +resultStr = faker.system.commonFileType(); +resultStr = faker.system.commonFileExt(); +resultStr = faker.system.fileType(); +resultStr = faker.system.fileExt( "foo" ); +resultStr = faker.system.semver(); + +import fakerEn = require('faker/locale/en'); +resultStr = faker.name.firstName(); diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts new file mode 100644 index 0000000000..ccca40e51a --- /dev/null +++ b/types/faker/index.d.ts @@ -0,0 +1,448 @@ +// Type definitions for faker v4.1.0 +// Project: http://marak.com/faker.js/ +// Definitions by: Ben Swartz , Bas Pennings , Yuki Kokubun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var fakerStatic: Faker.FakerStatic; + +declare namespace Faker { + interface FakerStatic { + locale: string; + + address: { + zipCode(format?: string): string; + city(format?: number): string; + cityPrefix(): string; + citySuffix(): string; + streetName(): string; + streetAddress(useFullAddress?: boolean): string; + streetSuffix(): string; + streetPrefix(): string; + secondaryAddress(): string; + county(): string; + country(): string; + countryCode(): string; + state(useAbbr?: boolean): string; + stateAbbr(): string; + latitude(): string; + longitude(): string; + }; + + commerce: { + color(): string; + department(): string; + productName(): string; + price(min?: number, max?: number, dec?: number, symbol?: string): string; + productAdjective(): string; + productMaterial(): string; + product(): string; + }; + + company: { + suffixes(): string[]; + companyName(format?: number): string; + companySuffix(): string; + catchPhrase(): string; + bs(): string; + catchPhraseAdjective(): string; + catchPhraseDescriptor(): string; + catchPhraseNoun(): string; + bsAdjective(): string; + bsBuzz(): string; + bsNoun(): string; + }; + + database: { + column(): string; + type(): string; + collation(): string; + engine(): string; + }; + + date: { + past(years?: number, refDate?: string|Date): Date; + future(years?: number, refDate?: string|Date): Date; + between(from: string|number|Date, to: string|Date): Date; + recent(days?: number): Date; + month(options?: { abbr?: boolean, context?: boolean }): string; + weekday(options?: { abbr?: boolean, context?: boolean }): string; + }; + + fake(str: string): string; + + finance: { + account(length?: number): string; + accountName(): string; + mask(length?: number, parens?: boolean, elipsis?: boolean): string; + amount(min?:number, max?: number, dec?: number, symbol?: string): string; + transactionType(): string; + currencyCode(): string; + currencyName(): string; + currencySymbol(): string; + bitcoinAddress(): string; + bic(): string + }; + + hacker: { + abbreviation(): string; + adjective(): string; + noun(): string; + verb(): string; + ingverb(): string; + phrase(): string; + }; + + helpers: { + randomize(array: T[]): T; + randomize(): string; + slugify(string?: string): string; + replaceSymbolWithNumber(string?: string, symbol?: string): string; + replaceSymbols(string?: string): string; + shuffle(o: T[]): T[]; + shuffle(): string[]; + mustache(str: string, data: { [key: string]: string|((substring: string, ...args: any[]) => string) }): string; + createCard(): Faker.Card; + contextualCard(): Faker.ContextualCard; + userCard(): Faker.UserCard; + createTransaction(): Faker.Transaction; + }; + + + image: { + image(): string; + avatar(): string; + imageUrl(width?: number, height?: number, category?: string): string; + abstract(width?: number, height?: number): string; + animals(width?: number, height?: number): string; + business(width?: number, height?: number): string; + cats(width?: number, height?: number): string; + city(width?: number, height?: number): string; + food(width?: number, height?: number): string; + nightlife(width?: number, height?: number): string; + fashion(width?: number, height?: number): string; + people(width?: number, height?: number): string; + nature(width?: number, height?: number): string; + sports(width?: number, height?: number): string; + technics(width?: number, height?: number): string; + transport(width?: number, height?: number): string; + dataUri(width?: number, height?: number): string; + }; + + internet: { + avatar(): string; + email(firstName?: string, lastName?: string, provider?: string): string; + exampleEmail(firstName?: string, lastName?: string): string; + userName(firstName?: string, lastName?: string): string; + protocol(): string; + url(): string; + domainName(): string; + domainSuffix(): string; + domainWord(): string; + ip(): string; + ipv6(): string; + userAgent(): string; + color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; + mac(): string; + password(len?: number, memorable?: boolean, pattern?: string|RegExp, prefix?: string): string; + }; + + lorem: { + word(): string; + words(num?: number): string; + sentence(wordCount?: number, range?: number): string; + slug(wordCount?: number): string; + sentences(sentenceCount?: number): string; + paragraph(sentenceCount?: number): string; + paragraphs(paragraphCount?: number, separator?: string): string; + text(times?: number): string; + lines(lineCount?: number): string; + }; + + name: { + firstName(gender?: number): string; + lastName(gender?: number): string; + findName(firstName?: string, lastName?: string, gender?: number): string; + jobTitle(): string; + prefix(): string; + suffix(): string; + title(): string; + jobDescriptor(): string; + jobArea(): string; + jobType(): string; + }; + + phone: { + phoneNumber(format?: string): string; + phoneNumberFormat(phoneFormatsArrayIndex?: number): string; + phoneFormats(): string; + }; + + random: { + number(max: number): number; + number(options?: { min?: number, max?: number, precision?: number }): number; + arrayElement(): string; + arrayElement(array: T[]): T; + objectElement(object?: { [key: string]: any }, field?: "key"): string; + objectElement(object?: { [key: string]: T }, field?: any): T; + uuid(): string; + boolean(): boolean; + word(): string; // TODO: have ability to return specific type of word? As in: noun, adjective, verb, etc + words(count?: number): string; + image(): string; + locale(): string; + alphaNumeric(count?: number): string; + }; + + system: { + fileName(ext: string, type: string): string; + commonFileName(ext: string, type: string): string; + mimeType(): string; + commonFileType(): string; + commonFileExt(): string; + fileType(): string; + fileExt(mimeType: string): string; + //directoryPath(): string; + //filePath(): string; + semver(): string; + }; + + seed(value: number): void; + } + + interface Card { + name: string; + username: string; + email: string; + address: FullAddress; + phone: string; + website: string; + company: Company; + posts: Post[]; + accountHistory: string[]; + } + + interface FullAddress { + streetA: string; + streetB: string; + streetC: string; + streetD: string; + city: string; + state: string; + county: string; + zipcode: string; + geo: Geo; + } + + interface Geo { + lat: string; + lng: string; + } + + interface Company { + name: string; + catchPhrase: string; + bs: string; + } + + interface Post { + words: string; + sentence: string; + sentences: string; + paragraph: string; + } + + interface ContextualCard { + name: string; + username: string; + email: string; + dob: Date; + phone: string; + address: Address; + website: string; + company: Company; + } + + interface Address { + street: string; + suite: string; + city: string; + state: string; + zipcode: string; + geo: Geo; + } + + interface UserCard { + name: string; + username: string; + email: string; + address: Address; + phone: string; + website: string; + company: Company; + } + + interface Transaction { + amount: string; + date: Date; + business: string; + name: string; + type: string; + account: string; + } +} + +declare module "faker" { + export = fakerStatic; +} + +declare module "faker/locale/az" { + export = fakerStatic; +} + +declare module "faker/locale/cz" { + export = fakerStatic; +} + +declare module "faker/locale/de" { + export = fakerStatic; +} + +declare module "faker/locale/de_AT" { + export = fakerStatic; +} + +declare module "faker/locale/de_CH" { + export = fakerStatic; +} + +declare module "faker/locale/el_GR" { + export = fakerStatic; +} + +declare module "faker/locale/en" { + export = fakerStatic; +} + +declare module "faker/locale/en_AU" { + export = fakerStatic; +} + +declare module "faker/locale/en_BORK" { + export = fakerStatic; +} + +declare module "faker/locale/en_CA" { + export = fakerStatic; +} + +declare module "faker/locale/en_GB" { + export = fakerStatic; +} + +declare module "faker/locale/en_IE" { + export = fakerStatic; +} + +declare module "faker/locale/en_IND" { + export = fakerStatic; +} + +declare module "faker/locale/en_US" { + export = fakerStatic; +} + +declare module "faker/locale/en_au_ocker" { + export = fakerStatic; +} + +declare module "faker/locale/es" { + export = fakerStatic; +} + +declare module "faker/locale/es_MX" { + export = fakerStatic; +} + +declare module "faker/locale/fa" { + export = fakerStatic; +} + +declare module "faker/locale/fr" { + export = fakerStatic; +} + +declare module "faker/locale/fr_CA" { + export = fakerStatic; +} + +declare module "faker/locale/ge" { + export = fakerStatic; +} + +declare module "faker/locale/id_ID" { + export = fakerStatic; +} + +declare module "faker/locale/it" { + export = fakerStatic; +} + +declare module "faker/locale/ja" { + export = fakerStatic; +} + +declare module "faker/locale/ko" { + export = fakerStatic; +} + +declare module "faker/locale/nb_NO" { + export = fakerStatic; +} + +declare module "faker/locale/nep" { + export = fakerStatic; +} + +declare module "faker/locale/nl" { + export = fakerStatic; +} + +declare module "faker/locale/pl" { + export = fakerStatic; +} + +declare module "faker/locale/pt_BR" { + export = fakerStatic; +} + +declare module "faker/locale/ru" { + export = fakerStatic; +} + +declare module "faker/locale/sk" { + export = fakerStatic; +} + +declare module "faker/locale/sv" { + export = fakerStatic; +} + +declare module "faker/locale/tr" { + export = fakerStatic; +} + +declare module "faker/locale/uk" { + export = fakerStatic; +} + +declare module "faker/locale/vi" { + export = fakerStatic; +} + +declare module "faker/locale/zh_CN" { + export = fakerStatic; +} + +declare module "faker/locale/zh_TW" { + export = fakerStatic; +} diff --git a/faker/tsconfig.json b/types/faker/tsconfig.json similarity index 91% rename from faker/tsconfig.json rename to types/faker/tsconfig.json index c2ce14c941..0589e5dc54 100644 --- a/faker/tsconfig.json +++ b/types/faker/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +19,4 @@ "index.d.ts", "faker-tests.ts" ] -} \ No newline at end of file +} diff --git a/faker/faker-tests.ts b/types/faker/v3/faker-tests.ts similarity index 100% rename from faker/faker-tests.ts rename to types/faker/v3/faker-tests.ts diff --git a/faker/index.d.ts b/types/faker/v3/index.d.ts similarity index 100% rename from faker/index.d.ts rename to types/faker/v3/index.d.ts diff --git a/types/faker/v3/tsconfig.json b/types/faker/v3/tsconfig.json new file mode 100644 index 0000000000..052493a9c7 --- /dev/null +++ b/types/faker/v3/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "faker": [ "faker/v3" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "faker-tests.ts" + ] +} diff --git a/falcor-express/falcor-express-tests.ts b/types/falcor-express/falcor-express-tests.ts similarity index 85% rename from falcor-express/falcor-express-tests.ts rename to types/falcor-express/falcor-express-tests.ts index f4a4ed8b52..c76a61f901 100644 --- a/falcor-express/falcor-express-tests.ts +++ b/types/falcor-express/falcor-express-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - import express = require('express'); import Router = require('falcor-router'); import falcorExpress = require('falcor-express') diff --git a/falcor-express/index.d.ts b/types/falcor-express/index.d.ts similarity index 100% rename from falcor-express/index.d.ts rename to types/falcor-express/index.d.ts diff --git a/falcor-express/tsconfig.json b/types/falcor-express/tsconfig.json similarity index 100% rename from falcor-express/tsconfig.json rename to types/falcor-express/tsconfig.json diff --git a/falcor-http-datasource/falcor-http-datasource-tests.ts b/types/falcor-http-datasource/falcor-http-datasource-tests.ts similarity index 100% rename from falcor-http-datasource/falcor-http-datasource-tests.ts rename to types/falcor-http-datasource/falcor-http-datasource-tests.ts diff --git a/falcor-http-datasource/index.d.ts b/types/falcor-http-datasource/index.d.ts similarity index 100% rename from falcor-http-datasource/index.d.ts rename to types/falcor-http-datasource/index.d.ts diff --git a/falcor-http-datasource/tsconfig.json b/types/falcor-http-datasource/tsconfig.json similarity index 100% rename from falcor-http-datasource/tsconfig.json rename to types/falcor-http-datasource/tsconfig.json diff --git a/falcor-json-graph/falcor-json-graph-tests.ts b/types/falcor-json-graph/falcor-json-graph-tests.ts similarity index 100% rename from falcor-json-graph/falcor-json-graph-tests.ts rename to types/falcor-json-graph/falcor-json-graph-tests.ts diff --git a/falcor-json-graph/index.d.ts b/types/falcor-json-graph/index.d.ts similarity index 100% rename from falcor-json-graph/index.d.ts rename to types/falcor-json-graph/index.d.ts diff --git a/falcor-json-graph/tsconfig.json b/types/falcor-json-graph/tsconfig.json similarity index 100% rename from falcor-json-graph/tsconfig.json rename to types/falcor-json-graph/tsconfig.json diff --git a/falcor-router/falcor-router-tests.ts b/types/falcor-router/falcor-router-tests.ts similarity index 55% rename from falcor-router/falcor-router-tests.ts rename to types/falcor-router/falcor-router-tests.ts index 5f5bdca0e4..7358ab2e02 100644 --- a/falcor-router/falcor-router-tests.ts +++ b/types/falcor-router/falcor-router-tests.ts @@ -2,6 +2,7 @@ import falcor = require('falcor'); import Router = require('falcor-router'); +import falcorJsonGraph = require('falcor-json-graph'); new Router([]); new Router([], {}); @@ -100,3 +101,76 @@ new Router([{ } }]); +new Router([{ + route: 'todos.new', + call(callpath, args) { + return {path: 'json.todosById.1234.name', value: 'Buy cheese'}; + } +}]); + +new Router([{ + route: 'todos.new', + call(callpath, args) { + return falcorJsonGraph.pathInvalidation('json.todos.length'); + } +}]); + +new Router([{ + route: 'todos.new', + call(callpath, args) { + return [ + falcorJsonGraph.pathInvalidation('json.todos.length'), + {path: 'json.todosById.1234.name', value: 'Buy cheese'} + ] + } +}]); + +new Router([{ + route: 'todos.new', + call(callpath, args) { + return new Promise((resolve, reject): void => { + resolve([ + falcorJsonGraph.pathInvalidation('json.todos.length'), + {path: 'json.todosById.1234.name', value: 'Buy cheese'} + ]); + }); + } +}]); + +new Router([{ + route: 'todos.new', + call(callpath, args) { + return { + paths: [['json', 'todosById', '1234', 'name']], + jsonGraph: { + json: { + todosById: { + 1234: { + name: 'Buy cheese' + } + } + } + } + }; + } +}]); + +new Router([{ + route: 'todos.new', + call(callpath, args) { + return new Promise((resolve, reject): void => { + resolve({ + paths: [['json', 'todosById', '1234', 'name']], + jsonGraph: { + json: { + todosById: { + 1234: { + name: 'Buy cheese' + } + } + } + } + }); + }); + } +}]); diff --git a/falcor-router/index.d.ts b/types/falcor-router/index.d.ts similarity index 81% rename from falcor-router/index.d.ts rename to types/falcor-router/index.d.ts index 659f45767f..daef26f379 100644 --- a/falcor-router/index.d.ts +++ b/types/falcor-router/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for falcor-router 0.4.0 // Project: https://github.com/Netflix/falcor-router -// Definitions by: Quramy +// Definitions by: Quramy , cdhgee // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -34,7 +34,7 @@ declare namespace FalcorRouter { type RoutePathSet = FalcorJsonGraph.PathSet; interface CallRoute extends Route { - call(callPath: RoutePathSet, args: Array): RouteResult | Promise; + call(callPath: RoutePathSet, args: Array): CallRouteResult | Promise; } interface GetRoute extends Route { @@ -47,6 +47,7 @@ declare namespace FalcorRouter { type RouteDefinition = GetRoute | SetRoute | CallRoute; type RouteResult = FalcorJsonGraph.PathValue | Array | FalcorJsonGraph.JSONEnvelope; + type CallRouteResult = FalcorJsonGraph.PathValue | FalcorJsonGraph.InvalidPath | Array | FalcorJsonGraph.JSONGraphEnvelope; interface RouterOptions { debug?: boolean; diff --git a/falcor-router/tsconfig.json b/types/falcor-router/tsconfig.json similarity index 100% rename from falcor-router/tsconfig.json rename to types/falcor-router/tsconfig.json diff --git a/falcor/index.d.ts b/types/falcor/index.d.ts similarity index 100% rename from falcor/index.d.ts rename to types/falcor/index.d.ts diff --git a/falcor/test/browser.ts b/types/falcor/test/browser.ts similarity index 100% rename from falcor/test/browser.ts rename to types/falcor/test/browser.ts diff --git a/falcor/test/index.ts b/types/falcor/test/index.ts similarity index 100% rename from falcor/test/index.ts rename to types/falcor/test/index.ts diff --git a/falcor/tsconfig.json b/types/falcor/tsconfig.json similarity index 100% rename from falcor/tsconfig.json rename to types/falcor/tsconfig.json diff --git a/forever-monitor/tslint.json b/types/falcor/tslint.json similarity index 100% rename from forever-monitor/tslint.json rename to types/falcor/tslint.json diff --git a/famous/famous-tests.ts b/types/famous/famous-tests.ts similarity index 100% rename from famous/famous-tests.ts rename to types/famous/famous-tests.ts diff --git a/famous/index.d.ts b/types/famous/index.d.ts similarity index 100% rename from famous/index.d.ts rename to types/famous/index.d.ts diff --git a/famous/tsconfig.json b/types/famous/tsconfig.json similarity index 100% rename from famous/tsconfig.json rename to types/famous/tsconfig.json diff --git a/fancybox/fancybox-tests.ts b/types/fancybox/fancybox-tests.ts similarity index 98% rename from fancybox/fancybox-tests.ts rename to types/fancybox/fancybox-tests.ts index 2d5743c950..eac3f31771 100644 --- a/fancybox/fancybox-tests.ts +++ b/types/fancybox/fancybox-tests.ts @@ -1,6 +1,3 @@ -/// - - $('.fancybox').fancybox(); $('.fancybox').fancybox({ padding: 0, diff --git a/fancybox/index.d.ts b/types/fancybox/index.d.ts similarity index 100% rename from fancybox/index.d.ts rename to types/fancybox/index.d.ts diff --git a/fancybox/tsconfig.json b/types/fancybox/tsconfig.json similarity index 100% rename from fancybox/tsconfig.json rename to types/fancybox/tsconfig.json diff --git a/farbtastic/farbtastic-tests.ts b/types/farbtastic/farbtastic-tests.ts similarity index 100% rename from farbtastic/farbtastic-tests.ts rename to types/farbtastic/farbtastic-tests.ts diff --git a/farbtastic/index.d.ts b/types/farbtastic/index.d.ts similarity index 100% rename from farbtastic/index.d.ts rename to types/farbtastic/index.d.ts diff --git a/farbtastic/tsconfig.json b/types/farbtastic/tsconfig.json similarity index 100% rename from farbtastic/tsconfig.json rename to types/farbtastic/tsconfig.json diff --git a/fast-json-patch/fast-json-patch-tests.ts b/types/fast-json-patch/fast-json-patch-tests.ts similarity index 100% rename from fast-json-patch/fast-json-patch-tests.ts rename to types/fast-json-patch/fast-json-patch-tests.ts diff --git a/fast-json-patch/index.d.ts b/types/fast-json-patch/index.d.ts similarity index 100% rename from fast-json-patch/index.d.ts rename to types/fast-json-patch/index.d.ts diff --git a/fast-json-patch/tsconfig.json b/types/fast-json-patch/tsconfig.json similarity index 100% rename from fast-json-patch/tsconfig.json rename to types/fast-json-patch/tsconfig.json diff --git a/fast-levenshtein/fast-levenshtein-tests.ts b/types/fast-levenshtein/fast-levenshtein-tests.ts similarity index 100% rename from fast-levenshtein/fast-levenshtein-tests.ts rename to types/fast-levenshtein/fast-levenshtein-tests.ts diff --git a/fast-levenshtein/index.d.ts b/types/fast-levenshtein/index.d.ts similarity index 100% rename from fast-levenshtein/index.d.ts rename to types/fast-levenshtein/index.d.ts diff --git a/fast-levenshtein/tsconfig.json b/types/fast-levenshtein/tsconfig.json similarity index 100% rename from fast-levenshtein/tsconfig.json rename to types/fast-levenshtein/tsconfig.json diff --git a/fast-simplex-noise/fast-simplex-noise-tests.ts b/types/fast-simplex-noise/fast-simplex-noise-tests.ts similarity index 100% rename from fast-simplex-noise/fast-simplex-noise-tests.ts rename to types/fast-simplex-noise/fast-simplex-noise-tests.ts diff --git a/fast-simplex-noise/index.d.ts b/types/fast-simplex-noise/index.d.ts similarity index 100% rename from fast-simplex-noise/index.d.ts rename to types/fast-simplex-noise/index.d.ts diff --git a/fast-simplex-noise/tsconfig.json b/types/fast-simplex-noise/tsconfig.json similarity index 100% rename from fast-simplex-noise/tsconfig.json rename to types/fast-simplex-noise/tsconfig.json diff --git a/fast-stats/fast-stats-tests.ts b/types/fast-stats/fast-stats-tests.ts similarity index 100% rename from fast-stats/fast-stats-tests.ts rename to types/fast-stats/fast-stats-tests.ts diff --git a/fast-stats/index.d.ts b/types/fast-stats/index.d.ts similarity index 100% rename from fast-stats/index.d.ts rename to types/fast-stats/index.d.ts diff --git a/fast-stats/tsconfig.json b/types/fast-stats/tsconfig.json similarity index 100% rename from fast-stats/tsconfig.json rename to types/fast-stats/tsconfig.json diff --git a/fastclick/fastclick-tests.ts b/types/fastclick/fastclick-tests.ts similarity index 100% rename from fastclick/fastclick-tests.ts rename to types/fastclick/fastclick-tests.ts diff --git a/fastclick/index.d.ts b/types/fastclick/index.d.ts similarity index 100% rename from fastclick/index.d.ts rename to types/fastclick/index.d.ts diff --git a/fastclick/tsconfig.json b/types/fastclick/tsconfig.json similarity index 100% rename from fastclick/tsconfig.json rename to types/fastclick/tsconfig.json diff --git a/favico.js/favico.js-tests.ts b/types/favico.js/favico.js-tests.ts similarity index 100% rename from favico.js/favico.js-tests.ts rename to types/favico.js/favico.js-tests.ts diff --git a/favico.js/index.d.ts b/types/favico.js/index.d.ts similarity index 100% rename from favico.js/index.d.ts rename to types/favico.js/index.d.ts diff --git a/favico.js/tsconfig.json b/types/favico.js/tsconfig.json similarity index 100% rename from favico.js/tsconfig.json rename to types/favico.js/tsconfig.json diff --git a/fb/fb-tests.ts b/types/fb/fb-tests.ts similarity index 100% rename from fb/fb-tests.ts rename to types/fb/fb-tests.ts diff --git a/fb/index.d.ts b/types/fb/index.d.ts similarity index 100% rename from fb/index.d.ts rename to types/fb/index.d.ts diff --git a/fb/tsconfig.json b/types/fb/tsconfig.json similarity index 100% rename from fb/tsconfig.json rename to types/fb/tsconfig.json diff --git a/fbemitter/fbemitter-tests.ts b/types/fbemitter/fbemitter-tests.ts similarity index 100% rename from fbemitter/fbemitter-tests.ts rename to types/fbemitter/fbemitter-tests.ts diff --git a/fbemitter/index.d.ts b/types/fbemitter/index.d.ts similarity index 100% rename from fbemitter/index.d.ts rename to types/fbemitter/index.d.ts diff --git a/fbemitter/tsconfig.json b/types/fbemitter/tsconfig.json similarity index 100% rename from fbemitter/tsconfig.json rename to types/fbemitter/tsconfig.json diff --git a/featherlight/featherlight-tests.ts b/types/featherlight/featherlight-tests.ts similarity index 99% rename from featherlight/featherlight-tests.ts rename to types/featherlight/featherlight-tests.ts index 4d609d3475..e241a30990 100644 --- a/featherlight/featherlight-tests.ts +++ b/types/featherlight/featherlight-tests.ts @@ -1,7 +1,5 @@ // Tests by: Kaur Kuut -/// - // Every option as default var defaultOptions = { namespace: 'featherlight', diff --git a/featherlight/index.d.ts b/types/featherlight/index.d.ts similarity index 100% rename from featherlight/index.d.ts rename to types/featherlight/index.d.ts diff --git a/featherlight/tsconfig.json b/types/featherlight/tsconfig.json similarity index 100% rename from featherlight/tsconfig.json rename to types/featherlight/tsconfig.json diff --git a/types/fetch-jsonp/fetch-jsonp-tests.ts b/types/fetch-jsonp/fetch-jsonp-tests.ts new file mode 100644 index 0000000000..058f47e70c --- /dev/null +++ b/types/fetch-jsonp/fetch-jsonp-tests.ts @@ -0,0 +1,48 @@ +import * as fetchJsonp from 'fetch-jsonp'; + +/* Taken from https://github.com/camsong/fetch-jsonp/blob/v1.0.2/README.md */ + +fetchJsonp('/users.jsonp') + .then(function(response) { + return response.json() + }).then(function(json) { + console.log('parsed json', json) + }).catch(function(ex) { + console.log('parsing failed', ex) + }) + +fetchJsonp('/users.jsonp', { + jsonpCallback: 'custom_callback' + }) + .then(function(response) { + return response.json() + }).then(function(json) { + console.log('parsed json', json) + }).catch(function(ex) { + console.log('parsing failed', ex) + }) + +fetchJsonp('/users.jsonp', { + timeout: 3000, + jsonpCallback: 'custom_callback' + }) + .then(function(response) { + return response.json() + }).then(function(json) { + console.log('parsed json', json) + }).catch(function(ex) { + console.log('parsing failed', ex) + }) + +// Taken from https://github.com/camsong/fetch-jsonp/blob/v1.0.2/examples/index.html +var result = fetchJsonp('http://www.flickr.com/services/feeds/photos_public.gne?format=json', { + jsonpCallback: 'jsoncallback', + timeout: 3000 +}) +result.then(function(response) { + return response.json() +}).then(function(json) { + document.body.innerHTML = JSON.stringify(json); +})['catch'](function(ex) { + document.body.innerHTML = 'failed:' + ex; +}) diff --git a/types/fetch-jsonp/index.d.ts b/types/fetch-jsonp/index.d.ts new file mode 100644 index 0000000000..e37094254e --- /dev/null +++ b/types/fetch-jsonp/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for fetch-jsonp 1.0 +// Project: https://github.com/camsong/fetch-jsonp +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare namespace fetchJsonp { + interface Options { + timeout?: number; + jsonpCallback?: string; + } +} + +declare function fetchJsonp(url: RequestInfo, options?: fetchJsonp.Options): Promise; + +export = fetchJsonp; diff --git a/types/fetch-jsonp/tsconfig.json b/types/fetch-jsonp/tsconfig.json new file mode 100644 index 0000000000..05c3f994ed --- /dev/null +++ b/types/fetch-jsonp/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "fetch-jsonp-tests.ts" + ] +} diff --git a/react-intl/tslint.json b/types/fetch-jsonp/tslint.json similarity index 59% rename from react-intl/tslint.json rename to types/fetch-jsonp/tslint.json index 9311f348d9..88bd9662f7 100644 --- a/react-intl/tslint.json +++ b/types/fetch-jsonp/tslint.json @@ -1,6 +1,6 @@ { "extends": "../tslint.json", "rules": { - "max-line-length": false + "only-arrow-functions-2": false } } diff --git a/fetch-mock/fetch-mock-tests.ts b/types/fetch-mock/fetch-mock-tests.ts similarity index 100% rename from fetch-mock/fetch-mock-tests.ts rename to types/fetch-mock/fetch-mock-tests.ts diff --git a/fetch-mock/index.d.ts b/types/fetch-mock/index.d.ts similarity index 99% rename from fetch-mock/index.d.ts rename to types/fetch-mock/index.d.ts index 4d69096845..bda708ee55 100644 --- a/fetch-mock/index.d.ts +++ b/types/fetch-mock/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/wheresrhys/fetch-mock // Definitions by: Alexey Svetliakov , Tamir Duberstein , Risto Keravuori // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +// TypeScript Version: 2.2 type MockRequest = Request | RequestInit; diff --git a/fetch-mock/tsconfig.json b/types/fetch-mock/tsconfig.json similarity index 100% rename from fetch-mock/tsconfig.json rename to types/fetch-mock/tsconfig.json diff --git a/format-unicorn/tslint.json b/types/fetch-mock/tslint.json similarity index 100% rename from format-unicorn/tslint.json rename to types/fetch-mock/tslint.json diff --git a/fetch.io/fetch.io-tests.ts b/types/fetch.io/fetch.io-tests.ts similarity index 64% rename from fetch.io/fetch.io-tests.ts rename to types/fetch.io/fetch.io-tests.ts index 4e14a7a9a9..538da8e74b 100644 --- a/fetch.io/fetch.io-tests.ts +++ b/types/fetch.io/fetch.io-tests.ts @@ -1,60 +1,59 @@ +import Fetch from 'fetch.io'; -import Fetch from 'fetch.io' - -const request = new Fetch() +const request = new Fetch(); request .get('') .query({}) - .json() + .json(); request .delete('') - .json() + .json(); request .head('') - .json() + .json(); request .options('') - .json() + .json(); request .put('') - .json() + .json(); request .config('key', 'value') - .json() + .json(); request .config({key: 'value'}) - .json() + .json(); request .config('set', 'value') - .json() + .json(); request .set({key: 'value'}) - .json() + .json(); request .type('json') - .json() + .json(); request .get('') .query({}) - .text() + .text(); request .get('') .query({}) - .then(() => {}) + .then(() => {}); request .post('') .send({}) - .json() + .json(); diff --git a/types/fetch.io/index.d.ts b/types/fetch.io/index.d.ts new file mode 100644 index 0000000000..966925b68f --- /dev/null +++ b/types/fetch.io/index.d.ts @@ -0,0 +1,118 @@ +// Type definitions for fetch.io 3.1 +// Project: https://github.com/haoxins/fetch.io +// Definitions by: newraina +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +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 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 +} + +export default class Fetch extends Request { + constructor(options?: Options) +} diff --git a/fetch.io/tsconfig.json b/types/fetch.io/tsconfig.json similarity index 100% rename from fetch.io/tsconfig.json rename to types/fetch.io/tsconfig.json diff --git a/freeport/tslint.json b/types/fetch.io/tslint.json similarity index 100% rename from freeport/tslint.json rename to types/fetch.io/tslint.json diff --git a/ffi/ffi-tests.ts b/types/ffi/ffi-tests.ts similarity index 100% rename from ffi/ffi-tests.ts rename to types/ffi/ffi-tests.ts diff --git a/ffi/index.d.ts b/types/ffi/index.d.ts similarity index 100% rename from ffi/index.d.ts rename to types/ffi/index.d.ts diff --git a/ffi/node-ffi-buffer.d.ts b/types/ffi/node-ffi-buffer.d.ts similarity index 100% rename from ffi/node-ffi-buffer.d.ts rename to types/ffi/node-ffi-buffer.d.ts diff --git a/ffi/tsconfig.json b/types/ffi/tsconfig.json similarity index 100% rename from ffi/tsconfig.json rename to types/ffi/tsconfig.json diff --git a/fhir/fhir-tests.ts b/types/fhir/fhir-tests.ts similarity index 100% rename from fhir/fhir-tests.ts rename to types/fhir/fhir-tests.ts diff --git a/fhir/index.d.ts b/types/fhir/index.d.ts similarity index 100% rename from fhir/index.d.ts rename to types/fhir/index.d.ts diff --git a/fhir/tsconfig.json b/types/fhir/tsconfig.json similarity index 100% rename from fhir/tsconfig.json rename to types/fhir/tsconfig.json diff --git a/fibers/fibers-tests.ts b/types/fibers/fibers-tests.ts similarity index 100% rename from fibers/fibers-tests.ts rename to types/fibers/fibers-tests.ts diff --git a/fibers/index.d.ts b/types/fibers/index.d.ts similarity index 100% rename from fibers/index.d.ts rename to types/fibers/index.d.ts diff --git a/fibers/tsconfig.json b/types/fibers/tsconfig.json similarity index 100% rename from fibers/tsconfig.json rename to types/fibers/tsconfig.json diff --git a/field/field-tests.ts b/types/field/field-tests.ts similarity index 100% rename from field/field-tests.ts rename to types/field/field-tests.ts diff --git a/field/index.d.ts b/types/field/index.d.ts similarity index 100% rename from field/index.d.ts rename to types/field/index.d.ts diff --git a/field/tsconfig.json b/types/field/tsconfig.json similarity index 100% rename from field/tsconfig.json rename to types/field/tsconfig.json diff --git a/file-saver/file-saver-tests.ts b/types/file-saver/file-saver-tests.ts similarity index 100% rename from file-saver/file-saver-tests.ts rename to types/file-saver/file-saver-tests.ts diff --git a/file-saver/index.d.ts b/types/file-saver/index.d.ts similarity index 100% rename from file-saver/index.d.ts rename to types/file-saver/index.d.ts diff --git a/file-saver/tsconfig.json b/types/file-saver/tsconfig.json similarity index 100% rename from file-saver/tsconfig.json rename to types/file-saver/tsconfig.json diff --git a/file-type/file-type-tests.ts b/types/file-type/file-type-tests.ts similarity index 100% rename from file-type/file-type-tests.ts rename to types/file-type/file-type-tests.ts diff --git a/file-type/index.d.ts b/types/file-type/index.d.ts similarity index 100% rename from file-type/index.d.ts rename to types/file-type/index.d.ts diff --git a/file-type/tsconfig.json b/types/file-type/tsconfig.json similarity index 100% rename from file-type/tsconfig.json rename to types/file-type/tsconfig.json diff --git a/file-url/file-url-tests.ts b/types/file-url/file-url-tests.ts similarity index 100% rename from file-url/file-url-tests.ts rename to types/file-url/file-url-tests.ts diff --git a/file-url/index.d.ts b/types/file-url/index.d.ts similarity index 100% rename from file-url/index.d.ts rename to types/file-url/index.d.ts diff --git a/file-url/tsconfig.json b/types/file-url/tsconfig.json similarity index 100% rename from file-url/tsconfig.json rename to types/file-url/tsconfig.json diff --git a/filesize/filesize-tests.ts b/types/filesize/filesize-tests.ts similarity index 100% rename from filesize/filesize-tests.ts rename to types/filesize/filesize-tests.ts diff --git a/filesize/index.d.ts b/types/filesize/index.d.ts similarity index 100% rename from filesize/index.d.ts rename to types/filesize/index.d.ts diff --git a/filesize/tsconfig.json b/types/filesize/tsconfig.json similarity index 100% rename from filesize/tsconfig.json rename to types/filesize/tsconfig.json diff --git a/filesystem/filesystem-tests.ts b/types/filesystem/filesystem-tests.ts similarity index 100% rename from filesystem/filesystem-tests.ts rename to types/filesystem/filesystem-tests.ts diff --git a/filesystem/index.d.ts b/types/filesystem/index.d.ts similarity index 100% rename from filesystem/index.d.ts rename to types/filesystem/index.d.ts diff --git a/filesystem/tsconfig.json b/types/filesystem/tsconfig.json similarity index 100% rename from filesystem/tsconfig.json rename to types/filesystem/tsconfig.json diff --git a/filewriter/filewriter-tests.ts b/types/filewriter/filewriter-tests.ts similarity index 100% rename from filewriter/filewriter-tests.ts rename to types/filewriter/filewriter-tests.ts diff --git a/filewriter/index.d.ts b/types/filewriter/index.d.ts similarity index 100% rename from filewriter/index.d.ts rename to types/filewriter/index.d.ts diff --git a/filewriter/tsconfig.json b/types/filewriter/tsconfig.json similarity index 100% rename from filewriter/tsconfig.json rename to types/filewriter/tsconfig.json diff --git a/fill-pdf/fill-pdf-tests.ts b/types/fill-pdf/fill-pdf-tests.ts similarity index 100% rename from fill-pdf/fill-pdf-tests.ts rename to types/fill-pdf/fill-pdf-tests.ts diff --git a/fill-pdf/index.d.ts b/types/fill-pdf/index.d.ts similarity index 100% rename from fill-pdf/index.d.ts rename to types/fill-pdf/index.d.ts diff --git a/fill-pdf/tsconfig.json b/types/fill-pdf/tsconfig.json similarity index 100% rename from fill-pdf/tsconfig.json rename to types/fill-pdf/tsconfig.json diff --git a/finalhandler/finalhandler-tests.ts b/types/finalhandler/finalhandler-tests.ts similarity index 100% rename from finalhandler/finalhandler-tests.ts rename to types/finalhandler/finalhandler-tests.ts diff --git a/finalhandler/index.d.ts b/types/finalhandler/index.d.ts similarity index 100% rename from finalhandler/index.d.ts rename to types/finalhandler/index.d.ts diff --git a/finalhandler/tsconfig.json b/types/finalhandler/tsconfig.json similarity index 100% rename from finalhandler/tsconfig.json rename to types/finalhandler/tsconfig.json diff --git a/finch/finch-tests.ts b/types/finch/finch-tests.ts similarity index 100% rename from finch/finch-tests.ts rename to types/finch/finch-tests.ts diff --git a/finch/index.d.ts b/types/finch/index.d.ts similarity index 100% rename from finch/index.d.ts rename to types/finch/index.d.ts diff --git a/finch/tsconfig.json b/types/finch/tsconfig.json similarity index 100% rename from finch/tsconfig.json rename to types/finch/tsconfig.json diff --git a/findup-sync/findup-sync-tests.ts b/types/findup-sync/findup-sync-tests.ts similarity index 100% rename from findup-sync/findup-sync-tests.ts rename to types/findup-sync/findup-sync-tests.ts diff --git a/findup-sync/index.d.ts b/types/findup-sync/index.d.ts similarity index 100% rename from findup-sync/index.d.ts rename to types/findup-sync/index.d.ts diff --git a/findup-sync/tsconfig.json b/types/findup-sync/tsconfig.json similarity index 100% rename from findup-sync/tsconfig.json rename to types/findup-sync/tsconfig.json diff --git a/fingerprintjs/fingerprintjs-tests.ts b/types/fingerprintjs/fingerprintjs-tests.ts similarity index 100% rename from fingerprintjs/fingerprintjs-tests.ts rename to types/fingerprintjs/fingerprintjs-tests.ts diff --git a/fingerprintjs/index.d.ts b/types/fingerprintjs/index.d.ts similarity index 100% rename from fingerprintjs/index.d.ts rename to types/fingerprintjs/index.d.ts diff --git a/fingerprintjs/tsconfig.json b/types/fingerprintjs/tsconfig.json similarity index 100% rename from fingerprintjs/tsconfig.json rename to types/fingerprintjs/tsconfig.json diff --git a/firebase-client/firebase-client-tests.ts b/types/firebase-client/firebase-client-tests.ts similarity index 83% rename from firebase-client/firebase-client-tests.ts rename to types/firebase-client/firebase-client-tests.ts index 0b79ec75d6..987b4b638b 100644 --- a/firebase-client/firebase-client-tests.ts +++ b/types/firebase-client/firebase-client-tests.ts @@ -19,16 +19,16 @@ var client = new FirebaseClient({ var newUser:User = new User(); newUser.name = { first: "Fred", - last: "Flinstone" + last: "Flinstone" }; client.push("users", newUser) .then(function (result){ console.log(result.name); var newUser2:User = new User(); - newUser2.name = { - first: "Fred", - last: "Rockington" + newUser2.name = { + first: "Fred", + last: "Rockington" } return client.update("users/" + result.name, newUser2); }).then(function (result){ @@ -36,15 +36,15 @@ client.push("users", newUser) var newUser3:User = new User(); newUser3.name = { first: "Axe", - last: "Steel" + last: "Steel" }; return client.set("users/AXESTEEL", newUser3); }).then(function (result){ console.log(result.name.first); return client.get(); - }).then(function (result){ + }).then(function (result){ console.log(result); return client.get("users/AXESTEEL") }).then(function (result){ - console.log(result.name.first); + console.log(result.name.first); }); \ No newline at end of file diff --git a/firebase-client/index.d.ts b/types/firebase-client/index.d.ts similarity index 94% rename from firebase-client/index.d.ts rename to types/firebase-client/index.d.ts index d2c58bb5ba..b766fc2478 100644 --- a/firebase-client/index.d.ts +++ b/types/firebase-client/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Andrew Breen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import * as Q from "q"; interface PushResponse { /** @@ -17,7 +17,7 @@ interface FirebaseConfig { * path for the Firebase instance */ url : string; - + /** * Token for authorisation */ @@ -29,38 +29,38 @@ 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 @@ -70,7 +70,5 @@ interface FirebaseClient { declare var FirebaseClient: FirebaseClient; -declare module 'firebase-client' { - export = FirebaseClient; -} - +export = FirebaseClient; +export as namespace FirebaseClient; diff --git a/types/firebase-client/tsconfig.json b/types/firebase-client/tsconfig.json new file mode 100644 index 0000000000..b439fb8310 --- /dev/null +++ b/types/firebase-client/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "q": [ "q/v0" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "firebase-client-tests.ts" + ] +} \ No newline at end of file diff --git a/firebase-token-generator/firebase-token-generator-tests.ts b/types/firebase-token-generator/firebase-token-generator-tests.ts similarity index 100% rename from firebase-token-generator/firebase-token-generator-tests.ts rename to types/firebase-token-generator/firebase-token-generator-tests.ts diff --git a/firebase-token-generator/index.d.ts b/types/firebase-token-generator/index.d.ts similarity index 100% rename from firebase-token-generator/index.d.ts rename to types/firebase-token-generator/index.d.ts diff --git a/firebase-token-generator/tsconfig.json b/types/firebase-token-generator/tsconfig.json similarity index 100% rename from firebase-token-generator/tsconfig.json rename to types/firebase-token-generator/tsconfig.json diff --git a/firebase/firebase-simplelogin.d.ts b/types/firebase/firebase-simplelogin.d.ts similarity index 100% rename from firebase/firebase-simplelogin.d.ts rename to types/firebase/firebase-simplelogin.d.ts diff --git a/firebase/index.d.ts b/types/firebase/index.d.ts similarity index 100% rename from firebase/index.d.ts rename to types/firebase/index.d.ts diff --git a/firebase/test/index.ts b/types/firebase/test/index.ts similarity index 100% rename from firebase/test/index.ts rename to types/firebase/test/index.ts diff --git a/firebase/test/simplelogin.ts b/types/firebase/test/simplelogin.ts similarity index 100% rename from firebase/test/simplelogin.ts rename to types/firebase/test/simplelogin.ts diff --git a/firebase/tsconfig.json b/types/firebase/tsconfig.json similarity index 100% rename from firebase/tsconfig.json rename to types/firebase/tsconfig.json diff --git a/firefox/firefox-tests.ts b/types/firefox/firefox-tests.ts similarity index 100% rename from firefox/firefox-tests.ts rename to types/firefox/firefox-tests.ts diff --git a/firefox/index.d.ts b/types/firefox/index.d.ts similarity index 100% rename from firefox/index.d.ts rename to types/firefox/index.d.ts diff --git a/firefox/tsconfig.json b/types/firefox/tsconfig.json similarity index 100% rename from firefox/tsconfig.json rename to types/firefox/tsconfig.json diff --git a/types/firmata/firmata-tests.ts b/types/firmata/firmata-tests.ts new file mode 100644 index 0000000000..5e1eab09cb --- /dev/null +++ b/types/firmata/firmata-tests.ts @@ -0,0 +1,42 @@ +import * as Board from 'firmata' + +function test_basic_board() +{ + let board = new Board(''); +} + +function test_board_with_callback() +{ + let board = new Board('', (error: any) => + { + board.pinMode(13, board.MODES.OUTPUT); + board.pinMode(12, Board.PIN_MODE.OUTPUT); + }); +} + +function test_board_with_listener() +{ + let board = new Board(''); + + board.on('ready', () => + { + board.pinMode(13, board.MODES.OUTPUT); + board.pinMode(12, Board.PIN_MODE.OUTPUT); + }); +} + +function test_class_extension() +{ + class MyBoard extends Board + { + Disconnect() + { + this.transport.close((error: any) => {}); + } + } + + let myBoard: MyBoard = new MyBoard('', () => + { + myBoard.Disconnect(); + }); +} \ No newline at end of file diff --git a/types/firmata/index.d.ts b/types/firmata/index.d.ts new file mode 100644 index 0000000000..4bda44d3f9 --- /dev/null +++ b/types/firmata/index.d.ts @@ -0,0 +1,303 @@ +// Type definitions for firmata.js 0.15 +// Project: https://github.com/firmata/firmata.js +// Definitions by: Troy W. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as SerialPort from 'serialport' + +export = Board; + +/** + * Most of these are generated by observing https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js. + * + * This is a starting point that appeared to work fine for months within a project of my company, but I give no + * guarantee that it cannot be improved. + */ +declare class Board extends NodeJS.EventEmitter +{ + constructor(serialPort: string, callback?: (error: any) => void) + MODES: Board.PinModes; + STEPPER: Board.StepperConstants; + I2C_MODES: Board.I2cModes; + SERIAL_MODES: Board.SerialModes; + SERIAL_PORT_IDs: Board.SerialPortIds; + SERIAL_PIN_TYPES: Board.SerialPinTypes; + HIGH: Board.PIN_STATE; + LOW: Board.PIN_STATE; + pins: Board.Pins[]; + ports: number[]; + analogPins: number[]; + version: Board.Version; + firmware: Board.Firmware; + settings: Board.Settings; + protected transport: SerialPort; + reportVersion(callback: () => void): void + queryFirmware(callback: () => void): void + analogRead(pin: number, callback: (value: number) => void): void + analogWrite(pin: number, value: number): void + pwmWrite(pin: number, value: number): void + servoConfig(pin: number, min: number, max: number): void + servoWrite(pin: number, value: number): void + pinMode(pin: number, mode: Board.PIN_MODE): void + digitalWrite(pin: number, val: Board.PIN_STATE): void + digitalRead(pin: number, callback: (val: Board.PIN_STATE) => void): void + queryCapabilities(callback: () => void): void + queryAnalogMapping(callback: () => void): void + queryPinState(pin: number, callback: () => void): void + // TODO untested --- TWW + sendString(str: string): void + // TODO untested --- TWW + sendI2CConfig(delay: number): void + // TODO untested --- TWW + i2cConfig(options: number|{ delay: number }): void + // TODO untested --- TWW + sendI2CWriteRequest(slaveAddress: number, bytes: number[]): void + // TODO untested --- TWW + i2cWrite(address: number, register: number, inBytes: number[]): void + i2cWrite(address: number, data: number[]): void + // TODO untested --- TWW + i2cWriteReg(address: number, register: number, byte: number): void + // TODO untested --- TWW + sendI2CReadRequest(address: number, numBytes: number, callback: () => void): void + // TODO untested --- TWW + i2cRead(address: number, register: number, bytesToRead: number, callback: (data: number[]) => void): void + i2cRead(address: number, bytesToRead: number, callback: (data: number[]) => void): void + // TODO untested --- TWW + i2cStop(options: number|{ bus: number, address: number }): void + // TODO untested --- TWW + i2cReadOnce(address: number, register: number, bytesToRead: number, callback: (data: number[]) => void): void + i2cReadOnce(address: number, bytesToRead: number, callback: (data: number[]) => void): void + // TODO untested --- TWW + sendOneWireConfig(pin: number, enableParasiticPower: boolean): void + // TODO untested --- TWW + sendOneWireSearch(pin: number, callback: () => void): void + // TODO untested --- TWW + sendOneWireAlarmsSearch(pin: number, callback: () => void): void + // TODO untested --- TWW + sendOneWireRead(pin: number, device: number, numBytesToRead: number, callback: () => void): void + // TODO untested --- TWW + sendOneWireReset(pin: number): void + // TODO untested --- TWW + sendOneWireWrite(pin: number, device: number, data: number|number[]): void + // TODO untested --- TWW + sendOneWireDelay(pin: number, delay: number): void + // TODO untested --- TWW + sendOneWireWriteAndRead(pin: number, device: number, data: number|number[], numBytesToRead: number, + callback: (error?: Error, data?: number) => void): void + setSamplingInterval(interval: number): void + getSamplingInterval(): number + reportAnalogPin(pin: number, value: Board.REPORTING): void + reportDigitalPin(pin: number, value: Board.REPORTING): void + // TODO untested/incomplete --- TWW + pingRead(opts: any, callback: () => void): void + stepperConfig(deviceNum: number, type: number, stepsPerRev: number, dirOrMotor1Pin: number, + stepOrMotor2Pin: number, motor3Pin?: number, motor4Pin?: number): void + stepperStep(deviceNum: number, direction: Board.STEPPER_DIRECTION, steps: number, speed: number, + accel: number|((bool?: boolean) => void), decel?: number, callback?: (bool?: boolean) => void): void + // TODO untested --- TWW + serialConfig(options: { portId: Board.SERIAL_PORT_ID, baud: number, rxPin?: number, txPin?: number }): void + // TODO untested --- TWW + serialWrite(portId: Board.SERIAL_PORT_ID, inBytes: number[]): void + // TODO untested --- TWW + serialRead(portId: Board.SERIAL_PORT_ID, maxBytesToRead: number, callback: () => void): void + // TODO untested --- TWW + serialStop(portId: Board.SERIAL_PORT_ID): void + // TODO untested --- TWW + serialClose(portId: Board.SERIAL_PORT_ID): void + // TODO untested --- TWW + serialFlush(portId: Board.SERIAL_PORT_ID): void + // TODO untested --- TWW + serialListen(portId: Board.SERIAL_PORT_ID): void + // TODO untested --- TWW + sysexResponse(commandByte: number, handler: (data: number[]) => void): void + // TODO untested --- TWW + sysexCommand(message: number[]): void + reset(): void + static isAcceptablePort(port: Board.Port): boolean + static requestPort(callback: (error: any, port: Board.Port) => any): void + // TODO untested --- TWW + static encode(data: number[]): number[] + // TODO untested --- TWW + static decode(data: number[]): number[] + // TODO untested/incomplete --- TWW + protected _sendOneWireSearch(type: any, event: any, pin: number, callback: () => void): void + // TODO untested/incomplete --- TWW + protected _sendOneWireRequest(pin: number, subcommand: any, device: any, numBytesToRead: any, correlationId: any, + delay: number, dataToWrite: any, event: any, callback: () => void): void +} + +declare namespace Board +{ + export interface PinModes + { + INPUT: PIN_MODE, OUTPUT: PIN_MODE, ANALOG: PIN_MODE, PWM: PIN_MODE, SERVO: PIN_MODE, SHIFT: PIN_MODE, + I2C: PIN_MODE, ONEWIRE: PIN_MODE, STEPPER: PIN_MODE, SERIAL: PIN_MODE, PULLUP: PIN_MODE, IGNORE: PIN_MODE, + PING_READ: PIN_MODE, UNKOWN: PIN_MODE + } + + export interface StepperConstants + { + TYPE: { DRIVER: STEPPER_TYPE, TWO_WIRE: STEPPER_TYPE, FOUR_WIRE: STEPPER_TYPE }, + RUNSTATE: { + STOP: STEPPER_RUN_STATE, ACCEL: STEPPER_RUN_STATE, DECEL: STEPPER_RUN_STATE, RUN: STEPPER_RUN_STATE + }, + DIRECTION: { CCW: STEPPER_DIRECTION, CW: STEPPER_DIRECTION } + } + + // tslint:disable-next-line interface-name + export interface I2cModes + { + WRITE: I2C_MODE, READ: I2C_MODE, CONTINUOUS_READ: I2C_MODE, STOP_READING: I2C_MODE + } + + export interface SerialModes + { + CONTINUOUS_READ: SERIAL_MODE, STOP_READING: SERIAL_MODE + } + + export interface SerialPortIds + { + HW_SERIAL0: SERIAL_PORT_ID, HW_SERIAL1: SERIAL_PORT_ID, HW_SERIAL2: SERIAL_PORT_ID, + HW_SERIAL3: SERIAL_PORT_ID, SW_SERIAL0: SERIAL_PORT_ID, SW_SERIAL1: SERIAL_PORT_ID, + SW_SERIAL2: SERIAL_PORT_ID, SW_SERIAL3: SERIAL_PORT_ID, DEFAULT: SERIAL_PORT_ID, + } + + export interface SerialPinTypes + { + RES_RX0: SERIAL_PIN_TYPE, RES_TX0: SERIAL_PIN_TYPE, RES_RX1: SERIAL_PIN_TYPE, RES_TX1: SERIAL_PIN_TYPE, + RES_RX2: SERIAL_PIN_TYPE, RES_TX2: SERIAL_PIN_TYPE, RES_RX3: SERIAL_PIN_TYPE, RES_TX3: SERIAL_PIN_TYPE, + } + + export interface Pins + { + mode: PIN_MODE, + value: PIN_STATE|number, + supportedModes: PIN_MODE[], + analogChannel: number, + report: REPORTING, + state: PIN_STATE|PULLUP_STATE, // TODO not sure if this exists anymore... --- TWW + } + + export interface Firmware + { + name: string, + version: Version, + } + + export interface Settings + { + reportVersionTimeout: number, + samplingInterval: number, + serialport: { + baudRate: number, + bufferSize: number + } + } + + export interface Port + { + comName: string, + } + + export interface Version + { + major: number, + minor: number + } + + // TODO these enums could actually be non-const in the future (provides some benefits) --- TWW + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L449-L464 + export const enum PIN_MODE { + INPUT = 0x00, + OUTPUT = 0x01, + ANALOG = 0x02, + PWM = 0x03, + SERVO = 0x04, + SHIFT = 0x05, + I2C = 0x06, + ONEWIRE = 0x07, + STEPPER = 0x08, + SERIAL = 0x0A, + PULLUP = 0x0B, + IGNORE = 0x7F, + PING_READ = 0x75, + UNKNOWN = 0x10, + } + + export const enum PIN_STATE { + LOW = 0, + HIGH = 1 + } + + export const enum REPORTING { + ON = 1, + OFF = 0, + } + + export const enum PULLUP_STATE { + ENABLED = 1, + DISABLED = 0, + } + + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L474-L478 + export const enum STEPPER_TYPE { + DRIVER = 1, + TWO_WIRE = 2, + FOUR_WIRE = 4, + } + + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L479-L484 + export const enum STEPPER_RUN_STATE { + STOP = 0, + ACCEL = 1, + DECEL = 2, + RUN = 3, + } + + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L485-L488 + export const enum STEPPER_DIRECTION { + CCW = 0, + CW = 1, + } + + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L466-L471 + export const enum I2C_MODE { + WRITE = 0, + READ = 1, + CONTINUOUS_READ = 2, + STOP_READING = 3 + } + + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L491-L494 + export const enum SERIAL_MODE { + CONTINUOUS_READ = 0x00, + STOP_READING = 0x01, + } + + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L497-L512 + export const enum SERIAL_PORT_ID { + HW_SERIAL0 = 0x00, + HW_SERIAL1 = 0x01, + HW_SERIAL2 = 0x02, + HW_SERIAL3 = 0x03, + SW_SERIAL0 = 0x08, + SW_SERIAL1 = 0x09, + SW_SERIAL2 = 0x10, + SW_SERIAL3 = 0x11, + DEFAULT = 0x08, + } + + // https://github.com/firmata/firmata.js/blob/v0.15.0/lib/firmata.js#L515-L524 + export const enum SERIAL_PIN_TYPE { + RES_RX0 = 0x00, + RES_TX0 = 0x01, + RES_RX1 = 0x02, + RES_TX1 = 0x03, + RES_RX2 = 0x04, + RES_TX2 = 0x05, + RES_RX3 = 0x06, + RES_TX3 = 0x07, + } +} \ No newline at end of file diff --git a/xmpp-jid/tsconfig.json b/types/firmata/tsconfig.json similarity index 93% rename from xmpp-jid/tsconfig.json rename to types/firmata/tsconfig.json index f4d02187a2..3b0d4b97cb 100644 --- a/xmpp-jid/tsconfig.json +++ b/types/firmata/tsconfig.json @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "xmpp-jid-tests.ts" + "firmata-tests.ts" ] } \ No newline at end of file diff --git a/massive/tslint.json b/types/firmata/tslint.json similarity index 100% rename from massive/tslint.json rename to types/firmata/tslint.json diff --git a/first-mate/.editorconfig b/types/first-mate/.editorconfig similarity index 100% rename from first-mate/.editorconfig rename to types/first-mate/.editorconfig diff --git a/first-mate/first-mate-tests.ts b/types/first-mate/first-mate-tests.ts similarity index 100% rename from first-mate/first-mate-tests.ts rename to types/first-mate/first-mate-tests.ts diff --git a/first-mate/index.d.ts b/types/first-mate/index.d.ts similarity index 100% rename from first-mate/index.d.ts rename to types/first-mate/index.d.ts diff --git a/first-mate/tsconfig.json b/types/first-mate/tsconfig.json similarity index 100% rename from first-mate/tsconfig.json rename to types/first-mate/tsconfig.json diff --git a/fixed-data-table/fixed-data-table-tests.tsx b/types/fixed-data-table/fixed-data-table-tests.tsx similarity index 99% rename from fixed-data-table/fixed-data-table-tests.tsx rename to types/fixed-data-table/fixed-data-table-tests.tsx index 7dfac22230..f57ff3d946 100644 --- a/fixed-data-table/fixed-data-table-tests.tsx +++ b/types/fixed-data-table/fixed-data-table-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as React from "react"; import {Table, Cell, Column, CellProps} from "fixed-data-table"; diff --git a/fixed-data-table/index.d.ts b/types/fixed-data-table/index.d.ts similarity index 100% rename from fixed-data-table/index.d.ts rename to types/fixed-data-table/index.d.ts diff --git a/fixed-data-table/tsconfig.json b/types/fixed-data-table/tsconfig.json similarity index 100% rename from fixed-data-table/tsconfig.json rename to types/fixed-data-table/tsconfig.json diff --git a/flake-idgen/flake-idgen-tests.ts b/types/flake-idgen/flake-idgen-tests.ts similarity index 100% rename from flake-idgen/flake-idgen-tests.ts rename to types/flake-idgen/flake-idgen-tests.ts diff --git a/flake-idgen/index.d.ts b/types/flake-idgen/index.d.ts similarity index 100% rename from flake-idgen/index.d.ts rename to types/flake-idgen/index.d.ts diff --git a/flake-idgen/tsconfig.json b/types/flake-idgen/tsconfig.json similarity index 100% rename from flake-idgen/tsconfig.json rename to types/flake-idgen/tsconfig.json diff --git a/flat/flat-tests.ts b/types/flat/flat-tests.ts similarity index 100% rename from flat/flat-tests.ts rename to types/flat/flat-tests.ts diff --git a/flat/index.d.ts b/types/flat/index.d.ts similarity index 100% rename from flat/index.d.ts rename to types/flat/index.d.ts diff --git a/flat/tsconfig.json b/types/flat/tsconfig.json similarity index 100% rename from flat/tsconfig.json rename to types/flat/tsconfig.json diff --git a/flatpickr/flatpickr-tests.ts b/types/flatpickr/flatpickr-tests.ts similarity index 100% rename from flatpickr/flatpickr-tests.ts rename to types/flatpickr/flatpickr-tests.ts diff --git a/flatpickr/index.d.ts b/types/flatpickr/index.d.ts similarity index 100% rename from flatpickr/index.d.ts rename to types/flatpickr/index.d.ts diff --git a/flatpickr/tsconfig.json b/types/flatpickr/tsconfig.json similarity index 100% rename from flatpickr/tsconfig.json rename to types/flatpickr/tsconfig.json diff --git a/fs-promise/tslint.json b/types/flatpickr/tslint.json similarity index 100% rename from fs-promise/tslint.json rename to types/flatpickr/tslint.json diff --git a/flexslider/flexslider-tests.ts b/types/flexslider/flexslider-tests.ts similarity index 100% rename from flexslider/flexslider-tests.ts rename to types/flexslider/flexslider-tests.ts diff --git a/flexslider/index.d.ts b/types/flexslider/index.d.ts similarity index 100% rename from flexslider/index.d.ts rename to types/flexslider/index.d.ts diff --git a/flexslider/tsconfig.json b/types/flexslider/tsconfig.json similarity index 100% rename from flexslider/tsconfig.json rename to types/flexslider/tsconfig.json diff --git a/flickity/FlickityEvents.ts b/types/flickity/FlickityEvents.ts similarity index 100% rename from flickity/FlickityEvents.ts rename to types/flickity/FlickityEvents.ts diff --git a/flickity/UNUSED_FILES.txt b/types/flickity/UNUSED_FILES.txt similarity index 100% rename from flickity/UNUSED_FILES.txt rename to types/flickity/UNUSED_FILES.txt diff --git a/flickity/flickity-tests.ts b/types/flickity/flickity-tests.ts similarity index 93% rename from flickity/flickity-tests.ts rename to types/flickity/flickity-tests.ts index b98315285f..b4ecf51997 100644 --- a/flickity/flickity-tests.ts +++ b/types/flickity/flickity-tests.ts @@ -4,11 +4,9 @@ // Definitions: https://github.com/clmcgrath/ /// -/// //jQuery tests - var $flickity: JQuery = $("#flickity-selector").flickity( { initialIndex: 0, @@ -105,15 +103,15 @@ flikty2.destroy(); flikty2.reloadCells(); //event handlers -flikty2.on(FlickityEvents.cellSelect, (evt, ele) => { +flikty2.on("cellSelect", (evt, ele) => { //do something }); -flikty2.off(FlickityEvents.cellSelect, (evt, ele, pntr, vctr) => { +flikty2.off("cellSelect", (evt, ele, pntr, vctr) => { //do something }); -flikty2.once(FlickityEvents.cellSelect, (evt, ele, pntr) => { +flikty2.once("cellSelect", (evt, ele, pntr) => { //do something }); diff --git a/flickity/index.d.ts b/types/flickity/index.d.ts similarity index 100% rename from flickity/index.d.ts rename to types/flickity/index.d.ts diff --git a/flickity/tsconfig.json b/types/flickity/tsconfig.json similarity index 100% rename from flickity/tsconfig.json rename to types/flickity/tsconfig.json diff --git a/flight/flight-tests.ts b/types/flight/flight-tests.ts similarity index 100% rename from flight/flight-tests.ts rename to types/flight/flight-tests.ts diff --git a/flight/index.d.ts b/types/flight/index.d.ts similarity index 100% rename from flight/index.d.ts rename to types/flight/index.d.ts diff --git a/flight/tsconfig.json b/types/flight/tsconfig.json similarity index 100% rename from flight/tsconfig.json rename to types/flight/tsconfig.json diff --git a/flightplan/flightplan-tests.ts b/types/flightplan/flightplan-tests.ts similarity index 100% rename from flightplan/flightplan-tests.ts rename to types/flightplan/flightplan-tests.ts diff --git a/flightplan/index.d.ts b/types/flightplan/index.d.ts similarity index 100% rename from flightplan/index.d.ts rename to types/flightplan/index.d.ts diff --git a/flightplan/tsconfig.json b/types/flightplan/tsconfig.json similarity index 100% rename from flightplan/tsconfig.json rename to types/flightplan/tsconfig.json diff --git a/flipsnap/flipsnap-tests.ts b/types/flipsnap/flipsnap-tests.ts similarity index 100% rename from flipsnap/flipsnap-tests.ts rename to types/flipsnap/flipsnap-tests.ts diff --git a/flipsnap/index.d.ts b/types/flipsnap/index.d.ts similarity index 100% rename from flipsnap/index.d.ts rename to types/flipsnap/index.d.ts diff --git a/flipsnap/tsconfig.json b/types/flipsnap/tsconfig.json similarity index 100% rename from flipsnap/tsconfig.json rename to types/flipsnap/tsconfig.json diff --git a/flot/index.d.ts b/types/flot/index.d.ts similarity index 87% rename from flot/index.d.ts rename to types/flot/index.d.ts index 20fadd0a47..e4fed6a246 100644 --- a/flot/index.d.ts +++ b/types/flot/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Flot // Project: http://www.flotcharts.org/ -// Definitions by: Matt Burland +// Definitions by: Matt Burland , Timo Mühlbach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -21,16 +21,16 @@ declare namespace jquery.flot { } 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; }[]; + 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 { diff --git a/flot/tsconfig.json b/types/flot/tsconfig.json similarity index 100% rename from flot/tsconfig.json rename to types/flot/tsconfig.json diff --git a/flowjs/flowjs-tests.ts b/types/flowjs/flowjs-tests.ts similarity index 100% rename from flowjs/flowjs-tests.ts rename to types/flowjs/flowjs-tests.ts diff --git a/flowjs/index.d.ts b/types/flowjs/index.d.ts similarity index 100% rename from flowjs/index.d.ts rename to types/flowjs/index.d.ts diff --git a/flowjs/tsconfig.json b/types/flowjs/tsconfig.json similarity index 100% rename from flowjs/tsconfig.json rename to types/flowjs/tsconfig.json diff --git a/fluent-ffmpeg/fluent-ffmpeg-tests.ts b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts similarity index 100% rename from fluent-ffmpeg/fluent-ffmpeg-tests.ts rename to types/fluent-ffmpeg/fluent-ffmpeg-tests.ts diff --git a/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts similarity index 100% rename from fluent-ffmpeg/index.d.ts rename to types/fluent-ffmpeg/index.d.ts diff --git a/fluent-ffmpeg/tsconfig.json b/types/fluent-ffmpeg/tsconfig.json similarity index 100% rename from fluent-ffmpeg/tsconfig.json rename to types/fluent-ffmpeg/tsconfig.json diff --git a/flux-standard-action/flux-standard-action-tests.ts b/types/flux-standard-action/flux-standard-action-tests.ts similarity index 100% rename from flux-standard-action/flux-standard-action-tests.ts rename to types/flux-standard-action/flux-standard-action-tests.ts diff --git a/flux-standard-action/index.d.ts b/types/flux-standard-action/index.d.ts similarity index 100% rename from flux-standard-action/index.d.ts rename to types/flux-standard-action/index.d.ts diff --git a/flux-standard-action/tsconfig.json b/types/flux-standard-action/tsconfig.json similarity index 100% rename from flux-standard-action/tsconfig.json rename to types/flux-standard-action/tsconfig.json diff --git a/flux/flux-tests.ts b/types/flux/flux-tests.ts similarity index 100% rename from flux/flux-tests.ts rename to types/flux/flux-tests.ts diff --git a/flux/index.d.ts b/types/flux/index.d.ts similarity index 100% rename from flux/index.d.ts rename to types/flux/index.d.ts diff --git a/flux/tsconfig.json b/types/flux/tsconfig.json similarity index 100% rename from flux/tsconfig.json rename to types/flux/tsconfig.json diff --git a/flux/utils/index.d.ts b/types/flux/utils/index.d.ts similarity index 100% rename from flux/utils/index.d.ts rename to types/flux/utils/index.d.ts diff --git a/fluxxor/fluxxor-tests.ts b/types/fluxxor/fluxxor-tests.ts similarity index 100% rename from fluxxor/fluxxor-tests.ts rename to types/fluxxor/fluxxor-tests.ts diff --git a/fluxxor/index.d.ts b/types/fluxxor/index.d.ts similarity index 100% rename from fluxxor/index.d.ts rename to types/fluxxor/index.d.ts diff --git a/fluxxor/tsconfig.json b/types/fluxxor/tsconfig.json similarity index 100% rename from fluxxor/tsconfig.json rename to types/fluxxor/tsconfig.json diff --git a/fontfaceobserver/fontfaceobserver-tests.ts b/types/fontfaceobserver/fontfaceobserver-tests.ts similarity index 100% rename from fontfaceobserver/fontfaceobserver-tests.ts rename to types/fontfaceobserver/fontfaceobserver-tests.ts diff --git a/fontfaceobserver/index.d.ts b/types/fontfaceobserver/index.d.ts similarity index 100% rename from fontfaceobserver/index.d.ts rename to types/fontfaceobserver/index.d.ts diff --git a/fontfaceobserver/tsconfig.json b/types/fontfaceobserver/tsconfig.json similarity index 100% rename from fontfaceobserver/tsconfig.json rename to types/fontfaceobserver/tsconfig.json diff --git a/fontoxml/fontoxml-tests.ts b/types/fontoxml/fontoxml-tests.ts similarity index 100% rename from fontoxml/fontoxml-tests.ts rename to types/fontoxml/fontoxml-tests.ts diff --git a/fontoxml/index.d.ts b/types/fontoxml/index.d.ts similarity index 100% rename from fontoxml/index.d.ts rename to types/fontoxml/index.d.ts diff --git a/fontoxml/tsconfig.json b/types/fontoxml/tsconfig.json similarity index 100% rename from fontoxml/tsconfig.json rename to types/fontoxml/tsconfig.json diff --git a/forever-monitor/forever-monitor-tests.ts b/types/forever-monitor/forever-monitor-tests.ts similarity index 100% rename from forever-monitor/forever-monitor-tests.ts rename to types/forever-monitor/forever-monitor-tests.ts diff --git a/forever-monitor/index.d.ts b/types/forever-monitor/index.d.ts similarity index 100% rename from forever-monitor/index.d.ts rename to types/forever-monitor/index.d.ts diff --git a/forever-monitor/tsconfig.json b/types/forever-monitor/tsconfig.json similarity index 100% rename from forever-monitor/tsconfig.json rename to types/forever-monitor/tsconfig.json diff --git a/fusioncharts/tslint.json b/types/forever-monitor/tslint.json similarity index 100% rename from fusioncharts/tslint.json rename to types/forever-monitor/tslint.json diff --git a/forge-di/forge-di-tests.ts b/types/forge-di/forge-di-tests.ts similarity index 100% rename from forge-di/forge-di-tests.ts rename to types/forge-di/forge-di-tests.ts diff --git a/forge-di/index.d.ts b/types/forge-di/index.d.ts similarity index 100% rename from forge-di/index.d.ts rename to types/forge-di/index.d.ts diff --git a/forge-di/tsconfig.json b/types/forge-di/tsconfig.json similarity index 100% rename from forge-di/tsconfig.json rename to types/forge-di/tsconfig.json diff --git a/form-data/form-data-tests.ts b/types/form-data/form-data-tests.ts similarity index 100% rename from form-data/form-data-tests.ts rename to types/form-data/form-data-tests.ts diff --git a/form-data/index.d.ts b/types/form-data/index.d.ts similarity index 100% rename from form-data/index.d.ts rename to types/form-data/index.d.ts diff --git a/form-data/tsconfig.json b/types/form-data/tsconfig.json similarity index 100% rename from form-data/tsconfig.json rename to types/form-data/tsconfig.json diff --git a/form-serializer/form-serializer-tests.ts b/types/form-serializer/form-serializer-tests.ts similarity index 100% rename from form-serializer/form-serializer-tests.ts rename to types/form-serializer/form-serializer-tests.ts diff --git a/form-serializer/index.d.ts b/types/form-serializer/index.d.ts similarity index 100% rename from form-serializer/index.d.ts rename to types/form-serializer/index.d.ts diff --git a/form-serializer/tsconfig.json b/types/form-serializer/tsconfig.json similarity index 100% rename from form-serializer/tsconfig.json rename to types/form-serializer/tsconfig.json diff --git a/format-unicorn/index.d.ts b/types/format-unicorn/index.d.ts similarity index 100% rename from format-unicorn/index.d.ts rename to types/format-unicorn/index.d.ts diff --git a/format-unicorn/safe.d.ts b/types/format-unicorn/safe.d.ts similarity index 100% rename from format-unicorn/safe.d.ts rename to types/format-unicorn/safe.d.ts diff --git a/format-unicorn/test/index.ts b/types/format-unicorn/test/index.ts similarity index 100% rename from format-unicorn/test/index.ts rename to types/format-unicorn/test/index.ts diff --git a/format-unicorn/test/safe.ts b/types/format-unicorn/test/safe.ts similarity index 100% rename from format-unicorn/test/safe.ts rename to types/format-unicorn/test/safe.ts diff --git a/format-unicorn/tsconfig.json b/types/format-unicorn/tsconfig.json similarity index 100% rename from format-unicorn/tsconfig.json rename to types/format-unicorn/tsconfig.json diff --git a/fuzzaldrin/tslint.json b/types/format-unicorn/tslint.json similarity index 100% rename from fuzzaldrin/tslint.json rename to types/format-unicorn/tslint.json diff --git a/formidable/formidable-tests.ts b/types/formidable/formidable-tests.ts similarity index 100% rename from formidable/formidable-tests.ts rename to types/formidable/formidable-tests.ts diff --git a/formidable/index.d.ts b/types/formidable/index.d.ts similarity index 100% rename from formidable/index.d.ts rename to types/formidable/index.d.ts diff --git a/formidable/tsconfig.json b/types/formidable/tsconfig.json similarity index 100% rename from formidable/tsconfig.json rename to types/formidable/tsconfig.json diff --git a/fossil-delta/fossil-delta-tests.ts b/types/fossil-delta/fossil-delta-tests.ts similarity index 100% rename from fossil-delta/fossil-delta-tests.ts rename to types/fossil-delta/fossil-delta-tests.ts diff --git a/fossil-delta/index.d.ts b/types/fossil-delta/index.d.ts similarity index 100% rename from fossil-delta/index.d.ts rename to types/fossil-delta/index.d.ts diff --git a/fossil-delta/tsconfig.json b/types/fossil-delta/tsconfig.json similarity index 100% rename from fossil-delta/tsconfig.json rename to types/fossil-delta/tsconfig.json diff --git a/foundation-sites/foundation-sites-tests.ts b/types/foundation-sites/foundation-sites-tests.ts similarity index 87% rename from foundation-sites/foundation-sites-tests.ts rename to types/foundation-sites/foundation-sites-tests.ts index 4932f01624..2e90071c7d 100644 --- a/foundation-sites/foundation-sites-tests.ts +++ b/types/foundation-sites/foundation-sites-tests.ts @@ -1,11 +1,3 @@ -// Tests for type definitions for Foundation Sites v6.0.4 -// Project: http://foundation.zurb.com/ -// Definitions by: Sam Vloeberghs -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - $(document).foundation(); $(document).foundation('method5'); $(document).foundation(['method', 'method2']); diff --git a/foundation-sites/index.d.ts b/types/foundation-sites/index.d.ts similarity index 100% rename from foundation-sites/index.d.ts rename to types/foundation-sites/index.d.ts diff --git a/foundation-sites/tsconfig.json b/types/foundation-sites/tsconfig.json similarity index 100% rename from foundation-sites/tsconfig.json rename to types/foundation-sites/tsconfig.json diff --git a/foundation/foundation-tests.ts b/types/foundation/foundation-tests.ts similarity index 99% rename from foundation/foundation-tests.ts rename to types/foundation/foundation-tests.ts index 913bd0ee1b..33f8530589 100644 --- a/foundation/foundation-tests.ts +++ b/types/foundation/foundation-tests.ts @@ -1,6 +1,3 @@ -/// - - function empty_callback() : void {} function plugin_list() { diff --git a/foundation/index.d.ts b/types/foundation/index.d.ts similarity index 100% rename from foundation/index.d.ts rename to types/foundation/index.d.ts diff --git a/foundation/tsconfig.json b/types/foundation/tsconfig.json similarity index 100% rename from foundation/tsconfig.json rename to types/foundation/tsconfig.json diff --git a/fpsmeter/index.d.ts b/types/fpsmeter/index.d.ts similarity index 100% rename from fpsmeter/index.d.ts rename to types/fpsmeter/index.d.ts diff --git a/fpsmeter/tsconfig.json b/types/fpsmeter/tsconfig.json similarity index 100% rename from fpsmeter/tsconfig.json rename to types/fpsmeter/tsconfig.json diff --git a/freedom/UNUSED_FILES.txt b/types/freedom/UNUSED_FILES.txt similarity index 100% rename from freedom/UNUSED_FILES.txt rename to types/freedom/UNUSED_FILES.txt diff --git a/freedom/freedom-core-env.d.ts b/types/freedom/freedom-core-env.d.ts similarity index 100% rename from freedom/freedom-core-env.d.ts rename to types/freedom/freedom-core-env.d.ts diff --git a/freedom/freedom-module-env.d.ts b/types/freedom/freedom-module-env.d.ts similarity index 100% rename from freedom/freedom-module-env.d.ts rename to types/freedom/freedom-module-env.d.ts diff --git a/freedom/freedom-tests.ts b/types/freedom/freedom-tests.ts similarity index 100% rename from freedom/freedom-tests.ts rename to types/freedom/freedom-tests.ts diff --git a/freedom/index.d.ts b/types/freedom/index.d.ts similarity index 100% rename from freedom/index.d.ts rename to types/freedom/index.d.ts diff --git a/freedom/tsconfig.json b/types/freedom/tsconfig.json similarity index 100% rename from freedom/tsconfig.json rename to types/freedom/tsconfig.json diff --git a/freeport/freeport-tests.ts b/types/freeport/freeport-tests.ts similarity index 100% rename from freeport/freeport-tests.ts rename to types/freeport/freeport-tests.ts diff --git a/freeport/index.d.ts b/types/freeport/index.d.ts similarity index 100% rename from freeport/index.d.ts rename to types/freeport/index.d.ts diff --git a/freeport/tsconfig.json b/types/freeport/tsconfig.json similarity index 100% rename from freeport/tsconfig.json rename to types/freeport/tsconfig.json diff --git a/gaussian/tslint.json b/types/freeport/tslint.json similarity index 100% rename from gaussian/tslint.json rename to types/freeport/tslint.json diff --git a/from/from-tests.ts b/types/from/from-tests.ts similarity index 82% rename from from/from-tests.ts rename to types/from/from-tests.ts index b46bdf66f1..e73a4915a0 100644 --- a/from/from-tests.ts +++ b/types/from/from-tests.ts @@ -1,6 +1,3 @@ - -/// - import from = require('from'); var rs: NodeJS.ReadableStream; diff --git a/from/index.d.ts b/types/from/index.d.ts similarity index 100% rename from from/index.d.ts rename to types/from/index.d.ts diff --git a/from/tsconfig.json b/types/from/tsconfig.json similarity index 100% rename from from/tsconfig.json rename to types/from/tsconfig.json diff --git a/fromjs/fromjs-tests.ts b/types/fromjs/fromjs-tests.ts similarity index 100% rename from fromjs/fromjs-tests.ts rename to types/fromjs/fromjs-tests.ts diff --git a/fromjs/index.d.ts b/types/fromjs/index.d.ts similarity index 100% rename from fromjs/index.d.ts rename to types/fromjs/index.d.ts diff --git a/fromjs/tsconfig.json b/types/fromjs/tsconfig.json similarity index 100% rename from fromjs/tsconfig.json rename to types/fromjs/tsconfig.json diff --git a/fromnow/fromnow-tests.ts b/types/fromnow/fromnow-tests.ts similarity index 100% rename from fromnow/fromnow-tests.ts rename to types/fromnow/fromnow-tests.ts diff --git a/fromnow/index.d.ts b/types/fromnow/index.d.ts similarity index 100% rename from fromnow/index.d.ts rename to types/fromnow/index.d.ts diff --git a/fromnow/tsconfig.json b/types/fromnow/tsconfig.json similarity index 100% rename from fromnow/tsconfig.json rename to types/fromnow/tsconfig.json diff --git a/fs-ext/fs-ext-tests.ts b/types/fs-ext/fs-ext-tests.ts similarity index 72% rename from fs-ext/fs-ext-tests.ts rename to types/fs-ext/fs-ext-tests.ts index baba88f092..0c774589bc 100644 --- a/fs-ext/fs-ext-tests.ts +++ b/types/fs-ext/fs-ext-tests.ts @@ -1,19 +1,16 @@ - -/// - import fs = require('fs-ext'); var num:number; var str:string; -//from node.js 'fs' module +//from node.js 'fs' module fs.appendFileSync(str, "data"); -fs.flock(num, str, (err)=>{ +fs.flock(num, str, (err)=>{ }); fs.flockSync(num, str); -fs.fcntl(num, str, num, (err, res)=>{ +fs.fcntl(num, str, num, (err, res)=>{ }); fs.fcntl(num, str, (err, res)=>{ }); diff --git a/fs-ext/index.d.ts b/types/fs-ext/index.d.ts similarity index 100% rename from fs-ext/index.d.ts rename to types/fs-ext/index.d.ts diff --git a/fs-ext/tsconfig.json b/types/fs-ext/tsconfig.json similarity index 100% rename from fs-ext/tsconfig.json rename to types/fs-ext/tsconfig.json diff --git a/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts b/types/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts similarity index 99% rename from fs-extra-promise-es6/fs-extra-promise-es6-tests.ts rename to types/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts index 12623c54b1..46e623207a 100644 --- a/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts +++ b/types/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require('fs-extra-promise-es6'); import stream = require('stream'); @@ -145,7 +143,7 @@ strArr = fs.readdirSync(path); fs.close(fd, errorCallback); fs.closeSync(fd); fs.open(path, flags, modeStr, (err: Error, fd: number) => { - + }); num = fs.openSync(path, flags, modeStr); fs.utimes(path, atime, mtime, errorCallback); diff --git a/fs-extra-promise-es6/index.d.ts b/types/fs-extra-promise-es6/index.d.ts similarity index 100% rename from fs-extra-promise-es6/index.d.ts rename to types/fs-extra-promise-es6/index.d.ts diff --git a/fs-extra-promise-es6/tsconfig.json b/types/fs-extra-promise-es6/tsconfig.json similarity index 100% rename from fs-extra-promise-es6/tsconfig.json rename to types/fs-extra-promise-es6/tsconfig.json diff --git a/fs-extra-promise/fs-extra-promise-tests.ts b/types/fs-extra-promise/fs-extra-promise-tests.ts similarity index 99% rename from fs-extra-promise/fs-extra-promise-tests.ts rename to types/fs-extra-promise/fs-extra-promise-tests.ts index 112a27109c..28bdd26120 100644 --- a/fs-extra-promise/fs-extra-promise-tests.ts +++ b/types/fs-extra-promise/fs-extra-promise-tests.ts @@ -1,6 +1,3 @@ - -/// - import fs = require('fs-extra-promise'); import stream = require('stream'); diff --git a/fs-extra-promise/index.d.ts b/types/fs-extra-promise/index.d.ts similarity index 100% rename from fs-extra-promise/index.d.ts rename to types/fs-extra-promise/index.d.ts diff --git a/fs-extra-promise/tsconfig.json b/types/fs-extra-promise/tsconfig.json similarity index 100% rename from fs-extra-promise/tsconfig.json rename to types/fs-extra-promise/tsconfig.json diff --git a/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts similarity index 73% rename from fs-extra/fs-extra-tests.ts rename to types/fs-extra/fs-extra-tests.ts index 896d6411f7..a6990cc75f 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -1,8 +1,5 @@ - -/// - import fs = require('fs-extra'); -import * as Path from 'path' +import * as Path from 'path'; var src: string; var dest: string; @@ -22,7 +19,7 @@ fs.copy(src, dest, { clobber: true, preserveTimestamps: true, - filter: (src: string) => {return false} + filter: (src: string) => { return false; } }, errorCallback ); @@ -43,7 +40,7 @@ fs.copySync(src, dest, { clobber: true, preserveTimestamps: true, - filter: (src: string) => {return false} + filter: (src: string) => { return false; } } ); fs.copySync(src, dest, @@ -102,35 +99,3 @@ 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/types/fs-extra/index.d.ts similarity index 96% rename from fs-extra/index.d.ts rename to types/fs-extra/index.d.ts index 2cc47724c8..57f4a6fb24 100644 --- a/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for fs-extra +// Type definitions for fs-extra v2.0.0 // Project: https://github.com/jprichardson/node-fs-extra -// Definitions by: midknight41 +// Definitions by: midknight41 , Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts @@ -120,9 +120,6 @@ 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 } diff --git a/fs-extra/tsconfig.json b/types/fs-extra/tsconfig.json similarity index 100% rename from fs-extra/tsconfig.json rename to types/fs-extra/tsconfig.json diff --git a/fs-finder/fs-finder-tests.ts b/types/fs-finder/fs-finder-tests.ts similarity index 100% rename from fs-finder/fs-finder-tests.ts rename to types/fs-finder/fs-finder-tests.ts diff --git a/fs-finder/index.d.ts b/types/fs-finder/index.d.ts similarity index 100% rename from fs-finder/index.d.ts rename to types/fs-finder/index.d.ts diff --git a/fs-finder/tsconfig.json b/types/fs-finder/tsconfig.json similarity index 100% rename from fs-finder/tsconfig.json rename to types/fs-finder/tsconfig.json diff --git a/fs-mock/fs-mock-tests.ts b/types/fs-mock/fs-mock-tests.ts similarity index 100% rename from fs-mock/fs-mock-tests.ts rename to types/fs-mock/fs-mock-tests.ts diff --git a/fs-mock/index.d.ts b/types/fs-mock/index.d.ts similarity index 100% rename from fs-mock/index.d.ts rename to types/fs-mock/index.d.ts diff --git a/fs-mock/tsconfig.json b/types/fs-mock/tsconfig.json similarity index 100% rename from fs-mock/tsconfig.json rename to types/fs-mock/tsconfig.json diff --git a/fs-promise/fs-promise-tests.ts b/types/fs-promise/fs-promise-tests.ts similarity index 100% rename from fs-promise/fs-promise-tests.ts rename to types/fs-promise/fs-promise-tests.ts diff --git a/fs-promise/index.d.ts b/types/fs-promise/index.d.ts similarity index 100% rename from fs-promise/index.d.ts rename to types/fs-promise/index.d.ts diff --git a/fs-promise/tsconfig.json b/types/fs-promise/tsconfig.json similarity index 100% rename from fs-promise/tsconfig.json rename to types/fs-promise/tsconfig.json diff --git a/geodesy/tslint.json b/types/fs-promise/tslint.json similarity index 100% rename from geodesy/tslint.json rename to types/fs-promise/tslint.json diff --git a/ftdomdelegate/ftdomdelegate-tests.ts b/types/ftdomdelegate/ftdomdelegate-tests.ts similarity index 100% rename from ftdomdelegate/ftdomdelegate-tests.ts rename to types/ftdomdelegate/ftdomdelegate-tests.ts diff --git a/ftdomdelegate/index.d.ts b/types/ftdomdelegate/index.d.ts similarity index 100% rename from ftdomdelegate/index.d.ts rename to types/ftdomdelegate/index.d.ts diff --git a/ftdomdelegate/tsconfig.json b/types/ftdomdelegate/tsconfig.json similarity index 100% rename from ftdomdelegate/tsconfig.json rename to types/ftdomdelegate/tsconfig.json diff --git a/ftp/ftp-tests.ts b/types/ftp/ftp-tests.ts similarity index 82% rename from ftp/ftp-tests.ts rename to types/ftp/ftp-tests.ts index 6e5e7d37a9..4d78104940 100644 --- a/ftp/ftp-tests.ts +++ b/types/ftp/ftp-tests.ts @@ -1,6 +1,3 @@ - -/// - import Client = require("ftp"); import fs = require("fs"); @@ -8,8 +5,8 @@ var c = new Client(); c.on('ready', (): void => { c.get('foo.txt', function(err: Error, stream: NodeJS.ReadableStream): void { if (err) throw err; - stream.once('close', function(): void { - c.end(); + stream.once('close', function(): void { + c.end(); }); stream.pipe(fs.createWriteStream('foo.local-copy.txt')); }); @@ -25,4 +22,4 @@ c.connect({ }); - + diff --git a/ftp/index.d.ts b/types/ftp/index.d.ts similarity index 100% rename from ftp/index.d.ts rename to types/ftp/index.d.ts diff --git a/ftp/tsconfig.json b/types/ftp/tsconfig.json similarity index 100% rename from ftp/tsconfig.json rename to types/ftp/tsconfig.json diff --git a/ftpd/ftpd-tests.ts b/types/ftpd/ftpd-tests.ts similarity index 100% rename from ftpd/ftpd-tests.ts rename to types/ftpd/ftpd-tests.ts diff --git a/ftpd/index.d.ts b/types/ftpd/index.d.ts similarity index 100% rename from ftpd/index.d.ts rename to types/ftpd/index.d.ts diff --git a/ftpd/tsconfig.json b/types/ftpd/tsconfig.json similarity index 100% rename from ftpd/tsconfig.json rename to types/ftpd/tsconfig.json diff --git a/fullcalendar/fullcalendar-tests.ts b/types/fullcalendar/fullcalendar-tests.ts similarity index 94% rename from fullcalendar/fullcalendar-tests.ts rename to types/fullcalendar/fullcalendar-tests.ts index 7640c85db6..4557a94eef 100644 --- a/fullcalendar/fullcalendar-tests.ts +++ b/types/fullcalendar/fullcalendar-tests.ts @@ -1,5 +1,4 @@ -/// -/// +/// import * as FullCalendar from 'fullcalendar'; import * as moment from 'moment'; @@ -34,7 +33,6 @@ $('#calendar').fullCalendar({ $('#calendar').fullCalendar({ eventSources: [ - // source with no options "http://www.google.com/your_feed_url1/", @@ -85,15 +83,14 @@ $('#calendar').fullCalendar({ dragOpacity: .5 }); -var view = $('#calendar').fullCalendar('getView'); +const 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(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -149,15 +146,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -214,15 +209,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -268,15 +261,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ editable: true, @@ -333,15 +324,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -387,7 +376,6 @@ $(document).ready(() => { } ] }); - }); $('#my-prev-button').click(() => { @@ -405,7 +393,7 @@ $('#my-today-button').click(() => { $('#calendar').fullCalendar('gotoDate', 1, 0, 1); $('#my-button').click(() => { - var d = $('#calendar').fullCalendar('getDate'); + const d = $('#calendar').fullCalendar('getDate'); alert("The current date of the calendar is " + d); }); @@ -430,7 +418,6 @@ $('#calendar').fullCalendar({ $('#calendar').fullCalendar({ dayClick(date, allDay, jsEvent, view) { - if (allDay) { alert('Clicked on the entire day: ' + date); } else { @@ -443,20 +430,17 @@ $('#calendar').fullCalendar({ // 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'); - } }); @@ -478,9 +462,7 @@ $('#calendar').fullCalendar({ }); $('#calendar').fullCalendar({ - eventSources: [ - // your event source { url: '/myfeed.php', @@ -497,13 +479,10 @@ $('#calendar').fullCalendar({ } // any other sources... - ] - }); $('#calendar').fullCalendar({ - events: { url: '/myfeed.php', type: 'POST', @@ -517,22 +496,17 @@ $('#calendar').fullCalendar({ 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 @@ -541,9 +515,7 @@ $('#calendar').fullCalendar({ } // any other sources... - ] - }); $('#calendar').fullCalendar({ @@ -570,9 +542,7 @@ $('#calendar').fullCalendar({ }); $('#calendar').fullCalendar({ - eventSources: [ - // your event source { events: [ // put the array in the `events` property @@ -595,9 +565,7 @@ $('#calendar').fullCalendar({ } // any other event sources... - ] - }); $('#calendar').fullCalendar({ @@ -611,7 +579,7 @@ $('#calendar').fullCalendar({ end: Math.round(end.toDate().getTime() / 1000) }, success(doc) { - var events: any[] = []; + const events: any[] = []; $(doc).find('event').each(() => { events.push({ title: $(this).attr('title'), @@ -625,9 +593,7 @@ $('#calendar').fullCalendar({ }); $('#calendar').fullCalendar({ - eventSources: [ - // your event source { events(start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) { @@ -636,11 +602,8 @@ $('#calendar').fullCalendar({ color: 'yellow', // an option! textColor: 'black' // an option! } - // any other sources... - ] - }); $('#calendar').fullCalendar({ @@ -652,11 +615,9 @@ $('#calendar').fullCalendar({ $('#calendar').fullCalendar({ eventClick(event, element) { - event.title = "CLICKED!"; $('#calendar').fullCalendar('updateEvent', event); - } }); @@ -713,11 +674,10 @@ $('#draggable1').draggable(); $('#draggable2').draggable(); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ theme: true, @@ -774,17 +734,15 @@ $(document).ready(() => { } ] }); - }); $(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 = { + const eventObject = { title: $.trim($(this).text()) // use the element's text as the event title }; @@ -797,7 +755,6 @@ $(document).ready(() => { revert: true, // will cause the event to go back to its revertDuration: 0 // original position after the drag }); - }); /* initialize the calendar -----------------------------------------------------------------*/ @@ -813,10 +770,10 @@ $(document).ready(() => { drop(date, allDay) { // this function is called when something is dropped // retrieve the dropped element's stored Event Object - var originalEventObject = $(this).data('eventObject'); + const 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); + const copiedEventObject: any = $.extend({}, originalEventObject); // assign it the date that was reported copiedEventObject.start = date; @@ -836,10 +793,10 @@ $(document).ready(() => { }); $(document).ready(() => { - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ theme: true, diff --git a/fullcalendar/index.d.ts b/types/fullcalendar/index.d.ts similarity index 100% rename from fullcalendar/index.d.ts rename to types/fullcalendar/index.d.ts diff --git a/fullcalendar/package.json b/types/fullcalendar/package.json similarity index 100% rename from fullcalendar/package.json rename to types/fullcalendar/package.json diff --git a/fullcalendar/tsconfig.json b/types/fullcalendar/tsconfig.json similarity index 100% rename from fullcalendar/tsconfig.json rename to types/fullcalendar/tsconfig.json diff --git a/fullcalendar/tslint.json b/types/fullcalendar/tslint.json similarity index 100% rename from fullcalendar/tslint.json rename to types/fullcalendar/tslint.json diff --git a/fullcalendar/v1/fullcalendar-tests.ts b/types/fullcalendar/v1/fullcalendar-tests.ts similarity index 94% rename from fullcalendar/v1/fullcalendar-tests.ts rename to types/fullcalendar/v1/fullcalendar-tests.ts index 56a9eb0024..c2c0da1948 100644 --- a/fullcalendar/v1/fullcalendar-tests.ts +++ b/types/fullcalendar/v1/fullcalendar-tests.ts @@ -1,6 +1,4 @@ -/// -/// -/// +/// // All examples from http://arshaw.com/fullcalendar/docs/ @@ -32,7 +30,6 @@ $('#calendar').fullCalendar({ $('#calendar').fullCalendar({ eventSources: [ - // source with no options "http://www.google.com/your_feed_url1/", @@ -83,15 +80,14 @@ $('#calendar').fullCalendar({ dragOpacity: .5 }); -var view = $('#calendar').fullCalendar('getView'); +const 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(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -147,15 +143,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -212,15 +206,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -266,15 +258,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ editable: true, @@ -331,15 +321,13 @@ $(document).ready(() => { } ] }); - }); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ header: { @@ -385,7 +373,6 @@ $(document).ready(() => { } ] }); - }); $('#my-prev-button').click(() => { @@ -403,7 +390,7 @@ $('#my-today-button').click(() => { $('#calendar').fullCalendar('gotoDate', 1, 0, 1); $('#my-button').click(() => { - var d = $('#calendar').fullCalendar('getDate'); + const d = $('#calendar').fullCalendar('getDate'); alert("The current date of the calendar is " + d); }); @@ -428,7 +415,6 @@ $('#calendar').fullCalendar({ $('#calendar').fullCalendar({ dayClick(date, allDay, jsEvent, view) { - if (allDay) { alert('Clicked on the entire day: ' + date); } else { @@ -441,20 +427,17 @@ $('#calendar').fullCalendar({ // 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'); - } }); @@ -476,9 +459,7 @@ $('#calendar').fullCalendar({ }); $('#calendar').fullCalendar({ - eventSources: [ - // your event source { url: '/myfeed.php', @@ -495,13 +476,10 @@ $('#calendar').fullCalendar({ } // any other sources... - ] - }); $('#calendar').fullCalendar({ - events: { url: '/myfeed.php', type: 'POST', @@ -515,22 +493,17 @@ $('#calendar').fullCalendar({ 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 @@ -539,9 +512,7 @@ $('#calendar').fullCalendar({ } // any other sources... - ] - }); $('#calendar').fullCalendar({ @@ -568,9 +539,7 @@ $('#calendar').fullCalendar({ }); $('#calendar').fullCalendar({ - eventSources: [ - // your event source { events: [ // put the array in the `events` property @@ -593,9 +562,7 @@ $('#calendar').fullCalendar({ } // any other event sources... - ] - }); $('#calendar').fullCalendar({ @@ -609,7 +576,7 @@ $('#calendar').fullCalendar({ end: Math.round(end.getTime() / 1000) }, success(doc) { - var events: any[] = []; + const events: any[] = []; $(doc).find('event').each(() => { events.push({ title: $(this).attr('title'), @@ -623,9 +590,7 @@ $('#calendar').fullCalendar({ }); $('#calendar').fullCalendar({ - eventSources: [ - // your event source { events(start: any, end: any, callback: any) { @@ -636,9 +601,7 @@ $('#calendar').fullCalendar({ } // any other sources... - ] - }); $('#calendar').fullCalendar({ @@ -650,11 +613,9 @@ $('#calendar').fullCalendar({ $('#calendar').fullCalendar({ eventClick(event, element) { - event.title = "CLICKED!"; $('#calendar').fullCalendar('updateEvent', event); - } }); @@ -711,11 +672,10 @@ $('#draggable1').draggable(); $('#draggable2').draggable(); $(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); + const date = new Date(); + const d = date.getDate(); + const m = date.getMonth(); + const y = date.getFullYear(); $('#calendar').fullCalendar({ theme: true, @@ -772,17 +732,15 @@ $(document).ready(() => { } ] }); - }); $(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 = { + const eventObject = { title: $.trim($(this).text()) // use the element's text as the event title }; @@ -795,7 +753,6 @@ $(document).ready(() => { revert: true, // will cause the event to go back to its revertDuration: 0 // original position after the drag }); - }); /* initialize the calendar -----------------------------------------------------------------*/ @@ -811,10 +768,10 @@ $(document).ready(() => { drop(date, allDay) { // this function is called when something is dropped // retrieve the dropped element's stored Event Object - var originalEventObject = $(this).data('eventObject'); + const 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); + const copiedEventObject: any = $.extend({}, originalEventObject); // assign it the date that was reported copiedEventObject.start = date; diff --git a/fullcalendar/v1/index.d.ts b/types/fullcalendar/v1/index.d.ts similarity index 95% rename from fullcalendar/v1/index.d.ts rename to types/fullcalendar/v1/index.d.ts index 9f521ca8fc..4fcb41731b 100644 --- a/fullcalendar/v1/index.d.ts +++ b/types/fullcalendar/v1/index.d.ts @@ -8,8 +8,7 @@ import * as moment from "moment"; declare global { namespace FullCalendar { - export interface Calendar { - + interface Calendar { /** * Formats a Date object into a string. */ @@ -36,22 +35,21 @@ declare global { version: string; } - export interface BusinessHours { + interface BusinessHours { start: moment.Duration; end: moment.Duration; dow: number[]; } - export interface Timespan { + interface Timespan { start: moment.Moment; end: moment.Moment; } - export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { - + interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { // General display - http://arshaw.com/fullcalendar/docs/display/ - header?: { + header?: { left: string; center: string; right: string; @@ -152,11 +150,9 @@ declare global { eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; eventAfterAllRender?: (view: ViewObject) => void; eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void; - - } - export interface ViewOptionHash { + interface ViewOptionHash { month?: any; week?: any; day?: any; @@ -172,7 +168,7 @@ declare global { /** * Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/ */ - export interface AgendaOptions { + interface AgendaOptions { allDaySlot?: boolean; allDayText?: string; slotDuration?: moment.Duration; @@ -188,7 +184,7 @@ declare global { /* * Event Dragging & Resizing */ - export interface EventDraggingResizingOptions { + interface EventDraggingResizingOptions { editable?: boolean; eventStartEditable?: boolean; eventDurationEditable?: boolean; @@ -207,7 +203,7 @@ declare global { /* * Selection - http://arshaw.com/fullcalendar/docs/selection/ */ - export interface SelectionOptions { + interface SelectionOptions { selectable?: boolean; selectHelper?: boolean | ((start: moment.Moment, end: moment.Moment) => HTMLElement); unselectAuto?: boolean; @@ -218,14 +214,14 @@ declare global { unselect?: (view: ViewObject, jsEvent: Event) => void; } - export interface DroppingExternalElementsOptions { + 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 { + interface ButtonTextObject { prev?: string; next?: string; prevYear?: string; @@ -236,7 +232,7 @@ declare global { day?: string; } - export interface EventObject extends Timespan { + interface EventObject extends Timespan { id?: any; // String/number title: string; allDay?: boolean; @@ -251,15 +247,14 @@ declare global { rendering?: string; } - export interface ViewObject extends Timespan { + interface ViewObject extends Timespan { name: string; title: string; intervalStart: moment.Moment; intervalEnd: moment.Moment; } - export interface EventSource extends JQueryAjaxSettings { - + interface EventSource extends JQueryAjaxSettings { /** * This has one of the following types: * @@ -281,11 +276,9 @@ declare global { startParam?: string; endParam?: string; } - } interface JQuery { - /** * Get/Set option value */ diff --git a/fullcalendar/v1/package.json b/types/fullcalendar/v1/package.json similarity index 100% rename from fullcalendar/v1/package.json rename to types/fullcalendar/v1/package.json diff --git a/fullcalendar/v1/tsconfig.json b/types/fullcalendar/v1/tsconfig.json similarity index 100% rename from fullcalendar/v1/tsconfig.json rename to types/fullcalendar/v1/tsconfig.json diff --git a/fullcalendar/v1/tslint.json b/types/fullcalendar/v1/tslint.json similarity index 100% rename from fullcalendar/v1/tslint.json rename to types/fullcalendar/v1/tslint.json diff --git a/fullname/fullname-tests.ts b/types/fullname/fullname-tests.ts similarity index 100% rename from fullname/fullname-tests.ts rename to types/fullname/fullname-tests.ts diff --git a/fullname/index.d.ts b/types/fullname/index.d.ts similarity index 100% rename from fullname/index.d.ts rename to types/fullname/index.d.ts diff --git a/fullname/tsconfig.json b/types/fullname/tsconfig.json similarity index 100% rename from fullname/tsconfig.json rename to types/fullname/tsconfig.json diff --git a/fullpage.js/fullpage.js-tests.ts b/types/fullpage.js/fullpage.js-tests.ts similarity index 100% rename from fullpage.js/fullpage.js-tests.ts rename to types/fullpage.js/fullpage.js-tests.ts diff --git a/fullpage.js/index.d.ts b/types/fullpage.js/index.d.ts similarity index 100% rename from fullpage.js/index.d.ts rename to types/fullpage.js/index.d.ts diff --git a/fullpage.js/tsconfig.json b/types/fullpage.js/tsconfig.json similarity index 100% rename from fullpage.js/tsconfig.json rename to types/fullpage.js/tsconfig.json diff --git a/fuse/fuse-tests.ts b/types/fuse/fuse-tests.ts similarity index 100% rename from fuse/fuse-tests.ts rename to types/fuse/fuse-tests.ts diff --git a/fuse/index.d.ts b/types/fuse/index.d.ts similarity index 100% rename from fuse/index.d.ts rename to types/fuse/index.d.ts diff --git a/fuse/tsconfig.json b/types/fuse/tsconfig.json similarity index 100% rename from fuse/tsconfig.json rename to types/fuse/tsconfig.json diff --git a/fusioncharts/fusioncharts-tests.ts b/types/fusioncharts/fusioncharts-tests.ts similarity index 100% rename from fusioncharts/fusioncharts-tests.ts rename to types/fusioncharts/fusioncharts-tests.ts diff --git a/fusioncharts/fusioncharts.charts.d.ts b/types/fusioncharts/fusioncharts.charts.d.ts similarity index 100% rename from fusioncharts/fusioncharts.charts.d.ts rename to types/fusioncharts/fusioncharts.charts.d.ts diff --git a/fusioncharts/fusioncharts.gantt.d.ts b/types/fusioncharts/fusioncharts.gantt.d.ts similarity index 100% rename from fusioncharts/fusioncharts.gantt.d.ts rename to types/fusioncharts/fusioncharts.gantt.d.ts diff --git a/fusioncharts/fusioncharts.maps.d.ts b/types/fusioncharts/fusioncharts.maps.d.ts similarity index 100% rename from fusioncharts/fusioncharts.maps.d.ts rename to types/fusioncharts/fusioncharts.maps.d.ts diff --git a/fusioncharts/fusioncharts.powercharts.d.ts b/types/fusioncharts/fusioncharts.powercharts.d.ts similarity index 100% rename from fusioncharts/fusioncharts.powercharts.d.ts rename to types/fusioncharts/fusioncharts.powercharts.d.ts diff --git a/fusioncharts/fusioncharts.ssgrid.d.ts b/types/fusioncharts/fusioncharts.ssgrid.d.ts similarity index 100% rename from fusioncharts/fusioncharts.ssgrid.d.ts rename to types/fusioncharts/fusioncharts.ssgrid.d.ts diff --git a/fusioncharts/fusioncharts.treemap.d.ts b/types/fusioncharts/fusioncharts.treemap.d.ts similarity index 100% rename from fusioncharts/fusioncharts.treemap.d.ts rename to types/fusioncharts/fusioncharts.treemap.d.ts diff --git a/fusioncharts/fusioncharts.widgets.d.ts b/types/fusioncharts/fusioncharts.widgets.d.ts similarity index 100% rename from fusioncharts/fusioncharts.widgets.d.ts rename to types/fusioncharts/fusioncharts.widgets.d.ts diff --git a/fusioncharts/fusioncharts.zoomscatter.d.ts b/types/fusioncharts/fusioncharts.zoomscatter.d.ts similarity index 100% rename from fusioncharts/fusioncharts.zoomscatter.d.ts rename to types/fusioncharts/fusioncharts.zoomscatter.d.ts diff --git a/fusioncharts/index.d.ts b/types/fusioncharts/index.d.ts similarity index 100% rename from fusioncharts/index.d.ts rename to types/fusioncharts/index.d.ts diff --git a/fusioncharts/maps/fusioncharts.usa.d.ts b/types/fusioncharts/maps/fusioncharts.usa.d.ts similarity index 100% rename from fusioncharts/maps/fusioncharts.usa.d.ts rename to types/fusioncharts/maps/fusioncharts.usa.d.ts diff --git a/fusioncharts/maps/fusioncharts.world.d.ts b/types/fusioncharts/maps/fusioncharts.world.d.ts similarity index 100% rename from fusioncharts/maps/fusioncharts.world.d.ts rename to types/fusioncharts/maps/fusioncharts.world.d.ts diff --git a/fusioncharts/themes/fusioncharts.theme.carbon.d.ts b/types/fusioncharts/themes/fusioncharts.theme.carbon.d.ts similarity index 100% rename from fusioncharts/themes/fusioncharts.theme.carbon.d.ts rename to types/fusioncharts/themes/fusioncharts.theme.carbon.d.ts diff --git a/fusioncharts/themes/fusioncharts.theme.fint.d.ts b/types/fusioncharts/themes/fusioncharts.theme.fint.d.ts similarity index 100% rename from fusioncharts/themes/fusioncharts.theme.fint.d.ts rename to types/fusioncharts/themes/fusioncharts.theme.fint.d.ts diff --git a/fusioncharts/themes/fusioncharts.theme.ocean.d.ts b/types/fusioncharts/themes/fusioncharts.theme.ocean.d.ts similarity index 100% rename from fusioncharts/themes/fusioncharts.theme.ocean.d.ts rename to types/fusioncharts/themes/fusioncharts.theme.ocean.d.ts diff --git a/fusioncharts/themes/fusioncharts.theme.zune.d.ts b/types/fusioncharts/themes/fusioncharts.theme.zune.d.ts similarity index 100% rename from fusioncharts/themes/fusioncharts.theme.zune.d.ts rename to types/fusioncharts/themes/fusioncharts.theme.zune.d.ts diff --git a/fusioncharts/tsconfig.json b/types/fusioncharts/tsconfig.json similarity index 100% rename from fusioncharts/tsconfig.json rename to types/fusioncharts/tsconfig.json diff --git a/geolib/tslint.json b/types/fusioncharts/tslint.json similarity index 100% rename from geolib/tslint.json rename to types/fusioncharts/tslint.json diff --git a/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts b/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts similarity index 100% rename from fuzzaldrin-plus/fuzzaldrin-plus-tests.ts rename to types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts diff --git a/fuzzaldrin-plus/index.d.ts b/types/fuzzaldrin-plus/index.d.ts similarity index 100% rename from fuzzaldrin-plus/index.d.ts rename to types/fuzzaldrin-plus/index.d.ts diff --git a/fuzzaldrin-plus/tsconfig.json b/types/fuzzaldrin-plus/tsconfig.json similarity index 100% rename from fuzzaldrin-plus/tsconfig.json rename to types/fuzzaldrin-plus/tsconfig.json diff --git a/fuzzaldrin/index.d.ts b/types/fuzzaldrin/index.d.ts similarity index 100% rename from fuzzaldrin/index.d.ts rename to types/fuzzaldrin/index.d.ts diff --git a/fuzzaldrin/tsconfig.json b/types/fuzzaldrin/tsconfig.json similarity index 100% rename from fuzzaldrin/tsconfig.json rename to types/fuzzaldrin/tsconfig.json diff --git a/geopattern/tslint.json b/types/fuzzaldrin/tslint.json similarity index 100% rename from geopattern/tslint.json rename to types/fuzzaldrin/tslint.json diff --git a/fxn/index.d.ts b/types/fxn/index.d.ts similarity index 100% rename from fxn/index.d.ts rename to types/fxn/index.d.ts diff --git a/fxn/tsconfig.json b/types/fxn/tsconfig.json similarity index 100% rename from fxn/tsconfig.json rename to types/fxn/tsconfig.json diff --git a/gae.channel.api/gae.channel.api-tests.ts b/types/gae.channel.api/gae.channel.api-tests.ts similarity index 100% rename from gae.channel.api/gae.channel.api-tests.ts rename to types/gae.channel.api/gae.channel.api-tests.ts diff --git a/gae.channel.api/index.d.ts b/types/gae.channel.api/index.d.ts similarity index 100% rename from gae.channel.api/index.d.ts rename to types/gae.channel.api/index.d.ts diff --git a/gae.channel.api/tsconfig.json b/types/gae.channel.api/tsconfig.json similarity index 100% rename from gae.channel.api/tsconfig.json rename to types/gae.channel.api/tsconfig.json diff --git a/gamepad/gamepad-tests.ts b/types/gamepad/gamepad-tests.ts similarity index 100% rename from gamepad/gamepad-tests.ts rename to types/gamepad/gamepad-tests.ts diff --git a/gamepad/index.d.ts b/types/gamepad/index.d.ts similarity index 100% rename from gamepad/index.d.ts rename to types/gamepad/index.d.ts diff --git a/gamepad/tsconfig.json b/types/gamepad/tsconfig.json similarity index 100% rename from gamepad/tsconfig.json rename to types/gamepad/tsconfig.json diff --git a/gamequery/gamequery-tests.ts b/types/gamequery/gamequery-tests.ts similarity index 100% rename from gamequery/gamequery-tests.ts rename to types/gamequery/gamequery-tests.ts diff --git a/gamequery/index.d.ts b/types/gamequery/index.d.ts similarity index 100% rename from gamequery/index.d.ts rename to types/gamequery/index.d.ts diff --git a/gamequery/tsconfig.json b/types/gamequery/tsconfig.json similarity index 100% rename from gamequery/tsconfig.json rename to types/gamequery/tsconfig.json diff --git a/gandi-livedns/gandi-livedns-tests.ts b/types/gandi-livedns/gandi-livedns-tests.ts similarity index 100% rename from gandi-livedns/gandi-livedns-tests.ts rename to types/gandi-livedns/gandi-livedns-tests.ts diff --git a/gandi-livedns/index.d.ts b/types/gandi-livedns/index.d.ts similarity index 100% rename from gandi-livedns/index.d.ts rename to types/gandi-livedns/index.d.ts diff --git a/gandi-livedns/tsconfig.json b/types/gandi-livedns/tsconfig.json similarity index 100% rename from gandi-livedns/tsconfig.json rename to types/gandi-livedns/tsconfig.json diff --git a/gapi.analytics/gapi.analytics-tests.ts b/types/gapi.analytics/gapi.analytics-tests.ts similarity index 100% rename from gapi.analytics/gapi.analytics-tests.ts rename to types/gapi.analytics/gapi.analytics-tests.ts diff --git a/gapi.analytics/index.d.ts b/types/gapi.analytics/index.d.ts similarity index 100% rename from gapi.analytics/index.d.ts rename to types/gapi.analytics/index.d.ts diff --git a/gapi.analytics/tsconfig.json b/types/gapi.analytics/tsconfig.json similarity index 100% rename from gapi.analytics/tsconfig.json rename to types/gapi.analytics/tsconfig.json diff --git a/types/gapi.auth2/gapi.auth2-tests.ts b/types/gapi.auth2/gapi.auth2-tests.ts new file mode 100644 index 0000000000..1d389d59e9 --- /dev/null +++ b/types/gapi.auth2/gapi.auth2-tests.ts @@ -0,0 +1,145 @@ +/// + +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 + }); +} + +/* Example taken from https://developers.google.com/identity/sign-in/web/ */ +function onSignIn(googleUser: gapi.auth2.GoogleUser) { + // Useful data for your client-side scripts: + var profile = googleUser.getBasicProfile(); + console.log("ID: " + profile.getId()); // Don't send this directly to your server! + console.log('Full Name: ' + profile.getName()); + console.log('Given Name: ' + profile.getGivenName()); + console.log('Family Name: ' + profile.getFamilyName()); + console.log("Image URL: " + profile.getImageUrl()); + console.log("Email: " + profile.getEmail()); + + // The ID token you need to pass to your backend: + var id_token = googleUser.getAuthResponse().id_token; + console.log("ID Token: " + id_token); +}; + + +/* Example taken from https://github.com/google/google-api-javascript-client/blob/master/samples/authSample.html */ + +// Enter an API key from the Google API Console: +// https://console.developers.google.com/apis/credentials +var apiKey = 'YOUR_API_KEY'; +// Enter the API Discovery Docs that describes the APIs you want to +// access. In this example, we are accessing the People API, so we load +// Discovery Doc found here: https://developers.google.com/people/api/rest/ +var discoveryDocs = ["https://people.googleapis.com/$discovery/rest?version=v1"]; +// Enter a client ID for a web application from the Google API Console: +// https://console.developers.google.com/apis/credentials?project=_ +// In your API Console project, add a JavaScript origin that corresponds +// to the domain where you will be running the script. +var clientId = 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com'; +// Enter one or more authorization scopes. Refer to the documentation for +// the API or https://developers.google.com/people/v1/how-tos/authorizing +// for details. +var scopes = 'profile'; +var authorizeButton = document.getElementById('authorize-button'); +var signoutButton = document.getElementById('signout-button'); +function handleClientLoad() { + // Load the API client and auth2 library + gapi.load('client:auth2', initClient); +} +function initClient() { + gapi.client.init({ + apiKey: apiKey, + discoveryDocs: discoveryDocs, + clientId: clientId, + scope: scopes + }).then(function () { + // Listen for sign-in state changes. + gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus); + // Handle the initial sign-in state. + updateSigninStatus(gapi.auth2.getAuthInstance().isSignedIn.get()); + authorizeButton.onclick = handleAuthClick; + signoutButton.onclick = handleSignoutClick; + }); +} +function updateSigninStatus(isSignedIn: boolean) { + if (isSignedIn) { + authorizeButton.style.display = 'none'; + signoutButton.style.display = 'block'; + makeApiCall(); + } else { + authorizeButton.style.display = 'block'; + signoutButton.style.display = 'none'; + } +} +function handleAuthClick(event: MouseEvent) { + gapi.auth2.getAuthInstance().signIn(); +} +function handleSignoutClick(event: MouseEvent) { + gapi.auth2.getAuthInstance().signOut(); +} +// Load the API and make an API call. Display the results on the screen. +function makeApiCall() { + gapi.client.people.people.get({ + resourceName: 'people/me' + }).then(function(resp) { + var p = document.createElement('p'); + var name = resp.result.names[0].givenName; + p.appendChild(document.createTextNode('Hello, '+name+'!')); + document.getElementById('content').appendChild(p); + }); +} diff --git a/gapi.auth2/index.d.ts b/types/gapi.auth2/index.d.ts similarity index 98% rename from gapi.auth2/index.d.ts rename to types/gapi.auth2/index.d.ts index 6146a87e28..402da68699 100644 --- a/gapi.auth2/index.d.ts +++ b/types/gapi.auth2/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Sign-In API +// Type definitions for Google Sign-In API 0.0 // Project: https://developers.google.com/identity/sign-in/web/ // Definitions by: Derek Lawless // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -21,7 +21,7 @@ declare namespace gapi.auth2 { * 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; + then(onInit: () => any, onFailure?: (reason: string) => any): any; /** * Signs in the user with the options specified to gapi.auth2.init(). @@ -58,7 +58,7 @@ declare namespace gapi.auth2 { onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; } - export interface IsSignedIn{ + export interface IsSignedIn { /** * Returns whether the current user is currently signed in. */ diff --git a/gapi.auth2/tsconfig.json b/types/gapi.auth2/tsconfig.json similarity index 100% rename from gapi.auth2/tsconfig.json rename to types/gapi.auth2/tsconfig.json diff --git a/types/gapi.calendar/gapi.calendar-tests.ts b/types/gapi.calendar/gapi.calendar-tests.ts new file mode 100644 index 0000000000..bd42483df5 --- /dev/null +++ b/types/gapi.calendar/gapi.calendar-tests.ts @@ -0,0 +1,152 @@ +/* Example taken from Google Calendar API JavaScript Quickstart https://developers.google.com/google-apps/calendar/quickstart/js */ + +{ + // Your Client ID can be retrieved from your project in the Google + // Developer Console, https://console.developers.google.com + var CLIENT_ID = ''; + + var SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"]; + + /** + * Check if current user has authorized this application. + */ + function checkAuth() { + gapi.auth.authorize( + { + 'client_id': CLIENT_ID, + 'scope': SCOPES.join(' '), + 'immediate': true + }, handleAuthResult); + } + + /** + * Handle response from authorization server. + * + * @param {Object} authResult Authorization result. + */ + function handleAuthResult(authResult: GoogleApiOAuth2TokenObject) { + var authorizeDiv = document.getElementById('authorize-div')!; + if (authResult && !authResult.error) { + // Hide auth UI, then load client library. + authorizeDiv.style.display = 'none'; + loadCalendarApi(); + } else { + // Show auth UI, allowing the user to initiate authorization by + // clicking authorize button. + authorizeDiv.style.display = 'inline'; + } + } + + /** + * Initiate auth flow in response to user clicking authorize button. + * + * @param {Event} event Button click event. + */ + function handleAuthClick(event: MouseEvent) { + gapi.auth.authorize( + {client_id: CLIENT_ID, scope: SCOPES, immediate: false}, + handleAuthResult); + return false; + } + + /** + * Load Google Calendar client library. List upcoming events + * once client library is loaded. + */ + function loadCalendarApi() { + gapi.client.load('calendar', 'v3', listUpcomingEvents); + } + + /** + * Print the summary and start datetime/date of the next ten events in + * the authorized user's calendar. If no events are found an + * appropriate message is printed. + */ + function listUpcomingEvents() { + var request = gapi.client.calendar.events.list({ + 'calendarId': 'primary', + 'timeMin': (new Date()).toISOString(), + 'showDeleted': false, + 'singleEvents': true, + 'maxResults': 10, + 'orderBy': 'startTime' + }); + + request.execute(function(resp) { + var events = resp.items; + appendPre('Upcoming events:'); + + if (events.length > 0) { + for (let i = 0; i < events.length; i++) { + var event = events[i]; + var when = event.start.dateTime; + if (!when) { + when = event.start.date; + } + appendPre(event.summary + ' (' + when + ')') + } + } else { + appendPre('No upcoming events found.'); + } + + }); + } + + /** + * Append a pre element to the body containing the given message + * as its text node. + * + * @param {string} message Text to be placed in pre element. + */ + function appendPre(message: string) { + var pre = document.getElementById('output')!; + var textContent = document.createTextNode(message + '\n'); + pre.appendChild(textContent); + } +} + +/* Example taken from https://developers.google.com/google-apps/calendar/v3/reference/events/insert#examples */ + +{ + // Refer to the JavaScript quickstart on how to setup the environment: + // https://developers.google.com/google-apps/calendar/quickstart/js + // Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any + // stored credentials. + + const event = { + 'summary': 'Google I/O 2015', + 'location': '800 Howard St., San Francisco, CA 94103', + 'description': 'A chance to hear more about Google\'s developer products.', + 'start': { + 'dateTime': '2015-05-28T09:00:00-07:00', + 'timeZone': 'America/Los_Angeles' + }, + 'end': { + 'dateTime': '2015-05-28T17:00:00-07:00', + 'timeZone': 'America/Los_Angeles' + }, + 'recurrence': [ + 'RRULE:FREQ=DAILY;COUNT=2' + ], + 'attendees': [ + {'email': 'lpage@example.com'}, + {'email': 'sbrin@example.com'} + ], + 'reminders': { + 'useDefault': false, + 'overrides': [ + {'method': 'email', 'minutes': 24 * 60}, + {'method': 'popup', 'minutes': 10} + ] + } + }; + + var request = gapi.client.calendar.events.insert({ + 'calendarId': 'primary', + 'resource': event + }); + + request.execute(function(event) { + appendPre('Event created: ' + event.htmlLink); + }); +} diff --git a/types/gapi.calendar/index.d.ts b/types/gapi.calendar/index.d.ts new file mode 100644 index 0000000000..bd0e3b0d17 --- /dev/null +++ b/types/gapi.calendar/index.d.ts @@ -0,0 +1,675 @@ +// Type definitions for Google Calendar API 3.0 +// Project: https://developers.google.com/google-apps/calendar/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gapi.client.calendar { + export class freebusy { + static query(parameters: FreeBusyQueryParameters): HttpRequest; + } + + interface FreeBusyQueryParameters { + timeMin: datetime; + timeMax: datetime; + timeZone?: string; + groupExpansionMax?: integer; + calendarExpansionMax?: integer; + items: {id: string}[]; + } + + interface FreeBusy { + kind: 'calendar#freeBusy'; + timeMin: datetime; + timeMax: datetime; + groups: { + (key: string): { + errors?: { + domain: string; + reason: string; + }[]; + calendars: string[]; + } + }; + calendars: { + (key: string): { + errors?: { + domain: string; + reason: string; + }[]; + busy: { + start: datetime; + end: datetime; + }[]; + } + }; + } + + export class acl { + static insert(parameters: AclInsertParameters): HttpRequest; + static get(parameters: AclGetParameters): HttpRequest; + static update(parameters: AclUpdateParameters): HttpRequest; + static delete(parameters: AclDeleteParameters): HttpRequest; + } + + // The type of the scope. Possible values are: + type ScopeType = + // The public scope. This is the default value. + // Note: The permissions granted to the "default", or public, scope apply to any user, authenticated or not. + 'default' | + // Limits the scope to a single user. + 'user' | + // Limits the scope to a group. + 'group' | + // Limits the scope to a domain. + 'domain'; + + interface Acl { + kind: 'calendar#aclRule'; + etag: etag; + id: string; + scope: { + type: ScopeType; + value: string; + }; + role: AccessRole; + } + + interface AclInsertParameters { + calendarId: string; + + // Acl resource + role: AccessRole; + scope: { + type: ScopeType; + value?: string; + }; + } + + interface AclGetParameters { + calendarId: string; + ruleId: string; + } + + interface AclUpdateParameters extends AclInsertParameters { + ruleId: string; + } + + interface AclDeleteParameters extends AclGetParameters { + } + + export class calendarList { + static list(parameters?: CalendarListListParameters): HttpRequest; + static insert(parameters: CalendarListInsertParameters): HttpRequest; + } + + type AccessRoleWithoutNone = + // The user has read access to free/busy information. + 'freeBusyReader' | + // The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + 'reader' | + // The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + 'writer' | + // The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs. + 'owner'; + + // The user's access role for this calendar. Read-only. Possible values are: + type AccessRole = + // The user has no access. + 'none' | + AccessRoleWithoutNone; + + interface CalendarListListParameters { + maxResults?: integer; + // The minimum access role for the user in the returned entries. Optional. The default is no restriction. Acceptable values are: + minAccessRole?: AccessRoleWithoutNone; + pageToken?: string; + showDeleted?: boolean; + showHidden?: boolean; + syncToken?: string; + } + + interface CalendarListInsertParameters { + // Parameters + // Optional query parameters + colorRgbFormat?: boolean; + + // CalendarList resource + resource: CalendarListInput; + } + + interface CalendarListInput { + // Required Properties + id: string; + + // Optional Properties + backgroundColor?: string; + colorId?: string; + defaultReminders?: { + method: ReminderMethod; + minutes: integer; + }[]; + foregroundColor?: string; + hidden?: boolean; + notificationSettings?: { + notifications: { + type: NotificationType; + method: string; + }[]; + }; + selected?: boolean; + summaryOverride?: string; + } + + interface CalendarList { + kind: 'calendar#calendarList'; + etag: etag; + + /** + * Token used to access the next page of this result. + * Omitted if no further results are available, in which case nextSyncToken is provided. + */ + nextPageToken?: string; + + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. + * Omitted if further results are available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + + items: CalendarListEntry[]; + } + + // The type of notification. Possible values are: + type NotificationType = + // Notification sent when a new event is put on the calendar. + 'eventCreation' | + // Notification sent when an event is changed. + 'eventChange' | + // Notification sent when an event is cancelled. + 'eventCancellation' | + // Notification sent when an event is changed. + 'eventResponse' | + // An agenda with the events of the day (sent out in the morning). + 'agenda'; + + interface CalendarListEntry { + kind: 'calendar#calendarListEntry'; + etag: etag; + id: string; + summary: string; + description?: string; + location?: string; + timeZone?: string; + summaryOverride?: string; + colorId?: string; + backgroundColor?: string; + foregroundColor?: string; + hidden?: boolean; + selected?: boolean; + // The effective access role that the authenticated user has on the calendar. Read-only. + accessRole: AccessRoleWithoutNone; + defaultReminders: { + method: ReminderMethod; + minutes: integer; + }[]; + notificationSettings?: { + notifications: { + type: NotificationType; + method: string; + }[]; + }; + primary?: boolean; + deleted?: boolean; + } + + export class calendars { + static insert(parameters: CalendarsInsertParameters): HttpRequest; + static update(parameters: CalendarsUpdateParameters): HttpRequest; + static delete(parameters: CalendarsDeleteParameters): HttpRequest; + } + + interface CalendarsUpdateParameters { + calendarId: string; + + // Calendars resource + // Optional Properties + description?: string; + location?: string; + summary?: string; + timeZone?: string; + } + + interface CalendarsInsertParameters { + // Calendars resource + // Required Properties + summary: string; + + description?: string; + location?: string; + timeZone?: string; + } + + interface CalendarsDeleteParameters { + calendarId: string; + } + + interface Calendar { + kind: 'calendar#calendar'; + etag: etag; + id: string; + summary: string; + description?: string; + location?: string; + timeZone?: string; + } + + export class events { + static list(parameters: EventsListParameters): HttpRequest; + static insert(parameters: EventsInsertParameters): HttpRequest; + static update(parameters: EventsUpdateParameters): HttpRequest; + static get(parameters: EventsGetParameters): HttpRequest; + } + + interface EventsGetParameters { + calendarId: string; + eventId: string; + + alwaysIncludeEmail?: boolean; + maxAttendees?: integer; + timeZone?: string; + } + + interface EventsInsertParameters { + calendarId: string; + + maxAttendees?: integer; + sendNotifications?: boolean; + supportsAttachments?: boolean; + + // Event resource + resource: EventInput; + } + + interface EventsUpdateParameters { + calendarId: string; + eventId: string; + + alwaysIncludeEmail?: boolean; + maxAttendees?: integer; + sendNotifications?: boolean; + supportsAttachments?: boolean; + + // Event resource + resource: EventInput; + } + + interface EventInput { + // Required Properties + attachments?: { + fileUrl: string; + }[]; + attendees?: { + email: string; + displayName?: string; + optional?: boolean; + responseStatus?: AttendeeResponseStatus; + comment?: string; + additionalGuests?: integer; + }[]; + end: { + date?: date; + dateTime?: datetime; + timeZone?: string + }; + reminders?: { + overrides: { + method: string; + minutes: integer; + }[]; + useDefault: boolean; + }; + start: { + date?: date; + dateTime?: datetime; + timeZone: string; + }; + + // Optional Properties + anyoneCanAddSelf?: boolean; + colorId?: string; + description?: string; + extendedProperties?: { + private: { + (key: string): string + }; + shared: { + (key: string): string + } + }; + gadget?: { + display?: GadgetDisplayMode; + height: integer; + iconLink: string; + link: string; + preferences: { + (key: string): string + } + title: string; + type: string; + width: integer; + }; + guestsCanInviteOthers?: boolean; + guestsCanSeeOtherGuests?: boolean; + id?: string; + location?: string; + originalStartTime?: { + date: date; + dateTime: datetime; + timeZone: string + }; + recurrence?: string[]; + sequence?: integer; + source?: { + url: string; + title: string + }; + status?: EventStatus; + summary?: string; + transparency?: EventTransparency; + visibility?: EventVisibility; + } + + // The order of the events returned in the result. Optional. The default is an unspecified, stable order. + // Acceptable values are: + type EventsOrder = + // Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True) + 'startTime' | + // Order by last modification time (ascending). + 'updated'; + + // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. + // It makes the result of this list request contain only entries that have changed since then. + // All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + // There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + // These are: + type SyncToken = + 'iCalUID' | + 'orderBy' | + 'privateExtendedProperty' | + 'q' | + 'sharedExtendedProperty' | + 'timeMin' | + 'timeMax' | + 'updatedMin'; + + interface EventsListParameters { + calendarId: string; + alwaysIncludeEmail?: boolean; + iCalUID?: string; + maxAttendees?: integer; + maxResults?: integer; + orderBy?: EventsOrder; + pageToken?: string; + privateExtendedProperty?: string; + q?: string; + sharedExtendedProperty?: string; + showDeleted?: boolean; + showHiddenInvitations?: boolean; + singleEvents?: boolean; + syncToken?: SyncToken; + timeMax?: datetime; + timeMin?: datetime; + timeZone?: string; + updatedMin?: datetime; + } + + interface Events { + kind: 'calendar#events'; + etag: etag; + summary: string; + description: string; + updated: datetime; + timeZone: string; + // The user's access role for this calendar. Read-only. Possible values are: + accessRole: AccessRole; + defaultReminders: { + method: ReminderMethod; + minutes: integer; + }[]; + nextPageToken?: string; + nextSyncToken?: string; + items: Event[]; + } + + type etag = string; + type datetime = string; + type date = string; + type integer = number; + + // The attendee's response status. Possible values are: + type AttendeeResponseStatus = + // The attendee has not responded to the invitation. + 'needsAction' | + // The attendee has declined the invitation. + 'declined' | + // The attendee has tentatively accepted the invitation. + 'tentative' | + // The attendee has accepted the invitation. + 'accepted'; + + // The gadget's display mode. Optional. Possible values are: + type GadgetDisplayMode = + // The gadget displays next to the event's title in the calendar view. + 'icon' | + // The gadget displays when the event is clicked. + 'chip'; + + // The method used by this reminder. Possible values are: + type ReminderMethod = + // Reminders are sent via email. + 'email' | + // Reminders are sent via SMS. These are only available for Google Apps for Work, Education, and Government customers. Requests to set SMS reminders for other account types are ignored. + 'sms' | + // Reminders are sent via a UI popup. + 'popup'; + + // Status of the event. Optional. Possible values are: + type EventStatus = + // The event is confirmed. This is the default status. + 'confirmed' | + // The event is tentatively confirmed. + 'tentative' | + // The event is cancelled. + 'cancelled'; + + // Whether the event blocks time on the calendar. Optional. Possible values are: + type EventTransparency = + // The event blocks time on the calendar. This is the default value. + 'opaque' | + // The event does not block time on the calendar. + 'transparent'; + + // Visibility of the event. Optional. Possible values are: + type EventVisibility = + // Uses the default visibility for events on the calendar. This is the default value. + 'default' | + // The event is public and event details are visible to all readers of the calendar. + 'public' | + // The event is private and only event attendees may view event details. + 'private' | + // The event is private. This value is provided for compatibility reasons. + 'confidential'; + + class Event { + kind: 'calendar#event'; + etag: etag; + id: string; + status?: EventStatus; + htmlLink: string; + created: datetime; + updated: datetime; + summary: string; + description: string; + location?: string; + colorId?: string; + + // The creator of the event. Read-only. + creator: { + // The creator's Profile ID, if available. + id?: string; + + // The creator's email address, if available. + email?: string; + + // The creator's name, if available. + displayName?: string; + + // Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + self?: boolean; + }; + + // The organizer of the event. + organizer: { + // The organizer's Profile ID, if available. + id?: string; + + // The organizer's email address, if available. + email?: string; + + // The organizer's name, if available. + displayName?: string; + + // Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + self?: boolean; + }; + + // The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance. + start: { + // The date, in the format "yyyy-mm-dd", if this is an all-day event. + date?: date; + + // The time, as a combined date-time value (formatted according to RFC3339). + // A time zone offset is required unless a time zone is explicitly specified in timeZone. + dateTime?: datetime; + + // The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) + // For recurring events this field is required and specifies the time zone in which the recurrence is expanded. + // For single events this field is optional and indicates a custom time zone for the event start/end. + timeZone?: string; + }; + + // The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance. + end: { + // The date, in the format "yyyy-mm-dd", if this is an all-day event. + date?: date; + + // The time, as a combined date-time value (formatted according to RFC3339). + // A time zone offset is required unless a time zone is explicitly specified in timeZone. + dateTime?: datetime; + + // The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) + // For recurring events this field is required and specifies the time zone in which the recurrence is expanded. + // For single events this field is optional and indicates a custom time zone for the event start/end. + timeZone?: string; + }; + + // Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. + // The default is False. + endTimeUnspecified?: boolean; + + recurrence: string[]; + + // For an instance of a recurring event, this is the id of the recurring event to which this instance belongs. Immutable. + recurringEventId?: string; + + // Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + originalStartTime?: { + date: date; + dateTime: datetime; + timeZone?: string; + }; + + transparency?: EventTransparency; + visibility?: EventVisibility; + iCalUID: string; + sequence: integer; + + // The attendees of the event. + attendees?: { + id: string; + email: string; + displayName?: string; + organizer: boolean; + self: boolean; + resource: boolean; + optional?: boolean; + responseStatus: AttendeeResponseStatus; + comment?: string; + additionalGuests?: integer; + }[]; + + attendeesOmitted?: boolean; + + // Extended properties of the event. + extendedProperties?: { + private: { + (key: string): string; + }; + shared: { + (key: string): string; + } + }; + + // An absolute link to the Google+ hangout associated with this event. Read-only. + hangoutLink?: string; + + // A gadget that extends this event. + gadget?: { + type: string; + title: string; + link: string; + iconLink: string; + width?: integer; + height?: integer; + display?: GadgetDisplayMode; + preferences: { + (key: string): string; + } + }; + + anyoneCanAddSelf?: boolean; + guestsCanInviteOthers?: boolean; + guestsCanModify?: boolean; + guestsCanSeeOtherGuests?: boolean; + privateCopy?: boolean; + + // Whether this is a locked event copy where no changes can be made to the main event fields "summary", "description", "location", "start", "end" or "recurrence". The default is False. Read-Only. + locked?: boolean; + + reminders: { + useDefault: boolean; + overrides?: { + method: ReminderMethod; + minutes: integer; + }[]; + }; + + // Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. + // Can only be seen or modified by the creator of the event. + source?: { + url: string; + title: string; + }; + + // File attachments for the event. Currently only Google Drive attachments are supported. + attachments?: { + fileUrl: string; + title: string; + mimeType: string; + iconLink: string; + fileId: string; + }[]; + } +} diff --git a/types/gapi.calendar/tsconfig.json b/types/gapi.calendar/tsconfig.json new file mode 100644 index 0000000000..7613ee5b3d --- /dev/null +++ b/types/gapi.calendar/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.calendar-tests.ts" + ] +} diff --git a/gapi.pagespeedonline/index.d.ts b/types/gapi.pagespeedonline/index.d.ts similarity index 100% rename from gapi.pagespeedonline/index.d.ts rename to types/gapi.pagespeedonline/index.d.ts diff --git a/gapi.pagespeedonline/tsconfig.json b/types/gapi.pagespeedonline/tsconfig.json similarity index 100% rename from gapi.pagespeedonline/tsconfig.json rename to types/gapi.pagespeedonline/tsconfig.json diff --git a/types/gapi.people/gapi.people-tests.ts b/types/gapi.people/gapi.people-tests.ts new file mode 100644 index 0000000000..65b6339765 --- /dev/null +++ b/types/gapi.people/gapi.people-tests.ts @@ -0,0 +1,99 @@ +/* Example taken from Google People API JavaScript Quickstart https://developers.google.com/people/quickstart/js */ + +{ + // Your Client ID can be retrieved from your project in the Google + // Developer Console, https://console.developers.google.com + var CLIENT_ID = ''; + + var SCOPES = ["https://www.googleapis.com/auth/contacts.readonly"]; + + /** + * Check if current user has authorized this application. + */ + function checkAuth() { + gapi.auth.authorize( + { + 'client_id': CLIENT_ID, + 'scope': SCOPES.join(' '), + 'immediate': true + }, handleAuthResult); + } + + /** + * Handle response from authorization server. + * + * @param {Object} authResult Authorization result. + */ + function handleAuthResult(authResult: GoogleApiOAuth2TokenObject) { + var authorizeDiv = document.getElementById('authorize-div')!; + if (authResult && !authResult.error) { + // Hide auth UI, then load client library. + authorizeDiv.style.display = 'none'; + loadPeopleApi(); + } else { + // Show auth UI, allowing the user to initiate authorization by + // clicking authorize button. + authorizeDiv.style.display = 'inline'; + } + } + + /** + * Initiate auth flow in response to user clicking authorize button. + * + * @param {Event} event Button click event. + */ + function handleAuthClick(event: MouseEvent) { + gapi.auth.authorize( + {client_id: CLIENT_ID, scope: SCOPES, immediate: false}, + handleAuthResult); + return false; + } + + /** + * Load Google People client library. List names if available + * of 10 connections. + */ + function loadPeopleApi() { + gapi.client.load('https://people.googleapis.com/$discovery/rest', 'v1', listConnectionNames); + } + + /** + * Print the display name if available for 10 connections. + */ + function listConnectionNames() { + var request = gapi.client.people.people.connections.list({ + 'resourceName': 'people/me', + 'pageSize': 10, + }); + + request.execute(function(resp) { + var connections = resp.connections; + appendPre('Connections:'); + + if (connections.length > 0) { + for (var i = 0; i < connections.length; i++) { + var person = connections[i]; + if (person.names && person.names.length > 0) { + appendPre(person.names[0].displayName) + } else { + appendPre("No display name found for connection."); + } + } + } else { + appendPre('No upcoming events found.'); + } + }); + } + + /** + * Append a pre element to the body containing the given message + * as its text node. + * + * @param {string} message Text to be placed in pre element. + */ + function appendPre(message: string) { + var pre = document.getElementById('output')!; + var textContent = document.createTextNode(message + '\n'); + pre.appendChild(textContent); + } +} diff --git a/types/gapi.people/index.d.ts b/types/gapi.people/index.d.ts new file mode 100644 index 0000000000..86bf930beb --- /dev/null +++ b/types/gapi.people/index.d.ts @@ -0,0 +1,246 @@ +// Type definitions for Google People API 1.0 +// Project: https://developers.google.com/people/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gapi.client.people { + export namespace people { + + interface GetParameters { + resourceName: string; + + // Query parameters + requestMask?: RequestMask; + } + + function get(parameters: GetParameters): HttpRequest; + + interface GetBatchGetParameters { + // Query parameters + resourcesName?: string; + requestMask?: RequestMask; + } + + function getBatchGet(parameters: GetBatchGetParameters): HttpRequest; + + interface BatchGetResponse { + responses: PersonResponse[]; + } + + interface PersonResponse { + httpStatusCode: number; + person: Person; + requestedResourceName: string; + } + + namespace connections { + function list(parameters: ListParameters): HttpRequest; + + type SortOrder = 'LAST_MODIFIED_ASCENDING' | 'FIRST_NAME_ASCENDING' | 'LAST_NAME_ASCENDING'; + + interface ListParameters { + resourceName: string; + + // Query parameters + pageToken?: string; + pageSize?: number; + sortOrder?: SortOrder; + syncToken?: string; + requestMask?: RequestMask; + } + + interface Response { + connections: Person[]; + nextPageToken: string; + nextSyncToken: string; + } + } + } + + interface RequestMask { + includeField: string; + } + + type SourceType = 'SOURCE_TYPE_UNSPECIFIED' | 'ACCOUNT' | 'PROFILE' | 'DOMAIN_PROFILE' | 'CONTACT'; + + interface Source { + type: SourceType; + id: string; + etag: string; + resourceName: string; + } + + type ObjectType = 'OBJECT_TYPE_UNSPECIFIED' | 'PERSON' | 'PAGE'; + + interface PersonMetadata { + sources: Source[]; + previousResourceNames: string[]; + linkedPeopleResourceNames: string[]; + deleted: boolean; + objectType: ObjectType; + } + + interface FieldMetadata { + primary: boolean; + verified: boolean; + source: Source; + } + + interface Locale { + metadata: FieldMetadata; + value: string; + } + + interface Name { + metadata: FieldMetadata; + displayName: string; + displayNameLastFirst: string; + familyName: string; + givenName: string; + middleName: string; + honorificPrefix: string; + honorificSuffix: string; + phoneticFullName: string; + phoneticFamilyName: string; + phoneticGivenName: string; + phoneticMiddleName: string; + phoneticHonorificPrefix: string; + phoneticHonorificSuffix: string; + } + + type NicknameType = 'DEFAULT' | 'MAIDEN_NAME' | 'INITIALS' | 'GPLUS' | 'OTHER_NAME'; + + interface Nickname { + metadata: FieldMetadata; + value: string; + type: NicknameType; + } + + interface CoverPhoto { + } + + interface Photo { + } + + interface Gender { + } + + interface AgeRange { + } + + interface Birthday { + } + + interface Event { + } + + interface Address { + metadata: FieldMetadata; + formattedValue: string; + type: string; + formattedType: string; + poBox: string; + streetAddress: string; + extendedAddress: string; + city: string; + region: string; + postalCode: string; + country: string; + countryCode: string; + } + + interface Residence { + metadata: FieldMetadata; + value: string; + current: boolean; + } + + interface EmailAddress { + metadata: FieldMetadata; + value: string; + type: string; + formattedType: string; + displayName: string; + } + + interface PhoneNumber { + metadata: FieldMetadata; + value: string; + canonicalForm: string; + type: string; + formattedType: string; + } + + interface ImClient { + } + + interface Tagline { + } + + interface Biography { + } + + interface Url { + } + + interface Organization { + } + + interface Occupation { + } + + interface Interest { + } + + interface Skill { + } + + interface BraggingRights { + } + + interface Relation { + } + + interface RelationshipInterest { + } + + interface RelationshipStatus { + } + + interface Membership { + } + + interface Person { + resourceName: string; + etag: string; + metadata: PersonMetadata; + locales: Locale[]; + names: Name[]; + nicknames?: Nickname[]; + coverPhotos: CoverPhoto[]; + photos?: Photo[]; + genders?: Gender[]; + ageRange?: AgeRange; + birthdays?: Birthday[]; + events?: Event[]; + addresses?: Address[]; + residences?: Residence[]; + emailAddresses?: EmailAddress[]; + phoneNumbers?: PhoneNumber[]; + imClients?: ImClient[]; + taglines?: Tagline[]; + biographies?: Biography[]; + urls?: Url[]; + organizations?: Organization[]; + occupations?: Occupation[]; + interests?: Interest[]; + skills?: Skill[]; + BraggingRights?: BraggingRights[]; + relations?: Relation[]; + relationshipInterests?: RelationshipInterest[]; + relationshipStatuses?: RelationshipStatus[]; + memberships?: Membership[]; + } +} diff --git a/types/gapi.people/tsconfig.json b/types/gapi.people/tsconfig.json new file mode 100644 index 0000000000..93fcfc59b6 --- /dev/null +++ b/types/gapi.people/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.people-tests.ts" + ] +} diff --git a/types/gapi.plus/gapi.plus-tests.ts b/types/gapi.plus/gapi.plus-tests.ts new file mode 100644 index 0000000000..12368dd63c --- /dev/null +++ b/types/gapi.plus/gapi.plus-tests.ts @@ -0,0 +1,10 @@ +/* Example taken from https://developers.google.com/+/web/people/ */ + +gapi.client.load('plus','v1', function(){ + var request = gapi.client.plus.people.get({ + 'userId': 'me' + }); + request.execute(function(resp) { + console.log('Retrieved profile for:' + resp.displayName); + }); +}); diff --git a/types/gapi.plus/index.d.ts b/types/gapi.plus/index.d.ts new file mode 100644 index 0000000000..3e24b79ce1 --- /dev/null +++ b/types/gapi.plus/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for Google+ Platform API 1.0 +// Project: https://developers.google.com/+/web/people/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +// See Google+ REST API Reference https://developers.google.com/+/web/api/rest/latest/ +declare namespace gapi.client.plus { + export namespace people { + + interface GetParameters { + userId: string; + } + function get(parameters: GetParameters): HttpRequest; + + interface SearchParameters { + query: string; + language?: string; + maxResults?: number; + pageToken?: string; + } + function search(parameters: SearchParameters): HttpRequest; + + // Search response + interface PeopleFeed { + kind: 'plus#peopleFeed'; + etag: string; + selfLink: string; + title: string; + nextPageToken: string; + totalItems: number; + items: Person[]; + } + + interface Person { + kind: 'plus#person'; + etag: string; + nickname: string; + occupation: string; + skills: string; + birthday: string; + gender: string; + emails: { + value: string; + type: string; + }[]; + urls: { + value: string; + type: string; + label: string; + }[]; + objectType: string; + id: string; + displayName: string; + name: { + formatted: string; + familyName: string; + givenName: string; + middleName: string; + honorificPrefix: string; + honorificSuffix: string; + }; + tagline: string; + braggingRights: string; + aboutMe: string; + relationshipStatus: string; + url: string; + image: { + url: string; + }; + organizations: { + name: string; + department: string; + title: string; + type: string; + startDate: string; + endDate: string; + location: string; + description: string; + primary: boolean; + }[]; + placesLived: { + value: string; + primary: boolean; + }[]; + isPlusUser: boolean; + language: string; + ageRange: { + min: number; + max: number; + }; + plusOneCount: number; + circledByCount: number; + verified: boolean; + cover: { + layout: string; + coverPhoto: { + url: string; + height: number; + width: number; + }; + coverInfo: { + topImageOffset: number; + leftImageOffset: number; + } + }; + domain: string; + } + } +} diff --git a/types/gapi.plus/tsconfig.json b/types/gapi.plus/tsconfig.json new file mode 100644 index 0000000000..1fc2401de1 --- /dev/null +++ b/types/gapi.plus/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.plus-tests.ts" + ] +} diff --git a/gapi.translate/index.d.ts b/types/gapi.translate/index.d.ts similarity index 100% rename from gapi.translate/index.d.ts rename to types/gapi.translate/index.d.ts diff --git a/gapi.translate/tsconfig.json b/types/gapi.translate/tsconfig.json similarity index 100% rename from gapi.translate/tsconfig.json rename to types/gapi.translate/tsconfig.json diff --git a/gapi.urlshortener/index.d.ts b/types/gapi.urlshortener/index.d.ts similarity index 100% rename from gapi.urlshortener/index.d.ts rename to types/gapi.urlshortener/index.d.ts diff --git a/gapi.urlshortener/tsconfig.json b/types/gapi.urlshortener/tsconfig.json similarity index 100% rename from gapi.urlshortener/tsconfig.json rename to types/gapi.urlshortener/tsconfig.json diff --git a/gapi.youtube/index.d.ts b/types/gapi.youtube/index.d.ts similarity index 100% rename from gapi.youtube/index.d.ts rename to types/gapi.youtube/index.d.ts diff --git a/gapi.youtube/tsconfig.json b/types/gapi.youtube/tsconfig.json similarity index 100% rename from gapi.youtube/tsconfig.json rename to types/gapi.youtube/tsconfig.json diff --git a/gapi.youtubeanalytics/index.d.ts b/types/gapi.youtubeanalytics/index.d.ts similarity index 100% rename from gapi.youtubeanalytics/index.d.ts rename to types/gapi.youtubeanalytics/index.d.ts diff --git a/gapi.youtubeanalytics/tsconfig.json b/types/gapi.youtubeanalytics/tsconfig.json similarity index 100% rename from gapi.youtubeanalytics/tsconfig.json rename to types/gapi.youtubeanalytics/tsconfig.json diff --git a/types/gapi/gapi-tests.ts b/types/gapi/gapi-tests.ts new file mode 100644 index 0000000000..d5d8c032ca --- /dev/null +++ b/types/gapi/gapi-tests.ts @@ -0,0 +1,97 @@ +/// +/// + +/* Examples taken from https://developers.google.com/api-client-library/javascript/start/start-js */ + +{ + function start1() { + // 2. Initialize the JavaScript client library. + gapi.client.init({ + 'apiKey': 'YOUR_API_KEY', + 'discoveryDocs': ['https://people.googleapis.com/$discovery/rest'], + // clientId and scope are optional if auth is not required. + 'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com', + 'scope': 'profile', + }).then(function() { + // 3. Initialize and make the API request. + return gapi.client.people.people.get({ + resourceName: 'people/me' + }); + }).then(function(response) { + console.log(response.result); + }, function(reason) { + console.log('Error: ' + reason.result.error.message); + }); + }; + // 1. Load the JavaScript client library. + gapi.load('client', start1); +} + +{ + function start2() { + // 2. Initialize the JavaScript client library. + gapi.client.init({ + 'apiKey': 'YOUR_API_KEY', + // clientId and scope are optional if auth is not required. + 'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com', + 'scope': 'profile', + }).then(function() { + // 3. Initialize and make the API request. + return gapi.client.request({ + 'path': 'https://people.googleapis.com/v1/people/me', + }) + }).then(function(response) { + console.log(response.result); + }, function(reason) { + console.log('Error: ' + reason.result.error.message); + }); + }; + // 1. Load the JavaScript client library. + gapi.load('client', start2); +} + + +/* Examples taken from https://developers.google.com/api-client-library/javascript/features/promises */ + +gapi.client.request({'path': '/plus/v1/people', 'params': {'query': 'John'}}).then(function(response) { + // Handle response +}, function(reason) { + // Handle error +}); + +gapi.client.load('plus', 'v1').then(function() { + gapi.client.plus.people.search({'query': ''}).then(response => { }); +}); + +var personFetcher = { + results: [], + + // Why this: any? Check https://github.com/Microsoft/TypeScript/issues/10835 + + fetch: function(this: any, name: string) { + gapi.client.request({path: '/plus/v1/people', params:{query: name}}).then(function(this: any, response) { + this.results.push(response.result); + }, function(reason) { + console.error(name, 'was not fetched:', reason.result.error.message); + }, this); + } +}; +personFetcher.fetch('John'); + +gapi.client.request({ + 'path': 'plus/v1/people', + 'params': {'query': name} +}).execute(function(resp, rawResp) { + processResponse(resp); +}); + +gapi.client.request({ + 'path': 'plus/v1/people', + 'params': {'query': name} +}).then(function(resp) { + processResponse(resp.result); +}); + +function processResponse(response: any) { + // Stub +} diff --git a/gapi/index.d.ts b/types/gapi/index.d.ts similarity index 68% rename from gapi/index.d.ts rename to types/gapi/index.d.ts index 28d5c990bc..8f8e621fa3 100644 --- a/gapi/index.d.ts +++ b/types/gapi/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for Google API Client +// Type definitions for Google API Client 0.0 // Project: https://code.google.com/p/google-api-javascript-client/ // Definitions by: Frank M // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.1 /** * The OAuth 2.0 token object represents the OAuth 2.0 token and any associated data. @@ -38,7 +38,7 @@ declare namespace gapi { /** * Pragmatically initialize gapi class member. */ - export function load(object: string, fn: any) : any; + export function load(apiName: string, callback: () => void): void; } @@ -102,7 +102,7 @@ declare namespace gapi.auth { /** * 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; + callback?: () => void; /** * 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. */ @@ -127,6 +127,30 @@ declare namespace gapi.auth { } declare namespace gapi.client { + /** + * Initializes the JavaScript client with API key, OAuth client ID, scope, and API discovery document(s). + * If OAuth client ID and scope are provided, this function will load the gapi.auth2 module to perform OAuth. + * The gapi.client.init function can be run multiple times, such as to set up more APIs, to change API key, or initialize OAuth lazily. + */ + export function init(args: { + /** + * The API Key to use. + */ + apiKey?: string; + /** + * An array of discovery doc URLs or discovery doc JSON objects. + */ + discoveryDocs?: string[]; + /** + * The app's client ID, found and created in the Google Developers Console. + */ + clientId?: string; + /** + * The scopes to request, as a space-delimited string. + */ + scope?: string + }): Promise; + interface RequestOptions { /** * The URL to handle the request @@ -155,43 +179,79 @@ declare namespace gapi.client { } /** - * 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. 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 - */ + * 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. - */ + * 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 - */ + * 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 - */ + * Sets the API key for the application. + * @param apiKey The API key to set + */ export function setApiKey(apiKey: string): void; + interface HttpRequestFulfilled { + result: T; + body: string; + headers?: any[]; + status?: number; + statusText?: string; + } + + interface HttpRequestRejected { + result: { + error: { + message: string; + } + }; + body: string; + headers?: any[]; + status?: number; + statusText?: string; + } + + /** + * HttpRequest supports promises. + * See Google API Client JavaScript Using Promises https://developers.google.com/api-client-library/javascript/features/promises + * + * TODO This should be updated when TypeScript 2.3 is released + * See https://github.com/Microsoft/TypeScript/issues/12409 + * See https://github.com/Microsoft/TypeScript/blob/65da012527937a3074c62655d60ee08fee809f7f/lib/lib.es5.d.ts#L1339 + */ + class HttpRequestPromise { + then( + opt_onFulfilled?: ((response: HttpRequestFulfilled) => void) | null, + opt_onRejected?: ((reason: HttpRequestRejected) => void) | null, + opt_context?: any + ): Promise; + } + /** * An object encapsulating an HTTP request. This object is not instantiated directly, rather it is returned by gapi.client.request. */ - export class HttpRequest { + export class HttpRequest extends HttpRequestPromise { /** * Executes the request and runs the supplied callback on response. * @param callback The callback function which executes when the request succeeds or fails. @@ -210,25 +270,9 @@ declare namespace gapi.client { 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; + ) => any): void; } + /** * Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute. */ @@ -244,16 +288,16 @@ declare namespace gapi.client { */ 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; + /** + * 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. @@ -267,7 +311,7 @@ declare namespace gapi.client { * is the same response, but as an unparsed JSON-string. */ rawBatchResponse: string - ) => any):void; + ) => any): void; } /** @@ -288,7 +332,7 @@ declare namespace gapi.client { * 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; + ) => void): void; } } diff --git a/qajax/tsconfig.json b/types/gapi/tsconfig.json similarity index 86% rename from qajax/tsconfig.json rename to types/gapi/tsconfig.json index 8ba8578ef5..22f5738c1a 100644 --- a/qajax/tsconfig.json +++ b/types/gapi/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "qajax-tests.ts" + "gapi-tests.ts" ] -} \ No newline at end of file +} diff --git a/gaussian/gaussian-tests.ts b/types/gaussian/gaussian-tests.ts similarity index 100% rename from gaussian/gaussian-tests.ts rename to types/gaussian/gaussian-tests.ts diff --git a/gaussian/index.d.ts b/types/gaussian/index.d.ts similarity index 98% rename from gaussian/index.d.ts rename to types/gaussian/index.d.ts index f0012597cb..fb34d74641 100644 --- a/gaussian/index.d.ts +++ b/types/gaussian/index.d.ts @@ -9,7 +9,7 @@ export = gaussian; export as namespace gaussian; declare namespace gaussian { - export interface Gaussian { + interface Gaussian { /** * the mean (μ) of the distribution */ diff --git a/gaussian/tsconfig.json b/types/gaussian/tsconfig.json similarity index 100% rename from gaussian/tsconfig.json rename to types/gaussian/tsconfig.json diff --git a/get-stdin/tslint.json b/types/gaussian/tslint.json similarity index 100% rename from get-stdin/tslint.json rename to types/gaussian/tslint.json diff --git a/generic-functions/generic-functions-tests.ts b/types/generic-functions/generic-functions-tests.ts similarity index 100% rename from generic-functions/generic-functions-tests.ts rename to types/generic-functions/generic-functions-tests.ts diff --git a/generic-functions/index.d.ts b/types/generic-functions/index.d.ts similarity index 100% rename from generic-functions/index.d.ts rename to types/generic-functions/index.d.ts diff --git a/generic-functions/tsconfig.json b/types/generic-functions/tsconfig.json similarity index 100% rename from generic-functions/tsconfig.json rename to types/generic-functions/tsconfig.json diff --git a/gently/gently-tests.ts b/types/gently/gently-tests.ts similarity index 100% rename from gently/gently-tests.ts rename to types/gently/gently-tests.ts diff --git a/gently/index.d.ts b/types/gently/index.d.ts similarity index 100% rename from gently/index.d.ts rename to types/gently/index.d.ts diff --git a/gently/tsconfig.json b/types/gently/tsconfig.json similarity index 100% rename from gently/tsconfig.json rename to types/gently/tsconfig.json diff --git a/geodesy/geodesy-tests.ts b/types/geodesy/geodesy-tests.ts similarity index 99% rename from geodesy/geodesy-tests.ts rename to types/geodesy/geodesy-tests.ts index 53c3b5c05c..e3ce4f627a 100644 --- a/geodesy/geodesy-tests.ts +++ b/types/geodesy/geodesy-tests.ts @@ -23,7 +23,6 @@ const zoneMgrs = mgrs.zone; mgrs.toString(); mgrs.toUtm(); - // Static Functions Mgrs.parse('31U DQ 48251 11932'); diff --git a/geodesy/index.d.ts b/types/geodesy/index.d.ts similarity index 93% rename from geodesy/index.d.ts rename to types/geodesy/index.d.ts index d5436f073d..12adb4d7c1 100644 --- a/geodesy/index.d.ts +++ b/types/geodesy/index.d.ts @@ -43,7 +43,7 @@ export interface Ellipsoids { Bessel1841: Ellipsoid; } -export declare class Mgrs { +export class Mgrs { zone: number; band: string; e100k: string; @@ -68,7 +68,7 @@ export declare class Mgrs { toString(digits?: 2 | 4 | 6 | 8 | 10): string; } -export declare class Utm { +export class Utm { zone: number; hemisphere: hemisphere; easting: number; @@ -91,11 +91,11 @@ export declare class Utm { toString(digits?: number): string; } -export declare namespace Dms { - export let separator: string; +export namespace Dms { + let separator: string; } -export declare class Dms { +export 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; @@ -104,7 +104,7 @@ export declare class Dms { static compassPoint(bearing: number, precision?: 1 | 2 | 3): string; } -export declare class Vector3d { +export class Vector3d { x: number; y: number; z: number; @@ -125,7 +125,7 @@ export declare class Vector3d { applyTransform(t: number[]): Vector3d; } -export declare class OsGridRef { +export class OsGridRef { easting: number; northing: number; constructor(easting: number, northing: number); @@ -135,7 +135,7 @@ export declare class OsGridRef { toString(digits?: number): string; } -export declare class LatLonEllipsoidal { +export class LatLonEllipsoidal { lat: number; lon: number; datum: Datum; diff --git a/geodesy/tsconfig.json b/types/geodesy/tsconfig.json similarity index 100% rename from geodesy/tsconfig.json rename to types/geodesy/tsconfig.json diff --git a/git-remote-origin-url/tslint.json b/types/geodesy/tslint.json similarity index 100% rename from git-remote-origin-url/tslint.json rename to types/geodesy/tslint.json diff --git a/geoip-lite/geoip-lite-tests.ts b/types/geoip-lite/geoip-lite-tests.ts similarity index 100% rename from geoip-lite/geoip-lite-tests.ts rename to types/geoip-lite/geoip-lite-tests.ts diff --git a/geoip-lite/index.d.ts b/types/geoip-lite/index.d.ts similarity index 100% rename from geoip-lite/index.d.ts rename to types/geoip-lite/index.d.ts diff --git a/geoip-lite/tsconfig.json b/types/geoip-lite/tsconfig.json similarity index 100% rename from geoip-lite/tsconfig.json rename to types/geoip-lite/tsconfig.json diff --git a/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts similarity index 100% rename from geojson/geojson-tests.ts rename to types/geojson/geojson-tests.ts diff --git a/geojson/index.d.ts b/types/geojson/index.d.ts similarity index 100% rename from geojson/index.d.ts rename to types/geojson/index.d.ts diff --git a/geojson/tsconfig.json b/types/geojson/tsconfig.json similarity index 100% rename from geojson/tsconfig.json rename to types/geojson/tsconfig.json diff --git a/geojson/tslint.json b/types/geojson/tslint.json similarity index 100% rename from geojson/tslint.json rename to types/geojson/tslint.json diff --git a/geojson2osm/geojson2osm-tests.ts b/types/geojson2osm/geojson2osm-tests.ts similarity index 100% rename from geojson2osm/geojson2osm-tests.ts rename to types/geojson2osm/geojson2osm-tests.ts diff --git a/geojson2osm/index.d.ts b/types/geojson2osm/index.d.ts similarity index 100% rename from geojson2osm/index.d.ts rename to types/geojson2osm/index.d.ts diff --git a/geojson2osm/tsconfig.json b/types/geojson2osm/tsconfig.json similarity index 100% rename from geojson2osm/tsconfig.json rename to types/geojson2osm/tsconfig.json diff --git a/geolib/geolib-tests.ts b/types/geolib/geolib-tests.ts similarity index 100% rename from geolib/geolib-tests.ts rename to types/geolib/geolib-tests.ts diff --git a/geolib/index.d.ts b/types/geolib/index.d.ts similarity index 95% rename from geolib/index.d.ts rename to types/geolib/index.d.ts index 69a6c99353..95779ab2c9 100644 --- a/geolib/index.d.ts +++ b/types/geolib/index.d.ts @@ -4,25 +4,25 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace geolib { - export interface PositionAsDecimal { + interface PositionAsDecimal { latitude: number; longitude: number; } - export interface PositionAsSexadecimal { + interface PositionAsSexadecimal { latitude: string; longitude: string; } - export interface PositionWithElevation extends PositionAsDecimal { + interface PositionWithElevation extends PositionAsDecimal { elevation?: number; } - export interface PositionInTime extends PositionAsDecimal { + interface PositionInTime extends PositionAsDecimal { time: number; } - export interface Bound { + interface Bound { minLat: number; maxLat: number; minLng: number; @@ -31,19 +31,19 @@ declare namespace geolib { maxElev?: number; } - export interface CompassDirection { + interface CompassDirection { rough: string; exact: string; } - export interface Distance { + interface Distance { latitude: number; longitude: number; distance: number; key: string; } - export interface SpeedOption { + interface SpeedOption { unit: string; } @@ -60,13 +60,11 @@ declare namespace geolib { */ 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, @@ -76,28 +74,24 @@ declare namespace geolib { */ 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) @@ -107,14 +101,12 @@ declare namespace geolib { */ 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). * @@ -122,15 +114,12 @@ declare namespace geolib { */ 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 */ @@ -142,11 +131,9 @@ declare namespace geolib { */ 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) @@ -161,11 +148,9 @@ declare namespace geolib { */ 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; @@ -184,11 +169,9 @@ declare namespace geolib { */ 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. * diff --git a/geolib/tsconfig.json b/types/geolib/tsconfig.json similarity index 100% rename from geolib/tsconfig.json rename to types/geolib/tsconfig.json diff --git a/types/geolib/tslint.json b/types/geolib/tslint.json new file mode 100644 index 0000000000..d3631e8907 --- /dev/null +++ b/types/geolib/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "no-useless-files": false + } +} diff --git a/geometry-dom/geometry-dom-tests.ts b/types/geometry-dom/geometry-dom-tests.ts similarity index 100% rename from geometry-dom/geometry-dom-tests.ts rename to types/geometry-dom/geometry-dom-tests.ts diff --git a/geometry-dom/index.d.ts b/types/geometry-dom/index.d.ts similarity index 100% rename from geometry-dom/index.d.ts rename to types/geometry-dom/index.d.ts diff --git a/geometry-dom/tsconfig.json b/types/geometry-dom/tsconfig.json similarity index 100% rename from geometry-dom/tsconfig.json rename to types/geometry-dom/tsconfig.json diff --git a/geopattern/geopattern-tests.ts b/types/geopattern/geopattern-tests.ts similarity index 100% rename from geopattern/geopattern-tests.ts rename to types/geopattern/geopattern-tests.ts diff --git a/geopattern/index.d.ts b/types/geopattern/index.d.ts similarity index 100% rename from geopattern/index.d.ts rename to types/geopattern/index.d.ts diff --git a/geopattern/tsconfig.json b/types/geopattern/tsconfig.json similarity index 100% rename from geopattern/tsconfig.json rename to types/geopattern/tsconfig.json diff --git a/globule/tslint.json b/types/geopattern/tslint.json similarity index 100% rename from globule/tslint.json rename to types/geopattern/tslint.json diff --git a/get-port/get-port-tests.ts b/types/get-port/get-port-tests.ts similarity index 100% rename from get-port/get-port-tests.ts rename to types/get-port/get-port-tests.ts diff --git a/get-port/index.d.ts b/types/get-port/index.d.ts similarity index 100% rename from get-port/index.d.ts rename to types/get-port/index.d.ts diff --git a/get-port/tsconfig.json b/types/get-port/tsconfig.json similarity index 100% rename from get-port/tsconfig.json rename to types/get-port/tsconfig.json diff --git a/get-stdin/get-stdin-tests.ts b/types/get-stdin/get-stdin-tests.ts similarity index 100% rename from get-stdin/get-stdin-tests.ts rename to types/get-stdin/get-stdin-tests.ts diff --git a/get-stdin/index.d.ts b/types/get-stdin/index.d.ts similarity index 88% rename from get-stdin/index.d.ts rename to types/get-stdin/index.d.ts index 9539b520b9..2d1b15ae98 100644 --- a/get-stdin/index.d.ts +++ b/types/get-stdin/index.d.ts @@ -7,7 +7,7 @@ declare function getStdin(): Promise; declare namespace getStdin { - export function buffer(): Promise; + function buffer(): Promise; } export = getStdin; diff --git a/get-stdin/tsconfig.json b/types/get-stdin/tsconfig.json similarity index 100% rename from get-stdin/tsconfig.json rename to types/get-stdin/tsconfig.json diff --git a/graphite-udp/tslint.json b/types/get-stdin/tslint.json similarity index 100% rename from graphite-udp/tslint.json rename to types/get-stdin/tslint.json diff --git a/gettext.js/gettext.js-tests.ts b/types/gettext.js/gettext.js-tests.ts similarity index 100% rename from gettext.js/gettext.js-tests.ts rename to types/gettext.js/gettext.js-tests.ts diff --git a/gettext.js/index.d.ts b/types/gettext.js/index.d.ts similarity index 100% rename from gettext.js/index.d.ts rename to types/gettext.js/index.d.ts diff --git a/gettext.js/tsconfig.json b/types/gettext.js/tsconfig.json similarity index 100% rename from gettext.js/tsconfig.json rename to types/gettext.js/tsconfig.json diff --git a/nanoscroller/tslint.json b/types/gettext.js/tslint.json similarity index 100% rename from nanoscroller/tslint.json rename to types/gettext.js/tslint.json diff --git a/gijgo/gijgo-tests.ts b/types/gijgo/gijgo-tests.ts similarity index 94% rename from gijgo/gijgo-tests.ts rename to types/gijgo/gijgo-tests.ts index 5731732295..6e624ad4f6 100644 --- a/gijgo/gijgo-tests.ts +++ b/types/gijgo/gijgo-tests.ts @@ -1,5 +1,4 @@ /// -/// // Grid $(() => { diff --git a/gijgo/index.d.ts b/types/gijgo/index.d.ts similarity index 100% rename from gijgo/index.d.ts rename to types/gijgo/index.d.ts diff --git a/gijgo/tsconfig.json b/types/gijgo/tsconfig.json similarity index 100% rename from gijgo/tsconfig.json rename to types/gijgo/tsconfig.json diff --git a/giraffe/giraffe-tests.ts b/types/giraffe/giraffe-tests.ts similarity index 100% rename from giraffe/giraffe-tests.ts rename to types/giraffe/giraffe-tests.ts diff --git a/giraffe/index.d.ts b/types/giraffe/index.d.ts similarity index 100% rename from giraffe/index.d.ts rename to types/giraffe/index.d.ts diff --git a/giraffe/tsconfig.json b/types/giraffe/tsconfig.json similarity index 100% rename from giraffe/tsconfig.json rename to types/giraffe/tsconfig.json diff --git a/git-config/git-config-tests.ts b/types/git-config/git-config-tests.ts similarity index 100% rename from git-config/git-config-tests.ts rename to types/git-config/git-config-tests.ts diff --git a/git-config/index.d.ts b/types/git-config/index.d.ts similarity index 100% rename from git-config/index.d.ts rename to types/git-config/index.d.ts diff --git a/git-config/tsconfig.json b/types/git-config/tsconfig.json similarity index 100% rename from git-config/tsconfig.json rename to types/git-config/tsconfig.json diff --git a/git-remote-origin-url/git-remote-origin-url-tests.ts b/types/git-remote-origin-url/git-remote-origin-url-tests.ts similarity index 100% rename from git-remote-origin-url/git-remote-origin-url-tests.ts rename to types/git-remote-origin-url/git-remote-origin-url-tests.ts diff --git a/git-remote-origin-url/index.d.ts b/types/git-remote-origin-url/index.d.ts similarity index 100% rename from git-remote-origin-url/index.d.ts rename to types/git-remote-origin-url/index.d.ts diff --git a/git-remote-origin-url/tsconfig.json b/types/git-remote-origin-url/tsconfig.json similarity index 100% rename from git-remote-origin-url/tsconfig.json rename to types/git-remote-origin-url/tsconfig.json diff --git a/graphql-date/tslint.json b/types/git-remote-origin-url/tslint.json similarity index 100% rename from graphql-date/tslint.json rename to types/git-remote-origin-url/tslint.json diff --git a/git/git-tests.ts b/types/git/git-tests.ts similarity index 100% rename from git/git-tests.ts rename to types/git/git-tests.ts diff --git a/git/index.d.ts b/types/git/index.d.ts similarity index 100% rename from git/index.d.ts rename to types/git/index.d.ts diff --git a/git/tsconfig.json b/types/git/tsconfig.json similarity index 100% rename from git/tsconfig.json rename to types/git/tsconfig.json diff --git a/github/github-tests.ts b/types/github/github-tests.ts similarity index 100% rename from github/github-tests.ts rename to types/github/github-tests.ts diff --git a/github/index.d.ts b/types/github/index.d.ts similarity index 100% rename from github/index.d.ts rename to types/github/index.d.ts diff --git a/github/tsconfig.json b/types/github/tsconfig.json similarity index 100% rename from github/tsconfig.json rename to types/github/tsconfig.json diff --git a/gl-matrix/gl-matrix-tests.ts b/types/gl-matrix/gl-matrix-tests.ts similarity index 100% rename from gl-matrix/gl-matrix-tests.ts rename to types/gl-matrix/gl-matrix-tests.ts diff --git a/gl-matrix/index.d.ts b/types/gl-matrix/index.d.ts similarity index 100% rename from gl-matrix/index.d.ts rename to types/gl-matrix/index.d.ts diff --git a/gl-matrix/tsconfig.json b/types/gl-matrix/tsconfig.json similarity index 100% rename from gl-matrix/tsconfig.json rename to types/gl-matrix/tsconfig.json diff --git a/gldatepicker/gldatepicker-tests.ts b/types/gldatepicker/gldatepicker-tests.ts similarity index 98% rename from gldatepicker/gldatepicker-tests.ts rename to types/gldatepicker/gldatepicker-tests.ts index d133a5f823..974c1da8a7 100644 --- a/gldatepicker/gldatepicker-tests.ts +++ b/types/gldatepicker/gldatepicker-tests.ts @@ -1,5 +1,3 @@ -/// - $('input').glDatePicker(); $('#example2').glDatePicker( { diff --git a/gldatepicker/index.d.ts b/types/gldatepicker/index.d.ts similarity index 100% rename from gldatepicker/index.d.ts rename to types/gldatepicker/index.d.ts diff --git a/gldatepicker/tsconfig.json b/types/gldatepicker/tsconfig.json similarity index 100% rename from gldatepicker/tsconfig.json rename to types/gldatepicker/tsconfig.json diff --git a/glidejs/glidejs-tests.ts b/types/glidejs/glidejs-tests.ts similarity index 100% rename from glidejs/glidejs-tests.ts rename to types/glidejs/glidejs-tests.ts diff --git a/glidejs/index.d.ts b/types/glidejs/index.d.ts similarity index 100% rename from glidejs/index.d.ts rename to types/glidejs/index.d.ts diff --git a/glidejs/tsconfig.json b/types/glidejs/tsconfig.json similarity index 100% rename from glidejs/tsconfig.json rename to types/glidejs/tsconfig.json diff --git a/glob-expand/glob-expand-tests.ts b/types/glob-expand/glob-expand-tests.ts similarity index 100% rename from glob-expand/glob-expand-tests.ts rename to types/glob-expand/glob-expand-tests.ts diff --git a/glob-expand/index.d.ts b/types/glob-expand/index.d.ts similarity index 100% rename from glob-expand/index.d.ts rename to types/glob-expand/index.d.ts diff --git a/glob-expand/tsconfig.json b/types/glob-expand/tsconfig.json similarity index 100% rename from glob-expand/tsconfig.json rename to types/glob-expand/tsconfig.json diff --git a/glob-stream/glob-stream-tests.ts b/types/glob-stream/glob-stream-tests.ts similarity index 100% rename from glob-stream/glob-stream-tests.ts rename to types/glob-stream/glob-stream-tests.ts diff --git a/glob-stream/index.d.ts b/types/glob-stream/index.d.ts similarity index 100% rename from glob-stream/index.d.ts rename to types/glob-stream/index.d.ts diff --git a/glob-stream/tsconfig.json b/types/glob-stream/tsconfig.json similarity index 100% rename from glob-stream/tsconfig.json rename to types/glob-stream/tsconfig.json diff --git a/glob/glob-tests.ts b/types/glob/glob-tests.ts similarity index 100% rename from glob/glob-tests.ts rename to types/glob/glob-tests.ts diff --git a/glob/index.d.ts b/types/glob/index.d.ts similarity index 100% rename from glob/index.d.ts rename to types/glob/index.d.ts diff --git a/glob/tsconfig.json b/types/glob/tsconfig.json similarity index 100% rename from glob/tsconfig.json rename to types/glob/tsconfig.json diff --git a/globalize-compiler/globalize-compiler-tests.ts b/types/globalize-compiler/globalize-compiler-tests.ts similarity index 100% rename from globalize-compiler/globalize-compiler-tests.ts rename to types/globalize-compiler/globalize-compiler-tests.ts diff --git a/globalize-compiler/index.d.ts b/types/globalize-compiler/index.d.ts similarity index 100% rename from globalize-compiler/index.d.ts rename to types/globalize-compiler/index.d.ts diff --git a/globalize-compiler/tsconfig.json b/types/globalize-compiler/tsconfig.json similarity index 100% rename from globalize-compiler/tsconfig.json rename to types/globalize-compiler/tsconfig.json diff --git a/globalize/globalize-tests.ts b/types/globalize/globalize-tests.ts similarity index 100% rename from globalize/globalize-tests.ts rename to types/globalize/globalize-tests.ts diff --git a/globalize/index.d.ts b/types/globalize/index.d.ts similarity index 100% rename from globalize/index.d.ts rename to types/globalize/index.d.ts diff --git a/globalize/tsconfig.json b/types/globalize/tsconfig.json similarity index 100% rename from globalize/tsconfig.json rename to types/globalize/tsconfig.json diff --git a/globule/globule-tests.ts b/types/globule/globule-tests.ts similarity index 100% rename from globule/globule-tests.ts rename to types/globule/globule-tests.ts diff --git a/globule/index.d.ts b/types/globule/index.d.ts similarity index 100% rename from globule/index.d.ts rename to types/globule/index.d.ts diff --git a/globule/tsconfig.json b/types/globule/tsconfig.json similarity index 100% rename from globule/tsconfig.json rename to types/globule/tsconfig.json diff --git a/graphql-relay/tslint.json b/types/globule/tslint.json similarity index 100% rename from graphql-relay/tslint.json rename to types/globule/tslint.json diff --git a/gm/gm-tests.ts b/types/gm/gm-tests.ts similarity index 99% rename from gm/gm-tests.ts rename to types/gm/gm-tests.ts index 2189d9064d..e8bf5787cd 100644 --- a/gm/gm-tests.ts +++ b/types/gm/gm-tests.ts @@ -1,6 +1,3 @@ - -/// - import gm = require('gm'); import stream = require('stream'); diff --git a/gm/index.d.ts b/types/gm/index.d.ts similarity index 100% rename from gm/index.d.ts rename to types/gm/index.d.ts diff --git a/gm/tsconfig.json b/types/gm/tsconfig.json similarity index 100% rename from gm/tsconfig.json rename to types/gm/tsconfig.json diff --git a/go/go-tests.ts b/types/go/go-tests.ts similarity index 100% rename from go/go-tests.ts rename to types/go/go-tests.ts diff --git a/go/index.d.ts b/types/go/index.d.ts similarity index 100% rename from go/index.d.ts rename to types/go/index.d.ts diff --git a/go/tsconfig.json b/types/go/tsconfig.json similarity index 100% rename from go/tsconfig.json rename to types/go/tsconfig.json diff --git a/google-apps-script/NOTICE b/types/google-apps-script/NOTICE similarity index 100% rename from google-apps-script/NOTICE rename to types/google-apps-script/NOTICE diff --git a/google-apps-script/google-apps-script-tests.ts b/types/google-apps-script/google-apps-script-tests.ts similarity index 100% rename from google-apps-script/google-apps-script-tests.ts rename to types/google-apps-script/google-apps-script-tests.ts diff --git a/google-apps-script/google-apps-script.base.d.ts b/types/google-apps-script/google-apps-script.base.d.ts similarity index 100% rename from google-apps-script/google-apps-script.base.d.ts rename to types/google-apps-script/google-apps-script.base.d.ts diff --git a/google-apps-script/google-apps-script.cache.d.ts b/types/google-apps-script/google-apps-script.cache.d.ts similarity index 100% rename from google-apps-script/google-apps-script.cache.d.ts rename to types/google-apps-script/google-apps-script.cache.d.ts diff --git a/google-apps-script/google-apps-script.calendar.d.ts b/types/google-apps-script/google-apps-script.calendar.d.ts similarity index 100% rename from google-apps-script/google-apps-script.calendar.d.ts rename to types/google-apps-script/google-apps-script.calendar.d.ts diff --git a/google-apps-script/google-apps-script.charts.d.ts b/types/google-apps-script/google-apps-script.charts.d.ts similarity index 100% rename from google-apps-script/google-apps-script.charts.d.ts rename to types/google-apps-script/google-apps-script.charts.d.ts diff --git a/google-apps-script/google-apps-script.contacts.d.ts b/types/google-apps-script/google-apps-script.contacts.d.ts similarity index 100% rename from google-apps-script/google-apps-script.contacts.d.ts rename to types/google-apps-script/google-apps-script.contacts.d.ts diff --git a/google-apps-script/google-apps-script.content.d.ts b/types/google-apps-script/google-apps-script.content.d.ts similarity index 100% rename from google-apps-script/google-apps-script.content.d.ts rename to types/google-apps-script/google-apps-script.content.d.ts diff --git a/google-apps-script/google-apps-script.document.d.ts b/types/google-apps-script/google-apps-script.document.d.ts similarity index 100% rename from google-apps-script/google-apps-script.document.d.ts rename to types/google-apps-script/google-apps-script.document.d.ts diff --git a/google-apps-script/google-apps-script.drive.d.ts b/types/google-apps-script/google-apps-script.drive.d.ts similarity index 100% rename from google-apps-script/google-apps-script.drive.d.ts rename to types/google-apps-script/google-apps-script.drive.d.ts diff --git a/google-apps-script/google-apps-script.forms.d.ts b/types/google-apps-script/google-apps-script.forms.d.ts similarity index 100% rename from google-apps-script/google-apps-script.forms.d.ts rename to types/google-apps-script/google-apps-script.forms.d.ts diff --git a/google-apps-script/google-apps-script.gmail.d.ts b/types/google-apps-script/google-apps-script.gmail.d.ts similarity index 100% rename from google-apps-script/google-apps-script.gmail.d.ts rename to types/google-apps-script/google-apps-script.gmail.d.ts diff --git a/google-apps-script/google-apps-script.groups.d.ts b/types/google-apps-script/google-apps-script.groups.d.ts similarity index 100% rename from google-apps-script/google-apps-script.groups.d.ts rename to types/google-apps-script/google-apps-script.groups.d.ts diff --git a/google-apps-script/google-apps-script.html.d.ts b/types/google-apps-script/google-apps-script.html.d.ts similarity index 100% rename from google-apps-script/google-apps-script.html.d.ts rename to types/google-apps-script/google-apps-script.html.d.ts diff --git a/google-apps-script/google-apps-script.jdbc.d.ts b/types/google-apps-script/google-apps-script.jdbc.d.ts similarity index 100% rename from google-apps-script/google-apps-script.jdbc.d.ts rename to types/google-apps-script/google-apps-script.jdbc.d.ts diff --git a/google-apps-script/google-apps-script.language.d.ts b/types/google-apps-script/google-apps-script.language.d.ts similarity index 100% rename from google-apps-script/google-apps-script.language.d.ts rename to types/google-apps-script/google-apps-script.language.d.ts diff --git a/google-apps-script/google-apps-script.lock.d.ts b/types/google-apps-script/google-apps-script.lock.d.ts similarity index 100% rename from google-apps-script/google-apps-script.lock.d.ts rename to types/google-apps-script/google-apps-script.lock.d.ts diff --git a/google-apps-script/google-apps-script.mail.d.ts b/types/google-apps-script/google-apps-script.mail.d.ts similarity index 100% rename from google-apps-script/google-apps-script.mail.d.ts rename to types/google-apps-script/google-apps-script.mail.d.ts diff --git a/google-apps-script/google-apps-script.maps.d.ts b/types/google-apps-script/google-apps-script.maps.d.ts similarity index 100% rename from google-apps-script/google-apps-script.maps.d.ts rename to types/google-apps-script/google-apps-script.maps.d.ts diff --git a/google-apps-script/google-apps-script.optimization.d.ts b/types/google-apps-script/google-apps-script.optimization.d.ts similarity index 100% rename from google-apps-script/google-apps-script.optimization.d.ts rename to types/google-apps-script/google-apps-script.optimization.d.ts diff --git a/google-apps-script/google-apps-script.properties.d.ts b/types/google-apps-script/google-apps-script.properties.d.ts similarity index 100% rename from google-apps-script/google-apps-script.properties.d.ts rename to types/google-apps-script/google-apps-script.properties.d.ts diff --git a/google-apps-script/google-apps-script.script.d.ts b/types/google-apps-script/google-apps-script.script.d.ts similarity index 100% rename from google-apps-script/google-apps-script.script.d.ts rename to types/google-apps-script/google-apps-script.script.d.ts diff --git a/google-apps-script/google-apps-script.sites.d.ts b/types/google-apps-script/google-apps-script.sites.d.ts similarity index 100% rename from google-apps-script/google-apps-script.sites.d.ts rename to types/google-apps-script/google-apps-script.sites.d.ts diff --git a/google-apps-script/google-apps-script.spreadsheet.d.ts b/types/google-apps-script/google-apps-script.spreadsheet.d.ts similarity index 100% rename from google-apps-script/google-apps-script.spreadsheet.d.ts rename to types/google-apps-script/google-apps-script.spreadsheet.d.ts diff --git a/google-apps-script/google-apps-script.types.d.ts b/types/google-apps-script/google-apps-script.types.d.ts similarity index 100% rename from google-apps-script/google-apps-script.types.d.ts rename to types/google-apps-script/google-apps-script.types.d.ts diff --git a/google-apps-script/google-apps-script.ui.d.ts b/types/google-apps-script/google-apps-script.ui.d.ts similarity index 100% rename from google-apps-script/google-apps-script.ui.d.ts rename to types/google-apps-script/google-apps-script.ui.d.ts diff --git a/google-apps-script/google-apps-script.url-fetch.d.ts b/types/google-apps-script/google-apps-script.url-fetch.d.ts similarity index 100% rename from google-apps-script/google-apps-script.url-fetch.d.ts rename to types/google-apps-script/google-apps-script.url-fetch.d.ts diff --git a/google-apps-script/google-apps-script.utilities.d.ts b/types/google-apps-script/google-apps-script.utilities.d.ts similarity index 100% rename from google-apps-script/google-apps-script.utilities.d.ts rename to types/google-apps-script/google-apps-script.utilities.d.ts diff --git a/google-apps-script/google-apps-script.xml-service.d.ts b/types/google-apps-script/google-apps-script.xml-service.d.ts similarity index 100% rename from google-apps-script/google-apps-script.xml-service.d.ts rename to types/google-apps-script/google-apps-script.xml-service.d.ts diff --git a/google-apps-script/index.d.ts b/types/google-apps-script/index.d.ts similarity index 100% rename from google-apps-script/index.d.ts rename to types/google-apps-script/index.d.ts diff --git a/google-apps-script/tsconfig.json b/types/google-apps-script/tsconfig.json similarity index 100% rename from google-apps-script/tsconfig.json rename to types/google-apps-script/tsconfig.json diff --git a/google-closure-compiler/google-closure-compiler-tests.ts b/types/google-closure-compiler/google-closure-compiler-tests.ts similarity index 100% rename from google-closure-compiler/google-closure-compiler-tests.ts rename to types/google-closure-compiler/google-closure-compiler-tests.ts diff --git a/google-closure-compiler/index.d.ts b/types/google-closure-compiler/index.d.ts similarity index 100% rename from google-closure-compiler/index.d.ts rename to types/google-closure-compiler/index.d.ts diff --git a/google-closure-compiler/tsconfig.json b/types/google-closure-compiler/tsconfig.json similarity index 100% rename from google-closure-compiler/tsconfig.json rename to types/google-closure-compiler/tsconfig.json diff --git a/google-drive-realtime-api/google-drive-realtime-api-tests.ts b/types/google-drive-realtime-api/google-drive-realtime-api-tests.ts similarity index 100% rename from google-drive-realtime-api/google-drive-realtime-api-tests.ts rename to types/google-drive-realtime-api/google-drive-realtime-api-tests.ts diff --git a/google-drive-realtime-api/index.d.ts b/types/google-drive-realtime-api/index.d.ts similarity index 100% rename from google-drive-realtime-api/index.d.ts rename to types/google-drive-realtime-api/index.d.ts diff --git a/google-drive-realtime-api/tsconfig.json b/types/google-drive-realtime-api/tsconfig.json similarity index 100% rename from google-drive-realtime-api/tsconfig.json rename to types/google-drive-realtime-api/tsconfig.json diff --git a/google-earth/google-earth-tests.ts b/types/google-earth/google-earth-tests.ts similarity index 100% rename from google-earth/google-earth-tests.ts rename to types/google-earth/google-earth-tests.ts diff --git a/google-earth/index.d.ts b/types/google-earth/index.d.ts similarity index 100% rename from google-earth/index.d.ts rename to types/google-earth/index.d.ts diff --git a/google-earth/tsconfig.json b/types/google-earth/tsconfig.json similarity index 100% rename from google-earth/tsconfig.json rename to types/google-earth/tsconfig.json diff --git a/google-libphonenumber/google-libphonenumber-tests.ts b/types/google-libphonenumber/google-libphonenumber-tests.ts similarity index 100% rename from google-libphonenumber/google-libphonenumber-tests.ts rename to types/google-libphonenumber/google-libphonenumber-tests.ts diff --git a/google-libphonenumber/index.d.ts b/types/google-libphonenumber/index.d.ts similarity index 100% rename from google-libphonenumber/index.d.ts rename to types/google-libphonenumber/index.d.ts diff --git a/google-libphonenumber/tsconfig.json b/types/google-libphonenumber/tsconfig.json similarity index 100% rename from google-libphonenumber/tsconfig.json rename to types/google-libphonenumber/tsconfig.json diff --git a/google-maps/google-maps-tests.ts b/types/google-maps/google-maps-tests.ts similarity index 100% rename from google-maps/google-maps-tests.ts rename to types/google-maps/google-maps-tests.ts diff --git a/google-maps/index.d.ts b/types/google-maps/index.d.ts similarity index 100% rename from google-maps/index.d.ts rename to types/google-maps/index.d.ts diff --git a/google-maps/tsconfig.json b/types/google-maps/tsconfig.json similarity index 100% rename from google-maps/tsconfig.json rename to types/google-maps/tsconfig.json diff --git a/types/google-protobuf/google-protobuf-tests.ts b/types/google-protobuf/google-protobuf-tests.ts new file mode 100644 index 0000000000..809d8dfb7c --- /dev/null +++ b/types/google-protobuf/google-protobuf-tests.ts @@ -0,0 +1,524 @@ +import * as jspb from "./index"; + +import * as google_protobuf_compiler_plugin_pb from "./google/protobuf/compiler/plugin_pb"; +import * as google_protobuf_any_pb from "./google/protobuf/any_pb"; +import * as google_protobuf_api_pb from "./google/protobuf/api_pb"; +import * as google_protobuf_descriptor_pb from "./google/protobuf/descriptor_pb"; +import * as google_protobuf_duration_pb from "./google/protobuf/duration_pb"; +import * as google_protobuf_empty_pb from "./google/protobuf/empty_pb"; +import * as google_protobuf_field_mask_pb from "./google/protobuf/field_mask_pb"; +import * as google_protobuf_source_context_pb from "./google/protobuf/source_context_pb"; +import * as google_protobuf_struct_pb from "./google/protobuf/struct_pb"; +import * as google_protobuf_timestamp_pb from "./google/protobuf/timestamp_pb"; +import * as google_protobuf_type_pb from "./google/protobuf/type_pb"; +import * as google_protobuf_wrappers_pb from "./google/protobuf/wrappers_pb"; + +/* 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; + google.protobuf.compiler.CodeGeneratorRequest some_code_generator_request = 4; + google.protobuf.Any some_any = 5; + google.protobuf.Method some_method = 6; + google.protobuf.GeneratedCodeInfo some_generated_code_info = 7; + google.protobuf.Duration some_duration = 8; + google.protobuf.Empty some_empty = 9; + google.protobuf.FieldMask some_field_mask = 10; + google.protobuf.SourceContext some_source_context = 11; + google.protobuf.Struct some_struct = 12; + google.protobuf.Timestamp some_timestamp = 13; + google.protobuf.Type some_type = 14; + google.protobuf.DoubleValue some_double_value = 15; + } +*/ + +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 || false, 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), + someCodeGeneratorRequest: google_protobuf_compiler_plugin_pb.CodeGeneratorRequest.toObject(includeInstance, msg.getSomeCodeGeneratorRequest()), + someAny: google_protobuf_any_pb.Any.toObject(includeInstance, msg.getSomeAny()), + someMethod: google_protobuf_api_pb.Method.toObject(includeInstance, msg.getSomeMethod()), + someGeneratedCodeInfo: google_protobuf_descriptor_pb.GeneratedCodeInfo.toObject(includeInstance, msg.getSomeGeneratedCodeInfo()), + someDuration: google_protobuf_duration_pb.Duration.toObject(includeInstance, msg.getSomeDuration()), + someEmpty: google_protobuf_empty_pb.Empty.toObject(includeInstance, msg.getSomeEmpty()), + someFieldMask: google_protobuf_field_mask_pb.FieldMask.toObject(includeInstance, msg.getSomeFieldMask()), + someSourceContext: google_protobuf_source_context_pb.SourceContext.toObject(includeInstance, msg.getSomeSourceContext()), + someStruct: google_protobuf_struct_pb.Struct.toObject(includeInstance, msg.getSomeStruct()), + someTimestamp: google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, msg.getSomeTimestamp()), + someType: google_protobuf_type_pb.Type.toObject(includeInstance, msg.getSomeType()), + someDoubleValue: google_protobuf_wrappers_pb.DoubleValue.toObject(includeInstance, msg.getSomeDoubleValue()), + }; + + 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): MySimple { + var reader = new jspb.BinaryReader(bytes); + var msg = new MySimple; + return MySimple.deserializeBinaryFromReader(msg, reader); + } + + static deserializeBinaryFromReader(msg: MySimple, reader: jspb.BinaryReader): MySimple { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value1 = /** @type {string} */ (reader.readString()); + msg.setMyString(value1); + break; + case 2: + var value2 = /** @type {boolean} */ (reader.readBool()); + msg.setMyBool(value2); + break; + case 3: + var value3 = /** @type {string} */ (reader.readString()); + msg.addSomeLabels(value3); + break; + case 4: + var value4 = new google_protobuf_compiler_plugin_pb.CodeGeneratorRequest; + reader.readMessage(value4, google_protobuf_compiler_plugin_pb.CodeGeneratorRequest.deserializeBinaryFromReader); + msg.setSomeCodeGeneratorRequest(value4); + break; + case 5: + var value5 = new google_protobuf_any_pb.Any; + reader.readMessage(value5, google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setSomeAny(value5); + break; + case 6: + var value6 = new google_protobuf_api_pb.Method; + reader.readMessage(value6, google_protobuf_api_pb.Method.deserializeBinaryFromReader); + msg.setSomeMethod(value6); + break; + case 7: + var value7 = new google_protobuf_descriptor_pb.GeneratedCodeInfo; + reader.readMessage(value7, google_protobuf_descriptor_pb.GeneratedCodeInfo.deserializeBinaryFromReader); + msg.setSomeGeneratedCodeInfo(value7); + break; + case 8: + var value8 = new google_protobuf_duration_pb.Duration; + reader.readMessage(value8, google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); + msg.setSomeDuration(value8); + break; + case 9: + var value9 = new google_protobuf_empty_pb.Empty; + reader.readMessage(value9, google_protobuf_empty_pb.Empty.deserializeBinaryFromReader); + msg.setSomeEmpty(value9); + break; + case 10: + var value10 = new google_protobuf_field_mask_pb.FieldMask; + reader.readMessage(value10, google_protobuf_field_mask_pb.FieldMask.deserializeBinaryFromReader); + msg.setSomeFieldMask(value10); + break; + case 11: + var value11 = new google_protobuf_source_context_pb.SourceContext; + reader.readMessage(value11, google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader); + msg.setSomeSourceContext(value11); + break; + case 12: + var value12 = new google_protobuf_struct_pb.Struct; + reader.readMessage(value12, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setSomeStruct(value12); + break; + case 13: + var value13 = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value13, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.setSomeTimestamp(value13); + break; + case 14: + var value14 = new google_protobuf_type_pb.Type; + reader.readMessage(value14, google_protobuf_type_pb.Type.deserializeBinaryFromReader); + msg.setSomeType(value14); + break; + case 15: + var value15 = new google_protobuf_wrappers_pb.DoubleValue; + reader.readMessage(value15, google_protobuf_wrappers_pb.DoubleValue.deserializeBinaryFromReader); + msg.setSomeDoubleValue(value15); + break; + default: + reader.skipField(); + break; + } + } + return msg; + } + + serializeBinary(): Uint8Array { + var writer = new jspb.BinaryWriter(); + MySimple.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + } + + static serializeBinaryToWriter(message: MySimple, writer: jspb.BinaryWriter) { + const 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 + ); + } + const f4 = message.getSomeCodeGeneratorRequest(); + if (f4 != null) { + writer.writeMessage( + 4, + f4, + google_protobuf_compiler_plugin_pb.CodeGeneratorRequest.serializeBinaryToWriter + ); + } + const f5 = message.getSomeAny(); + if (f5 != null) { + writer.writeMessage( + 5, + f5, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } + const f6 = message.getSomeMethod(); + if (f6 != null) { + writer.writeMessage( + 6, + f6, + google_protobuf_api_pb.Method.serializeBinaryToWriter + ); + } + const f7 = message.getSomeGeneratedCodeInfo(); + if (f7 != null) { + writer.writeMessage( + 7, + f7, + google_protobuf_descriptor_pb.GeneratedCodeInfo.serializeBinaryToWriter + ); + } + const f8 = message.getSomeDuration(); + if (f8 != null) { + writer.writeMessage( + 8, + f8, + google_protobuf_duration_pb.Duration.serializeBinaryToWriter + ); + } + const f9 = message.getSomeEmpty(); + if (f9 != null) { + writer.writeMessage( + 9, + f9, + google_protobuf_empty_pb.Empty.serializeBinaryToWriter + ); + } + const f10 = message.getSomeFieldMask(); + if (f10 != null) { + writer.writeMessage( + 10, + f10, + google_protobuf_field_mask_pb.FieldMask.serializeBinaryToWriter + ); + } + const f11 = message.getSomeSourceContext(); + if (f11 != null) { + writer.writeMessage( + 11, + f11, + google_protobuf_source_context_pb.SourceContext.serializeBinaryToWriter + ); + } + const f12 = message.getSomeStruct(); + if (f12 != null) { + writer.writeMessage( + 12, + f12, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + const f13 = message.getSomeTimestamp(); + if (f13 != null) { + writer.writeMessage( + 13, + f13, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + const f14 = message.getSomeType(); + if (f14 != null) { + writer.writeMessage( + 14, + f14, + google_protobuf_type_pb.Type.serializeBinaryToWriter + ); + } + const f15 = message.getSomeDoubleValue(); + if (f15 != null) { + writer.writeMessage( + 15, + f15, + google_protobuf_wrappers_pb.DoubleValue.serializeBinaryToWriter + ); + } + } + + 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) as string[]; + } + + setSomeLabelsList(value: Array) { + jspb.Message.setField(this, 3, value || []); + } + + addSomeLabels(value: string, opt_index?: number) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); + } + + clearSomeLabelsList() { + this.setSomeLabelsList([]); + } + + getSomeCodeGeneratorRequest(): google_protobuf_compiler_plugin_pb.CodeGeneratorRequest { + return jspb.Message.getWrapperField(this, google_protobuf_compiler_plugin_pb.CodeGeneratorRequest, 4) as google_protobuf_compiler_plugin_pb.CodeGeneratorRequest; + } + + setSomeCodeGeneratorRequest(value?: google_protobuf_compiler_plugin_pb.CodeGeneratorRequest) { + jspb.Message.setWrapperField(this, 4, value); + } + + clearSomeCodeGeneratorRequest() { + this.setSomeCodeGeneratorRequest(undefined); + } + + hasSomeCodeGeneratorRequest(): boolean { + return jspb.Message.getField(this, 4) != null; + } + + getSomeAny(): google_protobuf_any_pb.Any { + return jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 5) as google_protobuf_any_pb.Any; + } + + setSomeAny(value?: google_protobuf_any_pb.Any) { + jspb.Message.setWrapperField(this, 5, value); + } + + clearSomeAny() { + this.setSomeAny(undefined); + } + + hasSomeAny(): boolean { + return jspb.Message.getField(this, 5) != null; + } + + getSomeMethod(): google_protobuf_api_pb.Method { + return jspb.Message.getWrapperField(this, google_protobuf_api_pb.Method, 6) as google_protobuf_api_pb.Method; + } + + setSomeMethod(value?: google_protobuf_api_pb.Method) { + jspb.Message.setWrapperField(this, 6, value); + } + + clearSomeMethod() { + this.setSomeMethod(undefined); + } + + hasSomeMethod(): boolean { + return jspb.Message.getField(this, 6) != null; + } + + getSomeGeneratedCodeInfo(): google_protobuf_descriptor_pb.GeneratedCodeInfo { + return jspb.Message.getWrapperField(this, google_protobuf_descriptor_pb.GeneratedCodeInfo, 7) as google_protobuf_descriptor_pb.GeneratedCodeInfo; + } + + setSomeGeneratedCodeInfo(value?: google_protobuf_descriptor_pb.GeneratedCodeInfo) { + jspb.Message.setWrapperField(this, 7, value); + } + + clearSomeGeneratedCodeInfo() { + this.setSomeGeneratedCodeInfo(undefined); + } + + hasSomeGeneratedCodeInfo(): boolean { + return jspb.Message.getField(this, 7) != null; + } + + getSomeDuration(): google_protobuf_duration_pb.Duration { + return jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 8) as google_protobuf_duration_pb.Duration; + } + + setSomeDuration(value?: google_protobuf_duration_pb.Duration) { + jspb.Message.setWrapperField(this, 8, value); + } + + clearSomeDuration() { + this.setSomeDuration(undefined); + } + + hasSomeDuration(): boolean { + return jspb.Message.getField(this, 8) != null; + } + + getSomeEmpty(): google_protobuf_empty_pb.Empty { + return jspb.Message.getWrapperField(this, google_protobuf_empty_pb.Empty, 9) as google_protobuf_empty_pb.Empty; + } + + setSomeEmpty(value?: google_protobuf_empty_pb.Empty) { + jspb.Message.setWrapperField(this, 9, value); + } + + clearSomeEmpty() { + this.setSomeEmpty(undefined); + } + + hasSomeEmpty(): boolean { + return jspb.Message.getField(this, 9) != null; + } + + getSomeFieldMask(): google_protobuf_field_mask_pb.FieldMask { + return jspb.Message.getWrapperField(this, google_protobuf_field_mask_pb.FieldMask, 10) as google_protobuf_field_mask_pb.FieldMask; + } + + setSomeFieldMask(value?: google_protobuf_field_mask_pb.FieldMask) { + jspb.Message.setWrapperField(this, 10, value); + } + + clearSomeFieldMask() { + this.setSomeFieldMask(undefined); + } + + hasSomeFieldMask(): boolean { + return jspb.Message.getField(this, 10) != null; + } + + getSomeSourceContext(): google_protobuf_source_context_pb.SourceContext { + return jspb.Message.getWrapperField(this, google_protobuf_source_context_pb.SourceContext, 11) as google_protobuf_source_context_pb.SourceContext; + } + + setSomeSourceContext(value?: google_protobuf_source_context_pb.SourceContext) { + jspb.Message.setWrapperField(this, 11, value); + } + + clearSomeSourceContext() { + this.setSomeSourceContext(undefined); + } + + hasSomeSourceContext(): boolean { + return jspb.Message.getField(this, 11) != null; + } + + getSomeStruct(): google_protobuf_struct_pb.Struct { + return jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 12) as google_protobuf_struct_pb.Struct; + } + + setSomeStruct(value?: google_protobuf_struct_pb.Struct) { + jspb.Message.setWrapperField(this, 12, value); + } + + clearSomeStruct() { + this.setSomeStruct(undefined); + } + + hasSomeStruct(): boolean { + return jspb.Message.getField(this, 12) != null; + } + + getSomeTimestamp(): google_protobuf_timestamp_pb.Timestamp { + return jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 13) as google_protobuf_timestamp_pb.Timestamp; + } + + setSomeTimestamp(value?: google_protobuf_timestamp_pb.Timestamp) { + jspb.Message.setWrapperField(this, 13, value); + } + + clearSomeTimestamp() { + this.setSomeTimestamp(undefined); + } + + hasSomeTimestamp(): boolean { + return jspb.Message.getField(this, 13) != null; + } + + getSomeType(): google_protobuf_type_pb.Type { + return jspb.Message.getWrapperField(this, google_protobuf_type_pb.Type, 14) as google_protobuf_type_pb.Type; + } + + setSomeType(value?: google_protobuf_type_pb.Type) { + jspb.Message.setWrapperField(this, 14, value); + } + + clearSomeType() { + this.setSomeType(undefined); + } + + hasSomeType(): boolean { + return jspb.Message.getField(this, 14) != null; + } + + getSomeDoubleValue(): google_protobuf_wrappers_pb.DoubleValue { + return jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.DoubleValue, 15) as google_protobuf_wrappers_pb.DoubleValue; + } + + setSomeDoubleValue(value?: google_protobuf_wrappers_pb.DoubleValue) { + jspb.Message.setWrapperField(this, 15, value); + } + + clearSomeDoubleValue() { + this.setSomeDoubleValue(undefined); + } + + hasSomeDoubleValue(): boolean { + return jspb.Message.getField(this, 15) != null; + } +}; diff --git a/types/google-protobuf/google/protobuf/any_pb.d.ts b/types/google-protobuf/google/protobuf/any_pb.d.ts new file mode 100644 index 0000000000..b1e275570a --- /dev/null +++ b/types/google-protobuf/google/protobuf/any_pb.d.ts @@ -0,0 +1,32 @@ +import * as jspb from "../../index"; + +export class Any extends jspb.Message { + getTypeUrl(): string; + setTypeUrl(value: string): void; + + getValue(): Uint8Array | string; + getValue_asU8(): Uint8Array; + getValue_asB64(): string; + setValue(value: Uint8Array | string): void; + + getTypeName(): string; + pack(serialized: Uint8Array, name: string, typeUrlPrefix?: string): void; + unpack(deserialize: (packed: Uint8Array) => T, name: string): T | null; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Any.AsObject; + static toObject(includeInstance: boolean, msg: Any): Any.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Any, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Any; + static deserializeBinaryFromReader(message: Any, reader: jspb.BinaryReader): Any; +} + +export namespace Any { + export type AsObject = { + typeUrl: string, + value: Uint8Array | string, + } +} + diff --git a/types/google-protobuf/google/protobuf/api_pb.d.ts b/types/google-protobuf/google/protobuf/api_pb.d.ts new file mode 100644 index 0000000000..a7ba91088c --- /dev/null +++ b/types/google-protobuf/google/protobuf/api_pb.d.ts @@ -0,0 +1,126 @@ +import * as jspb from "../../index"; +import * as google_protobuf_source_context_pb from "./source_context_pb"; +import * as google_protobuf_type_pb from "./type_pb"; + +export class Api extends jspb.Message { + getName(): string; + setName(value: string): void; + + clearMethodsList(): void; + getMethodsList(): Array; + setMethodsList(value: Array): void; + addMethods(value?: Method, index?: number): void; + + clearOptionsList(): void; + getOptionsList(): Array; + setOptionsList(value: Array): void; + addOptions(value?: google_protobuf_type_pb.Option, index?: number): void; + + getVersion(): string; + setVersion(value: string): void; + + hasSourceContext(): boolean; + clearSourceContext(): void; + getSourceContext(): google_protobuf_source_context_pb.SourceContext; + setSourceContext(value: google_protobuf_source_context_pb.SourceContext): void; + + clearMixinsList(): void; + getMixinsList(): Array; + setMixinsList(value: Array): void; + addMixins(value?: Mixin, index?: number): void; + + getSyntax(): google_protobuf_type_pb.Syntax; + setSyntax(value: google_protobuf_type_pb.Syntax): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Api.AsObject; + static toObject(includeInstance: boolean, msg: Api): Api.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Api, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Api; + static deserializeBinaryFromReader(message: Api, reader: jspb.BinaryReader): Api; +} + +export namespace Api { + export type AsObject = { + name: string, + methodsList: Array, + optionsList: Array, + version: string, + sourceContext: google_protobuf_source_context_pb.SourceContext.AsObject, + mixinsList: Array, + syntax: google_protobuf_type_pb.Syntax, + } +} + +export class Method extends jspb.Message { + getName(): string; + setName(value: string): void; + + getRequestTypeUrl(): string; + setRequestTypeUrl(value: string): void; + + getRequestStreaming(): boolean; + setRequestStreaming(value: boolean): void; + + getResponseTypeUrl(): string; + setResponseTypeUrl(value: string): void; + + getResponseStreaming(): boolean; + setResponseStreaming(value: boolean): void; + + clearOptionsList(): void; + getOptionsList(): Array; + setOptionsList(value: Array): void; + addOptions(value?: google_protobuf_type_pb.Option, index?: number): void; + + getSyntax(): google_protobuf_type_pb.Syntax; + setSyntax(value: google_protobuf_type_pb.Syntax): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Method.AsObject; + static toObject(includeInstance: boolean, msg: Method): Method.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Method, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Method; + static deserializeBinaryFromReader(message: Method, reader: jspb.BinaryReader): Method; +} + +export namespace Method { + export type AsObject = { + name: string, + requestTypeUrl: string, + requestStreaming: boolean, + responseTypeUrl: string, + responseStreaming: boolean, + optionsList: Array, + syntax: google_protobuf_type_pb.Syntax, + } +} + +export class Mixin extends jspb.Message { + getName(): string; + setName(value: string): void; + + getRoot(): string; + setRoot(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Mixin.AsObject; + static toObject(includeInstance: boolean, msg: Mixin): Mixin.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Mixin, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Mixin; + static deserializeBinaryFromReader(message: Mixin, reader: jspb.BinaryReader): Mixin; +} + +export namespace Mixin { + export type AsObject = { + name: string, + root: string, + } +} + diff --git a/types/google-protobuf/google/protobuf/compiler/plugin_pb.d.ts b/types/google-protobuf/google/protobuf/compiler/plugin_pb.d.ts new file mode 100644 index 0000000000..0e3491e702 --- /dev/null +++ b/types/google-protobuf/google/protobuf/compiler/plugin_pb.d.ts @@ -0,0 +1,145 @@ +import * as jspb from "../../../index"; +import * as google_protobuf_descriptor_pb from "../descriptor_pb"; + +export class Version extends jspb.Message { + hasMajor(): boolean; + clearMajor(): void; + getMajor(): number; + setMajor(value: number): void; + + hasMinor(): boolean; + clearMinor(): void; + getMinor(): number; + setMinor(value: number): void; + + hasPatch(): boolean; + clearPatch(): void; + getPatch(): number; + setPatch(value: number): void; + + hasSuffix(): boolean; + clearSuffix(): void; + getSuffix(): string; + setSuffix(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Version.AsObject; + static toObject(includeInstance: boolean, msg: Version): Version.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Version, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Version; + static deserializeBinaryFromReader(message: Version, reader: jspb.BinaryReader): Version; +} + +export namespace Version { + export type AsObject = { + major: number, + minor: number, + patch: number, + suffix: string, + } +} + +export class CodeGeneratorRequest extends jspb.Message { + clearFileToGenerateList(): void; + getFileToGenerateList(): Array; + setFileToGenerateList(value: Array): void; + addFileToGenerate(value: string, index?: number): void; + + hasParameter(): boolean; + clearParameter(): void; + getParameter(): string; + setParameter(value: string): void; + + clearProtoFileList(): void; + getProtoFileList(): Array; + setProtoFileList(value: Array): void; + addProtoFile(value?: google_protobuf_descriptor_pb.FileDescriptorProto, index?: number): void; + + hasCompilerVersion(): boolean; + clearCompilerVersion(): void; + getCompilerVersion(): Version; + setCompilerVersion(value: Version): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CodeGeneratorRequest.AsObject; + static toObject(includeInstance: boolean, msg: CodeGeneratorRequest): CodeGeneratorRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CodeGeneratorRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CodeGeneratorRequest; + static deserializeBinaryFromReader(message: CodeGeneratorRequest, reader: jspb.BinaryReader): CodeGeneratorRequest; +} + +export namespace CodeGeneratorRequest { + export type AsObject = { + fileToGenerateList: Array, + parameter: string, + protoFileList: Array, + compilerVersion: Version.AsObject, + } +} + +export class CodeGeneratorResponse extends jspb.Message { + hasError(): boolean; + clearError(): void; + getError(): string; + setError(value: string): void; + + clearFileList(): void; + getFileList(): Array; + setFileList(value: Array): void; + addFile(value?: CodeGeneratorResponse.File, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CodeGeneratorResponse.AsObject; + static toObject(includeInstance: boolean, msg: CodeGeneratorResponse): CodeGeneratorResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CodeGeneratorResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CodeGeneratorResponse; + static deserializeBinaryFromReader(message: CodeGeneratorResponse, reader: jspb.BinaryReader): CodeGeneratorResponse; +} + +export namespace CodeGeneratorResponse { + export type AsObject = { + error: string, + fileList: Array, + } + + export class File extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + hasInsertionPoint(): boolean; + clearInsertionPoint(): void; + getInsertionPoint(): string; + setInsertionPoint(value: string): void; + + hasContent(): boolean; + clearContent(): void; + getContent(): string; + setContent(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): File.AsObject; + static toObject(includeInstance: boolean, msg: File): File.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: File, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): File; + static deserializeBinaryFromReader(message: File, reader: jspb.BinaryReader): File; + } + + export namespace File { + export type AsObject = { + name: string, + insertionPoint: string, + content: string, + } + } +} + diff --git a/types/google-protobuf/google/protobuf/descriptor_pb.d.ts b/types/google-protobuf/google/protobuf/descriptor_pb.d.ts new file mode 100644 index 0000000000..294cbab1dc --- /dev/null +++ b/types/google-protobuf/google/protobuf/descriptor_pb.d.ts @@ -0,0 +1,1131 @@ +import * as jspb from "../../index"; + +export class FileDescriptorSet extends jspb.Message { + clearFileList(): void; + getFileList(): Array; + setFileList(value: Array): void; + addFile(value?: FileDescriptorProto, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FileDescriptorSet.AsObject; + static toObject(includeInstance: boolean, msg: FileDescriptorSet): FileDescriptorSet.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FileDescriptorSet, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FileDescriptorSet; + static deserializeBinaryFromReader(message: FileDescriptorSet, reader: jspb.BinaryReader): FileDescriptorSet; +} + +export namespace FileDescriptorSet { + export type AsObject = { + fileList: Array, + } +} + +export class FileDescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + hasPackage(): boolean; + clearPackage(): void; + getPackage(): string; + setPackage(value: string): void; + + clearDependencyList(): void; + getDependencyList(): Array; + setDependencyList(value: Array): void; + addDependency(value: string, index?: number): void; + + clearPublicDependencyList(): void; + getPublicDependencyList(): Array; + setPublicDependencyList(value: Array): void; + addPublicDependency(value: number, index?: number): void; + + clearWeakDependencyList(): void; + getWeakDependencyList(): Array; + setWeakDependencyList(value: Array): void; + addWeakDependency(value: number, index?: number): void; + + clearMessageTypeList(): void; + getMessageTypeList(): Array; + setMessageTypeList(value: Array): void; + addMessageType(value?: DescriptorProto, index?: number): void; + + clearEnumTypeList(): void; + getEnumTypeList(): Array; + setEnumTypeList(value: Array): void; + addEnumType(value?: EnumDescriptorProto, index?: number): void; + + clearServiceList(): void; + getServiceList(): Array; + setServiceList(value: Array): void; + addService(value?: ServiceDescriptorProto, index?: number): void; + + clearExtensionList(): void; + getExtensionList(): Array; + setExtensionList(value: Array): void; + addExtension(value?: FieldDescriptorProto, index?: number): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): FileOptions; + setOptions(value: FileOptions): void; + + hasSourceCodeInfo(): boolean; + clearSourceCodeInfo(): void; + getSourceCodeInfo(): SourceCodeInfo; + setSourceCodeInfo(value: SourceCodeInfo): void; + + hasSyntax(): boolean; + clearSyntax(): void; + getSyntax(): string; + setSyntax(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FileDescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: FileDescriptorProto): FileDescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FileDescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FileDescriptorProto; + static deserializeBinaryFromReader(message: FileDescriptorProto, reader: jspb.BinaryReader): FileDescriptorProto; +} + +export namespace FileDescriptorProto { + export type AsObject = { + name: string, + package: string, + dependencyList: Array, + publicDependencyList: Array, + weakDependencyList: Array, + messageTypeList: Array, + enumTypeList: Array, + serviceList: Array, + extensionList: Array, + options: FileOptions.AsObject, + sourceCodeInfo: SourceCodeInfo.AsObject, + syntax: string, + } +} + +export class DescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + clearFieldList(): void; + getFieldList(): Array; + setFieldList(value: Array): void; + addField(value?: FieldDescriptorProto, index?: number): void; + + clearExtensionList(): void; + getExtensionList(): Array; + setExtensionList(value: Array): void; + addExtension(value?: FieldDescriptorProto, index?: number): void; + + clearNestedTypeList(): void; + getNestedTypeList(): Array; + setNestedTypeList(value: Array): void; + addNestedType(value?: DescriptorProto, index?: number): void; + + clearEnumTypeList(): void; + getEnumTypeList(): Array; + setEnumTypeList(value: Array): void; + addEnumType(value?: EnumDescriptorProto, index?: number): void; + + clearExtensionRangeList(): void; + getExtensionRangeList(): Array; + setExtensionRangeList(value: Array): void; + addExtensionRange(value?: DescriptorProto.ExtensionRange, index?: number): void; + + clearOneofDeclList(): void; + getOneofDeclList(): Array; + setOneofDeclList(value: Array): void; + addOneofDecl(value?: OneofDescriptorProto, index?: number): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): MessageOptions; + setOptions(value: MessageOptions): void; + + clearReservedRangeList(): void; + getReservedRangeList(): Array; + setReservedRangeList(value: Array): void; + addReservedRange(value?: DescriptorProto.ReservedRange, index?: number): void; + + clearReservedNameList(): void; + getReservedNameList(): Array; + setReservedNameList(value: Array): void; + addReservedName(value: string, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: DescriptorProto): DescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DescriptorProto; + static deserializeBinaryFromReader(message: DescriptorProto, reader: jspb.BinaryReader): DescriptorProto; +} + +export namespace DescriptorProto { + export type AsObject = { + name: string, + fieldList: Array, + extensionList: Array, + nestedTypeList: Array, + enumTypeList: Array, + extensionRangeList: Array, + oneofDeclList: Array, + options: MessageOptions.AsObject, + reservedRangeList: Array, + reservedNameList: Array, + } + + export class ExtensionRange extends jspb.Message { + hasStart(): boolean; + clearStart(): void; + getStart(): number; + setStart(value: number): void; + + hasEnd(): boolean; + clearEnd(): void; + getEnd(): number; + setEnd(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ExtensionRange.AsObject; + static toObject(includeInstance: boolean, msg: ExtensionRange): ExtensionRange.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ExtensionRange, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ExtensionRange; + static deserializeBinaryFromReader(message: ExtensionRange, reader: jspb.BinaryReader): ExtensionRange; + } + + export namespace ExtensionRange { + export type AsObject = { + start: number, + end: number, + } + } + + export class ReservedRange extends jspb.Message { + hasStart(): boolean; + clearStart(): void; + getStart(): number; + setStart(value: number): void; + + hasEnd(): boolean; + clearEnd(): void; + getEnd(): number; + setEnd(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ReservedRange.AsObject; + static toObject(includeInstance: boolean, msg: ReservedRange): ReservedRange.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ReservedRange, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ReservedRange; + static deserializeBinaryFromReader(message: ReservedRange, reader: jspb.BinaryReader): ReservedRange; + } + + export namespace ReservedRange { + export type AsObject = { + start: number, + end: number, + } + } +} + +export class FieldDescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + hasNumber(): boolean; + clearNumber(): void; + getNumber(): number; + setNumber(value: number): void; + + hasLabel(): boolean; + clearLabel(): void; + getLabel(): FieldDescriptorProto.Label; + setLabel(value: FieldDescriptorProto.Label): void; + + hasType(): boolean; + clearType(): void; + getType(): FieldDescriptorProto.Type; + setType(value: FieldDescriptorProto.Type): void; + + hasTypeName(): boolean; + clearTypeName(): void; + getTypeName(): string; + setTypeName(value: string): void; + + hasExtendee(): boolean; + clearExtendee(): void; + getExtendee(): string; + setExtendee(value: string): void; + + hasDefaultValue(): boolean; + clearDefaultValue(): void; + getDefaultValue(): string; + setDefaultValue(value: string): void; + + hasOneofIndex(): boolean; + clearOneofIndex(): void; + getOneofIndex(): number; + setOneofIndex(value: number): void; + + hasJsonName(): boolean; + clearJsonName(): void; + getJsonName(): string; + setJsonName(value: string): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): FieldOptions; + setOptions(value: FieldOptions): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FieldDescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: FieldDescriptorProto): FieldDescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FieldDescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FieldDescriptorProto; + static deserializeBinaryFromReader(message: FieldDescriptorProto, reader: jspb.BinaryReader): FieldDescriptorProto; +} + +export namespace FieldDescriptorProto { + export type AsObject = { + name: string, + number: number, + label: FieldDescriptorProto.Label, + type: FieldDescriptorProto.Type, + typeName: string, + extendee: string, + defaultValue: string, + oneofIndex: number, + jsonName: string, + options: FieldOptions.AsObject, + } + + export enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18, + } + export enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + } +} + +export class OneofDescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): OneofOptions; + setOptions(value: OneofOptions): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): OneofDescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: OneofDescriptorProto): OneofDescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: OneofDescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): OneofDescriptorProto; + static deserializeBinaryFromReader(message: OneofDescriptorProto, reader: jspb.BinaryReader): OneofDescriptorProto; +} + +export namespace OneofDescriptorProto { + export type AsObject = { + name: string, + options: OneofOptions.AsObject, + } +} + +export class EnumDescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + clearValueList(): void; + getValueList(): Array; + setValueList(value: Array): void; + addValue(value?: EnumValueDescriptorProto, index?: number): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): EnumOptions; + setOptions(value: EnumOptions): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EnumDescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: EnumDescriptorProto): EnumDescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EnumDescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EnumDescriptorProto; + static deserializeBinaryFromReader(message: EnumDescriptorProto, reader: jspb.BinaryReader): EnumDescriptorProto; +} + +export namespace EnumDescriptorProto { + export type AsObject = { + name: string, + valueList: Array, + options: EnumOptions.AsObject, + } +} + +export class EnumValueDescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + hasNumber(): boolean; + clearNumber(): void; + getNumber(): number; + setNumber(value: number): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): EnumValueOptions; + setOptions(value: EnumValueOptions): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EnumValueDescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: EnumValueDescriptorProto): EnumValueDescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EnumValueDescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EnumValueDescriptorProto; + static deserializeBinaryFromReader(message: EnumValueDescriptorProto, reader: jspb.BinaryReader): EnumValueDescriptorProto; +} + +export namespace EnumValueDescriptorProto { + export type AsObject = { + name: string, + number: number, + options: EnumValueOptions.AsObject, + } +} + +export class ServiceDescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + clearMethodList(): void; + getMethodList(): Array; + setMethodList(value: Array): void; + addMethod(value?: MethodDescriptorProto, index?: number): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): ServiceOptions; + setOptions(value: ServiceOptions): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServiceDescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: ServiceDescriptorProto): ServiceDescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServiceDescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServiceDescriptorProto; + static deserializeBinaryFromReader(message: ServiceDescriptorProto, reader: jspb.BinaryReader): ServiceDescriptorProto; +} + +export namespace ServiceDescriptorProto { + export type AsObject = { + name: string, + methodList: Array, + options: ServiceOptions.AsObject, + } +} + +export class MethodDescriptorProto extends jspb.Message { + hasName(): boolean; + clearName(): void; + getName(): string; + setName(value: string): void; + + hasInputType(): boolean; + clearInputType(): void; + getInputType(): string; + setInputType(value: string): void; + + hasOutputType(): boolean; + clearOutputType(): void; + getOutputType(): string; + setOutputType(value: string): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): MethodOptions; + setOptions(value: MethodOptions): void; + + hasClientStreaming(): boolean; + clearClientStreaming(): void; + getClientStreaming(): boolean; + setClientStreaming(value: boolean): void; + + hasServerStreaming(): boolean; + clearServerStreaming(): void; + getServerStreaming(): boolean; + setServerStreaming(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MethodDescriptorProto.AsObject; + static toObject(includeInstance: boolean, msg: MethodDescriptorProto): MethodDescriptorProto.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MethodDescriptorProto, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MethodDescriptorProto; + static deserializeBinaryFromReader(message: MethodDescriptorProto, reader: jspb.BinaryReader): MethodDescriptorProto; +} + +export namespace MethodDescriptorProto { + export type AsObject = { + name: string, + inputType: string, + outputType: string, + options: MethodOptions.AsObject, + clientStreaming: boolean, + serverStreaming: boolean, + } +} + +export class FileOptions extends jspb.Message { + hasJavaPackage(): boolean; + clearJavaPackage(): void; + getJavaPackage(): string; + setJavaPackage(value: string): void; + + hasJavaOuterClassname(): boolean; + clearJavaOuterClassname(): void; + getJavaOuterClassname(): string; + setJavaOuterClassname(value: string): void; + + hasJavaMultipleFiles(): boolean; + clearJavaMultipleFiles(): void; + getJavaMultipleFiles(): boolean; + setJavaMultipleFiles(value: boolean): void; + + hasJavaGenerateEqualsAndHash(): boolean; + clearJavaGenerateEqualsAndHash(): void; + getJavaGenerateEqualsAndHash(): boolean; + setJavaGenerateEqualsAndHash(value: boolean): void; + + hasJavaStringCheckUtf8(): boolean; + clearJavaStringCheckUtf8(): void; + getJavaStringCheckUtf8(): boolean; + setJavaStringCheckUtf8(value: boolean): void; + + hasOptimizeFor(): boolean; + clearOptimizeFor(): void; + getOptimizeFor(): FileOptions.OptimizeMode; + setOptimizeFor(value: FileOptions.OptimizeMode): void; + + hasGoPackage(): boolean; + clearGoPackage(): void; + getGoPackage(): string; + setGoPackage(value: string): void; + + hasCcGenericServices(): boolean; + clearCcGenericServices(): void; + getCcGenericServices(): boolean; + setCcGenericServices(value: boolean): void; + + hasJavaGenericServices(): boolean; + clearJavaGenericServices(): void; + getJavaGenericServices(): boolean; + setJavaGenericServices(value: boolean): void; + + hasPyGenericServices(): boolean; + clearPyGenericServices(): void; + getPyGenericServices(): boolean; + setPyGenericServices(value: boolean): void; + + hasDeprecated(): boolean; + clearDeprecated(): void; + getDeprecated(): boolean; + setDeprecated(value: boolean): void; + + hasCcEnableArenas(): boolean; + clearCcEnableArenas(): void; + getCcEnableArenas(): boolean; + setCcEnableArenas(value: boolean): void; + + hasObjcClassPrefix(): boolean; + clearObjcClassPrefix(): void; + getObjcClassPrefix(): string; + setObjcClassPrefix(value: string): void; + + hasCsharpNamespace(): boolean; + clearCsharpNamespace(): void; + getCsharpNamespace(): string; + setCsharpNamespace(value: string): void; + + hasSwiftPrefix(): boolean; + clearSwiftPrefix(): void; + getSwiftPrefix(): string; + setSwiftPrefix(value: string): void; + + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FileOptions.AsObject; + static toObject(includeInstance: boolean, msg: FileOptions): FileOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FileOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FileOptions; + static deserializeBinaryFromReader(message: FileOptions, reader: jspb.BinaryReader): FileOptions; +} + +export namespace FileOptions { + export type AsObject = { + javaPackage: string, + javaOuterClassname: string, + javaMultipleFiles: boolean, + javaGenerateEqualsAndHash: boolean, + javaStringCheckUtf8: boolean, + optimizeFor: FileOptions.OptimizeMode, + goPackage: string, + ccGenericServices: boolean, + javaGenericServices: boolean, + pyGenericServices: boolean, + deprecated: boolean, + ccEnableArenas: boolean, + objcClassPrefix: string, + csharpNamespace: string, + swiftPrefix: string, + uninterpretedOptionList: Array, + } + + export enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3, + } +} + +export class MessageOptions extends jspb.Message { + hasMessageSetWireFormat(): boolean; + clearMessageSetWireFormat(): void; + getMessageSetWireFormat(): boolean; + setMessageSetWireFormat(value: boolean): void; + + hasNoStandardDescriptorAccessor(): boolean; + clearNoStandardDescriptorAccessor(): void; + getNoStandardDescriptorAccessor(): boolean; + setNoStandardDescriptorAccessor(value: boolean): void; + + hasDeprecated(): boolean; + clearDeprecated(): void; + getDeprecated(): boolean; + setDeprecated(value: boolean): void; + + hasMapEntry(): boolean; + clearMapEntry(): void; + getMapEntry(): boolean; + setMapEntry(value: boolean): void; + + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MessageOptions.AsObject; + static toObject(includeInstance: boolean, msg: MessageOptions): MessageOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MessageOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MessageOptions; + static deserializeBinaryFromReader(message: MessageOptions, reader: jspb.BinaryReader): MessageOptions; +} + +export namespace MessageOptions { + export type AsObject = { + messageSetWireFormat: boolean, + noStandardDescriptorAccessor: boolean, + deprecated: boolean, + mapEntry: boolean, + uninterpretedOptionList: Array, + } +} + +export class FieldOptions extends jspb.Message { + hasCtype(): boolean; + clearCtype(): void; + getCtype(): FieldOptions.CType; + setCtype(value: FieldOptions.CType): void; + + hasPacked(): boolean; + clearPacked(): void; + getPacked(): boolean; + setPacked(value: boolean): void; + + hasJstype(): boolean; + clearJstype(): void; + getJstype(): FieldOptions.JSType; + setJstype(value: FieldOptions.JSType): void; + + hasLazy(): boolean; + clearLazy(): void; + getLazy(): boolean; + setLazy(value: boolean): void; + + hasDeprecated(): boolean; + clearDeprecated(): void; + getDeprecated(): boolean; + setDeprecated(value: boolean): void; + + hasWeak(): boolean; + clearWeak(): void; + getWeak(): boolean; + setWeak(value: boolean): void; + + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FieldOptions.AsObject; + static toObject(includeInstance: boolean, msg: FieldOptions): FieldOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FieldOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FieldOptions; + static deserializeBinaryFromReader(message: FieldOptions, reader: jspb.BinaryReader): FieldOptions; +} + +export namespace FieldOptions { + export type AsObject = { + ctype: FieldOptions.CType, + packed: boolean, + jstype: FieldOptions.JSType, + lazy: boolean, + deprecated: boolean, + weak: boolean, + uninterpretedOptionList: Array, + } + + export enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + } + export enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2, + } +} + +export class OneofOptions extends jspb.Message { + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): OneofOptions.AsObject; + static toObject(includeInstance: boolean, msg: OneofOptions): OneofOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: OneofOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): OneofOptions; + static deserializeBinaryFromReader(message: OneofOptions, reader: jspb.BinaryReader): OneofOptions; +} + +export namespace OneofOptions { + export type AsObject = { + uninterpretedOptionList: Array, + } +} + +export class EnumOptions extends jspb.Message { + hasAllowAlias(): boolean; + clearAllowAlias(): void; + getAllowAlias(): boolean; + setAllowAlias(value: boolean): void; + + hasDeprecated(): boolean; + clearDeprecated(): void; + getDeprecated(): boolean; + setDeprecated(value: boolean): void; + + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EnumOptions.AsObject; + static toObject(includeInstance: boolean, msg: EnumOptions): EnumOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EnumOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EnumOptions; + static deserializeBinaryFromReader(message: EnumOptions, reader: jspb.BinaryReader): EnumOptions; +} + +export namespace EnumOptions { + export type AsObject = { + allowAlias: boolean, + deprecated: boolean, + uninterpretedOptionList: Array, + } +} + +export class EnumValueOptions extends jspb.Message { + hasDeprecated(): boolean; + clearDeprecated(): void; + getDeprecated(): boolean; + setDeprecated(value: boolean): void; + + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EnumValueOptions.AsObject; + static toObject(includeInstance: boolean, msg: EnumValueOptions): EnumValueOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EnumValueOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EnumValueOptions; + static deserializeBinaryFromReader(message: EnumValueOptions, reader: jspb.BinaryReader): EnumValueOptions; +} + +export namespace EnumValueOptions { + export type AsObject = { + deprecated: boolean, + uninterpretedOptionList: Array, + } +} + +export class ServiceOptions extends jspb.Message { + hasDeprecated(): boolean; + clearDeprecated(): void; + getDeprecated(): boolean; + setDeprecated(value: boolean): void; + + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServiceOptions.AsObject; + static toObject(includeInstance: boolean, msg: ServiceOptions): ServiceOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServiceOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServiceOptions; + static deserializeBinaryFromReader(message: ServiceOptions, reader: jspb.BinaryReader): ServiceOptions; +} + +export namespace ServiceOptions { + export type AsObject = { + deprecated: boolean, + uninterpretedOptionList: Array, + } +} + +export class MethodOptions extends jspb.Message { + hasDeprecated(): boolean; + clearDeprecated(): void; + getDeprecated(): boolean; + setDeprecated(value: boolean): void; + + hasIdempotencyLevel(): boolean; + clearIdempotencyLevel(): void; + getIdempotencyLevel(): MethodOptions.IdempotencyLevel; + setIdempotencyLevel(value: MethodOptions.IdempotencyLevel): void; + + clearUninterpretedOptionList(): void; + getUninterpretedOptionList(): Array; + setUninterpretedOptionList(value: Array): void; + addUninterpretedOption(value?: UninterpretedOption, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MethodOptions.AsObject; + static toObject(includeInstance: boolean, msg: MethodOptions): MethodOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MethodOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MethodOptions; + static deserializeBinaryFromReader(message: MethodOptions, reader: jspb.BinaryReader): MethodOptions; +} + +export namespace MethodOptions { + export type AsObject = { + deprecated: boolean, + idempotencyLevel: MethodOptions.IdempotencyLevel, + uninterpretedOptionList: Array, + } + + export enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2, + } +} + +export class UninterpretedOption extends jspb.Message { + clearNameList(): void; + getNameList(): Array; + setNameList(value: Array): void; + addName(value?: UninterpretedOption.NamePart, index?: number): void; + + hasIdentifierValue(): boolean; + clearIdentifierValue(): void; + getIdentifierValue(): string; + setIdentifierValue(value: string): void; + + hasPositiveIntValue(): boolean; + clearPositiveIntValue(): void; + getPositiveIntValue(): number; + setPositiveIntValue(value: number): void; + + hasNegativeIntValue(): boolean; + clearNegativeIntValue(): void; + getNegativeIntValue(): number; + setNegativeIntValue(value: number): void; + + hasDoubleValue(): boolean; + clearDoubleValue(): void; + getDoubleValue(): number; + setDoubleValue(value: number): void; + + hasStringValue(): boolean; + clearStringValue(): void; + getStringValue(): Uint8Array | string; + getStringValue_asU8(): Uint8Array; + getStringValue_asB64(): string; + setStringValue(value: Uint8Array | string): void; + + hasAggregateValue(): boolean; + clearAggregateValue(): void; + getAggregateValue(): string; + setAggregateValue(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UninterpretedOption.AsObject; + static toObject(includeInstance: boolean, msg: UninterpretedOption): UninterpretedOption.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UninterpretedOption, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UninterpretedOption; + static deserializeBinaryFromReader(message: UninterpretedOption, reader: jspb.BinaryReader): UninterpretedOption; +} + +export namespace UninterpretedOption { + export type AsObject = { + nameList: Array, + identifierValue: string, + positiveIntValue: number, + negativeIntValue: number, + doubleValue: number, + stringValue: Uint8Array | string, + aggregateValue: string, + } + + export class NamePart extends jspb.Message { + hasNamePart(): boolean; + clearNamePart(): void; + getNamePart(): string; + setNamePart(value: string): void; + + hasIsExtension(): boolean; + clearIsExtension(): void; + getIsExtension(): boolean; + setIsExtension(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NamePart.AsObject; + static toObject(includeInstance: boolean, msg: NamePart): NamePart.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NamePart, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NamePart; + static deserializeBinaryFromReader(message: NamePart, reader: jspb.BinaryReader): NamePart; + } + + export namespace NamePart { + export type AsObject = { + namePart: string, + isExtension: boolean, + } + } +} + +export class SourceCodeInfo extends jspb.Message { + clearLocationList(): void; + getLocationList(): Array; + setLocationList(value: Array): void; + addLocation(value?: SourceCodeInfo.Location, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SourceCodeInfo.AsObject; + static toObject(includeInstance: boolean, msg: SourceCodeInfo): SourceCodeInfo.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SourceCodeInfo, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SourceCodeInfo; + static deserializeBinaryFromReader(message: SourceCodeInfo, reader: jspb.BinaryReader): SourceCodeInfo; +} + +export namespace SourceCodeInfo { + export type AsObject = { + locationList: Array, + } + + export class Location extends jspb.Message { + clearPathList(): void; + getPathList(): Array; + setPathList(value: Array): void; + addPath(value: number, index?: number): void; + + clearSpanList(): void; + getSpanList(): Array; + setSpanList(value: Array): void; + addSpan(value: number, index?: number): void; + + hasLeadingComments(): boolean; + clearLeadingComments(): void; + getLeadingComments(): string; + setLeadingComments(value: string): void; + + hasTrailingComments(): boolean; + clearTrailingComments(): void; + getTrailingComments(): string; + setTrailingComments(value: string): void; + + clearLeadingDetachedCommentsList(): void; + getLeadingDetachedCommentsList(): Array; + setLeadingDetachedCommentsList(value: Array): void; + addLeadingDetachedComments(value: string, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Location.AsObject; + static toObject(includeInstance: boolean, msg: Location): Location.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Location, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Location; + static deserializeBinaryFromReader(message: Location, reader: jspb.BinaryReader): Location; + } + + export namespace Location { + export type AsObject = { + pathList: Array, + spanList: Array, + leadingComments: string, + trailingComments: string, + leadingDetachedCommentsList: Array, + } + } +} + +export class GeneratedCodeInfo extends jspb.Message { + clearAnnotationList(): void; + getAnnotationList(): Array; + setAnnotationList(value: Array): void; + addAnnotation(value?: GeneratedCodeInfo.Annotation, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GeneratedCodeInfo.AsObject; + static toObject(includeInstance: boolean, msg: GeneratedCodeInfo): GeneratedCodeInfo.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GeneratedCodeInfo, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GeneratedCodeInfo; + static deserializeBinaryFromReader(message: GeneratedCodeInfo, reader: jspb.BinaryReader): GeneratedCodeInfo; +} + +export namespace GeneratedCodeInfo { + export type AsObject = { + annotationList: Array, + } + + export class Annotation extends jspb.Message { + clearPathList(): void; + getPathList(): Array; + setPathList(value: Array): void; + addPath(value: number, index?: number): void; + + hasSourceFile(): boolean; + clearSourceFile(): void; + getSourceFile(): string; + setSourceFile(value: string): void; + + hasBegin(): boolean; + clearBegin(): void; + getBegin(): number; + setBegin(value: number): void; + + hasEnd(): boolean; + clearEnd(): void; + getEnd(): number; + setEnd(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Annotation.AsObject; + static toObject(includeInstance: boolean, msg: Annotation): Annotation.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Annotation, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Annotation; + static deserializeBinaryFromReader(message: Annotation, reader: jspb.BinaryReader): Annotation; + } + + export namespace Annotation { + export type AsObject = { + pathList: Array, + sourceFile: string, + begin: number, + end: number, + } + } +} + diff --git a/types/google-protobuf/google/protobuf/duration_pb.d.ts b/types/google-protobuf/google/protobuf/duration_pb.d.ts new file mode 100644 index 0000000000..29b39ae965 --- /dev/null +++ b/types/google-protobuf/google/protobuf/duration_pb.d.ts @@ -0,0 +1,26 @@ +import * as jspb from "../../index"; + +export class Duration extends jspb.Message { + getSeconds(): number; + setSeconds(value: number): void; + + getNanos(): number; + setNanos(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Duration.AsObject; + static toObject(includeInstance: boolean, msg: Duration): Duration.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Duration, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Duration; + static deserializeBinaryFromReader(message: Duration, reader: jspb.BinaryReader): Duration; +} + +export namespace Duration { + export type AsObject = { + seconds: number, + nanos: number, + } +} + diff --git a/types/google-protobuf/google/protobuf/empty_pb.d.ts b/types/google-protobuf/google/protobuf/empty_pb.d.ts new file mode 100644 index 0000000000..69de4641d9 --- /dev/null +++ b/types/google-protobuf/google/protobuf/empty_pb.d.ts @@ -0,0 +1,18 @@ +import * as jspb from "../../index"; + +export class Empty extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Empty.AsObject; + static toObject(includeInstance: boolean, msg: Empty): Empty.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Empty, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Empty; + static deserializeBinaryFromReader(message: Empty, reader: jspb.BinaryReader): Empty; +} + +export namespace Empty { + export type AsObject = { + } +} + diff --git a/types/google-protobuf/google/protobuf/field_mask_pb.d.ts b/types/google-protobuf/google/protobuf/field_mask_pb.d.ts new file mode 100644 index 0000000000..d0c4caf2aa --- /dev/null +++ b/types/google-protobuf/google/protobuf/field_mask_pb.d.ts @@ -0,0 +1,24 @@ +import * as jspb from "../../index"; + +export class FieldMask extends jspb.Message { + clearPathsList(): void; + getPathsList(): Array; + setPathsList(value: Array): void; + addPaths(value: string, index?: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FieldMask.AsObject; + static toObject(includeInstance: boolean, msg: FieldMask): FieldMask.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FieldMask, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FieldMask; + static deserializeBinaryFromReader(message: FieldMask, reader: jspb.BinaryReader): FieldMask; +} + +export namespace FieldMask { + export type AsObject = { + pathsList: Array, + } +} + diff --git a/types/google-protobuf/google/protobuf/source_context_pb.d.ts b/types/google-protobuf/google/protobuf/source_context_pb.d.ts new file mode 100644 index 0000000000..934b9a2636 --- /dev/null +++ b/types/google-protobuf/google/protobuf/source_context_pb.d.ts @@ -0,0 +1,22 @@ +import * as jspb from "../../index"; + +export class SourceContext extends jspb.Message { + getFileName(): string; + setFileName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SourceContext.AsObject; + static toObject(includeInstance: boolean, msg: SourceContext): SourceContext.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SourceContext, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SourceContext; + static deserializeBinaryFromReader(message: SourceContext, reader: jspb.BinaryReader): SourceContext; +} + +export namespace SourceContext { + export type AsObject = { + fileName: string, + } +} + diff --git a/types/google-protobuf/google/protobuf/struct_pb.d.ts b/types/google-protobuf/google/protobuf/struct_pb.d.ts new file mode 100644 index 0000000000..46c28ad1df --- /dev/null +++ b/types/google-protobuf/google/protobuf/struct_pb.d.ts @@ -0,0 +1,122 @@ +import * as jspb from "../../index"; + +export class Struct extends jspb.Message { + getFieldsMap(): jspb.Map; + clearFieldsMap(): void; + + toJavaScript(): {[key: string]: JavaScriptValue}; + static fromJavaScript(value: {[key: string]: JavaScriptValue}): Struct; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Struct.AsObject; + static toObject(includeInstance: boolean, msg: Struct): Struct.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Struct, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Struct; + static deserializeBinaryFromReader(message: Struct, reader: jspb.BinaryReader): Struct; +} + +export namespace Struct { + export type AsObject = { + fieldsMap: Array<[string, Value.AsObject]>, + } +} + +export class Value extends jspb.Message { + hasNullValue(): boolean; + clearNullValue(): void; + getNullValue(): NullValue; + setNullValue(value: NullValue): void; + + hasNumberValue(): boolean; + clearNumberValue(): void; + getNumberValue(): number; + setNumberValue(value: number): void; + + hasStringValue(): boolean; + clearStringValue(): void; + getStringValue(): string; + setStringValue(value: string): void; + + hasBoolValue(): boolean; + clearBoolValue(): void; + getBoolValue(): boolean; + setBoolValue(value: boolean): void; + + hasStructValue(): boolean; + clearStructValue(): void; + getStructValue(): Struct; + setStructValue(value: Struct): void; + + hasListValue(): boolean; + clearListValue(): void; + getListValue(): ListValue; + setListValue(value: ListValue): void; + + getKindCase(): Value.KindCase; + + toJavaScript(): JavaScriptValue; + static fromJavaScript(value: JavaScriptValue): Value; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Value.AsObject; + static toObject(includeInstance: boolean, msg: Value): Value.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Value, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Value; + static deserializeBinaryFromReader(message: Value, reader: jspb.BinaryReader): Value; +} + +export namespace Value { + export type AsObject = { + nullValue: NullValue, + numberValue: number, + stringValue: string, + boolValue: boolean, + structValue: Struct.AsObject, + listValue: ListValue.AsObject, + } + + export enum KindCase { + KIND_NOT_SET = 0, + NULL_VALUE = 1, + NUMBER_VALUE = 2, + STRING_VALUE = 3, + BOOL_VALUE = 4, + STRUCT_VALUE = 5, + LIST_VALUE = 6, + } +} + +export class ListValue extends jspb.Message { + clearValuesList(): void; + getValuesList(): Array; + setValuesList(value: Array): void; + addValues(value?: Value, index?: number): void; + + toJavaScript(): Array; + static fromJavaScript(value: Array): ListValue; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListValue.AsObject; + static toObject(includeInstance: boolean, msg: ListValue): ListValue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListValue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListValue; + static deserializeBinaryFromReader(message: ListValue, reader: jspb.BinaryReader): ListValue; +} + +export namespace ListValue { + export type AsObject = { + valuesList: Array, + } +} + +export enum NullValue { + NULL_VALUE = 0, +} + +export type JavaScriptValue = null | number | string | boolean | Array | {}; diff --git a/types/google-protobuf/google/protobuf/timestamp_pb.d.ts b/types/google-protobuf/google/protobuf/timestamp_pb.d.ts new file mode 100644 index 0000000000..2fadf11ad2 --- /dev/null +++ b/types/google-protobuf/google/protobuf/timestamp_pb.d.ts @@ -0,0 +1,29 @@ +import * as jspb from "../../index"; + +export class Timestamp extends jspb.Message { + getSeconds(): number; + setSeconds(value: number): void; + + getNanos(): number; + setNanos(value: number): void; + + toDate(): Date; + fromDate(date: Date): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Timestamp.AsObject; + static toObject(includeInstance: boolean, msg: Timestamp): Timestamp.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Timestamp, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Timestamp; + static deserializeBinaryFromReader(message: Timestamp, reader: jspb.BinaryReader): Timestamp; +} + +export namespace Timestamp { + export type AsObject = { + seconds: number, + nanos: number, + } +} + diff --git a/types/google-protobuf/google/protobuf/type_pb.d.ts b/types/google-protobuf/google/protobuf/type_pb.d.ts new file mode 100644 index 0000000000..186bad8d36 --- /dev/null +++ b/types/google-protobuf/google/protobuf/type_pb.d.ts @@ -0,0 +1,240 @@ +import * as jspb from "../../index"; +import * as google_protobuf_any_pb from "./any_pb"; +import * as google_protobuf_source_context_pb from "./source_context_pb"; + +export class Type extends jspb.Message { + getName(): string; + setName(value: string): void; + + clearFieldsList(): void; + getFieldsList(): Array; + setFieldsList(value: Array): void; + addFields(value?: Field, index?: number): void; + + clearOneofsList(): void; + getOneofsList(): Array; + setOneofsList(value: Array): void; + addOneofs(value: string, index?: number): void; + + clearOptionsList(): void; + getOptionsList(): Array

    ')).toContain('some-class') */ - toContain(selector: JQuery): boolean; + toContain(selector: any): boolean; /** * Check if DOM element exists inside the given parent element. diff --git a/jasmine-jquery/jasmine-jquery-tests.ts b/types/jasmine-jquery/jasmine-jquery-tests.ts similarity index 95% rename from jasmine-jquery/jasmine-jquery-tests.ts rename to types/jasmine-jquery/jasmine-jquery-tests.ts index 67b349d45e..440dff1b6c 100644 --- a/jasmine-jquery/jasmine-jquery-tests.ts +++ b/types/jasmine-jquery/jasmine-jquery-tests.ts @@ -1,18 +1,15 @@ -/// -/// - - describe("Jasmine jQuery extension", () => { it("Adds jQuery matchers", () => { - expect($('
    ')).toBe('div'); - expect($('
    ')).toBe('div#some-id'); + expect($('
    ')).toBe($('div')); + expect($('
    ')).toBe($('div#some-id')); expect($('')).toBeChecked(); expect($('
    ')).toBeHidden(); expect($('
    ')).toHaveCss({ display: "none", margin: "10px" }); expect($('
    ')).toHaveCss({ margin: "10px" }); expect($('')).toBeSelected(); expect($('
    ')).toBeVisible(); - expect($('
    ')).toContain('span.some-class'); + // NOTE: It is now necessary to explicitly add the generic parameter when using `toContain` + expect($('
    ')).toContain('span.some-class'); expect($('').addClass('js-something')).toBeMatchedBy('.js-something'); expect($('')).toExist(); expect($('
    ')).toHaveAttr('id', 'some-id'); diff --git a/jasmine-jquery/tsconfig.json b/types/jasmine-jquery/tsconfig.json similarity index 100% rename from jasmine-jquery/tsconfig.json rename to types/jasmine-jquery/tsconfig.json diff --git a/jasmine-matchers/index.d.ts b/types/jasmine-matchers/index.d.ts similarity index 99% rename from jasmine-matchers/index.d.ts rename to types/jasmine-matchers/index.d.ts index ac44d25c1c..d4cad3b77c 100644 --- a/jasmine-matchers/index.d.ts +++ b/types/jasmine-matchers/index.d.ts @@ -23,7 +23,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI /// declare namespace jasmine { - interface Matchers { + interface Matchers { //toBe toBeArray(): boolean; diff --git a/jasmine-matchers/jasmine-matchers-tests.ts b/types/jasmine-matchers/jasmine-matchers-tests.ts similarity index 99% rename from jasmine-matchers/jasmine-matchers-tests.ts rename to types/jasmine-matchers/jasmine-matchers-tests.ts index dc92e809dc..4ef032062d 100644 --- a/jasmine-matchers/jasmine-matchers-tests.ts +++ b/types/jasmine-matchers/jasmine-matchers-tests.ts @@ -14,9 +14,6 @@ The above copyright notice and this permission notice shall be included in all c 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. */ -/// - - describe('toBeArray', function () { describe('matches', function () { it('should pass for []', function () { diff --git a/jasmine-matchers/tsconfig.json b/types/jasmine-matchers/tsconfig.json similarity index 100% rename from jasmine-matchers/tsconfig.json rename to types/jasmine-matchers/tsconfig.json diff --git a/jasmine-node/index.d.ts b/types/jasmine-node/index.d.ts similarity index 100% rename from jasmine-node/index.d.ts rename to types/jasmine-node/index.d.ts diff --git a/jasmine-node/jasmine-node-tests.ts b/types/jasmine-node/jasmine-node-tests.ts similarity index 100% rename from jasmine-node/jasmine-node-tests.ts rename to types/jasmine-node/jasmine-node-tests.ts diff --git a/jasmine-node/tsconfig.json b/types/jasmine-node/tsconfig.json similarity index 100% rename from jasmine-node/tsconfig.json rename to types/jasmine-node/tsconfig.json diff --git a/jasmine-promise-matchers/index.d.ts b/types/jasmine-promise-matchers/index.d.ts similarity index 97% rename from jasmine-promise-matchers/index.d.ts rename to types/jasmine-promise-matchers/index.d.ts index c511019b62..ffe4f65142 100644 --- a/jasmine-promise-matchers/index.d.ts +++ b/types/jasmine-promise-matchers/index.d.ts @@ -10,7 +10,7 @@ declare function installPromiseMatchers(): void; declare namespace jasmine { - interface Matchers { + interface Matchers { /** * Verifies that a Promise is (or has been) rejected. */ diff --git a/jasmine-promise-matchers/jasmine-promise-matchers-tests.ts b/types/jasmine-promise-matchers/jasmine-promise-matchers-tests.ts similarity index 100% rename from jasmine-promise-matchers/jasmine-promise-matchers-tests.ts rename to types/jasmine-promise-matchers/jasmine-promise-matchers-tests.ts diff --git a/jasmine-promise-matchers/tsconfig.json b/types/jasmine-promise-matchers/tsconfig.json similarity index 100% rename from jasmine-promise-matchers/tsconfig.json rename to types/jasmine-promise-matchers/tsconfig.json diff --git a/jasmine/index.d.ts b/types/jasmine/index.d.ts similarity index 89% rename from jasmine/index.d.ts rename to types/jasmine/index.d.ts index c0db55d100..caa1d12635 100644 --- a/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -24,8 +24,9 @@ declare function afterEach(action: (done: DoneFn) => void, timeout?: number): vo 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 expect(spy: Function): jasmine.Matchers; +declare function expect(actual: ArrayLike): jasmine.ArrayLikeMatchers; +declare function expect(actual: T): jasmine.Matchers; declare function fail(e?: any): void; /** Action method that should be called when the async work is complete */ @@ -45,23 +46,33 @@ declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, t declare function waits(timeout?: number): void; declare namespace jasmine { + type Expected = T | ObjectContaining | Any | Spy; var clock: () => Clock; function any(aclass: any): Any; + function anything(): Any; + function arrayContaining(sample: any[]): ArrayContaining; - function objectContaining(sample: any): ObjectContaining; + function objectContaining(sample: Partial): 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 + + function formatErrorMsg(domain: string, usage: string): (msg: string) => string; interface Any { @@ -84,8 +95,8 @@ declare namespace jasmine { jasmineToString(): string; } - interface ObjectContaining { - new (sample: any): any; + interface ObjectContaining { + new (sample: Partial): Partial; jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; jasmineToString(): string; @@ -115,18 +126,14 @@ declare namespace jasmine { withMock(func: () => void): void; } - interface CustomEqualityTester { - (first: any, second: any): boolean; - } + type 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; - } + type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]) => CustomMatcher; interface CustomMatcherFactories { [index: string]: CustomMatcherFactory; @@ -138,9 +145,9 @@ declare namespace jasmine { } 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; + equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean; + contains(haystack: ArrayLike | string, needle: any, customTesters?: CustomEqualityTester[]): boolean; + buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string; } interface Env { @@ -152,7 +159,7 @@ declare namespace jasmine { currentSpec: Spec; - matchersClass: Matchers; + matchersClass: Matchers; version(): any; versionString(): string; @@ -226,12 +233,12 @@ declare namespace jasmine { passed(): boolean; } - interface MessageResult extends Result { + interface MessageResult extends Result { values: any; trace: Trace; } - interface ExpectationResult extends Result { + interface ExpectationResult extends Result { matcherName: string; passed(): boolean; expected: any; @@ -244,12 +251,13 @@ declare namespace jasmine { new (options: {random: boolean, seed: string}): any; random: boolean; seed: string; - sort(items: T[]) : T[]; + sort(items: T[]): T[]; } namespace errors { class ExpectationFailed extends Error { constructor(); + stack: any; } } @@ -257,7 +265,7 @@ declare namespace jasmine { interface TreeProcessor { new (attrs: any): any; execute: (done: Function) => void; - processTree() : any; + processTree(): any; } interface Trace { @@ -303,18 +311,18 @@ declare namespace jasmine { results(): NestedResults; } - interface Matchers { + interface Matchers { - new (env: Env, actual: any, spec: Env, isNot?: boolean): any; + new (env: Env, actual: T, spec: Env, isNot?: boolean): any; env: Env; - actual: any; + actual: T; spec: Env; isNot?: boolean; message(): any; - toBe(expected: any, expectationFailOutput?: any): boolean; - toEqual(expected: any, expectationFailOutput?: any): boolean; + toBe(expected: Expected, expectationFailOutput?: any): boolean; + toEqual(expected: Expected, expectationFailOutput?: any): boolean; toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; toBeDefined(expectationFailOutput?: any): boolean; toBeUndefined(expectationFailOutput?: any): boolean; @@ -334,11 +342,18 @@ declare namespace jasmine { toThrow(expected?: any): boolean; toThrowError(message?: string | RegExp): boolean; toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; - not: Matchers; + not: Matchers; Any: Any; } + interface ArrayLikeMatchers extends Matchers> { + toBe(expected: Expected>, expectationFailOutput?: any): boolean; + toEqual(expected: Expected>, expectationFailOutput?: any): boolean; + toContain(expected: T, expectationFailOutput?: any): boolean; + not: ArrayLikeMatchers; + } + interface Reporter { reportRunnerStarting(runner: Runner): void; reportRunnerResults(runner: Runner): void; @@ -373,18 +388,18 @@ declare namespace jasmine { } interface CustomReporterResult { - description: string, - failedExpectations?: FailedExpectation[], - fullName: string, + description: string; + failedExpectations?: FailedExpectation[]; + fullName: string; id: string; - passedExpectations?: PassedExpectation[], + passedExpectations?: PassedExpectation[]; pendingReason?: string; status?: string; } interface RunDetails { failedExpectations: ExpectationResult[]; - order: jasmine.Order + order: jasmine.Order; } interface CustomReporter { @@ -414,9 +429,7 @@ declare namespace jasmine { results(): NestedResults; } - interface SpecFunction { - (spec?: Spec): void; - } + type SpecFunction = (spec?: Spec) => void; interface SuiteOrSpec { id: number; @@ -435,7 +448,7 @@ declare namespace jasmine { spies_: Spy[]; results_: NestedResults; - matchersClass: Matchers; + matchersClass: Matchers; getFullName(): string; results(): NestedResults; @@ -448,7 +461,7 @@ declare namespace jasmine { waits(timeout: number): Spec; waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; fail(e?: any): void; - getMatchersClass_(): Matchers; + getMatchersClass_(): Matchers; addMatchers(matchersPrototype: CustomMatcherFactories): void; finishCallback(): void; finish(onComplete?: () => void): void; @@ -497,7 +510,7 @@ declare namespace jasmine { identity: string; and: SpyAnd; calls: Calls; - mostRecentCall: { args: any[]; }; + mostRecentCall: {args: any[]; }; argsForCall: any[]; } @@ -558,7 +571,7 @@ declare namespace jasmine { finished: boolean; result: any; messages: any; - runDetails: RunDetails + runDetails: RunDetails; new (): any; diff --git a/jasmine/jasmine-tests.ts b/types/jasmine/jasmine-tests.ts similarity index 61% rename from jasmine/jasmine-tests.ts rename to types/jasmine/jasmine-tests.ts index 4632eb8b4c..1c9d5366e1 100644 --- a/jasmine/jasmine-tests.ts +++ b/types/jasmine/jasmine-tests.ts @@ -1,34 +1,34 @@ // tests based on http://jasmine.github.io/2.2/introduction.html -describe("A suite", function () { - it("contains spec with an expectation", function () { +describe("A suite", () => { + it("contains spec with an expectation", () => { expect(true).toBe(true); }); }); -describe("A suite is just a function", function () { +describe("A suite is just a function", () => { var a: boolean; - it("and so is a spec", function () { + it("and so is a spec", () => { a = true; expect(a).toBe(true); }); }); -describe("The 'toBe' matcher compares with ===", function () { +describe("The 'toBe' matcher compares with ===", () => { - it("and has a positive case", function () { + it("and has a positive case", () => { expect(true).toBe(true); }); - it("and can have a negative case", function () { + it("and can have a negative case", () => { expect(false).not.toBe(true); }); }); -describe("Included matchers:", function () { +describe("Included matchers:", () => { - it("The 'toBe' matcher compares with ===", function () { + it("The 'toBe' matcher compares with ===", () => { var a = 12; var b = a; @@ -36,14 +36,14 @@ describe("Included matchers:", function () { expect(a).not.toBe(null); }); - describe("The 'toEqual' matcher", function () { + describe("The 'toEqual' matcher", () => { - it("works for simple literals and variables", function () { + it("works for simple literals and variables", () => { var a = 12; expect(a).toEqual(12); }); - it("should work for objects", function () { + it("should work for objects", () => { var foo = { a: 12, b: 34 @@ -56,7 +56,7 @@ describe("Included matchers:", function () { }); }); - it("The 'toMatch' matcher is for regular expressions", function () { + it("The 'toMatch' matcher is for regular expressions", () => { var message = "foo bar baz"; expect(message).toMatch(/bar/); @@ -64,25 +64,25 @@ describe("Included matchers:", function () { expect(message).not.toMatch(/quux/); }); - it("The 'toBeDefined' matcher compares against `undefined`", function () { + it("The 'toBeDefined' matcher compares against `undefined`", () => { var a = { foo: "foo" }; expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); + expect((a as any).bar).not.toBeDefined(); }); - it("The `toBeUndefined` matcher compares against `undefined`", function () { + it("The `toBeUndefined` matcher compares against `undefined`", () => { var a = { foo: "foo" }; expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); + expect((a as any).bar).toBeUndefined(); }); - it("The 'toBeNull' matcher compares against null", function () { + it("The 'toBeNull' matcher compares against null", () => { var a: string = null; var foo = "foo"; @@ -91,28 +91,28 @@ describe("Included matchers:", function () { expect(foo).not.toBeNull(); }); - it("The 'toBeTruthy' matcher is for boolean casting testing", function () { + 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", function () { + 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", function () { + it("The 'toContain' matcher is for finding an item in an Array", () => { var a = ["foo", "bar", "baz"]; - expect(a).toContain("bar"); + expect(a).toContain('foo'); expect(a).not.toContain("quux"); }); - it("The 'toBeLessThan' matcher is for mathematical comparisons", function () { + it("The 'toBeLessThan' matcher is for mathematical comparisons", () => { var pi = 3.1415926, e = 2.78; @@ -120,7 +120,7 @@ describe("Included matchers:", function () { expect(pi).not.toBeLessThan(e); }); - it("The 'toBeGreaterThan' is for mathematical comparisons", function () { + it("The 'toBeGreaterThan' is for mathematical comparisons", () => { var pi = 3.1415926, e = 2.78; @@ -128,7 +128,7 @@ describe("Included matchers:", function () { expect(e).not.toBeGreaterThan(pi); }); - it("The 'toBeCloseTo' matcher is for precision math comparison", function () { + it("The 'toBeCloseTo' matcher is for precision math comparison", () => { var pi = 3.1415926, e = 2.78; @@ -136,12 +136,12 @@ describe("Included matchers:", function () { expect(pi).toBeCloseTo(e, 0); }); - it("The 'toThrow' matcher is for testing if a function throws an exception", function () { - var foo = function () { + it("The 'toThrow' matcher is for testing if a function throws an exception", () => { + var foo = () => { return 1 + 2; }; - var bar = function () { - var a: any = undefined; + var bar = () => { + var a: any; return a + 1; }; @@ -149,8 +149,8 @@ describe("Included matchers:", function () { expect(bar).toThrow(); }); - it("The 'toThrowError' matcher is for testing a specific thrown exception", function() { - var foo = function() { + it("The 'toThrowError' matcher is for testing a specific thrown exception", () => { + var foo = () => { throw new TypeError("foo bar baz"); }; @@ -161,15 +161,15 @@ describe("Included matchers:", function () { }); }); -describe("A spec", function () { - it("is just a function, so it can contain any code", function () { +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", function () { + it("can have more than one expectation", () => { var foo = 0; foo += 1; @@ -178,96 +178,96 @@ describe("A spec", function () { }); }); -describe("A spec (with setup and tear-down)", function () { +describe("A spec (with setup and tear-down)", () => { var foo: number; - beforeEach(function () { + beforeEach(() => { foo = 0; foo += 1; }); - afterEach(function () { + afterEach(() => { foo = 0; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", () => { expect(foo).toEqual(1); expect(true).toEqual(true); }); }); -describe("A spec", function () { +describe("A spec", () => { var foo: number; - beforeEach(function () { + beforeEach(() => { foo = 0; foo += 1; }); - afterEach(function () { + afterEach(() => { foo = 0; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", () => { expect(foo).toEqual(1); expect(true).toEqual(true); }); - describe("nested inside a second describe", function () { + describe("nested inside a second describe", () => { var bar: number; - beforeEach(function () { + beforeEach(() => { bar = 1; }); - it("can reference both scopes as needed", function () { + it("can reference both scopes as needed", () => { expect(foo).toEqual(bar); }); }); }); -xdescribe("A spec", function () { +xdescribe("A spec", () => { var foo: number; - beforeEach(function () { + beforeEach(() => { foo = 0; foo += 1; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); }); -describe("Pending specs", function () { +describe("Pending specs", () => { - xit("can be declared 'xit'", function () { + xit("can be declared 'xit'", () => { 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 () { + it("can be declared by calling 'pending' in the spec body", () => { expect(true).toBe(false); pending(); // without reason pending('this is why it is pending'); }); }); -describe("A spy", function () { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -278,29 +278,29 @@ describe("A spy", function () { foo.setBar(456, 'another param'); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", () => { expect(foo.setBar).toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", () => { expect(foo.setBar).toHaveBeenCalledWith(123); expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); }); - it("stops all execution on a function", function () { + it("stops all execution on a function", () => { expect(bar).toBeNull(); }); }); -describe("A spy, when configured to call through", function () { +describe("A spy, when configured to call through", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function () { + getBar: () => { return bar; } }; @@ -311,28 +311,28 @@ describe("A spy, when configured to call through", function () { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(123); }); }); -describe("A spy, when configured to fake a return value", function () { +describe("A spy, when configured to fake a return value", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function () { + getBar: () => { return bar; } }; @@ -343,28 +343,28 @@ describe("A spy, when configured to fake a return value", function () { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(745); }); }); -describe("A spy, when configured to fake a series of return values", function() { +describe("A spy, when configured to fake a series of return values", () => { var foo: any, bar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function(value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -374,36 +374,36 @@ describe("A spy, when configured to fake a series of return values", function() foo.setBar(123); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { foo.getBar(123); expect(foo.getBar).toHaveBeenCalled(); }); - it("should not affect other functions", function() { + it("should not affect other functions", () => { expect(bar).toEqual(123); }); - it("when called multiple times returns the requested values in order", function() { + it("when called multiple times returns the requested values in order", () => { 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 () { +describe("A spy, when configured with an alternate implementation", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function () { + getBar: () => { return bar; } }; - spyOn(foo, "getBar").and.callFake(function () { + spyOn(foo, "getBar").and.callFake(() => { return 1001; }); @@ -411,25 +411,25 @@ describe("A spy, when configured with an alternate implementation", function () fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(1001); }); }); -describe("A spy, when configured to throw a value", function () { +describe("A spy, when configured to throw a value", () => { var foo: any, bar: any; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -437,57 +437,57 @@ describe("A spy, when configured to throw a value", function () { spyOn(foo, "setBar").and.throwError("quux"); }); - it("throws the value", function () { - expect(function () { - foo.setBar(123) - }).toThrowError("quux"); + it("throws the value", () => { + expect(() => { + foo.setBar(123); + }).toThrowError("quux"); }); }); -describe("A spy, when configured with multiple actions", function () { +describe("A spy, when configured with multiple actions", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function () { + getBar: () => { return bar; } }; spyOn(foo, 'getBar').and.callThrough().and.callFake(() => { - this.fakeCalled = true; + this.fakeCalled = true; }); foo.setBar(123); fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(123); }); - it("should have called the fake implementation", function () { + it("should have called the fake implementation", () => { expect(this.fakeCalled).toEqual(true); }); }); -describe("A spy", function () { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -495,7 +495,7 @@ describe("A spy", function () { spyOn(foo, 'setBar').and.callThrough(); }); - it("can call through and then stub in the same spec", function () { + it("can call through and then stub in the same spec", () => { foo.setBar(123); expect(bar).toEqual(123); @@ -507,12 +507,12 @@ describe("A spy", function () { }); }); -describe("A spy", function () { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -520,7 +520,7 @@ describe("A spy", function () { spyOn(foo, 'setBar'); }); - it("tracks if it was called at all", function () { + it("tracks if it was called at all", () => { expect(foo.setBar.calls.any()).toEqual(false); foo.setBar(); @@ -528,7 +528,7 @@ describe("A spy", function () { expect(foo.setBar.calls.any()).toEqual(true); }); - it("tracks the number of times it was called", function () { + it("tracks the number of times it was called", () => { expect(foo.setBar.calls.count()).toEqual(0); foo.setBar(); @@ -537,7 +537,7 @@ describe("A spy", function () { expect(foo.setBar.calls.count()).toEqual(2); }); - it("tracks the arguments of each call", function () { + it("tracks the arguments of each call", () => { foo.setBar(123); foo.setBar(456, "baz"); @@ -545,34 +545,34 @@ describe("A spy", function () { expect(foo.setBar.calls.argsFor(1)).toEqual([456, "baz"]); }); - it("tracks the arguments of all calls", function () { + it("tracks the arguments of all calls", () => { 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 () { + it("can provide the context and arguments to all calls", () => { 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 () { + it("has a shortcut to the most recent call", () => { 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 () { + it("has a shortcut to the first call", () => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined }); }); - it("can be reset", function () { + it("can be reset", () => { foo.setBar(123); foo.setBar(456, "baz"); @@ -584,40 +584,40 @@ describe("A spy", function () { }); }); -describe("A spy, when created manually", function () { +describe("A spy, when created manually", () => { var whatAmI: any; - beforeEach(function () { + beforeEach(() => { whatAmI = jasmine.createSpy('whatAmI'); whatAmI("I", "am", "a", "spy"); }); - it("is named, which helps in error reporting", function () { + it("is named, which helps in error reporting", () => { expect(whatAmI.and.identity()).toEqual('whatAmI'); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", () => { expect(whatAmI).toHaveBeenCalled(); }); - it("tracks its number of calls", function () { + it("tracks its number of calls", () => { expect(whatAmI.calls.count()).toEqual(1); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", () => { expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); }); - it("allows access to the most recent call", function () { + it("allows access to the most recent call", () => { expect(whatAmI.calls.mostRecent().args[0]).toEqual("I"); }); }); -describe("Multiple spies, when created manually", function () { +describe("Multiple spies, when created manually", () => { var tape: any; - beforeEach(function () { + beforeEach(() => { tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); tape.play(); @@ -625,35 +625,35 @@ describe("Multiple spies, when created manually", function () { tape.rewind(0); }); - it("creates spies for each requested function", function () { + 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", function () { + 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", function () { + it("tracks all the arguments of its calls", () => { expect(tape.rewind).toHaveBeenCalledWith(0); }); }); -describe("jasmine.any", function () { - it("matches any value", function () { +describe("jasmine.any", () => { + it("matches any value", () => { 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 () { + describe("when used with a spy", () => { + it("is useful for comparing arguments", () => { var foo = jasmine.createSpy('foo'); - foo(12, function () { + foo(12, () => { return true; }); @@ -662,10 +662,15 @@ describe("jasmine.any", function () { }); }); -describe("jasmine.objectContaining", function () { - var foo: any; +describe("jasmine.objectContaining", () => { + interface fooType { + a: number; + b: number; + bar: string; + } + var foo: fooType; - beforeEach(function () { + beforeEach(() => { foo = { a: 1, b: 2, @@ -673,17 +678,25 @@ describe("jasmine.objectContaining", function () { }; }); - it("matches objects with the expect key/value pairs", function () { - expect(foo).toEqual(jasmine.objectContaining({ - bar: "baz" - })); + it("matches objects with the expect key/value pairs", () => { + // not explictly providing the type on objectContaining only guards against + // missmatching types on know properties expect(foo).not.toEqual(jasmine.objectContaining({ - c: 37 + a: 37, + foo: 2, // <-- this does not cause an error as the compiler cannot infer the type completely + // b: '123', <-- this would cause an error as `b` defined as number in fooType + })); + + // explictly providing the type on objectContaining makes the guard more precise + // as misspelled properties are detected as well + expect(foo).not.toEqual(jasmine.objectContaining({ + bar: '', + // foo: 1, <-- this would cause an error as `foo` is not defined in fooType })); }); - describe("when used with a spy", function () { - it("is useful for comparing arguments", function () { + describe("when used with a spy", () => { + it("is useful for comparing arguments", () => { var callback = jasmine.createSpy('callback'); callback({ @@ -700,44 +713,44 @@ describe("jasmine.objectContaining", function () { }); }); -describe("jasmine.arrayContaining", function() { - var foo: any; +describe("jasmine.arrayContaining", () => { + var foo: any; - beforeEach(function() { - foo = [1, 2, 3, 4]; - }); + beforeEach(() => { + 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])); - }); + it("matches arrays with some of the values", () => { + 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'); + describe("when used with a spy", () => { + it("is useful when comparing arguments", () => { + var callback = jasmine.createSpy('callback'); - callback([1, 2, 3, 4]); + callback([1, 2, 3, 4]); - expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3])); - expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2])); + expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3])); + expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2])); + }); }); - }); }); -describe("Manually ticking the Jasmine Clock", function () { +describe("Manually ticking the Jasmine Clock", () => { var timerCallback: any; - beforeEach(function () { + beforeEach(() => { timerCallback = jasmine.createSpy("timerCallback"); jasmine.clock().install(); }); - afterEach(function () { + afterEach(() => { jasmine.clock().uninstall(); }); - it("causes a timeout to be called synchronously", function () { - setTimeout(function () { + it("causes a timeout to be called synchronously", () => { + setTimeout(() => { timerCallback(); }, 100); @@ -748,8 +761,8 @@ describe("Manually ticking the Jasmine Clock", function () { expect(timerCallback).toHaveBeenCalled(); }); - it("causes an interval to be called synchronously", function () { - setInterval(function () { + it("causes an interval to be called synchronously", () => { + setInterval(() => { timerCallback(); }, 100); @@ -765,8 +778,8 @@ describe("Manually ticking the Jasmine Clock", function () { 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() { + describe("Mocking the Date object", () => { + it("mocks the Date object and sets it to a given time", () => { var baseTime = new Date(2013, 9, 23); jasmine.clock().mockDate(baseTime); @@ -777,82 +790,82 @@ describe("Manually ticking the Jasmine Clock", function () { }); }); -describe("Asynchronous specs", function () { +describe("Asynchronous specs", () => { var value: number; - beforeEach(function (done: DoneFn) { - setTimeout(function () { + beforeEach((done: DoneFn) => { + setTimeout(() => { value = 0; done(); }, 1); }); - it("should support async execution of test preparation and expectations", function (done: DoneFn) { + it("should support async execution of test preparation and expectations", (done: DoneFn) => { value++; expect(value).toBeGreaterThan(0); done(); }); - describe("long asynchronous specs", function() { - beforeEach(function(done: DoneFn) { - done(); + describe("long asynchronous specs", () => { + beforeEach((done: DoneFn) => { + done(); }, 1000); - it("takes a long time", function(done: DoneFn) { - setTimeout(function() { - done(); - }, 9000); + it("takes a long time", (done: DoneFn) => { + setTimeout(() => { + done(); + }, 9000); }, 10000); - afterEach(function(done: DoneFn) { - done(); + afterEach((done: DoneFn) => { + done(); }, 1000); }); }); -describe("Fail", function () { +describe("Fail", () => { - it("should fail test when called without arguments", function () { - fail(); - }); + it("should fail test when called without arguments", () => { + fail(); + }); - it("should fail test when called with a fail message", function () { - fail("The test failed"); - }); + it("should fail test when called with a fail message", () => { + fail("The test failed"); + }); - it("should fail test when called an error", function () { - fail(new Error("The test failed with this error")); - }); + it("should fail test when called an error", () => { + 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() { +describe("custom equality", () => { var myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean { - if (typeof first == "string" && typeof second == "string") { - return first[0] == second[1]; + if (typeof first === "string" && typeof second === "string") { + return first[0] === second[1]; } }; - beforeEach(function() { + beforeEach(() => { jasmine.addCustomEqualityTester(myCustomEquality); }); - it("should be custom equal", function() { + it("should be custom equal", () => { expect("abc").toEqual("aaa"); }); - it("should be custom not equal", function() { + it("should be custom not equal", () => { 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) { + toBeGoofy: (util: jasmine.MatchersUtil, customEqualityTesters: jasmine.CustomEqualityTester[]) => { return { - compare: function (actual: any, expected: any): jasmine.CustomMatcherResult { + compare: (actual: any, expected: any): jasmine.CustomMatcherResult => { if (expected === undefined) { expected = ''; } @@ -881,29 +894,29 @@ var customMatchers: jasmine.CustomMatcherFactories = { // } // } declare namespace jasmine { - interface Matchers { - toBeGoofy(expected?: any): boolean; + interface Matchers { + toBeGoofy(expected?: jasmine.Expected): boolean; } } -describe("Custom matcher: 'toBeGoofy'", function () { - beforeEach(function () { +describe("Custom matcher: 'toBeGoofy'", () => { + beforeEach(() => { jasmine.addMatchers(customMatchers); }); - it("is available on an expectation", function () { + it("is available on an expectation", () => { expect({ hyuk: 'gawrsh' }).toBeGoofy(); }); - it("can take an 'expected' parameter", function () { + it("can take an 'expected' parameter", () => { expect({ hyuk: 'gawrsh is fun' - }).toBeGoofy(' is fun'); + }).toBeGoofy({ hyuk: ' is fun' }); }); - it("can be negated", function () { + it("can be negated", () => { expect({ hyuk: 'this is fun' }).not.toBeGoofy(); @@ -912,20 +925,21 @@ describe("Custom matcher: 'toBeGoofy'", function () { // test based on http://jasmine.github.io/2.5/custom_reporter.html var myReporter: jasmine.CustomReporter = { - jasmineStarted: function (suiteInfo: jasmine.SuiteInfo ) { + jasmineStarted: (suiteInfo: jasmine.SuiteInfo) => { console.log("Running suite with " + suiteInfo.totalSpecsDefined); }, - suiteStarted: function (result: jasmine.CustomReporterResult) { + suiteStarted: (result: jasmine.CustomReporterResult) => { console.log("Suite started: " + result.description + " whose full description is: " + result.fullName); }, - specStarted: function (result: jasmine.CustomReporterResult) { + specStarted: (result: jasmine.CustomReporterResult) => { console.log("Spec started: " + result.description + " whose full description is: " + result.fullName); }, - specDone: function (result: jasmine.CustomReporterResult) { + specDone: (result: jasmine.CustomReporterResult) => { console.log("Spec: " + result.description + " was " + result.status); + //tslint:disable-next-line:prefer-for-of for (var i = 0; i < result.failedExpectations.length; i++) { console.log("Failure: " + result.failedExpectations[i].message); console.log("Actual: " + result.failedExpectations[i].actual); @@ -935,15 +949,16 @@ var myReporter: jasmine.CustomReporter = { console.log(result.passedExpectations.length); }, - suiteDone: function (result: jasmine.CustomReporterResult) { + suiteDone: (result: jasmine.CustomReporterResult) => { console.log('Suite: ' + result.description + ' was ' + result.status); + //tslint:disable-next-line:prefer-for-of 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) { + jasmineDone: (runDetails: jasmine.RunDetails) => { console.log('Finished suite'); console.log('Random:', runDetails.order.random); } @@ -951,21 +966,21 @@ var myReporter: jasmine.CustomReporter = { 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(); - }); +describe("Randomize Tests", () => { + it("should allow randomization of the order of tests", () => { + expect(() => { + 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(); - }); + it("should allow a seed to be passed in for randomization", () => { + expect(() => { + var env = jasmine.getEnv(); + env.randomizeTests(true); + return env.seed(1234); + }).not.toThrow(); + }); }); (() => { @@ -976,14 +991,14 @@ describe("Randomize Tests", function() { env.addReporter(htmlReporter); var specFilter = new jasmine.HtmlSpecFilter(); - env.specFilter = function (spec) { + env.specFilter = (spec) => { return specFilter.matches(spec.getFullName()); }; var currentWindowOnload = window.onload; - window.onload = function () { + window.onload = () => { if (currentWindowOnload) { - (currentWindowOnload)(null); + (currentWindowOnload as any)(null); } htmlReporter.initialize(); env.execute(); diff --git a/jasmine/tsconfig.json b/types/jasmine/tsconfig.json similarity index 100% rename from jasmine/tsconfig.json rename to types/jasmine/tsconfig.json diff --git a/jasmine/v1/index.d.ts b/types/jasmine/v1/index.d.ts similarity index 96% rename from jasmine/v1/index.d.ts rename to types/jasmine/v1/index.d.ts index 5cbb2a9f83..3f51240f63 100644 --- a/jasmine/v1/index.d.ts +++ b/types/jasmine/v1/index.d.ts @@ -16,9 +16,9 @@ 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 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; @@ -91,7 +91,7 @@ declare namespace jasmine { currentSpec: Spec; - matchersClass: Matchers; + matchersClass: Matchers; version(): any; versionString(): string; @@ -204,7 +204,7 @@ declare namespace jasmine { results(): NestedResults; } - interface Matchers { + interface Matchers { new (env: Env, actual: any, spec: Env, isNot?: boolean): any; @@ -232,7 +232,7 @@ declare namespace jasmine { toContainHtml(expected: string): boolean; toContainText(expected: string): boolean; toThrow(expected?: any): boolean; - not: Matchers; + not: Matchers; Any: Any; } @@ -287,7 +287,7 @@ declare namespace jasmine { spies_: Spy[]; results_: NestedResults; - matchersClass: Matchers; + matchersClass: Matchers; getFullName(): string; results(): NestedResults; @@ -299,7 +299,7 @@ declare namespace jasmine { waits(timeout: number): Spec; waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; fail(e?: any): void; - getMatchersClass_(): Matchers; + getMatchersClass_(): Matchers; addMatchers(matchersPrototype: any): void; finishCallback(): void; finish(onComplete?: () => void): void; diff --git a/jasmine/v1/jasmine-tests.ts b/types/jasmine/v1/jasmine-tests.ts similarity index 96% rename from jasmine/v1/jasmine-tests.ts rename to types/jasmine/v1/jasmine-tests.ts index 9177679f8a..c47fc84007 100644 --- a/jasmine/v1/jasmine-tests.ts +++ b/types/jasmine/v1/jasmine-tests.ts @@ -60,7 +60,7 @@ describe("Included matchers:", () => { foo: 'foo' }; expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); + expect((a as any).bar).not.toBeDefined(); }); it("The `toBeUndefined` matcher compares against `undefined`", () => { @@ -68,7 +68,7 @@ describe("Included matchers:", () => { foo: 'foo' }; expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); + expect((a as any).bar).toBeUndefined(); }); it("The 'toBeNull' matcher compares against null", () => { @@ -202,7 +202,7 @@ describe("A spy", () => { var foo: any, bar: any = null; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -235,7 +235,7 @@ describe("A spy, when configured to call through", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -261,7 +261,7 @@ describe("A spy, when faking a return value", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -287,7 +287,7 @@ describe("A spy, when faking a return value", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -319,7 +319,7 @@ describe("A spy, when created manually", () => { whatAmI("I", "am", "a", "spy"); }); it("is named, which helps in error reporting", () => { - expect(whatAmI.identity).toEqual('whatAmI') + expect(whatAmI.identity).toEqual('whatAmI'); }); it("tracks that the spy was called", () => { expect(whatAmI).toHaveBeenCalled(); @@ -369,7 +369,7 @@ describe("jasmine.any", () => { it("is useful for comparing arguments", () => { var foo = jasmine.createSpy('foo'); foo(12, () => { - return true + return true; }); expect(foo).toHaveBeenCalledWith(jasmine.any(Number), jasmine.any(Function)); }); @@ -430,7 +430,7 @@ describe("Asynchronous specs", () => { jasmineEnv.updateInterval = 250; var htmlReporter = new jasmine.HtmlReporter(); jasmineEnv.addReporter(htmlReporter); - jasmineEnv.specFilter = function (spec) { + jasmineEnv.specFilter = (spec) => { return htmlReporter.specFilter(spec); }; var currentWindowOnload = (arg: any) => window.onload(arg); @@ -439,11 +439,11 @@ describe("Asynchronous specs", () => { currentWindowOnload(null); } - (document.querySelector('.version')).innerHTML = jasmineEnv.versionString(); + (document.querySelector('.version') as HTMLElement).innerHTML = jasmineEnv.versionString(); execJasmine(); }; function execJasmine() { jasmineEnv.execute(); } -})(); \ No newline at end of file +})(); diff --git a/jasmine/v1/tsconfig.json b/types/jasmine/v1/tsconfig.json similarity index 100% rename from jasmine/v1/tsconfig.json rename to types/jasmine/v1/tsconfig.json diff --git a/jasminewd2/index.d.ts b/types/jasminewd2/index.d.ts similarity index 81% rename from jasminewd2/index.d.ts rename to types/jasminewd2/index.d.ts index 9d8ecde76e..3b8760709c 100644 --- a/jasminewd2/index.d.ts +++ b/types/jasminewd2/index.d.ts @@ -17,10 +17,10 @@ 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; + then(onFulfill?: (value: T) => U | Promise, onReject?: (error: any) => U | Promise): Promise; } - interface Matchers { + interface Matchers { toBe(expected: any, expectationFailOutput?: any): Promise; toEqual(expected: any, expectationFailOutput?: any): Promise; toMatch(expected: string | RegExp | Promise, expectationFailOutput?: any): Promise; @@ -44,6 +44,13 @@ declare namespace jasmine { toThrowError(expected?: new (...args: any[]) => Error | Promise Error>, message?: string | RegExp | Promise): Promise; } + interface ArrayLikeMatchers extends Matchers> { + toBe(expected: Expected>, expectationFailOutput?: any): Promise; + toEqual(expected: Expected>, expectationFailOutput?: any): Promise; + toContain(expected: T, expectationFailOutput?: any): Promise; + not: ArrayLikeMatchers; + } + function addMatchers(matchers: AsyncCustomMatcherFactories): void; interface Env { @@ -59,12 +66,12 @@ declare namespace jasmine { } interface AsyncCustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher; + (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher; } interface AsyncCustomMatcher { - compare(actual: T, expected: T): AsyncCustomMatcherResult; - compare(actual: any, expected: any): AsyncCustomMatcherResult; + compare(actual: T, expected: T): AsyncCustomMatcherResult; + compare(actual: any, expected: any): AsyncCustomMatcherResult; } interface AsyncCustomMatcherResult { diff --git a/jasminewd2/jasminewd2-tests.ts b/types/jasminewd2/jasminewd2-tests.ts similarity index 100% rename from jasminewd2/jasminewd2-tests.ts rename to types/jasminewd2/jasminewd2-tests.ts diff --git a/jasminewd2/tsconfig.json b/types/jasminewd2/tsconfig.json similarity index 100% rename from jasminewd2/tsconfig.json rename to types/jasminewd2/tsconfig.json diff --git a/jasminewd2/tslint.json b/types/jasminewd2/tslint.json similarity index 100% rename from jasminewd2/tslint.json rename to types/jasminewd2/tslint.json diff --git a/java-applet/index.d.ts b/types/java-applet/index.d.ts similarity index 100% rename from java-applet/index.d.ts rename to types/java-applet/index.d.ts diff --git a/java-applet/java-applet-tests.ts b/types/java-applet/java-applet-tests.ts similarity index 100% rename from java-applet/java-applet-tests.ts rename to types/java-applet/java-applet-tests.ts diff --git a/java-applet/tsconfig.json b/types/java-applet/tsconfig.json similarity index 100% rename from java-applet/tsconfig.json rename to types/java-applet/tsconfig.json diff --git a/java/index.d.ts b/types/java/index.d.ts similarity index 100% rename from java/index.d.ts rename to types/java/index.d.ts diff --git a/java/java-tests.ts b/types/java/java-tests.ts similarity index 100% rename from java/java-tests.ts rename to types/java/java-tests.ts diff --git a/java/tsconfig.json b/types/java/tsconfig.json similarity index 100% rename from java/tsconfig.json rename to types/java/tsconfig.json diff --git a/javascript-astar/index.d.ts b/types/javascript-astar/index.d.ts similarity index 100% rename from javascript-astar/index.d.ts rename to types/javascript-astar/index.d.ts diff --git a/javascript-astar/javascript-astar-tests.ts b/types/javascript-astar/javascript-astar-tests.ts similarity index 100% rename from javascript-astar/javascript-astar-tests.ts rename to types/javascript-astar/javascript-astar-tests.ts diff --git a/javascript-astar/tsconfig.json b/types/javascript-astar/tsconfig.json similarity index 100% rename from javascript-astar/tsconfig.json rename to types/javascript-astar/tsconfig.json diff --git a/javascript-bignum/index.d.ts b/types/javascript-bignum/index.d.ts similarity index 100% rename from javascript-bignum/index.d.ts rename to types/javascript-bignum/index.d.ts diff --git a/javascript-bignum/javascript-bignum-tests.ts b/types/javascript-bignum/javascript-bignum-tests.ts similarity index 100% rename from javascript-bignum/javascript-bignum-tests.ts rename to types/javascript-bignum/javascript-bignum-tests.ts diff --git a/javascript-bignum/tsconfig.json b/types/javascript-bignum/tsconfig.json similarity index 100% rename from javascript-bignum/tsconfig.json rename to types/javascript-bignum/tsconfig.json diff --git a/javascript-obfuscator/index.d.ts b/types/javascript-obfuscator/index.d.ts similarity index 100% rename from javascript-obfuscator/index.d.ts rename to types/javascript-obfuscator/index.d.ts diff --git a/javascript-obfuscator/javascript-obfuscator-tests.ts b/types/javascript-obfuscator/javascript-obfuscator-tests.ts similarity index 100% rename from javascript-obfuscator/javascript-obfuscator-tests.ts rename to types/javascript-obfuscator/javascript-obfuscator-tests.ts diff --git a/javascript-obfuscator/tsconfig.json b/types/javascript-obfuscator/tsconfig.json similarity index 100% rename from javascript-obfuscator/tsconfig.json rename to types/javascript-obfuscator/tsconfig.json diff --git a/jbinary/index.d.ts b/types/jbinary/index.d.ts similarity index 100% rename from jbinary/index.d.ts rename to types/jbinary/index.d.ts diff --git a/jbinary/jbinary-tests.ts b/types/jbinary/jbinary-tests.ts similarity index 100% rename from jbinary/jbinary-tests.ts rename to types/jbinary/jbinary-tests.ts diff --git a/jbinary/tsconfig.json b/types/jbinary/tsconfig.json similarity index 100% rename from jbinary/tsconfig.json rename to types/jbinary/tsconfig.json diff --git a/jcanvas/index.d.ts b/types/jcanvas/index.d.ts similarity index 100% rename from jcanvas/index.d.ts rename to types/jcanvas/index.d.ts diff --git a/jcanvas/jcanvas-tests.ts b/types/jcanvas/jcanvas-tests.ts similarity index 100% rename from jcanvas/jcanvas-tests.ts rename to types/jcanvas/jcanvas-tests.ts diff --git a/jcanvas/tsconfig.json b/types/jcanvas/tsconfig.json similarity index 100% rename from jcanvas/tsconfig.json rename to types/jcanvas/tsconfig.json diff --git a/jdataview/index.d.ts b/types/jdataview/index.d.ts similarity index 100% rename from jdataview/index.d.ts rename to types/jdataview/index.d.ts diff --git a/jdataview/jdataview-tests.ts b/types/jdataview/jdataview-tests.ts similarity index 100% rename from jdataview/jdataview-tests.ts rename to types/jdataview/jdataview-tests.ts diff --git a/jdataview/tsconfig.json b/types/jdataview/tsconfig.json similarity index 100% rename from jdataview/tsconfig.json rename to types/jdataview/tsconfig.json diff --git a/jdenticon/index.d.ts b/types/jdenticon/index.d.ts similarity index 100% rename from jdenticon/index.d.ts rename to types/jdenticon/index.d.ts diff --git a/jdenticon/jdenticon-tests.ts b/types/jdenticon/jdenticon-tests.ts similarity index 100% rename from jdenticon/jdenticon-tests.ts rename to types/jdenticon/jdenticon-tests.ts diff --git a/jdenticon/tsconfig.json b/types/jdenticon/tsconfig.json similarity index 100% rename from jdenticon/tsconfig.json rename to types/jdenticon/tsconfig.json diff --git a/jee-jsf/index.d.ts b/types/jee-jsf/index.d.ts similarity index 100% rename from jee-jsf/index.d.ts rename to types/jee-jsf/index.d.ts diff --git a/jee-jsf/jee-jsf-tests.ts b/types/jee-jsf/jee-jsf-tests.ts similarity index 100% rename from jee-jsf/jee-jsf-tests.ts rename to types/jee-jsf/jee-jsf-tests.ts diff --git a/jee-jsf/tsconfig.json b/types/jee-jsf/tsconfig.json similarity index 100% rename from jee-jsf/tsconfig.json rename to types/jee-jsf/tsconfig.json diff --git a/jenkins/index.d.ts b/types/jenkins/index.d.ts similarity index 99% rename from jenkins/index.d.ts rename to types/jenkins/index.d.ts index 5db91893a6..027cc8e0cf 100644 --- a/jenkins/index.d.ts +++ b/types/jenkins/index.d.ts @@ -65,7 +65,7 @@ declare namespace create { }; } - export interface JenkinsPromisifiedAPI { + interface JenkinsPromisifiedAPI { info(): Promise; build: { get(name: string, n: number): Promise; diff --git a/jenkins/jenkins-tests.ts b/types/jenkins/jenkins-tests.ts similarity index 96% rename from jenkins/jenkins-tests.ts rename to types/jenkins/jenkins-tests.ts index 0b409a4b87..98b30d4b73 100644 --- a/jenkins/jenkins-tests.ts +++ b/types/jenkins/jenkins-tests.ts @@ -20,7 +20,7 @@ jenkins.build.log('example', 1, (err, data) => { console.log('log', data); }); -var log = jenkins.build.logStream('example', 1); +const log = jenkins.build.logStream('example', 1); log.on('data', (text: string) => { process.stdout.write(text); @@ -202,4 +202,4 @@ jenkins.view.remove('example', 'jobExample', (err) => { const jenkins2 = J({ baseUrl: 'http://user:pass@localhost:8080', crumbIssuer: true, promisify: true }); jenkins2.info().then(info => console.log(info)); -jenkins2.job.exists('example').then(exists => { var b: boolean = exists; }); +jenkins2.job.exists('example').then(exists => { const b: boolean = exists; }); diff --git a/jenkins/tsconfig.json b/types/jenkins/tsconfig.json similarity index 100% rename from jenkins/tsconfig.json rename to types/jenkins/tsconfig.json diff --git a/js-quantities/tslint.json b/types/jenkins/tslint.json similarity index 100% rename from js-quantities/tslint.json rename to types/jenkins/tslint.json diff --git a/jest/index.d.ts b/types/jest/index.d.ts similarity index 97% rename from jest/index.d.ts rename to types/jest/index.d.ts index 4129dcc846..595a42ea2b 100644 --- a/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Jest 19.2.0 // Project: http://facebook.github.io/jest/ -// Definitions by: Asana , Ivo Stratev , jwbay , Alexey Svetliakov +// Definitions by: Asana , Ivo Stratev , jwbay , Alexey Svetliakov , Alex Jover Morales // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -77,6 +77,8 @@ declare namespace jest { 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; + /** Creates a mock function similar to jest.fn but also tracks calls to object[methodName] */ + function spyOn(object: T, method: M): SpyInstance; /** 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. */ @@ -158,19 +160,19 @@ declare namespace jest { * @param {any} actual The value to apply matchers against. */ (actual: any): Matchers; - anything(): void; + anything(): any; /** 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; + any(classType: any): any; /** 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; + arrayContaining(arr: any[]): any; /** 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; + objectContaining(obj: {}): any; /** Matches any string that contains the exact provided string */ - stringMatching(str: string | RegExp): void; + stringMatching(str: string | RegExp): any; } interface Matchers { @@ -245,6 +247,10 @@ declare namespace jest { (...args: any[]): any; } + interface SpyInstance extends MockInstance { + mockRestore(): void; + } + /** * Wrap module with mock definitions * @example diff --git a/jest/jest-tests.ts b/types/jest/jest-tests.ts similarity index 97% rename from jest/jest-tests.ts rename to types/jest/jest-tests.ts index 6cfff857eb..d951153842 100644 --- a/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -203,6 +203,19 @@ describe('Assymetric matchers', function () { })); expect.assertions(4); + + interface Test { + a: number; + b: string; + } + + // It's useful to create expected objects before the test call for refactoring purposes + // Assymetric matchers must return any in this case to constrain the required type + const test: Test = { + a: expect.any(Number), + b: expect.anything() + } + expect(callback).toHaveBeenCalledWith(test); }); }); diff --git a/jest/tsconfig.json b/types/jest/tsconfig.json similarity index 100% rename from jest/tsconfig.json rename to types/jest/tsconfig.json diff --git a/jest/v16/index.d.ts b/types/jest/v16/index.d.ts similarity index 100% rename from jest/v16/index.d.ts rename to types/jest/v16/index.d.ts diff --git a/jest/v16/jest-tests.ts b/types/jest/v16/jest-tests.ts similarity index 100% rename from jest/v16/jest-tests.ts rename to types/jest/v16/jest-tests.ts diff --git a/jest/v16/tsconfig.json b/types/jest/v16/tsconfig.json similarity index 100% rename from jest/v16/tsconfig.json rename to types/jest/v16/tsconfig.json diff --git a/jfp/index.d.ts b/types/jfp/index.d.ts similarity index 100% rename from jfp/index.d.ts rename to types/jfp/index.d.ts diff --git a/jfp/jfp-tests.ts b/types/jfp/jfp-tests.ts similarity index 100% rename from jfp/jfp-tests.ts rename to types/jfp/jfp-tests.ts diff --git a/jfp/tsconfig.json b/types/jfp/tsconfig.json similarity index 100% rename from jfp/tsconfig.json rename to types/jfp/tsconfig.json diff --git a/jfs/index.d.ts b/types/jfs/index.d.ts similarity index 90% rename from jfs/index.d.ts rename to types/jfs/index.d.ts index ba6edb26bc..8383f58981 100644 --- a/jfs/index.d.ts +++ b/types/jfs/index.d.ts @@ -7,21 +7,21 @@ declare const JsonFileStore: JsonFileStore.JsonFileStore; declare namespace JsonFileStore { - export interface Storable { + interface Storable { [key: string]: any; } - export interface Options { + interface Options { type?: 'single' | 'memory'; pretty?: boolean; saveId?: boolean | string; } - export interface JsonFileStore { + interface JsonFileStore { new (name?: string, opts?: Options): Instance; } - export interface Instance { + interface Instance { save(id: K, o: V, cb?: (err?: Error, id?: K) => void): void; save(o: V, cb?: (err?: Error, id?: string) => void): void; diff --git a/jfs/jfs-tests.ts b/types/jfs/jfs-tests.ts similarity index 96% rename from jfs/jfs-tests.ts rename to types/jfs/jfs-tests.ts index d53d1305a2..e736e3b668 100644 --- a/jfs/jfs-tests.ts +++ b/types/jfs/jfs-tests.ts @@ -33,7 +33,7 @@ db.all((err, objs) => { }); // get all synchronously -var objs = db.allSync(); +const objs = db.allSync(); // delete by ID db.delete('foo', err => { diff --git a/jfs/tsconfig.json b/types/jfs/tsconfig.json similarity index 100% rename from jfs/tsconfig.json rename to types/jfs/tsconfig.json diff --git a/json-stable-stringify/tslint.json b/types/jfs/tslint.json similarity index 100% rename from json-stable-stringify/tslint.json rename to types/jfs/tslint.json diff --git a/jimp/index.d.ts b/types/jimp/index.d.ts similarity index 100% rename from jimp/index.d.ts rename to types/jimp/index.d.ts diff --git a/jimp/jimp-tests.ts b/types/jimp/jimp-tests.ts similarity index 100% rename from jimp/jimp-tests.ts rename to types/jimp/jimp-tests.ts diff --git a/jimp/tsconfig.json b/types/jimp/tsconfig.json similarity index 100% rename from jimp/tsconfig.json rename to types/jimp/tsconfig.json diff --git a/jsonrpc-serializer/tslint.json b/types/jimp/tslint.json similarity index 100% rename from jsonrpc-serializer/tslint.json rename to types/jimp/tslint.json diff --git a/jjv/index.d.ts b/types/jjv/index.d.ts similarity index 100% rename from jjv/index.d.ts rename to types/jjv/index.d.ts diff --git a/jjv/jjv-tests.ts b/types/jjv/jjv-tests.ts similarity index 100% rename from jjv/jjv-tests.ts rename to types/jjv/jjv-tests.ts diff --git a/jjv/tsconfig.json b/types/jjv/tsconfig.json similarity index 100% rename from jjv/tsconfig.json rename to types/jjv/tsconfig.json diff --git a/jjve/index.d.ts b/types/jjve/index.d.ts similarity index 100% rename from jjve/index.d.ts rename to types/jjve/index.d.ts diff --git a/jjve/jjve-tests.ts b/types/jjve/jjve-tests.ts similarity index 100% rename from jjve/jjve-tests.ts rename to types/jjve/jjve-tests.ts diff --git a/jjve/tsconfig.json b/types/jjve/tsconfig.json similarity index 100% rename from jjve/tsconfig.json rename to types/jjve/tsconfig.json diff --git a/types/jmespath/index.d.ts b/types/jmespath/index.d.ts new file mode 100644 index 0000000000..a460fd6a4d --- /dev/null +++ b/types/jmespath/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for jmespath 0.15 +// Project: https://github.com/jmespath/jmespath.js +// Definitions by: Jeffery Grajkowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Take a JSON document and transform it into another JSON document + * through a JMESPath expression. See: http://jmespath.org/ + * @param jsonDoc the document to transform + * @param query a JMESPath expression + * @return the transformed document + */ +export function search(jsonDoc: any, query: string): any; diff --git a/types/jmespath/jmespath-tests.ts b/types/jmespath/jmespath-tests.ts new file mode 100644 index 0000000000..b254a503b4 --- /dev/null +++ b/types/jmespath/jmespath-tests.ts @@ -0,0 +1,6 @@ +import jmespath = require("jmespath"); + +const a = jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar.baz[2]"); +const b = jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar"); +const c = jmespath.search({foo: [{first: "a", last: "b"}, {first: "c", last: "d"}]}, "foo[*].first"); +const d = jmespath.search({foo: [{age: 20}, {age: 25}, {age: 30}, {age: 35}, {age: 40}]}, "foo[?age > `30`]"); diff --git a/types/jmespath/tsconfig.json b/types/jmespath/tsconfig.json new file mode 100644 index 0000000000..7db8ecc248 --- /dev/null +++ b/types/jmespath/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", + "jmespath-tests.ts" + ] +} diff --git a/proj4/tslint.json b/types/jmespath/tslint.json similarity index 100% rename from proj4/tslint.json rename to types/jmespath/tslint.json diff --git a/jodata/index.d.ts b/types/jodata/index.d.ts similarity index 100% rename from jodata/index.d.ts rename to types/jodata/index.d.ts diff --git a/jodata/jodata-tests.ts b/types/jodata/jodata-tests.ts similarity index 100% rename from jodata/jodata-tests.ts rename to types/jodata/jodata-tests.ts diff --git a/jodata/tsconfig.json b/types/jodata/tsconfig.json similarity index 100% rename from jodata/tsconfig.json rename to types/jodata/tsconfig.json diff --git a/johnny-five/index.d.ts b/types/johnny-five/index.d.ts similarity index 100% rename from johnny-five/index.d.ts rename to types/johnny-five/index.d.ts diff --git a/johnny-five/johnny-five-tests.ts b/types/johnny-five/johnny-five-tests.ts similarity index 100% rename from johnny-five/johnny-five-tests.ts rename to types/johnny-five/johnny-five-tests.ts diff --git a/johnny-five/tsconfig.json b/types/johnny-five/tsconfig.json similarity index 100% rename from johnny-five/tsconfig.json rename to types/johnny-five/tsconfig.json diff --git a/joi/index.d.ts b/types/joi/index.d.ts similarity index 100% rename from joi/index.d.ts rename to types/joi/index.d.ts diff --git a/joi/joi-tests.ts b/types/joi/joi-tests.ts similarity index 100% rename from joi/joi-tests.ts rename to types/joi/joi-tests.ts diff --git a/joi/tsconfig.json b/types/joi/tsconfig.json similarity index 100% rename from joi/tsconfig.json rename to types/joi/tsconfig.json diff --git a/joi/v6/index.d.ts b/types/joi/v6/index.d.ts similarity index 100% rename from joi/v6/index.d.ts rename to types/joi/v6/index.d.ts diff --git a/joi/v6/joi-tests.ts b/types/joi/v6/joi-tests.ts similarity index 99% rename from joi/v6/joi-tests.ts rename to types/joi/v6/joi-tests.ts index 265bbd045c..03ca5ffac0 100644 --- a/joi/v6/joi-tests.ts +++ b/types/joi/v6/joi-tests.ts @@ -1,4 +1,3 @@ -/// /// import Joi = require('joi'); diff --git a/joi/v6/tsconfig.json b/types/joi/v6/tsconfig.json similarity index 100% rename from joi/v6/tsconfig.json rename to types/joi/v6/tsconfig.json diff --git a/jointjs/README.md b/types/jointjs/README.md similarity index 100% rename from jointjs/README.md rename to types/jointjs/README.md diff --git a/types/jointjs/index.d.ts b/types/jointjs/index.d.ts new file mode 100644 index 0000000000..5ce0f187f0 --- /dev/null +++ b/types/jointjs/index.d.ts @@ -0,0 +1,897 @@ +// 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 + +/// + +import * as Backbone from "backbone"; + +export as namespace joint; + +export var g: any; +export var V: any; + +export 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; + } +} + +export namespace ui { } + +export 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); + } + } +} + +export 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; +} + +export 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; + } + + class DirectedGraph { + static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox; + } +} diff --git a/jointjs/tsconfig.json b/types/jointjs/tsconfig.json similarity index 100% rename from jointjs/tsconfig.json rename to types/jointjs/tsconfig.json diff --git a/jpm/index.d.ts b/types/jpm/index.d.ts similarity index 100% rename from jpm/index.d.ts rename to types/jpm/index.d.ts diff --git a/jpm/jpm-tests.ts b/types/jpm/jpm-tests.ts similarity index 100% rename from jpm/jpm-tests.ts rename to types/jpm/jpm-tests.ts diff --git a/jpm/tsconfig.json b/types/jpm/tsconfig.json similarity index 100% rename from jpm/tsconfig.json rename to types/jpm/tsconfig.json diff --git a/jqgrid/index.d.ts b/types/jqgrid/index.d.ts similarity index 100% rename from jqgrid/index.d.ts rename to types/jqgrid/index.d.ts diff --git a/jqgrid/jqgrid-tests.ts b/types/jqgrid/jqgrid-tests.ts similarity index 95% rename from jqgrid/jqgrid-tests.ts rename to types/jqgrid/jqgrid-tests.ts index 7354f527dc..832a94d909 100644 --- a/jqgrid/jqgrid-tests.ts +++ b/types/jqgrid/jqgrid-tests.ts @@ -2,8 +2,6 @@ // Definitions by: Lokesh Peta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - var mydata: any[] = []; $('#jqGrid') diff --git a/jqgrid/tsconfig.json b/types/jqgrid/tsconfig.json similarity index 100% rename from jqgrid/tsconfig.json rename to types/jqgrid/tsconfig.json diff --git a/jqrangeslider/index.d.ts b/types/jqrangeslider/index.d.ts similarity index 100% rename from jqrangeslider/index.d.ts rename to types/jqrangeslider/index.d.ts diff --git a/jqrangeslider/jqrangeslider-tests.ts b/types/jqrangeslider/jqrangeslider-tests.ts similarity index 98% rename from jqrangeslider/jqrangeslider-tests.ts rename to types/jqrangeslider/jqrangeslider-tests.ts index 1af815806f..cb6b417656 100644 --- a/jqrangeslider/jqrangeslider-tests.ts +++ b/types/jqrangeslider/jqrangeslider-tests.ts @@ -1,5 +1,3 @@ -/// - // Arrows $("#arrowsExample").rangeSlider({ arrows: false }); $("#arrowsExample").editRangeSlider({ arrows: false }); @@ -133,7 +131,7 @@ $("#rulersExample").rangeSlider({ next: function(val){ return val + 10; }, stop: function(val){ return false; }, label: function(val){ return val; }, - format: function(tickContainer, tickStart, tickEnd){ + format: function(tickContainer, tickStart, tickEnd){ tickContainer.addClass("myCustomClass"); } }, @@ -179,7 +177,7 @@ $("#rangeExample").dateRangeSlider({ // Symmetric Positionning $("#symmetricExample").rangeSlider({ symmetricPositionning: true, - range: {min: 0} + range: {min: 0} }); // Type $("#typeExample").editRangeSlider({type: "number"}); diff --git a/jqrangeslider/tsconfig.json b/types/jqrangeslider/tsconfig.json similarity index 100% rename from jqrangeslider/tsconfig.json rename to types/jqrangeslider/tsconfig.json diff --git a/jquery-ajax-chain/index.d.ts b/types/jquery-ajax-chain/index.d.ts similarity index 100% rename from jquery-ajax-chain/index.d.ts rename to types/jquery-ajax-chain/index.d.ts diff --git a/jquery-ajax-chain/jquery-ajax-chain-tests.ts b/types/jquery-ajax-chain/jquery-ajax-chain-tests.ts similarity index 98% rename from jquery-ajax-chain/jquery-ajax-chain-tests.ts rename to types/jquery-ajax-chain/jquery-ajax-chain-tests.ts index e5cbb8a26f..56ea354543 100644 --- a/jquery-ajax-chain/jquery-ajax-chain-tests.ts +++ b/types/jquery-ajax-chain/jquery-ajax-chain-tests.ts @@ -1,6 +1,3 @@ -/// -/// - function test_public_methods(): void { let ajaxChain: ajaxChain.JQueryAjaxChain, @@ -171,7 +168,7 @@ function test_optional_parameters(): void { }, hasCache: function (xmlResponse): XMLDocument { - + let $tempXmlResponse: JQuery, itemId: String; diff --git a/jquery-ajax-chain/tsconfig.json b/types/jquery-ajax-chain/tsconfig.json similarity index 100% rename from jquery-ajax-chain/tsconfig.json rename to types/jquery-ajax-chain/tsconfig.json diff --git a/jquery-alertable/index.d.ts b/types/jquery-alertable/index.d.ts similarity index 100% rename from jquery-alertable/index.d.ts rename to types/jquery-alertable/index.d.ts diff --git a/jquery-alertable/jquery-alertable-tests.ts b/types/jquery-alertable/jquery-alertable-tests.ts similarity index 96% rename from jquery-alertable/jquery-alertable-tests.ts rename to types/jquery-alertable/jquery-alertable-tests.ts index a61dca01b4..61d6e2c06c 100644 --- a/jquery-alertable/jquery-alertable-tests.ts +++ b/types/jquery-alertable/jquery-alertable-tests.ts @@ -1,6 +1,3 @@ -/// -/// - // // Examples from https://github.com/claviska/jquery-alertable // diff --git a/jquery-alertable/tsconfig.json b/types/jquery-alertable/tsconfig.json similarity index 100% rename from jquery-alertable/tsconfig.json rename to types/jquery-alertable/tsconfig.json diff --git a/jquery-backstretch/index.d.ts b/types/jquery-backstretch/index.d.ts similarity index 100% rename from jquery-backstretch/index.d.ts rename to types/jquery-backstretch/index.d.ts diff --git a/jquery-backstretch/jquery-backstretch-tests.ts b/types/jquery-backstretch/jquery-backstretch-tests.ts similarity index 91% rename from jquery-backstretch/jquery-backstretch-tests.ts rename to types/jquery-backstretch/jquery-backstretch-tests.ts index 7220458769..22835b4e43 100644 --- a/jquery-backstretch/jquery-backstretch-tests.ts +++ b/types/jquery-backstretch/jquery-backstretch-tests.ts @@ -1,5 +1,3 @@ -/// - var backstretch = jQuery.backstretch(['image.png'], { centeredX: false, centeredY: false, diff --git a/jquery-backstretch/tsconfig.json b/types/jquery-backstretch/tsconfig.json similarity index 100% rename from jquery-backstretch/tsconfig.json rename to types/jquery-backstretch/tsconfig.json diff --git a/jquery-cropbox/index.d.ts b/types/jquery-cropbox/index.d.ts similarity index 100% rename from jquery-cropbox/index.d.ts rename to types/jquery-cropbox/index.d.ts diff --git a/jquery-cropbox/jquery-cropbox-tests.ts b/types/jquery-cropbox/jquery-cropbox-tests.ts similarity index 94% rename from jquery-cropbox/jquery-cropbox-tests.ts rename to types/jquery-cropbox/jquery-cropbox-tests.ts index ddc5389625..eadb754088 100644 --- a/jquery-cropbox/jquery-cropbox-tests.ts +++ b/types/jquery-cropbox/jquery-cropbox-tests.ts @@ -1,5 +1,3 @@ -/// - var cropboxWithDefaultSettings = $("#element").cropbox(); var cropboxOptions: jQueryCropBox.CropboxOptions = { @@ -38,7 +36,7 @@ cropboxWithOptions.getBlob(); cropboxWithOptions.remove(); cropboxWithOptions.on("cropbox",(e: Event, data: any, img: jQueryCropBox.Cropbox) => { - - //DoStuff - + + //DoStuff + }); diff --git a/jquery-cropbox/tsconfig.json b/types/jquery-cropbox/tsconfig.json similarity index 100% rename from jquery-cropbox/tsconfig.json rename to types/jquery-cropbox/tsconfig.json diff --git a/jquery-deparam/index.d.ts b/types/jquery-deparam/index.d.ts similarity index 100% rename from jquery-deparam/index.d.ts rename to types/jquery-deparam/index.d.ts diff --git a/jquery-deparam/jquery-deparam-tests.ts b/types/jquery-deparam/jquery-deparam-tests.ts similarity index 100% rename from jquery-deparam/jquery-deparam-tests.ts rename to types/jquery-deparam/jquery-deparam-tests.ts diff --git a/jquery-deparam/tsconfig.json b/types/jquery-deparam/tsconfig.json similarity index 100% rename from jquery-deparam/tsconfig.json rename to types/jquery-deparam/tsconfig.json diff --git a/jquery-easy-loading/index.d.ts b/types/jquery-easy-loading/index.d.ts similarity index 100% rename from jquery-easy-loading/index.d.ts rename to types/jquery-easy-loading/index.d.ts diff --git a/jquery-easy-loading/jquery-easy-loading-tests.ts b/types/jquery-easy-loading/jquery-easy-loading-tests.ts similarity index 97% rename from jquery-easy-loading/jquery-easy-loading-tests.ts rename to types/jquery-easy-loading/jquery-easy-loading-tests.ts index 7a59d3d617..ece98fd6d0 100644 --- a/jquery-easy-loading/jquery-easy-loading-tests.ts +++ b/types/jquery-easy-loading/jquery-easy-loading-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_options() { const jqElement: JQuery = $("body").loading({ diff --git a/jquery-easy-loading/tsconfig.json b/types/jquery-easy-loading/tsconfig.json similarity index 100% rename from jquery-easy-loading/tsconfig.json rename to types/jquery-easy-loading/tsconfig.json diff --git a/jquery-fullscreen/index.d.ts b/types/jquery-fullscreen/index.d.ts similarity index 100% rename from jquery-fullscreen/index.d.ts rename to types/jquery-fullscreen/index.d.ts diff --git a/jquery-fullscreen/jquery-fullscreen-tests.ts b/types/jquery-fullscreen/jquery-fullscreen-tests.ts similarity index 100% rename from jquery-fullscreen/jquery-fullscreen-tests.ts rename to types/jquery-fullscreen/jquery-fullscreen-tests.ts diff --git a/jquery-fullscreen/tsconfig.json b/types/jquery-fullscreen/tsconfig.json similarity index 100% rename from jquery-fullscreen/tsconfig.json rename to types/jquery-fullscreen/tsconfig.json diff --git a/jquery-galleria/index.d.ts b/types/jquery-galleria/index.d.ts similarity index 100% rename from jquery-galleria/index.d.ts rename to types/jquery-galleria/index.d.ts diff --git a/jquery-galleria/jquery-galleria-tests.ts b/types/jquery-galleria/jquery-galleria-tests.ts similarity index 100% rename from jquery-galleria/jquery-galleria-tests.ts rename to types/jquery-galleria/jquery-galleria-tests.ts diff --git a/jquery-galleria/tsconfig.json b/types/jquery-galleria/tsconfig.json similarity index 100% rename from jquery-galleria/tsconfig.json rename to types/jquery-galleria/tsconfig.json diff --git a/jquery-handsontable/index.d.ts b/types/jquery-handsontable/index.d.ts similarity index 100% rename from jquery-handsontable/index.d.ts rename to types/jquery-handsontable/index.d.ts diff --git a/jquery-handsontable/jquery-handsontable-tests.ts b/types/jquery-handsontable/jquery-handsontable-tests.ts similarity index 95% rename from jquery-handsontable/jquery-handsontable-tests.ts rename to types/jquery-handsontable/jquery-handsontable-tests.ts index 267ab30d8a..a2e10b4827 100644 --- a/jquery-handsontable/jquery-handsontable-tests.ts +++ b/types/jquery-handsontable/jquery-handsontable-tests.ts @@ -1,6 +1,3 @@ -/// - - var data = [ ["", "Maserati", "Mazda", "Mercedes", "Mini", "Mitsubishi"], ["2009", 0, 2941, 4303, 354, 5814], diff --git a/jquery-handsontable/tsconfig.json b/types/jquery-handsontable/tsconfig.json similarity index 100% rename from jquery-handsontable/tsconfig.json rename to types/jquery-handsontable/tsconfig.json diff --git a/jquery-jsonrpcclient/index.d.ts b/types/jquery-jsonrpcclient/index.d.ts similarity index 100% rename from jquery-jsonrpcclient/index.d.ts rename to types/jquery-jsonrpcclient/index.d.ts diff --git a/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts b/types/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts similarity index 96% rename from jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts rename to types/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts index f680dbb688..0e42508202 100644 --- a/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts +++ b/types/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts @@ -1,5 +1,3 @@ -/// - var foo = new $.JsonRpcClient({ ajaxUrl: '/backend/jsonrpc' }); foo.call( 'bar', ['A parameter', 'B parameter'], diff --git a/jquery-jsonrpcclient/tsconfig.json b/types/jquery-jsonrpcclient/tsconfig.json similarity index 100% rename from jquery-jsonrpcclient/tsconfig.json rename to types/jquery-jsonrpcclient/tsconfig.json diff --git a/jquery-knob/index.d.ts b/types/jquery-knob/index.d.ts similarity index 100% rename from jquery-knob/index.d.ts rename to types/jquery-knob/index.d.ts diff --git a/jquery-knob/jquery-knob-tests.ts b/types/jquery-knob/jquery-knob-tests.ts similarity index 100% rename from jquery-knob/jquery-knob-tests.ts rename to types/jquery-knob/jquery-knob-tests.ts diff --git a/jquery-knob/tsconfig.json b/types/jquery-knob/tsconfig.json similarity index 100% rename from jquery-knob/tsconfig.json rename to types/jquery-knob/tsconfig.json diff --git a/jquery-mask-plugin/index.d.ts b/types/jquery-mask-plugin/index.d.ts similarity index 99% rename from jquery-mask-plugin/index.d.ts rename to types/jquery-mask-plugin/index.d.ts index 61f3a69359..270828856f 100644 --- a/jquery-mask-plugin/index.d.ts +++ b/types/jquery-mask-plugin/index.d.ts @@ -6,7 +6,6 @@ /// declare namespace jQueryMask { - interface Invalid { p: number; v: string; @@ -42,11 +41,9 @@ declare namespace jQueryMask { [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. @@ -72,4 +69,4 @@ interface JQuery { * @returns Masked value. */ masked(value: string): string; -} \ No newline at end of file +} diff --git a/jquery-mask-plugin/jquery-mask-plugin-tests.ts b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts similarity index 98% rename from jquery-mask-plugin/jquery-mask-plugin-tests.ts rename to types/jquery-mask-plugin/jquery-mask-plugin-tests.ts index 36362eccf7..310cec421b 100644 --- a/jquery-mask-plugin/jquery-mask-plugin-tests.ts +++ b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts @@ -1,4 +1,3 @@ - // basic usage $(document).ready(() => { $('.date').mask('00/00/0000'); @@ -53,7 +52,7 @@ let options: jQueryMask.Options = { console.log('cep changed! ', cep); }, onInvalid(val: Object, e: Event, f: JQuery, invalid: jQueryMask.Invalid[], options: jQueryMask.Options) { - var error = invalid[0]; + const error = invalid[0]; console.log("Digit: ", error.v, " is invalid for the position: ", error.p, ". We expect something like: ", error.e); } }; @@ -116,4 +115,4 @@ $('.date').unmask(); $('.date').cleanVal(); // Getting a masked value programmatically -$('.date').masked('19840807'); \ No newline at end of file +$('.date').masked('19840807'); diff --git a/jquery-mask-plugin/tsconfig.json b/types/jquery-mask-plugin/tsconfig.json similarity index 100% rename from jquery-mask-plugin/tsconfig.json rename to types/jquery-mask-plugin/tsconfig.json diff --git a/jquery-mask-plugin/tslint.json b/types/jquery-mask-plugin/tslint.json similarity index 100% rename from jquery-mask-plugin/tslint.json rename to types/jquery-mask-plugin/tslint.json diff --git a/jquery-mockjax/index.d.ts b/types/jquery-mockjax/index.d.ts similarity index 100% rename from jquery-mockjax/index.d.ts rename to types/jquery-mockjax/index.d.ts diff --git a/jquery-mockjax/jquery-mockjax-tests.ts b/types/jquery-mockjax/jquery-mockjax-tests.ts similarity index 99% rename from jquery-mockjax/jquery-mockjax-tests.ts rename to types/jquery-mockjax/jquery-mockjax-tests.ts index 7688645f8e..3090a1c3cc 100644 --- a/jquery-mockjax/jquery-mockjax-tests.ts +++ b/types/jquery-mockjax/jquery-mockjax-tests.ts @@ -1,4 +1,3 @@ -/// /// class Tests { diff --git a/jquery-mockjax/tsconfig.json b/types/jquery-mockjax/tsconfig.json similarity index 100% rename from jquery-mockjax/tsconfig.json rename to types/jquery-mockjax/tsconfig.json diff --git a/jquery-mousewheel/index.d.ts b/types/jquery-mousewheel/index.d.ts similarity index 100% rename from jquery-mousewheel/index.d.ts rename to types/jquery-mousewheel/index.d.ts diff --git a/jquery-mousewheel/jquery-mousewheel-tests.ts b/types/jquery-mousewheel/jquery-mousewheel-tests.ts similarity index 100% rename from jquery-mousewheel/jquery-mousewheel-tests.ts rename to types/jquery-mousewheel/jquery-mousewheel-tests.ts diff --git a/jquery-mousewheel/tsconfig.json b/types/jquery-mousewheel/tsconfig.json similarity index 100% rename from jquery-mousewheel/tsconfig.json rename to types/jquery-mousewheel/tsconfig.json diff --git a/jquery-param/index.d.ts b/types/jquery-param/index.d.ts similarity index 100% rename from jquery-param/index.d.ts rename to types/jquery-param/index.d.ts diff --git a/jquery-param/jquery-param-tests.ts b/types/jquery-param/jquery-param-tests.ts similarity index 100% rename from jquery-param/jquery-param-tests.ts rename to types/jquery-param/jquery-param-tests.ts diff --git a/jquery-param/tsconfig.json b/types/jquery-param/tsconfig.json similarity index 100% rename from jquery-param/tsconfig.json rename to types/jquery-param/tsconfig.json diff --git a/jquery-sortable/index.d.ts b/types/jquery-sortable/index.d.ts similarity index 100% rename from jquery-sortable/index.d.ts rename to types/jquery-sortable/index.d.ts diff --git a/jquery-sortable/jquery-sortable-tests.ts b/types/jquery-sortable/jquery-sortable-tests.ts similarity index 100% rename from jquery-sortable/jquery-sortable-tests.ts rename to types/jquery-sortable/jquery-sortable-tests.ts diff --git a/jquery-sortable/tsconfig.json b/types/jquery-sortable/tsconfig.json similarity index 100% rename from jquery-sortable/tsconfig.json rename to types/jquery-sortable/tsconfig.json diff --git a/jquery-steps/index.d.ts b/types/jquery-steps/index.d.ts similarity index 98% rename from jquery-steps/index.d.ts rename to types/jquery-steps/index.d.ts index 6abe640417..7670245480 100644 --- a/jquery-steps/index.d.ts +++ b/types/jquery-steps/index.d.ts @@ -1,8 +1,9 @@ // Type definitions for jQuery Steps v1.1.1 // Project: http://www.jquery-steps.com/ -// Definitions by: Joseph Blank +// Definitions by: Joseph Blank , Nicholas Wong // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Updated by: Nicholas Wong + +/// interface JQuery { steps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; diff --git a/jquery-steps/jquery-steps-tests.ts b/types/jquery-steps/jquery-steps-tests.ts similarity index 97% rename from jquery-steps/jquery-steps-tests.ts rename to types/jquery-steps/jquery-steps-tests.ts index 35346d1f7b..6659212e20 100644 --- a/jquery-steps/jquery-steps-tests.ts +++ b/types/jquery-steps/jquery-steps-tests.ts @@ -1,6 +1,3 @@ -/// -/// - var labels: JQuerySteps.LabelSettings = { cancel: 'Cancel', current: 'Current:', diff --git a/jquery-steps/tsconfig.json b/types/jquery-steps/tsconfig.json similarity index 100% rename from jquery-steps/tsconfig.json rename to types/jquery-steps/tsconfig.json diff --git a/jquery-timeentry/index.d.ts b/types/jquery-timeentry/index.d.ts similarity index 100% rename from jquery-timeentry/index.d.ts rename to types/jquery-timeentry/index.d.ts diff --git a/jquery-timeentry/jquery-timeentry-tests.ts b/types/jquery-timeentry/jquery-timeentry-tests.ts similarity index 97% rename from jquery-timeentry/jquery-timeentry-tests.ts rename to types/jquery-timeentry/jquery-timeentry-tests.ts index ccfe0794a3..8910487c65 100644 --- a/jquery-timeentry/jquery-timeentry-tests.ts +++ b/types/jquery-timeentry/jquery-timeentry-tests.ts @@ -1,5 +1,3 @@ -/// - var selector = '#example'; // basic diff --git a/jquery-timeentry/tsconfig.json b/types/jquery-timeentry/tsconfig.json similarity index 100% rename from jquery-timeentry/tsconfig.json rename to types/jquery-timeentry/tsconfig.json diff --git a/types/jquery-toastmessage-plugin/index.d.ts b/types/jquery-toastmessage-plugin/index.d.ts new file mode 100644 index 0000000000..6ca6816e21 --- /dev/null +++ b/types/jquery-toastmessage-plugin/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for jquery-toastmessage-plugin 0.2 +// Project: https://github.com/akquinet/jquery-toastmessage-plugin +// Definitions by: Joe Skeen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface JQuery { + toastmessage: JQueryToastmessage.ToastmessageStatic; +} + +/** jQuery Toastmessage (http://akquinet.github.io/jquery-toastmessage-plugin/) */ +declare namespace JQueryToastmessage { + interface ToastmessageStatic { + /* shows a toast message of the specified type */ + (command: ShowToastCommand, message: string): JQuery; + /** shows a custom toast */ + (command: 'showToast', toastOpts: ToastOptions): JQuery; + /** removes the specified toast and returns it */ + (command: 'removeToast', toast: JQuery, closeOpts?: ToastOptions): void; + /** configures the default toast options */ + (toastOpts: ToastOptions): void; + } + + type ShowToastCommand = 'showNoticeToast' | 'showSuccessToast' | 'showWarningToast' | 'showErrorToast'; + type ToastType = 'notice' | 'warning' | 'error' | 'success'; + type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right'; + + interface ToastOptions { + /** in effect duration in miliseconds @default 600 */ + inEffectDuration?: number; + /** + * time in miliseconds before the item has to disappear @default 3000 */ + stayTime?: number; + /** content of the item @default '' */ + text?: string; + /** should the toast item sticky or not? @default false */ + sticky?: boolean; + /** the type of toast @default 'notice' */ + type?: ToastType; + /** + * Position of the toast container holding different toast. + * Position can be set only once at the very first call, + * changing the position after the first call does nothing + * @default 'top-right' + */ + position?: ToastPosition; + /** + * text which will be shown as close button, + * set to '' when you want to introduce an image via css + * @default '' + */ + closeText?: string; + /** callback function when the toastmessage is closed @default null */ + close?: () => void; + } +} diff --git a/types/jquery-toastmessage-plugin/jquery-toastmessage-plugin-tests.ts b/types/jquery-toastmessage-plugin/jquery-toastmessage-plugin-tests.ts new file mode 100644 index 0000000000..ae096da350 --- /dev/null +++ b/types/jquery-toastmessage-plugin/jquery-toastmessage-plugin-tests.ts @@ -0,0 +1,85 @@ +/* code examples from documentation */ + +$().toastmessage('showNoticeToast', 'some message here'); +$().toastmessage('showSuccessToast', "some message here"); +$().toastmessage('showWarningToast', "some message here"); +$().toastmessage('showErrorToast', "some message here"); + +// user configured toastmessage: +const toastObject = $().toastmessage('showToast', { + text: 'Hello World', + sticky: true, + position: 'top-right', + type: 'success', + close() { console.log("toast is closed ..."); } +}); + +$().toastmessage('removeToast', toastObject); + +// reconfiguring the toasts as sticky +$().toastmessage({sticky : true}); + +// saving the newly created toast into a variable +const myToast = $().toastmessage('showNoticeToast', 'some message here'); + +// removing the toast +$().toastmessage('removeToast', myToast); + +// user configuration of all toastmessages to come: +$().toastmessage({ + text: 'Hello World', + sticky: true, + position: 'top-right', + type: 'success', + close() { console.log("toast is closed ..."); } +}); + +$().toastmessage({ + inEffectDuration: 600, // in effect duration in miliseconds + stayTime: 3000, // time in miliseconds before the item has to disappear + text: '', // content of the item + sticky: false, // should the toast item sticky or not? + type: 'notice', // notice, warning, error, success + position: 'top-right', // top-left, top-center, top-right, middle-left, middle-center, middle-right + // Position of the toast container holding different toast. + // Position can be set only once at the very first call, + // changing the position after the first call does nothing + closeText: '', // text which will be shown as close button, + // set to '' when you want to introduce an image via css + close: undefined // callback function when the toastmessage is closed +}); + +/* code examples from tests */ + +$('.toast-container').remove(); + +$().toastmessage('showSuccessToast', "SUCCESS"); +$().toastmessage('showNoticeToast', "NOTICE"); +$().toastmessage('showWarningToast', "WARNING"); +$().toastmessage('showErrorToast', "ERROR"); +$().toastmessage({ + sticky: true, + position: 'top-right', + closeText: '' +}); +$().toastmessage('showToast', { + text: 'Success Dialog', + type: 'success' +}); +$().toastmessage('showToast', { + text: 'Success Dialog', + sticky: true, + position: 'top-right', + type: 'success', + closeText: '', + close() {} +}); +const toast = $().toastmessage('showToast', { + text: 'Success Dialog', + sticky: true, + position: 'top-right', + type: 'success', + closeText: '', + close() {} +}); +$().toastmessage('removeToast', toast, { close() {} }); diff --git a/types/jquery-toastmessage-plugin/tsconfig.json b/types/jquery-toastmessage-plugin/tsconfig.json new file mode 100644 index 0000000000..193619fa0a --- /dev/null +++ b/types/jquery-toastmessage-plugin/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "lib": ["es6", "dom"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery-toastmessage-plugin-tests.ts" + ] +} \ No newline at end of file diff --git a/jui-core/tslint.json b/types/jquery-toastmessage-plugin/tslint.json similarity index 100% rename from jui-core/tslint.json rename to types/jquery-toastmessage-plugin/tslint.json diff --git a/jquery-truncate-html/index.d.ts b/types/jquery-truncate-html/index.d.ts similarity index 100% rename from jquery-truncate-html/index.d.ts rename to types/jquery-truncate-html/index.d.ts diff --git a/jquery-truncate-html/jquery-truncate-html-tests.ts b/types/jquery-truncate-html/jquery-truncate-html-tests.ts similarity index 100% rename from jquery-truncate-html/jquery-truncate-html-tests.ts rename to types/jquery-truncate-html/jquery-truncate-html-tests.ts diff --git a/jquery-truncate-html/tsconfig.json b/types/jquery-truncate-html/tsconfig.json similarity index 100% rename from jquery-truncate-html/tsconfig.json rename to types/jquery-truncate-html/tsconfig.json diff --git a/jquery-urlparam/index.d.ts b/types/jquery-urlparam/index.d.ts similarity index 100% rename from jquery-urlparam/index.d.ts rename to types/jquery-urlparam/index.d.ts diff --git a/jquery-urlparam/jquery-urlparam-tests.ts b/types/jquery-urlparam/jquery-urlparam-tests.ts similarity index 51% rename from jquery-urlparam/jquery-urlparam-tests.ts rename to types/jquery-urlparam/jquery-urlparam-tests.ts index a8ca144bb3..8d855e0e35 100644 --- a/jquery-urlparam/jquery-urlparam-tests.ts +++ b/types/jquery-urlparam/jquery-urlparam-tests.ts @@ -1,4 +1 @@ -/// - - console.log($.urlParam('variable')); diff --git a/jquery-urlparam/tsconfig.json b/types/jquery-urlparam/tsconfig.json similarity index 100% rename from jquery-urlparam/tsconfig.json rename to types/jquery-urlparam/tsconfig.json diff --git a/jquery-validation-unobtrusive/index.d.ts b/types/jquery-validation-unobtrusive/index.d.ts similarity index 100% rename from jquery-validation-unobtrusive/index.d.ts rename to types/jquery-validation-unobtrusive/index.d.ts diff --git a/jquery-validation-unobtrusive/jquery-validation-unobtrusive-tests.ts b/types/jquery-validation-unobtrusive/jquery-validation-unobtrusive-tests.ts similarity index 100% rename from jquery-validation-unobtrusive/jquery-validation-unobtrusive-tests.ts rename to types/jquery-validation-unobtrusive/jquery-validation-unobtrusive-tests.ts diff --git a/jquery-validation-unobtrusive/tsconfig.json b/types/jquery-validation-unobtrusive/tsconfig.json similarity index 100% rename from jquery-validation-unobtrusive/tsconfig.json rename to types/jquery-validation-unobtrusive/tsconfig.json diff --git a/jquery.address/index.d.ts b/types/jquery.address/index.d.ts similarity index 100% rename from jquery.address/index.d.ts rename to types/jquery.address/index.d.ts diff --git a/jquery.address/tsconfig.json b/types/jquery.address/tsconfig.json similarity index 100% rename from jquery.address/tsconfig.json rename to types/jquery.address/tsconfig.json diff --git a/jquery.ajaxfile/index.d.ts b/types/jquery.ajaxfile/index.d.ts similarity index 100% rename from jquery.ajaxfile/index.d.ts rename to types/jquery.ajaxfile/index.d.ts diff --git a/jquery.ajaxfile/jquery.ajaxfile-tests.ts b/types/jquery.ajaxfile/jquery.ajaxfile-tests.ts similarity index 95% rename from jquery.ajaxfile/jquery.ajaxfile-tests.ts rename to types/jquery.ajaxfile/jquery.ajaxfile-tests.ts index 364220325a..73bc6662dc 100644 --- a/jquery.ajaxfile/jquery.ajaxfile-tests.ts +++ b/types/jquery.ajaxfile/jquery.ajaxfile-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - function testRawApi(){ var inputElement:HTMLInputElement = null; var resultPromise = AjaxFile.send({ diff --git a/jquery.ajaxfile/tsconfig.json b/types/jquery.ajaxfile/tsconfig.json similarity index 100% rename from jquery.ajaxfile/tsconfig.json rename to types/jquery.ajaxfile/tsconfig.json diff --git a/jquery.are-you-sure/index.d.ts b/types/jquery.are-you-sure/index.d.ts similarity index 100% rename from jquery.are-you-sure/index.d.ts rename to types/jquery.are-you-sure/index.d.ts diff --git a/types/jquery.are-you-sure/jquery.are-you-sure-tests.ts b/types/jquery.are-you-sure/jquery.are-you-sure-tests.ts new file mode 100644 index 0000000000..37cb487602 --- /dev/null +++ b/types/jquery.are-you-sure/jquery.are-you-sure-tests.ts @@ -0,0 +1,11 @@ +//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.are-you-sure/tsconfig.json b/types/jquery.are-you-sure/tsconfig.json similarity index 100% rename from jquery.are-you-sure/tsconfig.json rename to types/jquery.are-you-sure/tsconfig.json diff --git a/jquery.autosize/index.d.ts b/types/jquery.autosize/index.d.ts similarity index 100% rename from jquery.autosize/index.d.ts rename to types/jquery.autosize/index.d.ts diff --git a/jquery.autosize/jquery.autosize-tests.ts b/types/jquery.autosize/jquery.autosize-tests.ts similarity index 100% rename from jquery.autosize/jquery.autosize-tests.ts rename to types/jquery.autosize/jquery.autosize-tests.ts diff --git a/jquery.autosize/tsconfig.json b/types/jquery.autosize/tsconfig.json similarity index 100% rename from jquery.autosize/tsconfig.json rename to types/jquery.autosize/tsconfig.json diff --git a/jquery.base64/index.d.ts b/types/jquery.base64/index.d.ts similarity index 100% rename from jquery.base64/index.d.ts rename to types/jquery.base64/index.d.ts diff --git a/jquery.base64/jquery.base64-tests.ts b/types/jquery.base64/jquery.base64-tests.ts similarity index 80% rename from jquery.base64/jquery.base64-tests.ts rename to types/jquery.base64/jquery.base64-tests.ts index 447a917620..c9c6955716 100644 --- a/jquery.base64/jquery.base64-tests.ts +++ b/types/jquery.base64/jquery.base64-tests.ts @@ -1,6 +1,3 @@ -/// - - var encoded = $.base64.encode(""); $.base64.decode(encoded); diff --git a/jquery.base64/tsconfig.json b/types/jquery.base64/tsconfig.json similarity index 100% rename from jquery.base64/tsconfig.json rename to types/jquery.base64/tsconfig.json diff --git a/jquery.bbq/index.d.ts b/types/jquery.bbq/index.d.ts similarity index 100% rename from jquery.bbq/index.d.ts rename to types/jquery.bbq/index.d.ts diff --git a/jquery.bbq/jquery.bbq-tests.ts b/types/jquery.bbq/jquery.bbq-tests.ts similarity index 100% rename from jquery.bbq/jquery.bbq-tests.ts rename to types/jquery.bbq/jquery.bbq-tests.ts diff --git a/jquery.bbq/tsconfig.json b/types/jquery.bbq/tsconfig.json similarity index 100% rename from jquery.bbq/tsconfig.json rename to types/jquery.bbq/tsconfig.json diff --git a/jquery.blockui/index.d.ts b/types/jquery.blockui/index.d.ts similarity index 100% rename from jquery.blockui/index.d.ts rename to types/jquery.blockui/index.d.ts diff --git a/jquery.blockui/jquery.blockui-tests.ts b/types/jquery.blockui/jquery.blockui-tests.ts similarity index 100% rename from jquery.blockui/jquery.blockui-tests.ts rename to types/jquery.blockui/jquery.blockui-tests.ts diff --git a/jquery.blockui/tsconfig.json b/types/jquery.blockui/tsconfig.json similarity index 100% rename from jquery.blockui/tsconfig.json rename to types/jquery.blockui/tsconfig.json diff --git a/jquery.bootstrap.wizard/index.d.ts b/types/jquery.bootstrap.wizard/index.d.ts similarity index 100% rename from jquery.bootstrap.wizard/index.d.ts rename to types/jquery.bootstrap.wizard/index.d.ts diff --git a/jquery.bootstrap.wizard/tsconfig.json b/types/jquery.bootstrap.wizard/tsconfig.json similarity index 100% rename from jquery.bootstrap.wizard/tsconfig.json rename to types/jquery.bootstrap.wizard/tsconfig.json diff --git a/jquery.cleditor/index.d.ts b/types/jquery.cleditor/index.d.ts similarity index 100% rename from jquery.cleditor/index.d.ts rename to types/jquery.cleditor/index.d.ts diff --git a/jquery.cleditor/jquery.cleditor-tests.ts b/types/jquery.cleditor/jquery.cleditor-tests.ts similarity index 98% rename from jquery.cleditor/jquery.cleditor-tests.ts rename to types/jquery.cleditor/jquery.cleditor-tests.ts index 7fe997c4c5..b4f4917551 100644 --- a/jquery.cleditor/jquery.cleditor-tests.ts +++ b/types/jquery.cleditor/jquery.cleditor-tests.ts @@ -1,5 +1,3 @@ -/// - // cribbed from http://premiumsoftware.net/CLEditor/GettingStarted $(document).ready(function () { $("#input").cleditor(); }); diff --git a/jquery.cleditor/tsconfig.json b/types/jquery.cleditor/tsconfig.json similarity index 100% rename from jquery.cleditor/tsconfig.json rename to types/jquery.cleditor/tsconfig.json diff --git a/jquery.clientsidelogging/index.d.ts b/types/jquery.clientsidelogging/index.d.ts similarity index 100% rename from jquery.clientsidelogging/index.d.ts rename to types/jquery.clientsidelogging/index.d.ts diff --git a/jquery.clientsidelogging/jquery.clientsidelogging-tests.ts b/types/jquery.clientsidelogging/jquery.clientsidelogging-tests.ts similarity index 100% rename from jquery.clientsidelogging/jquery.clientsidelogging-tests.ts rename to types/jquery.clientsidelogging/jquery.clientsidelogging-tests.ts diff --git a/jquery.clientsidelogging/tsconfig.json b/types/jquery.clientsidelogging/tsconfig.json similarity index 100% rename from jquery.clientsidelogging/tsconfig.json rename to types/jquery.clientsidelogging/tsconfig.json diff --git a/jquery.color/index.d.ts b/types/jquery.color/index.d.ts similarity index 100% rename from jquery.color/index.d.ts rename to types/jquery.color/index.d.ts diff --git a/jquery.color/jquery.color-tests.ts b/types/jquery.color/jquery.color-tests.ts similarity index 97% rename from jquery.color/jquery.color-tests.ts rename to types/jquery.color/jquery.color-tests.ts index c94a1cffed..e1439f4cd4 100644 --- a/jquery.color/jquery.color-tests.ts +++ b/types/jquery.color/jquery.color-tests.ts @@ -1,5 +1,3 @@ -/// - var color = $.Color("rgba(255, 255, 255, 0.4)"); var color1 = $.Color({red: 255, green: 255, blue: 255}); var color2 = $.Color({hue: 359, saturation: 0.5, lightness: 0.5}); diff --git a/jquery.color/tsconfig.json b/types/jquery.color/tsconfig.json similarity index 100% rename from jquery.color/tsconfig.json rename to types/jquery.color/tsconfig.json diff --git a/jquery.colorbox/index.d.ts b/types/jquery.colorbox/index.d.ts similarity index 100% rename from jquery.colorbox/index.d.ts rename to types/jquery.colorbox/index.d.ts diff --git a/jquery.colorbox/jquery.colorbox-tests.ts b/types/jquery.colorbox/jquery.colorbox-tests.ts similarity index 95% rename from jquery.colorbox/jquery.colorbox-tests.ts rename to types/jquery.colorbox/jquery.colorbox-tests.ts index 66d54240db..3c05f213c9 100644 --- a/jquery.colorbox/jquery.colorbox-tests.ts +++ b/types/jquery.colorbox/jquery.colorbox-tests.ts @@ -1,5 +1,3 @@ -/// - //Image gallery var gallery : JQuery = $('a.gallery').colorbox({ rel: 'gal' }); diff --git a/jquery.colorbox/tsconfig.json b/types/jquery.colorbox/tsconfig.json similarity index 100% rename from jquery.colorbox/tsconfig.json rename to types/jquery.colorbox/tsconfig.json diff --git a/jquery.colorpicker/index.d.ts b/types/jquery.colorpicker/index.d.ts similarity index 100% rename from jquery.colorpicker/index.d.ts rename to types/jquery.colorpicker/index.d.ts diff --git a/jquery.colorpicker/jquery.colorpicker-tests.ts b/types/jquery.colorpicker/jquery.colorpicker-tests.ts similarity index 100% rename from jquery.colorpicker/jquery.colorpicker-tests.ts rename to types/jquery.colorpicker/jquery.colorpicker-tests.ts diff --git a/jquery.colorpicker/tsconfig.json b/types/jquery.colorpicker/tsconfig.json similarity index 100% rename from jquery.colorpicker/tsconfig.json rename to types/jquery.colorpicker/tsconfig.json diff --git a/jquery.contextmenu/index.d.ts b/types/jquery.contextmenu/index.d.ts similarity index 100% rename from jquery.contextmenu/index.d.ts rename to types/jquery.contextmenu/index.d.ts diff --git a/jquery.contextmenu/jquery.contextmenu-tests.ts b/types/jquery.contextmenu/jquery.contextmenu-tests.ts similarity index 100% rename from jquery.contextmenu/jquery.contextmenu-tests.ts rename to types/jquery.contextmenu/jquery.contextmenu-tests.ts diff --git a/jquery.contextmenu/tsconfig.json b/types/jquery.contextmenu/tsconfig.json similarity index 100% rename from jquery.contextmenu/tsconfig.json rename to types/jquery.contextmenu/tsconfig.json diff --git a/jquery.cookie/index.d.ts b/types/jquery.cookie/index.d.ts similarity index 100% rename from jquery.cookie/index.d.ts rename to types/jquery.cookie/index.d.ts diff --git a/jquery.cookie/jquery.cookie-tests.ts b/types/jquery.cookie/jquery.cookie-tests.ts similarity index 95% rename from jquery.cookie/jquery.cookie-tests.ts rename to types/jquery.cookie/jquery.cookie-tests.ts index e93d29110c..998d7bf2df 100644 --- a/jquery.cookie/jquery.cookie-tests.ts +++ b/types/jquery.cookie/jquery.cookie-tests.ts @@ -1,5 +1,3 @@ -/// - class TestObject { text: string; value: number; diff --git a/jquery.cookie/tsconfig.json b/types/jquery.cookie/tsconfig.json similarity index 100% rename from jquery.cookie/tsconfig.json rename to types/jquery.cookie/tsconfig.json diff --git a/jquery.customselect/index.d.ts b/types/jquery.customselect/index.d.ts similarity index 100% rename from jquery.customselect/index.d.ts rename to types/jquery.customselect/index.d.ts diff --git a/jquery.customselect/jquery.customselect-tests.ts b/types/jquery.customselect/jquery.customselect-tests.ts similarity index 91% rename from jquery.customselect/jquery.customselect-tests.ts rename to types/jquery.customselect/jquery.customselect-tests.ts index b0dc9554a9..5cb28a9f05 100644 --- a/jquery.customselect/jquery.customselect-tests.ts +++ b/types/jquery.customselect/jquery.customselect-tests.ts @@ -1,6 +1,3 @@ -/// - - class CustomSelectOptions implements JQueryCustomSelectOption { "customClass": string; "mapClass": boolean; diff --git a/jquery.customselect/tsconfig.json b/types/jquery.customselect/tsconfig.json similarity index 100% rename from jquery.customselect/tsconfig.json rename to types/jquery.customselect/tsconfig.json diff --git a/jquery.cycle/index.d.ts b/types/jquery.cycle/index.d.ts similarity index 100% rename from jquery.cycle/index.d.ts rename to types/jquery.cycle/index.d.ts diff --git a/jquery.cycle/jquery.cycle-tests.ts b/types/jquery.cycle/jquery.cycle-tests.ts similarity index 97% rename from jquery.cycle/jquery.cycle-tests.ts rename to types/jquery.cycle/jquery.cycle-tests.ts index e93be101f6..df8ed24b22 100644 --- a/jquery.cycle/jquery.cycle-tests.ts +++ b/types/jquery.cycle/jquery.cycle-tests.ts @@ -1,5 +1,3 @@ -/// - // As basic as it can be $('#element').cycle(); @@ -284,7 +282,7 @@ $('#s2').cycle({ $('#slideshow2').cycle({ fx: 'scrollLeft,scrollDown,scrollRight,scrollUp', randomizeEffects: false, - easing: 'easeInBack' // easing supported via the easing plugin + easing: 'easeInBack' // easing supported via the easing plugin }); // Another Advanced "pager" Demo @@ -294,7 +292,7 @@ $('#slideshow').cycle({ timeout: 0, pager: '#nav', pagerAnchorBuilder: function (idx, slide) { - // return selector string for existing anchor + // return selector string for existing anchor return '#nav li:eq(' + idx + ') a'; } }); @@ -304,7 +302,7 @@ $('#slideshow').cycle({ slideExpr: 'img' }); // Defeating IE's ClearType bug $('#slideshow').cycle({ - cleartype: false // disable cleartype corrections + cleartype: false // disable cleartype corrections }); // Using the 'nowrap' option (manual slideshow) diff --git a/jquery.cycle/tsconfig.json b/types/jquery.cycle/tsconfig.json similarity index 100% rename from jquery.cycle/tsconfig.json rename to types/jquery.cycle/tsconfig.json diff --git a/jquery.cycle2/index.d.ts b/types/jquery.cycle2/index.d.ts similarity index 100% rename from jquery.cycle2/index.d.ts rename to types/jquery.cycle2/index.d.ts diff --git a/jquery.cycle2/jquery.cycle2-tests.ts b/types/jquery.cycle2/jquery.cycle2-tests.ts similarity index 97% rename from jquery.cycle2/jquery.cycle2-tests.ts rename to types/jquery.cycle2/jquery.cycle2-tests.ts index 0e16629a3e..9d88e92532 100644 --- a/jquery.cycle2/jquery.cycle2-tests.ts +++ b/types/jquery.cycle2/jquery.cycle2-tests.ts @@ -1,5 +1,3 @@ -/// - // basic $('#element').cycle(); diff --git a/jquery.cycle2/tsconfig.json b/types/jquery.cycle2/tsconfig.json similarity index 100% rename from jquery.cycle2/tsconfig.json rename to types/jquery.cycle2/tsconfig.json diff --git a/jquery.dropotron/index.d.ts b/types/jquery.dropotron/index.d.ts similarity index 100% rename from jquery.dropotron/index.d.ts rename to types/jquery.dropotron/index.d.ts diff --git a/jquery.dropotron/jquery.dropotron-tests.ts b/types/jquery.dropotron/jquery.dropotron-tests.ts similarity index 100% rename from jquery.dropotron/jquery.dropotron-tests.ts rename to types/jquery.dropotron/jquery.dropotron-tests.ts diff --git a/jquery.dropotron/tsconfig.json b/types/jquery.dropotron/tsconfig.json similarity index 100% rename from jquery.dropotron/tsconfig.json rename to types/jquery.dropotron/tsconfig.json diff --git a/jquery.dynatree/index.d.ts b/types/jquery.dynatree/index.d.ts similarity index 100% rename from jquery.dynatree/index.d.ts rename to types/jquery.dynatree/index.d.ts diff --git a/jquery.dynatree/jquery.dynatree-tests.ts b/types/jquery.dynatree/jquery.dynatree-tests.ts similarity index 100% rename from jquery.dynatree/jquery.dynatree-tests.ts rename to types/jquery.dynatree/jquery.dynatree-tests.ts diff --git a/jquery.dynatree/tsconfig.json b/types/jquery.dynatree/tsconfig.json similarity index 100% rename from jquery.dynatree/tsconfig.json rename to types/jquery.dynatree/tsconfig.json diff --git a/jquery.elang/index.d.ts b/types/jquery.elang/index.d.ts similarity index 100% rename from jquery.elang/index.d.ts rename to types/jquery.elang/index.d.ts diff --git a/jquery.elang/tsconfig.json b/types/jquery.elang/tsconfig.json similarity index 100% rename from jquery.elang/tsconfig.json rename to types/jquery.elang/tsconfig.json diff --git a/jquery.fancytree/index.d.ts b/types/jquery.fancytree/index.d.ts similarity index 98% rename from jquery.fancytree/index.d.ts rename to types/jquery.fancytree/index.d.ts index 5533e89cb7..c5e84d69f7 100644 --- a/jquery.fancytree/index.d.ts +++ b/types/jquery.fancytree/index.d.ts @@ -21,18 +21,21 @@ interface JQuery { declare namespace Fancytree { interface Fancytree { $div: JQuery; - + widget: any; //JQueryUI.Widget; rootNode: FancytreeNode; + $container: JQuery; + focusNode: FancytreeNode; + options: FancytreeOptions; /** Activate node with a given key and fire focus and - * activate events. A prevously activated node will be + * activate events. A previously 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; + activateKey(key: string | boolean): FancytreeNode; /** (experimental) * @@ -199,7 +202,7 @@ declare namespace Fancytree { /** Display name (may contain HTML) */ title: string; /** Contains all extra data that was passed on node creation */ - data: Object; + data: any; /** 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. */ @@ -214,6 +217,10 @@ declare namespace Fancytree { lazy: boolean; /** Alternative description used as hover banner */ tooltip: string; + /** Outer element of single nodes */ + span: HTMLElement; + /** Outer element of single nodes for table extension */ + tr: HTMLElement; //#endregion //#region Methods @@ -639,7 +646,7 @@ declare namespace Fancytree { /** The tree instance */ tree: Fancytree; /** The jQuery UI tree widget */ - widget: Object; + widget: any; // JQueryUI.Widget; /** Shortcut to tree.options */ options: FancytreeOptions; /** The jQuery Event that initially triggered this call */ @@ -773,7 +780,7 @@ declare namespace Fancytree { /** 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; + toggleEffect?: JQueryUI.EffectOptions; } /** Data object passed to FancytreeNode() constructor. Note: typically these attributes are accessed by meber methods, e.g. `node.isExpanded()` and `node.setSelected(false)`. */ diff --git a/jquery.fancytree/jquery.fancytree-tests.ts b/types/jquery.fancytree/jquery.fancytree-tests.ts similarity index 100% rename from jquery.fancytree/jquery.fancytree-tests.ts rename to types/jquery.fancytree/jquery.fancytree-tests.ts diff --git a/jquery.fancytree/tsconfig.json b/types/jquery.fancytree/tsconfig.json similarity index 100% rename from jquery.fancytree/tsconfig.json rename to types/jquery.fancytree/tsconfig.json diff --git a/jquery.fileupload/index.d.ts b/types/jquery.fileupload/index.d.ts similarity index 100% rename from jquery.fileupload/index.d.ts rename to types/jquery.fileupload/index.d.ts diff --git a/jquery.fileupload/jquery.fileupload-tests.ts b/types/jquery.fileupload/jquery.fileupload-tests.ts similarity index 100% rename from jquery.fileupload/jquery.fileupload-tests.ts rename to types/jquery.fileupload/jquery.fileupload-tests.ts diff --git a/jquery.fileupload/tsconfig.json b/types/jquery.fileupload/tsconfig.json similarity index 100% rename from jquery.fileupload/tsconfig.json rename to types/jquery.fileupload/tsconfig.json diff --git a/jquery.finger/index.d.ts b/types/jquery.finger/index.d.ts similarity index 100% rename from jquery.finger/index.d.ts rename to types/jquery.finger/index.d.ts diff --git a/jquery.finger/jquery.finger-tests.ts b/types/jquery.finger/jquery.finger-tests.ts similarity index 96% rename from jquery.finger/jquery.finger-tests.ts rename to types/jquery.finger/jquery.finger-tests.ts index 3f35e7322c..c4734610b2 100644 --- a/jquery.finger/jquery.finger-tests.ts +++ b/types/jquery.finger/jquery.finger-tests.ts @@ -1,5 +1,3 @@ -/// - $.Finger.doubleTapInterval = 400; $.Finger.flickDuration = 250; $.Finger.pressDuration = 100; diff --git a/jquery.finger/tsconfig.json b/types/jquery.finger/tsconfig.json similarity index 100% rename from jquery.finger/tsconfig.json rename to types/jquery.finger/tsconfig.json diff --git a/jquery.flagstrap/index.d.ts b/types/jquery.flagstrap/index.d.ts similarity index 100% rename from jquery.flagstrap/index.d.ts rename to types/jquery.flagstrap/index.d.ts diff --git a/jquery.flagstrap/jquery.flagstrap-tests.ts b/types/jquery.flagstrap/jquery.flagstrap-tests.ts similarity index 89% rename from jquery.flagstrap/jquery.flagstrap-tests.ts rename to types/jquery.flagstrap/jquery.flagstrap-tests.ts index 3bfcf0294e..6d262dc17f 100644 --- a/jquery.flagstrap/jquery.flagstrap-tests.ts +++ b/types/jquery.flagstrap/jquery.flagstrap-tests.ts @@ -1,14 +1,11 @@ -/// -/// - class TestObject { - + } $(function () { - // basic test - // written in according to basic example from documentation - var htmlSelect = '
    ' + + // basic test + // written in according to basic example from documentation + var htmlSelect = '' + '
    ' + '
    ' + '
    ' + @@ -21,7 +18,7 @@ $(function () { console.log('characters count: ' + $('#flagstrap').html().length + '\n' + $('#flagstrap').html()); // options test - // options -> data attributes + // options -> data attributes // written in according to options -> data attributes example from documentation htmlSelect = '' + '
    ' + @@ -42,7 +39,7 @@ $(function () { console.log('\n\ncharacters count: ' + $('#flagstrap2').html().length + '\n' + $('#flagstrap2').html()); // options test - // options -> instance options + // options -> instance options // written in according to options -> instance options example from documentation htmlSelect = '' + '
    ' + diff --git a/jquery.flagstrap/tsconfig.json b/types/jquery.flagstrap/tsconfig.json similarity index 100% rename from jquery.flagstrap/tsconfig.json rename to types/jquery.flagstrap/tsconfig.json diff --git a/jquery.form/index.d.ts b/types/jquery.form/index.d.ts similarity index 100% rename from jquery.form/index.d.ts rename to types/jquery.form/index.d.ts diff --git a/jquery.form/jquery.form-tests.ts b/types/jquery.form/jquery.form-tests.ts similarity index 73% rename from jquery.form/jquery.form-tests.ts rename to types/jquery.form/jquery.form-tests.ts index f115a97f57..c4d3d636bf 100644 --- a/jquery.form/jquery.form-tests.ts +++ b/types/jquery.form/jquery.form-tests.ts @@ -1,5 +1,3 @@ -/// - // Basic usage jQuery('#myFormId').ajaxForm(); @@ -30,112 +28,112 @@ jQuery.fn.ajaxSubmit.debug = true; // ajaxForm -// bind form using 'ajaxForm' +// bind form using 'ajaxForm' $('#myForm1').ajaxForm({ - target: '#output1', // target element(s) to be updated with server response + 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 + // 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]; + // 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 + // 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 - + // 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 + // 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 + // $.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 + 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 + // 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]; + // 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 + // 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 + // 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 '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 + // 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 + // 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 + // $.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. + // 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) { @@ -150,13 +148,13 @@ $('#myForm2').ajaxForm({ // JSON $('#jsonForm').ajaxForm({ - // dataType identifies the expected content type of the server response + // 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 identifies the function to invoke when the server response + // has been received success: function (data) { - // 'data' is the json object returned from the server + // 'data' is the json object returned from the server alert(data.message); } }); @@ -164,14 +162,14 @@ $('#jsonForm').ajaxForm({ // XML $('#xmlForm').ajaxForm({ - // dataType identifies the expected content type of the server response + // 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 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 + // '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); } @@ -180,11 +178,11 @@ $('#xmlForm').ajaxForm({ // HTML $('#htmlForm').ajaxForm({ - // target identifies the element(s) to update with the server response + // 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 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'); } diff --git a/jquery.form/tsconfig.json b/types/jquery.form/tsconfig.json similarity index 100% rename from jquery.form/tsconfig.json rename to types/jquery.form/tsconfig.json diff --git a/jquery.fullscreen/index.d.ts b/types/jquery.fullscreen/index.d.ts similarity index 100% rename from jquery.fullscreen/index.d.ts rename to types/jquery.fullscreen/index.d.ts diff --git a/jquery.fullscreen/jquery.fullscreen-tests.ts b/types/jquery.fullscreen/jquery.fullscreen-tests.ts similarity index 100% rename from jquery.fullscreen/jquery.fullscreen-tests.ts rename to types/jquery.fullscreen/jquery.fullscreen-tests.ts diff --git a/jquery.fullscreen/tsconfig.json b/types/jquery.fullscreen/tsconfig.json similarity index 100% rename from jquery.fullscreen/tsconfig.json rename to types/jquery.fullscreen/tsconfig.json diff --git a/jquery.gridster/index.d.ts b/types/jquery.gridster/index.d.ts similarity index 100% rename from jquery.gridster/index.d.ts rename to types/jquery.gridster/index.d.ts diff --git a/jquery.gridster/jquery.gridster-tests.ts b/types/jquery.gridster/jquery.gridster-tests.ts similarity index 100% rename from jquery.gridster/jquery.gridster-tests.ts rename to types/jquery.gridster/jquery.gridster-tests.ts diff --git a/jquery.gridster/tsconfig.json b/types/jquery.gridster/tsconfig.json similarity index 100% rename from jquery.gridster/tsconfig.json rename to types/jquery.gridster/tsconfig.json diff --git a/jquery.highlight-bartaz/index.d.ts b/types/jquery.highlight-bartaz/index.d.ts similarity index 100% rename from jquery.highlight-bartaz/index.d.ts rename to types/jquery.highlight-bartaz/index.d.ts diff --git a/jquery.highlight-bartaz/jquery.highlight-bartaz-tests.ts b/types/jquery.highlight-bartaz/jquery.highlight-bartaz-tests.ts similarity index 100% rename from jquery.highlight-bartaz/jquery.highlight-bartaz-tests.ts rename to types/jquery.highlight-bartaz/jquery.highlight-bartaz-tests.ts diff --git a/jquery.highlight-bartaz/tsconfig.json b/types/jquery.highlight-bartaz/tsconfig.json similarity index 100% rename from jquery.highlight-bartaz/tsconfig.json rename to types/jquery.highlight-bartaz/tsconfig.json diff --git a/jquery.jnotify/index.d.ts b/types/jquery.jnotify/index.d.ts similarity index 100% rename from jquery.jnotify/index.d.ts rename to types/jquery.jnotify/index.d.ts diff --git a/jquery.jnotify/jquery.jnotify-tests.ts b/types/jquery.jnotify/jquery.jnotify-tests.ts similarity index 97% rename from jquery.jnotify/jquery.jnotify-tests.ts rename to types/jquery.jnotify/jquery.jnotify-tests.ts index b5ad3927e2..f38a99760a 100644 --- a/jquery.jnotify/jquery.jnotify-tests.ts +++ b/types/jquery.jnotify/jquery.jnotify-tests.ts @@ -1,5 +1,3 @@ -/// - $(document).ready(function () { $('#StatusBar').jnotifyInizialize({ oneAtTime: true diff --git a/jquery.jnotify/tsconfig.json b/types/jquery.jnotify/tsconfig.json similarity index 100% rename from jquery.jnotify/tsconfig.json rename to types/jquery.jnotify/tsconfig.json diff --git a/jquery.joyride/index.d.ts b/types/jquery.joyride/index.d.ts similarity index 100% rename from jquery.joyride/index.d.ts rename to types/jquery.joyride/index.d.ts diff --git a/jquery.joyride/jquery.joyride-tests.ts b/types/jquery.joyride/jquery.joyride-tests.ts similarity index 89% rename from jquery.joyride/jquery.joyride-tests.ts rename to types/jquery.joyride/jquery.joyride-tests.ts index f0a51b5270..c7324dd6c9 100644 --- a/jquery.joyride/jquery.joyride-tests.ts +++ b/types/jquery.joyride/jquery.joyride-tests.ts @@ -1,6 +1,3 @@ -/// - - var options: JoyrideOptions; options.autoStart = true; options.postStepCallback = (index, tip)=> { diff --git a/jquery.joyride/tsconfig.json b/types/jquery.joyride/tsconfig.json similarity index 100% rename from jquery.joyride/tsconfig.json rename to types/jquery.joyride/tsconfig.json diff --git a/jquery.jsignature/index.d.ts b/types/jquery.jsignature/index.d.ts similarity index 100% rename from jquery.jsignature/index.d.ts rename to types/jquery.jsignature/index.d.ts diff --git a/jquery.jsignature/jquery.jsignature-tests.ts b/types/jquery.jsignature/jquery.jsignature-tests.ts similarity index 88% rename from jquery.jsignature/jquery.jsignature-tests.ts rename to types/jquery.jsignature/jquery.jsignature-tests.ts index 5ec4bc486d..58d73fe24b 100644 --- a/jquery.jsignature/jquery.jsignature-tests.ts +++ b/types/jquery.jsignature/jquery.jsignature-tests.ts @@ -1,8 +1,6 @@ -/// - /* * Taken from the tests section on jSignature - */ + */ $(document).ready(function () { var $sigdiv = $('#signature'); @@ -10,7 +8,7 @@ $(document).ready(function () { $sigdiv.jSignature(); $sigdiv.jSignature("reset"); - + var data = $sigdiv.jSignature("getData", "svgbase64"); $sigdiv.jSignature("setData", "data:" + data); diff --git a/jquery.jsignature/tsconfig.json b/types/jquery.jsignature/tsconfig.json similarity index 100% rename from jquery.jsignature/tsconfig.json rename to types/jquery.jsignature/tsconfig.json diff --git a/jquery.leanmodal/index.d.ts b/types/jquery.leanmodal/index.d.ts similarity index 100% rename from jquery.leanmodal/index.d.ts rename to types/jquery.leanmodal/index.d.ts diff --git a/jquery.leanmodal/jquery.leanmodal-tests.ts b/types/jquery.leanmodal/jquery.leanmodal-tests.ts similarity index 90% rename from jquery.leanmodal/jquery.leanmodal-tests.ts rename to types/jquery.leanmodal/jquery.leanmodal-tests.ts index fb6c4ae344..1884cb25d9 100644 --- a/jquery.leanmodal/jquery.leanmodal-tests.ts +++ b/types/jquery.leanmodal/jquery.leanmodal-tests.ts @@ -1,6 +1,3 @@ -/// - - class LeanModalOptions implements JQueryLeanModalOption { top : number; overlay : number; diff --git a/jquery.leanmodal/tsconfig.json b/types/jquery.leanmodal/tsconfig.json similarity index 100% rename from jquery.leanmodal/tsconfig.json rename to types/jquery.leanmodal/tsconfig.json diff --git a/jquery.livestampjs/index.d.ts b/types/jquery.livestampjs/index.d.ts similarity index 100% rename from jquery.livestampjs/index.d.ts rename to types/jquery.livestampjs/index.d.ts diff --git a/jquery.livestampjs/jquery.livestampjs-tests.ts b/types/jquery.livestampjs/jquery.livestampjs-tests.ts similarity index 91% rename from jquery.livestampjs/jquery.livestampjs-tests.ts rename to types/jquery.livestampjs/jquery.livestampjs-tests.ts index dc713819c9..6b5bd01835 100644 --- a/jquery.livestampjs/jquery.livestampjs-tests.ts +++ b/types/jquery.livestampjs/jquery.livestampjs-tests.ts @@ -1,4 +1,3 @@ -/// import * as moment from 'moment'; $('#test1').livestamp(new Date('June 18, 1987')); diff --git a/jquery.livestampjs/package.json b/types/jquery.livestampjs/package.json similarity index 100% rename from jquery.livestampjs/package.json rename to types/jquery.livestampjs/package.json diff --git a/jquery.livestampjs/tsconfig.json b/types/jquery.livestampjs/tsconfig.json similarity index 100% rename from jquery.livestampjs/tsconfig.json rename to types/jquery.livestampjs/tsconfig.json diff --git a/jquery.menuaim/index.d.ts b/types/jquery.menuaim/index.d.ts similarity index 100% rename from jquery.menuaim/index.d.ts rename to types/jquery.menuaim/index.d.ts diff --git a/jquery.menuaim/jquery.menuaim-tests.ts b/types/jquery.menuaim/jquery.menuaim-tests.ts similarity index 88% rename from jquery.menuaim/jquery.menuaim-tests.ts rename to types/jquery.menuaim/jquery.menuaim-tests.ts index e2a1b36aff..01baa59e03 100644 --- a/jquery.menuaim/jquery.menuaim-tests.ts +++ b/types/jquery.menuaim/jquery.menuaim-tests.ts @@ -1,5 +1,3 @@ -/// - $('div').menuAim({ activate: function () { }, deactivate: function () { }, diff --git a/jquery.menuaim/tsconfig.json b/types/jquery.menuaim/tsconfig.json similarity index 100% rename from jquery.menuaim/tsconfig.json rename to types/jquery.menuaim/tsconfig.json diff --git a/jquery.mmenu/index.d.ts b/types/jquery.mmenu/index.d.ts similarity index 100% rename from jquery.mmenu/index.d.ts rename to types/jquery.mmenu/index.d.ts diff --git a/jquery.mmenu/jquery.mmenu-tests.ts b/types/jquery.mmenu/jquery.mmenu-tests.ts similarity index 96% rename from jquery.mmenu/jquery.mmenu-tests.ts rename to types/jquery.mmenu/jquery.mmenu-tests.ts index 385f479507..a08f4371ec 100644 --- a/jquery.mmenu/jquery.mmenu-tests.ts +++ b/types/jquery.mmenu/jquery.mmenu-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - // -------------------------------------------------------- // ---------------- TEST DEFAULT OPTIONS ------------------ // -------------------------------------------------------- diff --git a/jquery.mmenu/tsconfig.json b/types/jquery.mmenu/tsconfig.json similarity index 100% rename from jquery.mmenu/tsconfig.json rename to types/jquery.mmenu/tsconfig.json diff --git a/jquery.notifybar/index.d.ts b/types/jquery.notifybar/index.d.ts similarity index 100% rename from jquery.notifybar/index.d.ts rename to types/jquery.notifybar/index.d.ts diff --git a/jquery.notifybar/jquery.notifybar-tests.ts b/types/jquery.notifybar/jquery.notifybar-tests.ts similarity index 100% rename from jquery.notifybar/jquery.notifybar-tests.ts rename to types/jquery.notifybar/jquery.notifybar-tests.ts diff --git a/jquery.notifybar/tsconfig.json b/types/jquery.notifybar/tsconfig.json similarity index 100% rename from jquery.notifybar/tsconfig.json rename to types/jquery.notifybar/tsconfig.json diff --git a/jquery.noty/index.d.ts b/types/jquery.noty/index.d.ts similarity index 100% rename from jquery.noty/index.d.ts rename to types/jquery.noty/index.d.ts diff --git a/jquery.noty/tsconfig.json b/types/jquery.noty/tsconfig.json similarity index 100% rename from jquery.noty/tsconfig.json rename to types/jquery.noty/tsconfig.json diff --git a/jquery.payment/index.d.ts b/types/jquery.payment/index.d.ts similarity index 99% rename from jquery.payment/index.d.ts rename to types/jquery.payment/index.d.ts index 341e695a9a..88ecd255a5 100644 --- a/jquery.payment/index.d.ts +++ b/types/jquery.payment/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Eric J. Smith , John Rutherford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare namespace JQueryPayment { interface Payment { diff --git a/jquery.payment/jquery.payment-tests.ts b/types/jquery.payment/jquery.payment-tests.ts similarity index 95% rename from jquery.payment/jquery.payment-tests.ts rename to types/jquery.payment/jquery.payment-tests.ts index db02b96d90..9eaad853cb 100644 --- a/jquery.payment/jquery.payment-tests.ts +++ b/types/jquery.payment/jquery.payment-tests.ts @@ -1,6 +1,3 @@ -/// -/// - $.payment.cards.push({ // Card type, as returned by $.payment.cardType. type: 'mastercard', diff --git a/jquery.payment/tsconfig.json b/types/jquery.payment/tsconfig.json similarity index 100% rename from jquery.payment/tsconfig.json rename to types/jquery.payment/tsconfig.json diff --git a/jquery.pjax.falsandtru/index.d.ts b/types/jquery.pjax.falsandtru/index.d.ts similarity index 100% rename from jquery.pjax.falsandtru/index.d.ts rename to types/jquery.pjax.falsandtru/index.d.ts diff --git a/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts b/types/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts similarity index 94% rename from jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts rename to types/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts index 8bfb91a27e..b215b02b35 100644 --- a/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts +++ b/types/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_pjax() { $.pjax(); } diff --git a/jquery.pjax.falsandtru/tsconfig.json b/types/jquery.pjax.falsandtru/tsconfig.json similarity index 100% rename from jquery.pjax.falsandtru/tsconfig.json rename to types/jquery.pjax.falsandtru/tsconfig.json diff --git a/jquery.pjax/index.d.ts b/types/jquery.pjax/index.d.ts similarity index 100% rename from jquery.pjax/index.d.ts rename to types/jquery.pjax/index.d.ts diff --git a/jquery.pjax/jquery.pjax-tests.ts b/types/jquery.pjax/jquery.pjax-tests.ts similarity index 97% rename from jquery.pjax/jquery.pjax-tests.ts rename to types/jquery.pjax/jquery.pjax-tests.ts index 25422922d8..91cc9391a2 100644 --- a/jquery.pjax/jquery.pjax-tests.ts +++ b/types/jquery.pjax/jquery.pjax-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_fn_pjax() { $(document).pjax("a"); $(document).pjax("a", "#pjax-container"); diff --git a/jquery.pjax/tsconfig.json b/types/jquery.pjax/tsconfig.json similarity index 100% rename from jquery.pjax/tsconfig.json rename to types/jquery.pjax/tsconfig.json diff --git a/jquery.placeholder/index.d.ts b/types/jquery.placeholder/index.d.ts similarity index 100% rename from jquery.placeholder/index.d.ts rename to types/jquery.placeholder/index.d.ts diff --git a/jquery.placeholder/jquery.placeholder-tests.ts b/types/jquery.placeholder/jquery.placeholder-tests.ts similarity index 77% rename from jquery.placeholder/jquery.placeholder-tests.ts rename to types/jquery.placeholder/jquery.placeholder-tests.ts index edaf3ea111..04c526b352 100644 --- a/jquery.placeholder/jquery.placeholder-tests.ts +++ b/types/jquery.placeholder/jquery.placeholder-tests.ts @@ -1,5 +1,3 @@ -/// - $('input').placeholder(); // specify custom class diff --git a/jquery.placeholder/tsconfig.json b/types/jquery.placeholder/tsconfig.json similarity index 100% rename from jquery.placeholder/tsconfig.json rename to types/jquery.placeholder/tsconfig.json diff --git a/jquery.pnotify/index.d.ts b/types/jquery.pnotify/index.d.ts similarity index 100% rename from jquery.pnotify/index.d.ts rename to types/jquery.pnotify/index.d.ts diff --git a/jquery.pnotify/jquery.pnotify-tests.ts b/types/jquery.pnotify/jquery.pnotify-tests.ts similarity index 99% rename from jquery.pnotify/jquery.pnotify-tests.ts rename to types/jquery.pnotify/jquery.pnotify-tests.ts index 41cd7d3fda..f1b8ffb73e 100644 --- a/jquery.pnotify/jquery.pnotify-tests.ts +++ b/types/jquery.pnotify/jquery.pnotify-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_pnotify() { diff --git a/jquery.pnotify/tsconfig.json b/types/jquery.pnotify/tsconfig.json similarity index 100% rename from jquery.pnotify/tsconfig.json rename to types/jquery.pnotify/tsconfig.json diff --git a/jquery.postmessage/index.d.ts b/types/jquery.postmessage/index.d.ts similarity index 100% rename from jquery.postmessage/index.d.ts rename to types/jquery.postmessage/index.d.ts diff --git a/jquery.postmessage/jquery.postmessage-tests.ts b/types/jquery.postmessage/jquery.postmessage-tests.ts similarity index 100% rename from jquery.postmessage/jquery.postmessage-tests.ts rename to types/jquery.postmessage/jquery.postmessage-tests.ts diff --git a/jquery.postmessage/tsconfig.json b/types/jquery.postmessage/tsconfig.json similarity index 100% rename from jquery.postmessage/tsconfig.json rename to types/jquery.postmessage/tsconfig.json diff --git a/jquery.prettyphoto/index.d.ts b/types/jquery.prettyphoto/index.d.ts similarity index 100% rename from jquery.prettyphoto/index.d.ts rename to types/jquery.prettyphoto/index.d.ts diff --git a/jquery.prettyphoto/jquery.prettyphoto-tests.ts b/types/jquery.prettyphoto/jquery.prettyphoto-tests.ts similarity index 88% rename from jquery.prettyphoto/jquery.prettyphoto-tests.ts rename to types/jquery.prettyphoto/jquery.prettyphoto-tests.ts index 4fcbf9ecdf..888d68ada4 100644 --- a/jquery.prettyphoto/jquery.prettyphoto-tests.ts +++ b/types/jquery.prettyphoto/jquery.prettyphoto-tests.ts @@ -1,8 +1,3 @@ -// Tests for prettyPhoto library - -/// - - // JQUERY $('#id').prettyPhoto(); diff --git a/jquery.prettyphoto/tsconfig.json b/types/jquery.prettyphoto/tsconfig.json similarity index 100% rename from jquery.prettyphoto/tsconfig.json rename to types/jquery.prettyphoto/tsconfig.json diff --git a/jquery.qrcode/index.d.ts b/types/jquery.qrcode/index.d.ts similarity index 100% rename from jquery.qrcode/index.d.ts rename to types/jquery.qrcode/index.d.ts diff --git a/jquery.qrcode/jquery.qrcode-tests.ts b/types/jquery.qrcode/jquery.qrcode-tests.ts similarity index 97% rename from jquery.qrcode/jquery.qrcode-tests.ts rename to types/jquery.qrcode/jquery.qrcode-tests.ts index a634bd6f07..d007b203da 100644 --- a/jquery.qrcode/jquery.qrcode-tests.ts +++ b/types/jquery.qrcode/jquery.qrcode-tests.ts @@ -1,5 +1,3 @@ -/// - // Examples from website (note: the examples use color instead of fill, which is not supported) $('.container').qrcode(); diff --git a/jquery.qrcode/tsconfig.json b/types/jquery.qrcode/tsconfig.json similarity index 100% rename from jquery.qrcode/tsconfig.json rename to types/jquery.qrcode/tsconfig.json diff --git a/jquery.rateit/index.d.ts b/types/jquery.rateit/index.d.ts similarity index 100% rename from jquery.rateit/index.d.ts rename to types/jquery.rateit/index.d.ts diff --git a/jquery.rateit/jquery.rateit-tests.ts b/types/jquery.rateit/jquery.rateit-tests.ts similarity index 100% rename from jquery.rateit/jquery.rateit-tests.ts rename to types/jquery.rateit/jquery.rateit-tests.ts diff --git a/jquery.rateit/tsconfig.json b/types/jquery.rateit/tsconfig.json similarity index 100% rename from jquery.rateit/tsconfig.json rename to types/jquery.rateit/tsconfig.json diff --git a/jquery.rowgrid/index.d.ts b/types/jquery.rowgrid/index.d.ts similarity index 100% rename from jquery.rowgrid/index.d.ts rename to types/jquery.rowgrid/index.d.ts diff --git a/jquery.rowgrid/jquery.rowgrid-tests.ts b/types/jquery.rowgrid/jquery.rowgrid-tests.ts similarity index 81% rename from jquery.rowgrid/jquery.rowgrid-tests.ts rename to types/jquery.rowgrid/jquery.rowgrid-tests.ts index ba3e5f822d..3f1427c94a 100644 --- a/jquery.rowgrid/jquery.rowgrid-tests.ts +++ b/types/jquery.rowgrid/jquery.rowgrid-tests.ts @@ -1,12 +1,10 @@ -/// - /* * Test different options */ var options = { - minMargin: 10, - maxMargin: 35, + minMargin: 10, + maxMargin: 35, itemSelector: ".item" }; diff --git a/jquery.rowgrid/tsconfig.json b/types/jquery.rowgrid/tsconfig.json similarity index 100% rename from jquery.rowgrid/tsconfig.json rename to types/jquery.rowgrid/tsconfig.json diff --git a/jquery.scrollto/index.d.ts b/types/jquery.scrollto/index.d.ts similarity index 100% rename from jquery.scrollto/index.d.ts rename to types/jquery.scrollto/index.d.ts diff --git a/jquery.scrollto/jquery.scrollto-tests.ts b/types/jquery.scrollto/jquery.scrollto-tests.ts similarity index 95% rename from jquery.scrollto/jquery.scrollto-tests.ts rename to types/jquery.scrollto/jquery.scrollto-tests.ts index 303ce0cd01..fcdc2f50bb 100644 --- a/jquery.scrollto/jquery.scrollto-tests.ts +++ b/types/jquery.scrollto/jquery.scrollto-tests.ts @@ -1,5 +1,3 @@ -/// - $('div').scrollTo(340); $('div').scrollTo('+=340px', { axis: 'y' }); diff --git a/jquery.scrollto/tsconfig.json b/types/jquery.scrollto/tsconfig.json similarity index 100% rename from jquery.scrollto/tsconfig.json rename to types/jquery.scrollto/tsconfig.json diff --git a/jquery.simplemodal/index.d.ts b/types/jquery.simplemodal/index.d.ts similarity index 100% rename from jquery.simplemodal/index.d.ts rename to types/jquery.simplemodal/index.d.ts diff --git a/jquery.simplemodal/jquery.simplemodal-tests.ts b/types/jquery.simplemodal/jquery.simplemodal-tests.ts similarity index 98% rename from jquery.simplemodal/jquery.simplemodal-tests.ts rename to types/jquery.simplemodal/jquery.simplemodal-tests.ts index 8e73e057cc..0784f0eeeb 100644 --- a/jquery.simplemodal/jquery.simplemodal-tests.ts +++ b/types/jquery.simplemodal/jquery.simplemodal-tests.ts @@ -1,7 +1,5 @@ // Tests taken from documentation: http://www.ericmmartin.com/projects/simplemodal/ -/// - // Chained call with no options $("#sample").modal(); diff --git a/jquery.simplemodal/tsconfig.json b/types/jquery.simplemodal/tsconfig.json similarity index 100% rename from jquery.simplemodal/tsconfig.json rename to types/jquery.simplemodal/tsconfig.json diff --git a/jquery.simplepagination/index.d.ts b/types/jquery.simplepagination/index.d.ts similarity index 100% rename from jquery.simplepagination/index.d.ts rename to types/jquery.simplepagination/index.d.ts diff --git a/jquery.simplepagination/jquery.simplepagination-tests.ts b/types/jquery.simplepagination/jquery.simplepagination-tests.ts similarity index 96% rename from jquery.simplepagination/jquery.simplepagination-tests.ts rename to types/jquery.simplepagination/jquery.simplepagination-tests.ts index b35a6f42a0..075fe02628 100644 --- a/jquery.simplepagination/jquery.simplepagination-tests.ts +++ b/types/jquery.simplepagination/jquery.simplepagination-tests.ts @@ -1,5 +1,3 @@ -/// - var selector = '#elementId'; $(function () { diff --git a/jquery.simplepagination/tsconfig.json b/types/jquery.simplepagination/tsconfig.json similarity index 100% rename from jquery.simplepagination/tsconfig.json rename to types/jquery.simplepagination/tsconfig.json diff --git a/jquery.simulate/index.d.ts b/types/jquery.simulate/index.d.ts similarity index 100% rename from jquery.simulate/index.d.ts rename to types/jquery.simulate/index.d.ts diff --git a/jquery.simulate/jquery.simulate-tests.ts b/types/jquery.simulate/jquery.simulate-tests.ts similarity index 100% rename from jquery.simulate/jquery.simulate-tests.ts rename to types/jquery.simulate/jquery.simulate-tests.ts diff --git a/jquery.simulate/tsconfig.json b/types/jquery.simulate/tsconfig.json similarity index 100% rename from jquery.simulate/tsconfig.json rename to types/jquery.simulate/tsconfig.json diff --git a/jquery.slimscroll/index.d.ts b/types/jquery.slimscroll/index.d.ts similarity index 100% rename from jquery.slimscroll/index.d.ts rename to types/jquery.slimscroll/index.d.ts diff --git a/jquery.slimscroll/jquery.slimscroll-tests.ts b/types/jquery.slimscroll/jquery.slimscroll-tests.ts similarity index 96% rename from jquery.slimscroll/jquery.slimscroll-tests.ts rename to types/jquery.slimscroll/jquery.slimscroll-tests.ts index 0d4be5af94..a0368d07e9 100644 --- a/jquery.slimscroll/jquery.slimscroll-tests.ts +++ b/types/jquery.slimscroll/jquery.slimscroll-tests.ts @@ -1,5 +1,3 @@ -/// - $("div").slimScroll(); $("div").slimScroll({ diff --git a/jquery.slimscroll/tsconfig.json b/types/jquery.slimscroll/tsconfig.json similarity index 100% rename from jquery.slimscroll/tsconfig.json rename to types/jquery.slimscroll/tsconfig.json diff --git a/jquery.soap/index.d.ts b/types/jquery.soap/index.d.ts similarity index 100% rename from jquery.soap/index.d.ts rename to types/jquery.soap/index.d.ts diff --git a/jquery.soap/jquery.soap-tests.ts b/types/jquery.soap/jquery.soap-tests.ts similarity index 100% rename from jquery.soap/jquery.soap-tests.ts rename to types/jquery.soap/jquery.soap-tests.ts diff --git a/jquery.soap/tsconfig.json b/types/jquery.soap/tsconfig.json similarity index 100% rename from jquery.soap/tsconfig.json rename to types/jquery.soap/tsconfig.json diff --git a/jquery.sortelements/index.d.ts b/types/jquery.sortelements/index.d.ts similarity index 100% rename from jquery.sortelements/index.d.ts rename to types/jquery.sortelements/index.d.ts diff --git a/jquery.sortelements/tsconfig.json b/types/jquery.sortelements/tsconfig.json similarity index 100% rename from jquery.sortelements/tsconfig.json rename to types/jquery.sortelements/tsconfig.json diff --git a/jquery.superlink/index.d.ts b/types/jquery.superlink/index.d.ts similarity index 100% rename from jquery.superlink/index.d.ts rename to types/jquery.superlink/index.d.ts diff --git a/jquery.superlink/tsconfig.json b/types/jquery.superlink/tsconfig.json similarity index 100% rename from jquery.superlink/tsconfig.json rename to types/jquery.superlink/tsconfig.json diff --git a/jquery.tagsmanager/index.d.ts b/types/jquery.tagsmanager/index.d.ts similarity index 100% rename from jquery.tagsmanager/index.d.ts rename to types/jquery.tagsmanager/index.d.ts diff --git a/jquery.tagsmanager/jquery.tagsmanager-tests.ts b/types/jquery.tagsmanager/jquery.tagsmanager-tests.ts similarity index 94% rename from jquery.tagsmanager/jquery.tagsmanager-tests.ts rename to types/jquery.tagsmanager/jquery.tagsmanager-tests.ts index 33af6a8b7b..26a75e8310 100644 --- a/jquery.tagsmanager/jquery.tagsmanager-tests.ts +++ b/types/jquery.tagsmanager/jquery.tagsmanager-tests.ts @@ -1,6 +1,3 @@ -/// - - var options: ITagsManagerOptions = { prefilled: ["Pisa", "Rome"], CapitalizeFirstLetter: true, diff --git a/jquery.tagsmanager/tsconfig.json b/types/jquery.tagsmanager/tsconfig.json similarity index 100% rename from jquery.tagsmanager/tsconfig.json rename to types/jquery.tagsmanager/tsconfig.json diff --git a/jquery.tile/index.d.ts b/types/jquery.tile/index.d.ts similarity index 100% rename from jquery.tile/index.d.ts rename to types/jquery.tile/index.d.ts diff --git a/jquery.tile/jquery.tile-tests.ts b/types/jquery.tile/jquery.tile-tests.ts similarity index 100% rename from jquery.tile/jquery.tile-tests.ts rename to types/jquery.tile/jquery.tile-tests.ts diff --git a/jquery.tile/tsconfig.json b/types/jquery.tile/tsconfig.json similarity index 100% rename from jquery.tile/tsconfig.json rename to types/jquery.tile/tsconfig.json diff --git a/jquery.timeago/index.d.ts b/types/jquery.timeago/index.d.ts similarity index 100% rename from jquery.timeago/index.d.ts rename to types/jquery.timeago/index.d.ts diff --git a/jquery.timeago/jquery.timeago-tests.ts b/types/jquery.timeago/jquery.timeago-tests.ts similarity index 98% rename from jquery.timeago/jquery.timeago-tests.ts rename to types/jquery.timeago/jquery.timeago-tests.ts index 2a852331be..f77b40b121 100644 --- a/jquery.timeago/jquery.timeago-tests.ts +++ b/types/jquery.timeago/jquery.timeago-tests.ts @@ -1,5 +1,3 @@ -/// - // Basic usage var jQueryElement: JQuery = jQuery("abbr.timeago").timeago(); diff --git a/jquery.timeago/tsconfig.json b/types/jquery.timeago/tsconfig.json similarity index 100% rename from jquery.timeago/tsconfig.json rename to types/jquery.timeago/tsconfig.json diff --git a/jquery.timepicker/index.d.ts b/types/jquery.timepicker/index.d.ts similarity index 100% rename from jquery.timepicker/index.d.ts rename to types/jquery.timepicker/index.d.ts diff --git a/jquery.timepicker/jquery.timepicker-tests.ts b/types/jquery.timepicker/jquery.timepicker-tests.ts similarity index 97% rename from jquery.timepicker/jquery.timepicker-tests.ts rename to types/jquery.timepicker/jquery.timepicker-tests.ts index cbb14dfe7c..52329cf11a 100644 --- a/jquery.timepicker/jquery.timepicker-tests.ts +++ b/types/jquery.timepicker/jquery.timepicker-tests.ts @@ -1,5 +1,3 @@ -/// - var beforeShowCallback, onSelectCallback, onCloseCallback, onHourShow, onMinuteShow; $('#timepicker').timepicker({ timeSeparator: ':', diff --git a/jquery.timepicker/tsconfig.json b/types/jquery.timepicker/tsconfig.json similarity index 100% rename from jquery.timepicker/tsconfig.json rename to types/jquery.timepicker/tsconfig.json diff --git a/jquery.timer/index.d.ts b/types/jquery.timer/index.d.ts similarity index 100% rename from jquery.timer/index.d.ts rename to types/jquery.timer/index.d.ts diff --git a/types/jquery.timer/jquery.timer-tests.ts b/types/jquery.timer/jquery.timer-tests.ts new file mode 100644 index 0000000000..1c6653bfdb --- /dev/null +++ b/types/jquery.timer/jquery.timer-tests.ts @@ -0,0 +1,28 @@ +// 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.timer/tsconfig.json b/types/jquery.timer/tsconfig.json similarity index 100% rename from jquery.timer/tsconfig.json rename to types/jquery.timer/tsconfig.json diff --git a/jquery.tinycarousel/index.d.ts b/types/jquery.tinycarousel/index.d.ts similarity index 100% rename from jquery.tinycarousel/index.d.ts rename to types/jquery.tinycarousel/index.d.ts diff --git a/jquery.tinycarousel/jquery.tinycarousel-tests.ts b/types/jquery.tinycarousel/jquery.tinycarousel-tests.ts similarity index 100% rename from jquery.tinycarousel/jquery.tinycarousel-tests.ts rename to types/jquery.tinycarousel/jquery.tinycarousel-tests.ts diff --git a/jquery.tinycarousel/tsconfig.json b/types/jquery.tinycarousel/tsconfig.json similarity index 100% rename from jquery.tinycarousel/tsconfig.json rename to types/jquery.tinycarousel/tsconfig.json diff --git a/jquery.tinyscrollbar/index.d.ts b/types/jquery.tinyscrollbar/index.d.ts similarity index 100% rename from jquery.tinyscrollbar/index.d.ts rename to types/jquery.tinyscrollbar/index.d.ts diff --git a/jquery.tinyscrollbar/jquery.tinyscrollbar-tests.ts b/types/jquery.tinyscrollbar/jquery.tinyscrollbar-tests.ts similarity index 100% rename from jquery.tinyscrollbar/jquery.tinyscrollbar-tests.ts rename to types/jquery.tinyscrollbar/jquery.tinyscrollbar-tests.ts diff --git a/jquery.tinyscrollbar/tsconfig.json b/types/jquery.tinyscrollbar/tsconfig.json similarity index 100% rename from jquery.tinyscrollbar/tsconfig.json rename to types/jquery.tinyscrollbar/tsconfig.json diff --git a/jquery.tipsy/index.d.ts b/types/jquery.tipsy/index.d.ts similarity index 100% rename from jquery.tipsy/index.d.ts rename to types/jquery.tipsy/index.d.ts diff --git a/jquery.tipsy/jquery.tipsy-tests.ts b/types/jquery.tipsy/jquery.tipsy-tests.ts similarity index 96% rename from jquery.tipsy/jquery.tipsy-tests.ts rename to types/jquery.tipsy/jquery.tipsy-tests.ts index e307e5d364..09ba7f2d68 100644 --- a/jquery.tipsy/jquery.tipsy-tests.ts +++ b/types/jquery.tipsy/jquery.tipsy-tests.ts @@ -1,5 +1,3 @@ -/// - // basic $('#example-1').tipsy(); diff --git a/jquery.tipsy/tsconfig.json b/types/jquery.tipsy/tsconfig.json similarity index 100% rename from jquery.tipsy/tsconfig.json rename to types/jquery.tipsy/tsconfig.json diff --git a/jquery.tools/index.d.ts b/types/jquery.tools/index.d.ts similarity index 99% rename from jquery.tools/index.d.ts rename to types/jquery.tools/index.d.ts index e511a961fd..fa1bc80cb4 100644 --- a/jquery.tools/index.d.ts +++ b/types/jquery.tools/index.d.ts @@ -3,16 +3,15 @@ // Definitions by: Joe Skeen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - /// -declare interface JQuery { +interface JQuery { overlay(opts?: JQueryTools.overlay.OverlayOptions): JQuery; overlay(opts?: JQueryTools.overlay.OverlayOptions): T; data(key: 'overlay'): JQueryTools.overlay.Overlay; } -declare interface JQueryStatic { +interface JQueryStatic { tools: JQueryTools.ToolsStatic; } diff --git a/jquery.tools/jquery.tools-tests.ts b/types/jquery.tools/jquery.tools-tests.ts similarity index 91% rename from jquery.tools/jquery.tools-tests.ts rename to types/jquery.tools/jquery.tools-tests.ts index 0a435ccf02..5092b49bff 100644 --- a/jquery.tools/jquery.tools-tests.ts +++ b/types/jquery.tools/jquery.tools-tests.ts @@ -1,10 +1,8 @@ -/// - /* from documentation at http://jquerytools.github.io/documentation/overlay/index.html */ $("img[rel]").overlay(); - var triggers = $(".modalInput").overlay({ + const triggers = $(".modalInput").overlay({   // some mask tweaks suitable for modal dialogs mask: { @@ -16,10 +14,10 @@ closeOnClick: false }); - var buttons = $("#yesno button").click(function(this: JQuery, e: JQueryEventObject) { + const buttons = $("#yesno button").click(function(this: JQuery, e: JQueryEventObject) {   // get user input - var yes = buttons.index(this) === 0; + const yes = buttons.index(this) === 0;   // do something with the answer triggers.eq(0).html("You clicked " + (yes ? "yes" : "no")); @@ -44,7 +42,7 @@ $("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) { triggers.data('overlay').close();   // get user input - var input = $("input", this).val(); + const input = $("input", this).val();   // do something with the answer triggers.eq(1).html(input); @@ -103,7 +101,7 @@ $(function() {   onBeforeLoad() { // grab wrapper element inside content - var wrap = this.getOverlay().find(".contentWrap"); + const wrap = this.getOverlay().find(".contentWrap");   // load the page specified in the trigger wrap.load(this.getTrigger().attr("href")); @@ -114,7 +112,7 @@ $(function() { $(() => { // positions for each overlay - var positions = [ + const positions = [ [0, 530], [400, 20], [400, 530], @@ -145,7 +143,7 @@ $(() => { $.tools.overlay.addEffect("drop", function(css, done) {   // use Overlay API to gain access to crucial elements - var conf = this.getConf(), + const conf = this.getConf(), overlay = this.getOverlay();   // determine initial position for the overlay diff --git a/jquery.tools/tsconfig.json b/types/jquery.tools/tsconfig.json similarity index 100% rename from jquery.tools/tsconfig.json rename to types/jquery.tools/tsconfig.json diff --git a/jui/tslint.json b/types/jquery.tools/tslint.json similarity index 100% rename from jui/tslint.json rename to types/jquery.tools/tslint.json diff --git a/jquery.tooltipster/index.d.ts b/types/jquery.tooltipster/index.d.ts similarity index 100% rename from jquery.tooltipster/index.d.ts rename to types/jquery.tooltipster/index.d.ts diff --git a/jquery.tooltipster/jquery.tooltipster-tests.ts b/types/jquery.tooltipster/jquery.tooltipster-tests.ts similarity index 100% rename from jquery.tooltipster/jquery.tooltipster-tests.ts rename to types/jquery.tooltipster/jquery.tooltipster-tests.ts diff --git a/jquery.tooltipster/tsconfig.json b/types/jquery.tooltipster/tsconfig.json similarity index 100% rename from jquery.tooltipster/tsconfig.json rename to types/jquery.tooltipster/tsconfig.json diff --git a/jquery.total-storage/index.d.ts b/types/jquery.total-storage/index.d.ts similarity index 100% rename from jquery.total-storage/index.d.ts rename to types/jquery.total-storage/index.d.ts diff --git a/jquery.total-storage/jquery.total-storage-tests.ts b/types/jquery.total-storage/jquery.total-storage-tests.ts similarity index 53% rename from jquery.total-storage/jquery.total-storage-tests.ts rename to types/jquery.total-storage/jquery.total-storage-tests.ts index 0a23dd67cf..37ebb1ca73 100644 --- a/jquery.total-storage/jquery.total-storage-tests.ts +++ b/types/jquery.total-storage/jquery.total-storage-tests.ts @@ -1,10 +1,3 @@ -// 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"); diff --git a/jquery.total-storage/tsconfig.json b/types/jquery.total-storage/tsconfig.json similarity index 100% rename from jquery.total-storage/tsconfig.json rename to types/jquery.total-storage/tsconfig.json diff --git a/jquery.transit/index.d.ts b/types/jquery.transit/index.d.ts similarity index 100% rename from jquery.transit/index.d.ts rename to types/jquery.transit/index.d.ts diff --git a/jquery.transit/jquery.transit-tests.ts b/types/jquery.transit/jquery.transit-tests.ts similarity index 99% rename from jquery.transit/jquery.transit-tests.ts rename to types/jquery.transit/jquery.transit-tests.ts index 2a672ec979..4f3b41f228 100644 --- a/jquery.transit/jquery.transit-tests.ts +++ b/types/jquery.transit/jquery.transit-tests.ts @@ -1,5 +1,3 @@ -/// - class TransitOptions implements JQueryTransitOptions { opacity: number; duration: number; diff --git a/jquery.transit/tsconfig.json b/types/jquery.transit/tsconfig.json similarity index 100% rename from jquery.transit/tsconfig.json rename to types/jquery.transit/tsconfig.json diff --git a/jquery.ui.datetimepicker/index.d.ts b/types/jquery.ui.datetimepicker/index.d.ts similarity index 100% rename from jquery.ui.datetimepicker/index.d.ts rename to types/jquery.ui.datetimepicker/index.d.ts diff --git a/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts b/types/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts similarity index 90% rename from jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts rename to types/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts index 44996637da..00ba4fe297 100644 --- a/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts +++ b/types/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts @@ -1,9 +1,6 @@ -/// - - // basic no options $('#datetimepicker').datetimepicker({ - + }); // basic with some options diff --git a/jquery.ui.datetimepicker/tsconfig.json b/types/jquery.ui.datetimepicker/tsconfig.json similarity index 100% rename from jquery.ui.datetimepicker/tsconfig.json rename to types/jquery.ui.datetimepicker/tsconfig.json diff --git a/jquery.ui.layout/index.d.ts b/types/jquery.ui.layout/index.d.ts similarity index 100% rename from jquery.ui.layout/index.d.ts rename to types/jquery.ui.layout/index.d.ts diff --git a/jquery.ui.layout/tsconfig.json b/types/jquery.ui.layout/tsconfig.json similarity index 100% rename from jquery.ui.layout/tsconfig.json rename to types/jquery.ui.layout/tsconfig.json diff --git a/jquery.uniform/index.d.ts b/types/jquery.uniform/index.d.ts similarity index 100% rename from jquery.uniform/index.d.ts rename to types/jquery.uniform/index.d.ts diff --git a/jquery.uniform/jquery.uniform-tests.ts b/types/jquery.uniform/jquery.uniform-tests.ts similarity index 100% rename from jquery.uniform/jquery.uniform-tests.ts rename to types/jquery.uniform/jquery.uniform-tests.ts diff --git a/jquery.uniform/tsconfig.json b/types/jquery.uniform/tsconfig.json similarity index 100% rename from jquery.uniform/tsconfig.json rename to types/jquery.uniform/tsconfig.json diff --git a/jquery.validation/index.d.ts b/types/jquery.validation/index.d.ts similarity index 100% rename from jquery.validation/index.d.ts rename to types/jquery.validation/index.d.ts diff --git a/jquery.validation/jquery.validation-tests.ts b/types/jquery.validation/jquery.validation-tests.ts similarity index 99% rename from jquery.validation/jquery.validation-tests.ts rename to types/jquery.validation/jquery.validation-tests.ts index 0b2de520f2..68062d6e1c 100644 --- a/jquery.validation/jquery.validation-tests.ts +++ b/types/jquery.validation/jquery.validation-tests.ts @@ -1,6 +1,4 @@ -/// -/// - +/// function test_validate() { $("#commentForm").validate(); @@ -264,4 +262,3 @@ function test_static_methods() { jQuery.validator.format('{0} {1}', 'a', 2); jQuery.validator.format('{0} {1}', ['a', 2]); } - \ No newline at end of file diff --git a/jquery.validation/tsconfig.json b/types/jquery.validation/tsconfig.json similarity index 100% rename from jquery.validation/tsconfig.json rename to types/jquery.validation/tsconfig.json diff --git a/jquery.watermark/index.d.ts b/types/jquery.watermark/index.d.ts similarity index 100% rename from jquery.watermark/index.d.ts rename to types/jquery.watermark/index.d.ts diff --git a/jquery.watermark/jquery.watermark-tests.ts b/types/jquery.watermark/jquery.watermark-tests.ts similarity index 95% rename from jquery.watermark/jquery.watermark-tests.ts rename to types/jquery.watermark/jquery.watermark-tests.ts index 225ba0a482..e92ec0df11 100644 --- a/jquery.watermark/jquery.watermark-tests.ts +++ b/types/jquery.watermark/jquery.watermark-tests.ts @@ -1,5 +1,3 @@ -/// - $('#inputId').watermark('Required information'); $('#inputId').watermark('Required information', { className: 'myClassName' }); $('#inputId').watermark('Search', { useNative: false }); diff --git a/jquery.watermark/tsconfig.json b/types/jquery.watermark/tsconfig.json similarity index 100% rename from jquery.watermark/tsconfig.json rename to types/jquery.watermark/tsconfig.json diff --git a/jquery.window/index.d.ts b/types/jquery.window/index.d.ts similarity index 100% rename from jquery.window/index.d.ts rename to types/jquery.window/index.d.ts diff --git a/jquery.window/jquery.window-tests.ts b/types/jquery.window/jquery.window-tests.ts similarity index 98% rename from jquery.window/jquery.window-tests.ts rename to types/jquery.window/jquery.window-tests.ts index 4b1b9b6eb2..15021cad7d 100644 --- a/jquery.window/jquery.window-tests.ts +++ b/types/jquery.window/jquery.window-tests.ts @@ -1,5 +1,3 @@ -/// - function example_1() { $.window({ title: "Cyclops Studio", @@ -20,13 +18,13 @@ function example_2() { function example_3() { // prepare customerized static attributes, see static attributes - // Note: you should call this method before starting to create window instances, or windows might display wrong. + // Note: you should call this method before starting to create window instances, or windows might display wrong. $.window.prepare({ dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom' animationSpeed: 200, // set animation speed minWinLong: 180 // set minimized window long dimension width in pixel }); - + // limit window within body $.window({ icon: 'http://www.fstoke.me/favicon.ico', @@ -51,7 +49,7 @@ function example_3() { x: 80, y: 80 }); - + // assign the dock area $.window.prepare({ dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom' diff --git a/jquery.window/tsconfig.json b/types/jquery.window/tsconfig.json similarity index 100% rename from jquery.window/tsconfig.json rename to types/jquery.window/tsconfig.json diff --git a/jquery/index.d.ts b/types/jquery/index.d.ts similarity index 99% rename from jquery/index.d.ts rename to types/jquery/index.d.ts index 3a785530aa..0a47546193 100644 --- a/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -1166,25 +1166,28 @@ interface JQueryStatic { * 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. + * @param callback The function that will be executed on every object. Will break the loop by returning false. + * @returns the first argument, the object that is iterated. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-array-callback} */ each( collection: T[], - callback: (indexInArray: number, valueOfElement: T) => any - ): any; + callback: (indexInArray: number, valueOfElement: T) => boolean | void + ): T[]; /** * 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. + * @param callback The function that will be executed on every object. Will break the loop by returning false. + * @returns the first argument, the object that is iterated. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-object-callback} */ - each( - collection: any, - callback: (indexInArray: any, valueOfElement: any) => any - ): any; + each( + collection: T, + // TODO: `(keyInObject: keyof T, valueOfElement: T[keyof T])`, when TypeScript 2.1 allowed in repository + callback: (keyInObject: string, valueOfElement: any) => boolean | void + ): T; /** * Merge the contents of two or more objects together into the first object. @@ -1240,7 +1243,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is an array. * @see {@link https://api.jquery.com/jQuery.isArray/} */ - isArray(obj: any): boolean; + isArray(obj: any): obj is Array; /** * Check to see if an object is empty (contains no enumerable properties). * @@ -1254,7 +1257,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a function. * @see {@link https://api.jquery.com/jQuery.isFunction/} */ - isFunction(obj: any): boolean; + isFunction(obj: any): obj is Function; /** * Determines whether its argument is a number. * @@ -1275,7 +1278,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a window. * @see {@link https://api.jquery.com/jQuery.isWindow/} */ - isWindow(obj: any): boolean; + isWindow(obj: any): obj is Window; /** * Check to see if a DOM node is within an XML document (or is an XML document). * @@ -1360,7 +1363,7 @@ interface JQueryStatic { * @param obj Object to get the internal JavaScript [[Class]] of. * @see {@link https://api.jquery.com/jQuery.type/} */ - type(obj: any): string; + type(obj: any): "array" | "boolean" | "date" | "error" | "function" | "null" | "number" | "object" | "regexp" | "string" | "symbol" | "undefined"; /** * 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. @@ -1368,7 +1371,7 @@ interface JQueryStatic { * @param array The Array of DOM elements. * @see {@link https://api.jquery.com/jQuery.unique/} */ - unique(array: Element[]): Element[]; + unique(array: T[]): T[]; /** * Parses a string into an array of DOM nodes. @@ -3301,10 +3304,10 @@ interface JQuery { /** * Iterate over a jQuery object, executing a function for each matched element. * - * @param func A function to execute for each matched element. + * @param func A function to execute for each matched element. Can stop the loop by returning false. * @see {@link https://api.jquery.com/each/} */ - each(func: (index: number, elem: Element) => any): JQuery; + each(func: (index: number, elem: Element) => boolean | void): JQuery; /** * Retrieve one of the elements matched by the jQuery object. @@ -3457,7 +3460,7 @@ interface JQuery { * @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; + filter(func: (index: number, element: Element) => boolean): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * diff --git a/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts similarity index 98% rename from jquery/jquery-tests.ts rename to types/jquery/jquery-tests.ts index e11a8b806f..d2d58aa2a2 100644 --- a/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -100,16 +100,18 @@ function test_ajax() { if (getAllResponseHeaders()) { return getAllResponseHeaders(); } - var allHeaders = ""; - $(["Cache-Control", "Content-Language", "Content-Type", - "Expires", "Last-Modified", "Pragma"]).each(function (i, header_name) { - if (xhr.getResponseHeader(header_name)) { - allHeaders += header_name + ": " + xhr.getResponseHeader(header_name) + "\n"; - } - return allHeaders; - }); + var allHeaders = ""; + var headersFieldNames = ["Cache-Control", "Content-Language", "Content-Type", + "Expires", "Last-Modified", "Pragma"]; + $(headersFieldNames).each(function (i, header_name) { + if (xhr.getResponseHeader(header_name)) { + allHeaders += header_name + ": " + xhr.getResponseHeader(header_name) + "\n"; + } + }); + return allHeaders; }; + return xhr; }; $.ajax({ @@ -1392,9 +1394,24 @@ function test_detach() { } function test_each() { - $.each([52, 97], function (index, value) { + var numArray: number[]; + numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { alert(index + ': ' + value); }); + numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { + alert(index + ': ' + value); + return value < 2; + }); + + var res: {one: number, 2: string}; + res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { + alert(key + ': ' + value); + }); + res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { + alert(key + ': ' + value); + return key === "2"; + }); + var map = { 'flammable': 'inflammable', 'duh': 'no duh' @@ -1404,8 +1421,7 @@ function test_each() { }); var arr = ["one", "two", "three", "four", "five"]; var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 }; - // TODO: Should not need explicit type annotation https://github.com/Microsoft/TypeScript/issues/10072 - jQuery.each(arr, function () { + jQuery.each(arr, function () { $("#" + this).text("Mine is " + this + "."); return (this != "three"); }); @@ -1482,9 +1498,10 @@ function test_error() { $(this).hide(); }) .attr("src", "missing.png"); + jQuery.error("Oups"); jQuery.error = (message?: string) => { console.error(message); return this; - } + }; } function test_eventParams() { @@ -1516,7 +1533,7 @@ function test_eventParams() { function propStopped(e) { var msg = ""; if (e.isPropagationStopped()) { - msg = "called" + msg = "called"; } else { msg = "not called"; } @@ -1703,11 +1720,11 @@ function test_fadeToggle() { function test_filter() { $('li').filter(':even').css('background-color', 'red'); $('li').filter(function (index) { - return index % 3 == 2; + return index % 3 === 2; }).css('background-color', 'red'); $("div").css("background", "#b4b0da") .filter(function (index) { - return index == 1 || $(this).attr("id") == "fourth"; + return index === 1 || $(this).attr("id") === "fourth"; }) .css("border", "3px double red"); $("div").filter(document.getElementById("unique")); @@ -1879,7 +1896,7 @@ function test_getJSON() { function (data) { $.each(data.items, function (i, item) { $("").attr("src", item.media.m).appendTo("#images"); - if (i == 3) return false; + if (i === "3") return false; }); }); $.getJSON("test.js", function (json) { @@ -2524,6 +2541,17 @@ function test_is() { }); } +function test_isTypeGuards() { + var foo: number[] | ((x: string) => number) | Window; + if (jQuery.isArray(foo)) { + foo.push(1515); + } else if (jQuery.isWindow(foo)) { + foo.close(); + } else if (jQuery.isFunction(foo)) { + foo("hello world"); + } +} + function test_isArray() { $("b").append("" + $.isArray([])); } @@ -2582,6 +2610,16 @@ function test_isXMLDoc() { jQuery.isXMLDoc(document.body); } +function test_unique() { + jQuery.unique($('div.foo, div.bar').get()); + jQuery.unique($('div.foo, div.bar').toArray()); + + var divs: HTMLDivElement[]; + var unique: HTMLDivElement[]; + unique = jQuery.unique(divs); + unique = jQuery.unique(divs); +} + function test_jQuery() { $('div.foo'); $('div.foo').click(function () { diff --git a/jquery/tsconfig.json b/types/jquery/tsconfig.json similarity index 100% rename from jquery/tsconfig.json rename to types/jquery/tsconfig.json diff --git a/jquerymobile/index.d.ts b/types/jquerymobile/index.d.ts similarity index 100% rename from jquerymobile/index.d.ts rename to types/jquerymobile/index.d.ts diff --git a/jquerymobile/jquerymobile-tests.ts b/types/jquerymobile/jquerymobile-tests.ts similarity index 99% rename from jquerymobile/jquerymobile-tests.ts rename to types/jquerymobile/jquerymobile-tests.ts index 105edc3f88..e7fbf3bfff 100644 --- a/jquerymobile/jquerymobile-tests.ts +++ b/types/jquerymobile/jquerymobile-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_api() { $.mobile.changePage("about/us.html", { transition: "slideup" }); $.mobile.changePage("searchresults.php", { diff --git a/jquerymobile/tsconfig.json b/types/jquerymobile/tsconfig.json similarity index 100% rename from jquerymobile/tsconfig.json rename to types/jquerymobile/tsconfig.json diff --git a/jqueryui/index.d.ts b/types/jqueryui/index.d.ts similarity index 100% rename from jqueryui/index.d.ts rename to types/jqueryui/index.d.ts diff --git a/jqueryui/jqueryui-tests.ts b/types/jqueryui/jqueryui-tests.ts similarity index 99% rename from jqueryui/jqueryui-tests.ts rename to types/jqueryui/jqueryui-tests.ts index 2cce742f86..5755738622 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/types/jqueryui/jqueryui-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_draggable() { $("#draggable").draggable({ axis: "y" }); diff --git a/jqueryui/tsconfig.json b/types/jqueryui/tsconfig.json similarity index 100% rename from jqueryui/tsconfig.json rename to types/jqueryui/tsconfig.json diff --git a/js-base64/index.d.ts b/types/js-base64/index.d.ts similarity index 100% rename from js-base64/index.d.ts rename to types/js-base64/index.d.ts diff --git a/js-base64/js-base64-tests.ts b/types/js-base64/js-base64-tests.ts similarity index 100% rename from js-base64/js-base64-tests.ts rename to types/js-base64/js-base64-tests.ts diff --git a/js-base64/tsconfig.json b/types/js-base64/tsconfig.json similarity index 100% rename from js-base64/tsconfig.json rename to types/js-base64/tsconfig.json diff --git a/js-beautify/index.d.ts b/types/js-beautify/index.d.ts similarity index 100% rename from js-beautify/index.d.ts rename to types/js-beautify/index.d.ts diff --git a/js-beautify/js-beautify-tests.ts b/types/js-beautify/js-beautify-tests.ts similarity index 100% rename from js-beautify/js-beautify-tests.ts rename to types/js-beautify/js-beautify-tests.ts diff --git a/js-beautify/tsconfig.json b/types/js-beautify/tsconfig.json similarity index 100% rename from js-beautify/tsconfig.json rename to types/js-beautify/tsconfig.json diff --git a/js-clipper/index.d.ts b/types/js-clipper/index.d.ts similarity index 100% rename from js-clipper/index.d.ts rename to types/js-clipper/index.d.ts diff --git a/js-clipper/js-clipper-tests.ts b/types/js-clipper/js-clipper-tests.ts similarity index 100% rename from js-clipper/js-clipper-tests.ts rename to types/js-clipper/js-clipper-tests.ts diff --git a/js-clipper/tsconfig.json b/types/js-clipper/tsconfig.json similarity index 100% rename from js-clipper/tsconfig.json rename to types/js-clipper/tsconfig.json diff --git a/js-combinatorics/index.d.ts b/types/js-combinatorics/index.d.ts similarity index 100% rename from js-combinatorics/index.d.ts rename to types/js-combinatorics/index.d.ts diff --git a/js-combinatorics/js-combinatorics-tests.ts b/types/js-combinatorics/js-combinatorics-tests.ts similarity index 100% rename from js-combinatorics/js-combinatorics-tests.ts rename to types/js-combinatorics/js-combinatorics-tests.ts diff --git a/js-combinatorics/tsconfig.json b/types/js-combinatorics/tsconfig.json similarity index 100% rename from js-combinatorics/tsconfig.json rename to types/js-combinatorics/tsconfig.json diff --git a/js-cookie/index.d.ts b/types/js-cookie/index.d.ts similarity index 100% rename from js-cookie/index.d.ts rename to types/js-cookie/index.d.ts diff --git a/js-cookie/js-cookie-tests.ts b/types/js-cookie/js-cookie-tests.ts similarity index 100% rename from js-cookie/js-cookie-tests.ts rename to types/js-cookie/js-cookie-tests.ts diff --git a/js-cookie/tsconfig.json b/types/js-cookie/tsconfig.json similarity index 100% rename from js-cookie/tsconfig.json rename to types/js-cookie/tsconfig.json diff --git a/js-data-angular/index.d.ts b/types/js-data-angular/index.d.ts similarity index 100% rename from js-data-angular/index.d.ts rename to types/js-data-angular/index.d.ts diff --git a/js-data-angular/js-data-angular-tests.ts b/types/js-data-angular/js-data-angular-tests.ts similarity index 100% rename from js-data-angular/js-data-angular-tests.ts rename to types/js-data-angular/js-data-angular-tests.ts diff --git a/js-data-angular/tsconfig.json b/types/js-data-angular/tsconfig.json similarity index 100% rename from js-data-angular/tsconfig.json rename to types/js-data-angular/tsconfig.json diff --git a/js-data-http/index.d.ts b/types/js-data-http/index.d.ts similarity index 98% rename from js-data-http/index.d.ts rename to types/js-data-http/index.d.ts index 2fa9c0e09a..2a2fafcedb 100644 --- a/js-data-http/index.d.ts +++ b/types/js-data-http/index.d.ts @@ -6,7 +6,6 @@ import * as JSData from 'js-data'; declare module 'js-data' { - interface DSHttpAdapterOptions { serialize?: (resourceName: string, data: any) => any; deserialize?: (resourceName: string, data: any) => any; @@ -27,7 +26,6 @@ declare module 'js-data' { } interface DSHttpAdapter extends IDSAdapter { - new(options?: DSHttpAdapterOptions): DSHttpAdapter; defaults: DSHttpAdapterOptions; @@ -44,4 +42,4 @@ declare module 'js-data' { declare var DSHttpAdapter: JSData.DSHttpAdapter; export = DSHttpAdapter; -export as namespace DSHttpAdapter; \ No newline at end of file +export as namespace DSHttpAdapter; diff --git a/js-data-http/js-data-http-tests.ts b/types/js-data-http/js-data-http-tests.ts similarity index 95% rename from js-data-http/js-data-http-tests.ts rename to types/js-data-http/js-data-http-tests.ts index d98cdd642a..082d34a71f 100644 --- a/js-data-http/js-data-http-tests.ts +++ b/types/js-data-http/js-data-http-tests.ts @@ -3,14 +3,14 @@ import DSHttpAdapter = require("js-data-http"); declare var axios: any; -var adapter = new DSHttpAdapter(); -var store = new JSData.DS(); +const adapter = new DSHttpAdapter(); +const store = new JSData.DS(); store.registerAdapter('http', adapter, { default: true }); adapter.defaults.basePath = '/api'; adapter.http = axios; -var ADocument: JSData.DSResourceDefinition = store.defineResource('document'); +const ADocument: JSData.DSResourceDefinition = store.defineResource('document'); ADocument.inject({ id: 5, author: 'John' }); @@ -79,9 +79,9 @@ adapter.GET('/user/1').then(data => { data.config; // {...} }); -var User: JSData.DSResourceDefinition = store.defineResource('user'); +const User: JSData.DSResourceDefinition = store.defineResource('user'); -var params: any = { +let params: any = { age: { '>': 30 } @@ -119,7 +119,7 @@ ADocument.find(5).then((document: any) => { ADocument.get(document.id); // { id: 5, author: 'John Anderson' } }); -var params: any = { +params = { author: 'John' }; diff --git a/js-data-http/tsconfig.json b/types/js-data-http/tsconfig.json similarity index 100% rename from js-data-http/tsconfig.json rename to types/js-data-http/tsconfig.json diff --git a/js-data-http/tslint.json b/types/js-data-http/tslint.json similarity index 100% rename from js-data-http/tslint.json rename to types/js-data-http/tslint.json diff --git a/js-data/index.d.ts b/types/js-data/index.d.ts similarity index 100% rename from js-data/index.d.ts rename to types/js-data/index.d.ts diff --git a/js-data/js-data-tests.ts b/types/js-data/js-data-tests.ts similarity index 100% rename from js-data/js-data-tests.ts rename to types/js-data/js-data-tests.ts diff --git a/js-data/tsconfig.json b/types/js-data/tsconfig.json similarity index 100% rename from js-data/tsconfig.json rename to types/js-data/tsconfig.json diff --git a/js-data/v1/index.d.ts b/types/js-data/v1/index.d.ts similarity index 100% rename from js-data/v1/index.d.ts rename to types/js-data/v1/index.d.ts diff --git a/js-data/v1/js-data-tests.ts b/types/js-data/v1/js-data-tests.ts similarity index 100% rename from js-data/v1/js-data-tests.ts rename to types/js-data/v1/js-data-tests.ts diff --git a/js-data/v1/tsconfig.json b/types/js-data/v1/tsconfig.json similarity index 100% rename from js-data/v1/tsconfig.json rename to types/js-data/v1/tsconfig.json diff --git a/js-fixtures/index.d.ts b/types/js-fixtures/index.d.ts similarity index 100% rename from js-fixtures/index.d.ts rename to types/js-fixtures/index.d.ts diff --git a/js-fixtures/js-fixtures-tests.ts b/types/js-fixtures/js-fixtures-tests.ts similarity index 100% rename from js-fixtures/js-fixtures-tests.ts rename to types/js-fixtures/js-fixtures-tests.ts diff --git a/js-fixtures/tsconfig.json b/types/js-fixtures/tsconfig.json similarity index 100% rename from js-fixtures/tsconfig.json rename to types/js-fixtures/tsconfig.json diff --git a/js-git/index.d.ts b/types/js-git/index.d.ts similarity index 100% rename from js-git/index.d.ts rename to types/js-git/index.d.ts diff --git a/js-git/js-git-tests.ts b/types/js-git/js-git-tests.ts similarity index 100% rename from js-git/js-git-tests.ts rename to types/js-git/js-git-tests.ts diff --git a/js-git/tsconfig.json b/types/js-git/tsconfig.json similarity index 100% rename from js-git/tsconfig.json rename to types/js-git/tsconfig.json diff --git a/js-md5/index.d.ts b/types/js-md5/index.d.ts similarity index 100% rename from js-md5/index.d.ts rename to types/js-md5/index.d.ts diff --git a/js-md5/js-md5-tests.ts b/types/js-md5/js-md5-tests.ts similarity index 100% rename from js-md5/js-md5-tests.ts rename to types/js-md5/js-md5-tests.ts diff --git a/js-md5/tsconfig.json b/types/js-md5/tsconfig.json similarity index 100% rename from js-md5/tsconfig.json rename to types/js-md5/tsconfig.json diff --git a/jump.js/tslint.json b/types/js-md5/tslint.json similarity index 100% rename from jump.js/tslint.json rename to types/js-md5/tslint.json diff --git a/js-priority-queue/index.d.ts b/types/js-priority-queue/index.d.ts similarity index 100% rename from js-priority-queue/index.d.ts rename to types/js-priority-queue/index.d.ts diff --git a/js-priority-queue/js-priority-queue-tests.ts b/types/js-priority-queue/js-priority-queue-tests.ts similarity index 100% rename from js-priority-queue/js-priority-queue-tests.ts rename to types/js-priority-queue/js-priority-queue-tests.ts diff --git a/js-priority-queue/tsconfig.json b/types/js-priority-queue/tsconfig.json similarity index 100% rename from js-priority-queue/tsconfig.json rename to types/js-priority-queue/tsconfig.json diff --git a/js-quantities/index.d.ts b/types/js-quantities/index.d.ts similarity index 98% rename from js-quantities/index.d.ts rename to types/js-quantities/index.d.ts index 5d4a8df304..ab76433c0d 100644 --- a/js-quantities/index.d.ts +++ b/types/js-quantities/index.d.ts @@ -5,7 +5,7 @@ declare const Qty: Qty.Type; -declare interface Qty { +interface Qty { readonly numerator: string[]; readonly denominator: string[]; readonly scalar: number; @@ -39,7 +39,6 @@ declare interface Qty { } declare namespace Qty { - interface Type { (value: Source): Qty; (value: number, unit: string): Qty; diff --git a/js-quantities/js-quantities-tests.ts b/types/js-quantities/js-quantities-tests.ts similarity index 88% rename from js-quantities/js-quantities-tests.ts rename to types/js-quantities/js-quantities-tests.ts index ed69816dc3..e7734e7520 100644 --- a/js-quantities/js-quantities-tests.ts +++ b/types/js-quantities/js-quantities-tests.ts @@ -84,13 +84,13 @@ Qty('10ohm').inverse(); // '.1/ohm' (not '.1S', although they are equivalent) // however, the 'to' command will convert between inverses also Qty('10ohm').to('S'); // '.1S' -var convert = Qty.swiftConverter('m/h', 'ft/s'); // Configures converter +const convert = Qty.swiftConverter('m/h', 'ft/s'); // Configures converter // Converting single value -var converted = convert(2500); // => 2.278.. +const converted = convert(2500); // => 2.278.. // Converting large array of values -var convertedSerie = convert([2500, 5000]); // => [2.278.., 4.556.., ...] +const convertedSerie = convert([2500, 5000]); // => [2.278.., 4.556.., ...] qty1.eq(qty2); // => true if both quantities are equal (1m == 100cm => true) qty1.same(qty2); // => true if both quantities are same (1m == 100cm => false) @@ -138,10 +138,10 @@ qty = Qty('1.1234 m'); qty.format(); // same units, default formatter => '1.234 m' qty.format('cm'); // converted to 'cm', default formatter => '123.45 cm' -var configurableRoundingFormatter = (maxDecimals: number) => { +const configurableRoundingFormatter = (maxDecimals: number) => { return (scalar: number, units: string) => { - var pow = Math.pow(10, maxDecimals); - var rounded = Math.round(scalar * pow) / pow; + const pow = Math.pow(10, maxDecimals); + const rounded = Math.round(scalar * pow) / pow; return rounded + ' ' + units; }; @@ -200,13 +200,13 @@ describe("js-quantities", () => { describe("initialization", () => { it("should create unit only", () => { - var qty = Qty("m"); + const qty = Qty("m"); expect(qty.numerator).toEqual([""]); expect(qty.scalar).toBe(1); }); it("should create unitless", () => { - var qty = Qty("1"); + let qty = Qty("1"); expect(qty.toFloat()).toBe(1); expect(qty.numerator).toEqual(["<1>"]); expect(qty.denominator).toEqual(["<1>"]); @@ -217,21 +217,21 @@ describe("js-quantities", () => { }); it("should create unitless from numbers", () => { - var qty = Qty(1.5); + const qty = Qty(1.5); expect(qty.toFloat()).toBe(1.5); expect(qty.numerator).toEqual(["<1>"]); expect(qty.denominator).toEqual(["<1>"]); }); it("should create from numbers with explicit units", () => { - var qty = Qty(1.5, "m"); + const qty = Qty(1.5, "m"); expect(qty.scalar).toBe(1.5); expect(qty.numerator).toEqual([""]); expect(qty.denominator).toEqual(["<1>"]); }); it("temperatures should have base unit in kelvin", () => { - var qty = Qty("1 tempK").toBase(); + let qty = Qty("1 tempK").toBase(); expect(qty.scalar).toBe(1); expect(qty.units()).toBe("tempK"); @@ -249,7 +249,7 @@ describe("js-quantities", () => { }); it("temperature degrees should have base unit in kelvin", () => { - var qty = Qty("1 degK").toBase(); + let qty = Qty("1 degK").toBase(); expect(qty.scalar).toBe(1); expect(qty.units()).toBe("degK"); @@ -272,7 +272,7 @@ describe("js-quantities", () => { expect(() => { Qty("-459.68 tempF"); }).toThrow("Temperatures must not be less than absolute zero"); expect(() => { Qty("-1 tempR"); }).toThrow("Temperatures must not be less than absolute zero"); - var qty = Qty("1 tempK"); + let qty = Qty("1 tempK"); expect(() => { qty.mul("-1"); }).toThrow("Temperatures must not be less than absolute zero"); qty = Qty("0 tempK"); @@ -289,28 +289,28 @@ describe("js-quantities", () => { }); it("should create simple", () => { - var qty = Qty("1m"); + const qty = Qty("1m"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual([""]); expect(qty.denominator).toEqual(["<1>"]); }); it("should create negative", () => { - var qty = Qty("-1m"); + const qty = Qty("-1m"); expect(qty.scalar).toBe(-1); expect(qty.numerator).toEqual([""]); expect(qty.denominator).toEqual(["<1>"]); }); it("should create compound", () => { - var qty = Qty("1 N*m"); + const qty = Qty("1 N*m"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual(["", ""]); expect(qty.denominator).toEqual(["<1>"]); }); it("should create pressure units in term of height of water", () => { - var qty = Qty("1 inH2O"); + let qty = Qty("1 inH2O"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual([""]); @@ -320,14 +320,14 @@ describe("js-quantities", () => { }); it("should create with denominator", () => { - var qty = Qty("1 m/s"); + const qty = Qty("1 m/s"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual([""]); expect(qty.denominator).toEqual([""]); }); it("should create with denominator only", () => { - var qty = Qty("1 /s"); + let qty = Qty("1 /s"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual(["<1>"]); expect(qty.denominator).toEqual([""]); @@ -344,7 +344,7 @@ describe("js-quantities", () => { }); it("should create with powers", () => { - var qty = Qty("1 m^2/s^2"); + let qty = Qty("1 m^2/s^2"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual(["", ""]); expect(qty.denominator).toEqual(["", ""]); @@ -359,14 +359,14 @@ describe("js-quantities", () => { }); it("should create with zero power", () => { - var qty = Qty("1 m^0"); + const qty = Qty("1 m^0"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual(["<1>"]); expect(qty.denominator).toEqual(["<1>"]); }); it("should create with negative powers", () => { - var qty = Qty("1 m^2 s^-2"); + const qty = Qty("1 m^2 s^-2"); expect(qty.scalar).toBe(1); expect(qty.numerator).toEqual(["", ""]); expect(qty.denominator).toEqual(["", ""]); @@ -374,26 +374,26 @@ describe("js-quantities", () => { }); it("should accept powers without ^ syntax (simple)", () => { - var qty1 = Qty("1 m2"); - var qty2 = Qty("1 m^2"); + const qty1 = Qty("1 m2"); + const qty2 = Qty("1 m^2"); expect(qty1.eq(qty2)).toBe(true); }); it("should accept powers without ^ syntax (negative power)", () => { - var qty1 = Qty("1 m-2"); - var qty2 = Qty("1 m^-2"); + const qty1 = Qty("1 m-2"); + const qty2 = Qty("1 m^-2"); expect(qty1.eq(qty2)).toBe(true); }); it("should accept powers without ^ syntax (compound)", () => { - var qty1 = Qty("1 m^2 kg^2 J^2/s^2"); - var qty2 = Qty("1 m2 kg2 J2/s2"); + const qty1 = Qty("1 m^2 kg^2 J^2/s^2"); + const qty2 = Qty("1 m2 kg2 J2/s2"); expect(qty1.eq(qty2)).toBe(true); }); it("should accept powers without ^ syntax (compound and negative power)", () => { - var qty1 = Qty("1 m^2 kg^2 J^2 s^-2"); - var qty2 = Qty("1 m2 kg2 J2 s-2"); + const qty1 = Qty("1 m^2 kg^2 J^2 s^-2"); + const qty2 = Qty("1 m2 kg2 J2 s-2"); expect(qty1.eq(qty2)).toBe(true); }); @@ -424,7 +424,7 @@ describe("js-quantities", () => { }); it("should set baseScalar", () => { - var qty = Qty("0.018 MPa"); + let qty = Qty("0.018 MPa"); expect(qty.baseScalar).toBe(18000); qty = Qty("66 cm3"); @@ -432,8 +432,8 @@ describe("js-quantities", () => { }); it("should keep init value as is", () => { - var initValue = " 66 cm3 "; - var qty = Qty(initValue); + const initValue = " 66 cm3 "; + const qty = Qty(initValue); expect(qty.initValue).toEqual(initValue); }); @@ -443,7 +443,7 @@ describe("js-quantities", () => { }); it("should allow whitespaces between sign and scalar", () => { - var qty = Qty("- 1m"); + const qty = Qty("- 1m"); expect(qty.scalar).toEqual(-1); expect(qty.units()).toEqual("m"); @@ -457,23 +457,23 @@ describe("js-quantities", () => { describe("isCompatible", () => { it("should return true with compatible quantities", () => { - var qty1 = Qty("1 m*kg/s"); - var qty2 = Qty("1 in*pound/min"); + const qty1 = Qty("1 m*kg/s"); + let qty2 = Qty("1 in*pound/min"); expect(qty1.isCompatible(qty2)).toBe(true); qty2 = Qty("1 in/min"); expect(qty1.isCompatible(qty2)).toBe(false); }); it("should return true with dimensionless quantities", () => { - var qty1 = Qty("1"); - var qty2 = Qty("2"); + const qty1 = Qty("1"); + const qty2 = Qty("2"); expect(qty1.isCompatible(qty2)).toBe(true); }); }); describe("conversion", () => { it("should convert to base units", () => { - var qty = Qty("100 cm"); + let qty = Qty("100 cm"); expect(qty.toBase().scalar).toBe(1); expect(qty.toBase().units()).toBe("m"); qty = Qty("10 cm"); @@ -485,7 +485,7 @@ describe("js-quantities", () => { }); it("should convert to compatible units", () => { - var qty = Qty("10 cm"); + let qty = Qty("10 cm"); expect(qty.to("ft").scalar).toBe(Qty.divSafe(0.1, 0.3048)); qty = Qty("2m^3"); expect(qty.to("l").scalar).toBe(2000); @@ -518,7 +518,7 @@ describe("js-quantities", () => { }); it("should convert temperatures to compatible units", () => { - var qty = Qty("0 tempK"); + let qty = Qty("0 tempK"); expect(qty.to("tempC").scalar).toBe(-273.15); qty = Qty("0 tempF"); @@ -532,7 +532,7 @@ describe("js-quantities", () => { }); it("should convert temperature degrees to compatible units", () => { - var qty = Qty("0 degK"); + let qty = Qty("0 degK"); expect(qty.to("degC").scalar).toBe(0); qty = Qty("1 degK/s"); @@ -547,7 +547,7 @@ describe("js-quantities", () => { it("should convert temperature degrees to temperatures", () => { // according to ruby-units, deg -> temp conversion adds the degress to 0 kelvin before converting - var qty = Qty("100 degC"); + let qty = Qty("100 degC"); expect(qty.to("tempC").scalar).toBeCloseTo(-173.15, 10); qty = Qty("273.15 degC"); @@ -559,7 +559,7 @@ describe("js-quantities", () => { it("should convert temperatures to temperature degrees", () => { // according to ruby-units, temp -> deg conversion always uses the 0 relative degrees - var qty = Qty("100 tempC"); + let qty = Qty("100 tempC"); expect(qty.to("degC").scalar).toBe(100); qty = Qty("0 tempK"); @@ -576,8 +576,8 @@ describe("js-quantities", () => { }); it("should calculate inverses", () => { - var qty = Qty("1 ohm"); - var result = qty.to("siemens"); + let qty = Qty("1 ohm"); + let result = qty.to("siemens"); expect(result.scalar).toBe(1); expect(result.kind()).toBe("conductance"); @@ -611,7 +611,7 @@ describe("js-quantities", () => { }); it("should return itself if target units are the same", () => { - var qty = Qty("123 cm3"); + let qty = Qty("123 cm3"); expect(qty.to("cm3")).toBe(qty); expect(qty.to("cm^3")).toBe(qty); @@ -621,7 +621,7 @@ describe("js-quantities", () => { }); it("should be cached", () => { - var qty = Qty("100 m"), + const qty = Qty("100 m"), converted = qty.to("ft"); expect(qty.to("ft") === converted).toBe(true); @@ -630,16 +630,16 @@ describe("js-quantities", () => { describe("comparison", () => { it("should return true when comparing equal quantities", () => { - var qty1 = Qty("1cm"); - var qty2 = Qty("10mm"); + const qty1 = Qty("1cm"); + const qty2 = Qty("10mm"); expect(qty1.eq(qty2)).toBe(true); }); it("should compare compatible quantities", () => { - var qty1 = Qty("1cm"); - var qty2 = Qty("1mm"); - var qty3 = Qty("10mm"); - var qty4 = Qty("28A"); + const qty1 = Qty("1cm"); + const qty2 = Qty("1mm"); + const qty3 = Qty("10mm"); + const qty4 = Qty("28A"); expect(qty1.compareTo(qty2)).toBe(1); expect(qty2.compareTo(qty1)).toBe(-1); expect(qty1.compareTo(qty3)).toBe(0); @@ -654,21 +654,20 @@ describe("js-quantities", () => { }); it("should compare identical quantities", () => { - var qty1 = Qty("1cm"); - var qty2 = Qty("1cm"); - var qty3 = Qty("10mm"); + const qty1 = Qty("1cm"); + const qty2 = Qty("1cm"); + const qty3 = Qty("10mm"); expect(qty1.same(qty2)).toBe(true); expect(qty1.same(qty3)).toBe(false); }); it("should accept strings as parameter", () => { - var qty = Qty("1 cm"); + const qty = Qty("1 cm"); expect(qty.lt("0.5 cm")).toBe(false); expect(qty.lte("1 cm")).toBe(true); expect(qty.gte("3 mm")).toBe(true); expect(qty.gt("5 m")).toBe(false); }); - }); describe("non-ASCII character", () => { @@ -692,16 +691,15 @@ describe("js-quantities", () => { }); describe("math", () => { - it("should add quantities", () => { - var qty1 = Qty("2.5m"); - var qty2 = Qty("3m"); + const qty1 = Qty("2.5m"); + let qty2 = Qty("3m"); expect(qty1.add(qty2).scalar).toBe(5.5); expect(qty1.add("3m").scalar).toBe(5.5); qty2 = Qty("3cm"); - var result = qty1.add(qty2); + let result = qty1.add(qty2); expect(result.scalar).toBe(2.53); expect(result.units()).toBe("m"); @@ -716,15 +714,15 @@ describe("js-quantities", () => { }); it("should fail to add unlike quantities", () => { - var qty1 = Qty("3m"); - var qty2 = Qty("2s"); + const qty1 = Qty("3m"); + const qty2 = Qty("2s"); expect(() => { qty1.add(qty2); }).toThrow("Incompatible units"); expect(() => { qty2.add(qty1); }).toThrow("Incompatible units"); }); it("should fail to add inverse quantities", () => { - var qty1 = Qty("10S"); - var qty2 = qty1.inverse(); + let qty1 = Qty("10S"); + let qty2 = qty1.inverse(); expect(() => { qty1.add(qty2); }).toThrow("Incompatible units"); expect(() => { qty2.add(qty1); }).toThrow("Incompatible units"); @@ -735,15 +733,15 @@ describe("js-quantities", () => { }); it("should subtract quantities", () => { - var qty1 = Qty("2.5m"); - var qty2 = Qty("3m"); + const qty1 = Qty("2.5m"); + let qty2 = Qty("3m"); expect(qty1.sub(qty2).scalar).toBe(-0.5); expect(qty1.sub("2m").scalar).toBe(0.5); expect(qty1.sub("-2m").scalar).toBe(4.5); qty2 = Qty("3cm"); - var result = qty1.sub(qty2); + let result = qty1.sub(qty2); expect(result.scalar).toBe(2.47); expect(result.units()).toBe("m"); @@ -753,15 +751,15 @@ describe("js-quantities", () => { }); it("should fail to subtract unlike quantities", () => { - var qty1 = Qty("3m"); - var qty2 = Qty("2s"); + const qty1 = Qty("3m"); + const qty2 = Qty("2s"); expect(() => { qty1.sub(qty2); }).toThrow("Incompatible units"); expect(() => { qty2.sub(qty1); }).toThrow("Incompatible units"); }); it("should fail to subtract inverse quantities", () => { - var qty1 = Qty("10S"); - var qty2 = qty1.inverse(); + let qty1 = Qty("10S"); + let qty2 = qty1.inverse(); expect(() => { qty1.sub(qty2); }).toThrow("Incompatible units"); expect(() => { qty2.sub(qty1); }).toThrow("Incompatible units"); @@ -772,9 +770,9 @@ describe("js-quantities", () => { }); it("should multiply quantities", () => { - var qty1 = Qty("2.5m"); - var qty2 = Qty("3m"); - var result = qty1.mul(qty2); + const qty1 = Qty("2.5m"); + let qty2 = Qty("3m"); + let result = qty1.mul(qty2); expect(result.scalar).toBe(7.5); expect(result.units()).toBe("m2"); expect(result.kind()).toBe("area"); @@ -807,10 +805,10 @@ describe("js-quantities", () => { }); it("should multiply unlike quantities", () => { - var qty1 = Qty("2.5 m"); - var qty2 = Qty("3 N"); + let qty1 = Qty("2.5 m"); + let qty2 = Qty("3 N"); - var result = qty1.mul(qty2); + let result = qty1.mul(qty2); expect(result.scalar).toBe(7.5); qty1 = Qty("2.5 m^2"); @@ -822,11 +820,11 @@ describe("js-quantities", () => { }); it("should multiply inverse quantities", () => { - var qty1 = Qty("10S"); - var qty2 = Qty(".5S").inverse(); // 2/S - var qty3 = qty1.inverse(); // .1/S + const qty1 = Qty("10S"); + const qty2 = Qty(".5S").inverse(); // 2/S + const qty3 = qty1.inverse(); // .1/S - var result = qty1.mul(qty2); + let result = qty1.mul(qty2); expect(result.scalar).toBe(20); expect(result.isUnitless()).toBe(true); expect(result.units()).toBe(""); @@ -848,20 +846,20 @@ describe("js-quantities", () => { }); it("should divide quantities", () => { - var qty1 = Qty("2.5m"); - var qty2 = Qty("3m"); - var qty3 = Qty("0m"); + const qty1 = Qty("2.5m"); + const qty2 = Qty("3m"); + const qty3 = Qty("0m"); expect(() => { qty1.div(qty3); }).toThrow("Divide by zero"); expect(() => { qty1.div(0); }).toThrow("Divide by zero"); expect(qty3.div(qty1).scalar).toBe(0); - var result = qty1.div(qty2); + let result = qty1.div(qty2); expect(result.scalar).toBe(2.5 / 3); expect(result.units()).toBe(""); expect(result.kind()).toBe("unitless"); - var qty4 = Qty("3cm"); + const qty4 = Qty("3cm"); result = qty1.div(qty4); expect(result.scalar).toBe(2.5 / 0.03); expect(result.units()).toBe(""); @@ -876,20 +874,20 @@ describe("js-quantities", () => { }); it("should divide unlike quantities", () => { - var qty1 = Qty("7.5kg"); - var qty2 = Qty("2.5m^2"); + const qty1 = Qty("7.5kg"); + const qty2 = Qty("2.5m^2"); - var result = qty1.div(qty2); + const result = qty1.div(qty2); expect(result.scalar).toBe(3); expect(result.units()).toBe("kg/m2"); }); it("should divide inverse quantities", () => { - var qty1 = Qty("10 S"); - var qty2 = Qty(".5 S").inverse(); // 2/S - var qty3 = qty1.inverse(); // .1/S + const qty1 = Qty("10 S"); + const qty2 = Qty(".5 S").inverse(); // 2/S + const qty3 = qty1.inverse(); // .1/S - var result = qty1.div(qty2); + let result = qty1.div(qty2); expect(result.scalar).toBe(5); expect(result.units()).toBe("S2"); @@ -905,18 +903,16 @@ describe("js-quantities", () => { expect(result.scalar).toBe(0.01); expect(result.units()).toBe("1/S2"); }); - }); describe("math with temperatures", () => { - it("should add temperature degrees", () => { - var qty = Qty("2degC"); + let qty = Qty("2degC"); expect(qty.add("3degF").scalar).toBeCloseTo(11 / 3, 10); expect(qty.add("-1degC").scalar).toBe(1); qty = Qty("2 degC"); - var result = qty.add("2 degF"); + let result = qty.add("2 degF"); expect(result.scalar).toBe(28 / 9); expect(result.units()).toBe("degC"); @@ -932,14 +928,14 @@ describe("js-quantities", () => { }); it("should not add two temperatures", () => { - var qty = Qty("2tempC"); + const qty = Qty("2tempC"); expect(() => { qty.add("1 tempF"); }).toThrow("Cannot add two temperatures"); expect(() => { qty.add("1 tempC"); }).toThrow("Cannot add two temperatures"); }); it("should add temperatures to degrees", () => { - var qty = Qty("2degC"); - var result = qty.add("3tempF"); + let qty = Qty("2degC"); + let result = qty.add("3tempF"); expect(result.scalar).toBe(33 / 5); expect(result.units()).toBe("tempF"); @@ -954,33 +950,33 @@ describe("js-quantities", () => { }); it("should subtract degrees from degrees", () => { - var qty = Qty("2degC"); + const qty = Qty("2degC"); expect(qty.sub("1.5degK").scalar).toBe(0.5); expect(qty.sub("-2degC").scalar).toBe(4); expect(qty.sub("1degF").scalar).toBe(2 - 5 / 9); expect(qty.sub("-1degC").scalar).toBe(3); - var result = qty.sub("degC"); + const result = qty.sub("degC"); expect(result.scalar).toBe(1); expect(result.units()).toBe("degC"); }); it("should subtract degrees from temperatures", () => { - var qty = Qty("2tempC"); + const qty = Qty("2tempC"); expect(qty.sub("1.5degK").scalar).toBe(0.5); expect(qty.sub("-2degC").scalar).toBe(4); expect(qty.sub("1degF").scalar).toBe(2 - 5 / 9); expect(qty.sub("-1degC").scalar).toBe(3); - var result = qty.sub("degC"); + const result = qty.sub("degC"); expect(result.scalar).toBe(1); expect(result.units()).toBe("tempC"); }); it("should subtract temperatures from temperatures", () => { - var qty = Qty("2tempC"); + const qty = Qty("2tempC"); - var result = qty.sub("1.5tempK"); + let result = qty.sub("1.5tempK"); expect(result.scalar).toBe(273.65); expect(result.units()).toBe("degC"); @@ -994,14 +990,14 @@ describe("js-quantities", () => { }); it("should not subtract temperatures from degrees", () => { - var qty = Qty("2degC"); + const qty = Qty("2degC"); expect(() => { qty.sub("1 tempF"); }).toThrow("Cannot subtract a temperature from a differential degree unit"); expect(() => { qty.sub("1 tempC"); }).toThrow("Cannot subtract a temperature from a differential degree unit"); }); it("should multiply temperature degrees", () => { - var qty = Qty("2degF"); - var result = qty.mul(3); + let qty = Qty("2degF"); + let result = qty.mul(3); expect(result.scalar).toBe(6); expect(result.units()).toBe("degF"); @@ -1022,12 +1018,12 @@ describe("js-quantities", () => { }); it("should not multiply temperatures except by scalar", () => { - var qty = Qty("2tempF"); + const qty = Qty("2tempF"); expect(() => { qty.mul("1 tempC"); }).toThrow("Cannot multiply by temperatures"); expect(() => { qty.mul("1 degC"); }).toThrow("Cannot multiply by temperatures"); expect(() => { Qty("1 tempC*s"); }).toThrow("Cannot multiply by temperatures"); - var result = qty.mul(2); + let result = qty.mul(2); expect(result.scalar).toBe(4); expect(result.units()).toBe("tempF"); @@ -1037,10 +1033,10 @@ describe("js-quantities", () => { }); it("should multiply temperature degrees with unlike quantities", () => { - var qty1 = Qty("2.5 degF"); - var qty2 = Qty("3 m"); + let qty1 = Qty("2.5 degF"); + let qty2 = Qty("3 m"); - var result = qty1.mul(qty2); + let result = qty1.mul(qty2); expect(result.scalar).toBe(7.5); qty1 = Qty("2.5 degF"); @@ -1052,23 +1048,23 @@ describe("js-quantities", () => { }); it("should divide temperature degrees with unlike quantities", () => { - var qty1 = Qty("7.5degF"); - var qty2 = Qty("2.5m^2"); + const qty1 = Qty("7.5degF"); + const qty2 = Qty("2.5m^2"); - var result = qty1.div(qty2); + const result = qty1.div(qty2); expect(result.scalar).toBe(3); expect(result.units()).toBe("degF/m2"); }); it("should divide temperature degree quantities", () => { - var qty = Qty("2.5 degF"); + const qty = Qty("2.5 degF"); expect(() => { qty.div("0 degF"); }).toThrow("Divide by zero"); expect(() => { qty.div(0); }).toThrow("Divide by zero"); expect(Qty("0 degF").div(qty).scalar).toBe(0); expect(Qty("0 degF").div(qty).units()).toBe(""); - var result = qty.div("3 degF"); + let result = qty.div("3 degF"); expect(result.scalar).toBe(2.5 / 3); expect(result.units()).toBe(""); expect(result.kind()).toBe("unitless"); @@ -1094,11 +1090,10 @@ describe("js-quantities", () => { // inverse is division: 1/x expect(() => { Qty("tempF").inverse(); }).toThrow("Cannot divide with temperatures"); - var result = Qty("4 tempF").div(2); + const result = Qty("4 tempF").div(2); expect(result.scalar).toBe(2); expect(result.units()).toBe("tempF"); }); - }); describe("errors", () => { @@ -1112,16 +1107,15 @@ describe("js-quantities", () => { }); describe("utility methods", () => { - it("should accept string as parameter for compatibility tests", () => { - var qty = Qty("1 mm"); + const qty = Qty("1 mm"); expect(qty.isCompatible("2 mm")).toBe(true); expect(qty.isCompatible("2 mm^3")).toBe(false); }); it("should return kind", () => { - var qty = Qty("1 mm"); + let qty = Qty("1 mm"); expect(qty.kind()).toBe("length"); qty = Qty("1 N"); @@ -1129,7 +1123,7 @@ describe("js-quantities", () => { }); it("should know if a quantity is in base units", () => { - var qty = Qty("100 cm"); + let qty = Qty("100 cm"); expect(qty.isBase()).toBe(false); qty = Qty("1m"); @@ -1137,7 +1131,7 @@ describe("js-quantities", () => { }); it("should return unit part of quantities", () => { - var qty = Qty("1"); + let qty = Qty("1"); expect(qty.units()).toBe(""); qty = Qty("1 /s"); expect(qty.units()).toBe("1/s"); @@ -1152,12 +1146,11 @@ describe("js-quantities", () => { qty = Qty("1 cm^2*J^3/s^2*A^2"); expect(qty.units()).toBe("cm2*J3/s2*A2"); }); - }); describe("toString", () => { it("should generate readable human output", () => { - var qty = Qty("2m"); + let qty = Qty("2m"); expect(qty.toString()).toBe("2 m"); expect(qty.toString("cm")).toBe("200 cm"); expect(qty.toString("km")).toBe("0.002 km"); @@ -1176,7 +1169,7 @@ describe("js-quantities", () => { }); it("should round readable human output when max decimals is specified", () => { - var qty = (Qty("2m")).div(3); + let qty = Qty("2m").div(3); expect(qty.toString("cm", 2)).toBe("66.67 cm"); qty = Qty("2.8m"); @@ -1187,14 +1180,14 @@ describe("js-quantities", () => { }); it("should round to max decimals", () => { - var qty = (Qty("2.987654321 m")); + const qty = Qty("2.987654321 m"); expect(qty.toString(3)).toBe("2.988 m"); expect(qty.toString(0)).toBe("3 m"); }); it("should round according to precision passed as quantity", () => { - var qty = Qty("5.17 ft"); + const qty = Qty("5.17 ft"); expect(qty.toString(Qty("ft"))).toBe("5 ft"); expect(qty.toString(Qty("2 ft"))).toBe("6 ft"); @@ -1206,49 +1199,48 @@ describe("js-quantities", () => { }); it("should return same output with successive calls", () => { - var qty = Qty("123 cm3"); + const qty = Qty("123 cm3"); expect(qty.toString("cm3", 0)).toBe("123 cm3"); expect(qty.toString("cm3", 0)).toBe("123 cm3"); }); it("should return identical output when called with no parameters or same units", () => { - var qty = Qty("123 cm3"); + const qty = Qty("123 cm3"); expect(qty.toString()).toBe(qty.toString("cm3")); }); - }); describe("format", () => { describe("provided default formatter", () => { it("should be applied to output", () => { - var qty = (Qty("2.987654321 m")); + const qty = Qty("2.987654321 m"); expect(qty.format()).toBe("2.987654321 m"); }); }); describe("custom formatter", () => { - var roundingFormatter = (maxDecimals: number) => { + const roundingFormatter = (maxDecimals: number) => { return (scalar: number, units: string) => { - var pow = Math.pow(10, maxDecimals); - var rounded = Math.round(scalar * pow) / pow; + const pow = Math.pow(10, maxDecimals); + const rounded = Math.round(scalar * pow) / pow; return rounded + " " + units; }; }; it("should be applied to output", () => { - var qty = (Qty("2.987654321 m")); + const qty = Qty("2.987654321 m"); expect(qty.format(roundingFormatter(3))).toBe("2.988 m"); expect(qty.format(roundingFormatter(0))).toBe("3 m"); }); it("should be applied after conversion to target units", () => { - var qty = (Qty("2m")).div(3); + let qty = Qty("2m").div(3); expect(qty.format("cm", roundingFormatter(2))).toBe("66.67 cm"); - var intRoundingFormatter = roundingFormatter(0); + const intRoundingFormatter = roundingFormatter(0); qty = Qty("2.8m"); expect(qty.format("m", intRoundingFormatter)).toBe("3 m"); expect(qty.format("cm", intRoundingFormatter)).toBe("280 cm"); @@ -1257,7 +1249,7 @@ describe("js-quantities", () => { }); describe("globally set as default formatter", () => { - var previousFormatter: Qty.Formatter; + let previousFormatter: Qty.Formatter; beforeEach(() => { previousFormatter = Qty.formatter; @@ -1270,7 +1262,7 @@ describe("js-quantities", () => { }); it("should be applied when no formatter is passed", () => { - var qty = (Qty("2.987654321 m")); + const qty = Qty("2.987654321 m"); expect(qty.format()).toBe("2.988 m"); }); @@ -1280,7 +1272,7 @@ describe("js-quantities", () => { describe("precision rounding", () => { it("should round according to precision passed as quantity with same units", () => { - var qty = Qty("5.17 ft"); + const qty = Qty("5.17 ft"); expect(qty.toPrec(Qty("ft")).toString()).toBe("5 ft"); expect(qty.toPrec(Qty("2 ft")).toString()).toBe("6 ft"); @@ -1294,7 +1286,7 @@ describe("js-quantities", () => { }); it("should allow string as precision parameter", () => { - var qty = Qty("5.17 ft"); + const qty = Qty("5.17 ft"); expect(qty.toPrec("ft").toString()).toBe("5 ft"); expect(qty.toPrec("0.5 ft").toString()).toBe("5 ft"); @@ -1302,7 +1294,7 @@ describe("js-quantities", () => { }); it("should round according to precision passed as quantity with different prefixes", () => { - var qty = Qty("6.3782 m"); + const qty = Qty("6.3782 m"); expect(qty.toPrec(Qty("dm")).toString()).toBe("6.4 m"); expect(qty.toPrec(Qty("cm")).toString()).toBe("6.38 m"); @@ -1312,7 +1304,7 @@ describe("js-quantities", () => { }); it("should round according to precision passed as quantity with different compatible units", () => { - var qty = Qty("1.146 MPa"); + let qty = Qty("1.146 MPa"); expect(qty.toPrec(Qty("0.1 bar")).toString()).toBe("1.15 MPa"); expect(qty.toPrec(Qty("0.01 MPa")).toString()).toBe("1.15 MPa"); expect(qty.toPrec(Qty("dbar")).toString()).toBe("1.15 MPa"); @@ -1371,25 +1363,25 @@ describe("js-quantities", () => { it("should convert value", () => { // TODO Same test but with m/h -> ft/s triggers rounding issue // (For the sake of speed, converter does not check and fix rounding issues) - var converter = Qty.swiftConverter("m/h", "m/s"); + const converter = Qty.swiftConverter("m/h", "m/s"); expect(converter(2500)).toEqual(Qty("2500 m/h").to("m/s").scalar); }); it("should returned value unchanged when units are identical", () => { - var converter = Qty.swiftConverter("m/h", "m/h"); + const converter = Qty.swiftConverter("m/h", "m/h"); expect(converter(2500)).toEqual(2500); }); it("should convert temperatures", () => { - var converter = Qty.swiftConverter("tempF", "tempC"); + const converter = Qty.swiftConverter("tempF", "tempC"); expect(converter(32)).toEqual(0); }); it("should convert degrees", () => { - var converter = Qty.swiftConverter("degC", "degF"); + const converter = Qty.swiftConverter("degC", "degF"); expect(converter(10)).toEqual(18); }); @@ -1397,7 +1389,7 @@ describe("js-quantities", () => { describe("array of values", () => { it("should be converted", () => { - var converter = Qty.swiftConverter("MPa", "bar"), + const converter = Qty.swiftConverter("MPa", "bar"), values = [250, 10, 15], expected = [2500, 100, 150]; @@ -1413,8 +1405,8 @@ describe("js-quantities", () => { }); it("should not contain duplicate kind names", () => { - var kinds = Qty.getKinds(); - var map: { [key: string]: number } = {}; + const kinds = Qty.getKinds(); + const map: { [key: string]: number } = {}; kinds.forEach(kind => { map[kind] = 1; }); @@ -1500,14 +1492,14 @@ describe("js-quantities", () => { }); it('should not be defined as base unit', () => { - var qty = Qty("F"); + const qty = Qty("F"); expect(qty.isBase()).toBe(false); expect(qty.toBase().units()).toEqual("s4*A2/m2*kg"); }); it('should be parsed when prefixed', () => { - var qty = Qty("100 nF"); + const qty = Qty("100 nF"); expect(qty.eq(Qty("100 F").div(1e9))).toBe(true); expect(qty.baseScalar).toEqual(1e-7); diff --git a/js-quantities/tsconfig.json b/types/js-quantities/tsconfig.json similarity index 100% rename from js-quantities/tsconfig.json rename to types/js-quantities/tsconfig.json diff --git a/kcors/tslint.json b/types/js-quantities/tslint.json similarity index 100% rename from kcors/tslint.json rename to types/js-quantities/tslint.json diff --git a/js-schema/index.d.ts b/types/js-schema/index.d.ts similarity index 100% rename from js-schema/index.d.ts rename to types/js-schema/index.d.ts diff --git a/js-schema/js-schema-tests.ts b/types/js-schema/js-schema-tests.ts similarity index 100% rename from js-schema/js-schema-tests.ts rename to types/js-schema/js-schema-tests.ts diff --git a/js-schema/tsconfig.json b/types/js-schema/tsconfig.json similarity index 100% rename from js-schema/tsconfig.json rename to types/js-schema/tsconfig.json diff --git a/js-url/index.d.ts b/types/js-url/index.d.ts similarity index 100% rename from js-url/index.d.ts rename to types/js-url/index.d.ts diff --git a/js-url/js-url-tests.ts b/types/js-url/js-url-tests.ts similarity index 100% rename from js-url/js-url-tests.ts rename to types/js-url/js-url-tests.ts diff --git a/js-url/tsconfig.json b/types/js-url/tsconfig.json similarity index 100% rename from js-url/tsconfig.json rename to types/js-url/tsconfig.json diff --git a/js-yaml/index.d.ts b/types/js-yaml/index.d.ts similarity index 100% rename from js-yaml/index.d.ts rename to types/js-yaml/index.d.ts diff --git a/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts similarity index 100% rename from js-yaml/js-yaml-tests.ts rename to types/js-yaml/js-yaml-tests.ts diff --git a/js-yaml/tsconfig.json b/types/js-yaml/tsconfig.json similarity index 100% rename from js-yaml/tsconfig.json rename to types/js-yaml/tsconfig.json diff --git a/jsbn/index.d.ts b/types/jsbn/index.d.ts similarity index 100% rename from jsbn/index.d.ts rename to types/jsbn/index.d.ts diff --git a/jsbn/jsbn-tests.ts b/types/jsbn/jsbn-tests.ts similarity index 100% rename from jsbn/jsbn-tests.ts rename to types/jsbn/jsbn-tests.ts diff --git a/jsbn/tsconfig.json b/types/jsbn/tsconfig.json similarity index 100% rename from jsbn/tsconfig.json rename to types/jsbn/tsconfig.json diff --git a/jscrollpane/index.d.ts b/types/jscrollpane/index.d.ts similarity index 100% rename from jscrollpane/index.d.ts rename to types/jscrollpane/index.d.ts diff --git a/jscrollpane/tsconfig.json b/types/jscrollpane/tsconfig.json similarity index 100% rename from jscrollpane/tsconfig.json rename to types/jscrollpane/tsconfig.json diff --git a/jsdeferred/index.d.ts b/types/jsdeferred/index.d.ts similarity index 100% rename from jsdeferred/index.d.ts rename to types/jsdeferred/index.d.ts diff --git a/jsdeferred/jsdeferred-tests.ts b/types/jsdeferred/jsdeferred-tests.ts similarity index 100% rename from jsdeferred/jsdeferred-tests.ts rename to types/jsdeferred/jsdeferred-tests.ts diff --git a/jsdeferred/tsconfig.json b/types/jsdeferred/tsconfig.json similarity index 100% rename from jsdeferred/tsconfig.json rename to types/jsdeferred/tsconfig.json diff --git a/jsdom/index.d.ts b/types/jsdom/index.d.ts similarity index 100% rename from jsdom/index.d.ts rename to types/jsdom/index.d.ts diff --git a/jsdom/jsdom-tests.ts b/types/jsdom/jsdom-tests.ts similarity index 100% rename from jsdom/jsdom-tests.ts rename to types/jsdom/jsdom-tests.ts diff --git a/jsdom/tsconfig.json b/types/jsdom/tsconfig.json similarity index 100% rename from jsdom/tsconfig.json rename to types/jsdom/tsconfig.json diff --git a/jsen/index.d.ts b/types/jsen/index.d.ts similarity index 100% rename from jsen/index.d.ts rename to types/jsen/index.d.ts diff --git a/jsen/jsen-tests.ts b/types/jsen/jsen-tests.ts similarity index 100% rename from jsen/jsen-tests.ts rename to types/jsen/jsen-tests.ts diff --git a/jsen/tsconfig.json b/types/jsen/tsconfig.json similarity index 100% rename from jsen/tsconfig.json rename to types/jsen/tsconfig.json diff --git a/jsend/index.d.ts b/types/jsend/index.d.ts similarity index 100% rename from jsend/index.d.ts rename to types/jsend/index.d.ts diff --git a/jsend/jsend-tests.ts b/types/jsend/jsend-tests.ts similarity index 100% rename from jsend/jsend-tests.ts rename to types/jsend/jsend-tests.ts diff --git a/jsend/tsconfig.json b/types/jsend/tsconfig.json similarity index 100% rename from jsend/tsconfig.json rename to types/jsend/tsconfig.json diff --git a/jsesc/index.d.ts b/types/jsesc/index.d.ts similarity index 100% rename from jsesc/index.d.ts rename to types/jsesc/index.d.ts diff --git a/jsesc/jsesc-tests.ts b/types/jsesc/jsesc-tests.ts similarity index 100% rename from jsesc/jsesc-tests.ts rename to types/jsesc/jsesc-tests.ts diff --git a/jsesc/tsconfig.json b/types/jsesc/tsconfig.json similarity index 100% rename from jsesc/tsconfig.json rename to types/jsesc/tsconfig.json diff --git a/jsfl/index.d.ts b/types/jsfl/index.d.ts similarity index 100% rename from jsfl/index.d.ts rename to types/jsfl/index.d.ts diff --git a/jsfl/tsconfig.json b/types/jsfl/tsconfig.json similarity index 100% rename from jsfl/tsconfig.json rename to types/jsfl/tsconfig.json diff --git a/jsfl/xJSFL.d.ts b/types/jsfl/xJSFL.d.ts similarity index 100% rename from jsfl/xJSFL.d.ts rename to types/jsfl/xJSFL.d.ts diff --git a/jshamcrest/index.d.ts b/types/jshamcrest/index.d.ts similarity index 100% rename from jshamcrest/index.d.ts rename to types/jshamcrest/index.d.ts diff --git a/jshamcrest/jshamcrest-tests.ts b/types/jshamcrest/jshamcrest-tests.ts similarity index 100% rename from jshamcrest/jshamcrest-tests.ts rename to types/jshamcrest/jshamcrest-tests.ts diff --git a/jshamcrest/tsconfig.json b/types/jshamcrest/tsconfig.json similarity index 100% rename from jshamcrest/tsconfig.json rename to types/jshamcrest/tsconfig.json diff --git a/jsmockito/index.d.ts b/types/jsmockito/index.d.ts similarity index 100% rename from jsmockito/index.d.ts rename to types/jsmockito/index.d.ts diff --git a/jsmockito/jsmockito-tests.ts b/types/jsmockito/jsmockito-tests.ts similarity index 100% rename from jsmockito/jsmockito-tests.ts rename to types/jsmockito/jsmockito-tests.ts diff --git a/jsmockito/tsconfig.json b/types/jsmockito/tsconfig.json similarity index 100% rename from jsmockito/tsconfig.json rename to types/jsmockito/tsconfig.json diff --git a/jsnlog/index.d.ts b/types/jsnlog/index.d.ts similarity index 86% rename from jsnlog/index.d.ts rename to types/jsnlog/index.d.ts index e252d5cf36..4d1c707b4f 100644 --- a/jsnlog/index.d.ts +++ b/types/jsnlog/index.d.ts @@ -25,7 +25,6 @@ // JSNLog. declare namespace JL { - interface JSNLogOptions { enabled?: boolean; maxMessages?: number; @@ -88,7 +87,6 @@ declare namespace JL { declare function __jsnlog_configure(jsnlog: any): void; - // Ambient declaration of the JL function itself declare function JL(loggerName?: string): JL.JSNLogLogger; @@ -97,20 +95,20 @@ declare function JL(loggerName?: string): JL.JSNLogLogger; // 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; + function setOptions(options: JSNLogOptions): void; + function createAjaxAppender(appenderName: string): JSNLogAjaxAppender; + function createConsoleAppender(appenderName: string): JSNLogConsoleAppender; - export class Exception { + 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; + function getOffLevel(): number; + function getTraceLevel(): number; + function getDebugLevel(): number; + function getInfoLevel(): number; + function getWarnLevel(): number; + function getErrorLevel(): number; + function getFatalLevel(): number; + function getAllLevel(): number; } diff --git a/jsnlog/jsnlog-tests.ts b/types/jsnlog/jsnlog-tests.ts similarity index 71% rename from jsnlog/jsnlog-tests.ts rename to types/jsnlog/jsnlog-tests.ts index c988234394..c7610aba78 100644 --- a/jsnlog/jsnlog-tests.ts +++ b/types/jsnlog/jsnlog-tests.ts @@ -1,16 +1,14 @@ - - // ---------------------------------------------------------- // 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(); +const offLevel: number = JL.getOffLevel(); +const traceLevel: number = JL.getTraceLevel(); +const debugLevel: number = JL.getDebugLevel(); +const infoLevel: number = JL.getInfoLevel(); +const warnLevel: number = JL.getWarnLevel(); +const errorLevel: number = JL.getErrorLevel(); +const fatalLevel: number = JL.getFatalLevel(); +const allLevel: number = JL.getAllLevel(); JL.setOptions({ enabled: true, @@ -25,12 +23,12 @@ JL.setOptions({ // ---------------------------------------------------------- // Exception -var e = new JL.Exception("i is too small!"); +const e = new JL.Exception("i is too small!"); // ---------------------------------------------------------- // Ajax Appender -var ajaxAppender1: JL.JSNLogAjaxAppender = JL.createAjaxAppender('ajaxAppender'); +const ajaxAppender1: JL.JSNLogAjaxAppender = JL.createAjaxAppender('ajaxAppender'); ajaxAppender1.setOptions({ level: 5000, @@ -48,7 +46,7 @@ ajaxAppender1.setOptions({ // ---------------------------------------------------------- // Console Appender -var consoleAppender1: JL.JSNLogConsoleAppender = JL.createConsoleAppender('consoleAppender'); +const consoleAppender1: JL.JSNLogConsoleAppender = JL.createConsoleAppender('consoleAppender'); consoleAppender1.setOptions({ level: 5000, @@ -61,13 +59,12 @@ consoleAppender1.setOptions({ batchSize: 2 }); - // ---------------------------------------------------------- // Loggers -var logger1: JL.JSNLogLogger = JL('mylogger'); +const logger1: JL.JSNLogLogger = JL('mylogger'); -var exception = {}; +const exception = {}; logger1.trace('log message').debug({ x: 1, y: 2}); logger1.info(() => 5); @@ -85,4 +82,3 @@ logger1.setOptions({ appenders: [ ajaxAppender1, consoleAppender1 ], onceOnly: [ 'regex1', 'regex2' ] }); - diff --git a/jsnlog/tsconfig.json b/types/jsnlog/tsconfig.json similarity index 100% rename from jsnlog/tsconfig.json rename to types/jsnlog/tsconfig.json diff --git a/jsnlog/tslint.json b/types/jsnlog/tslint.json similarity index 100% rename from jsnlog/tslint.json rename to types/jsnlog/tslint.json diff --git a/jsnox/index.d.ts b/types/jsnox/index.d.ts similarity index 100% rename from jsnox/index.d.ts rename to types/jsnox/index.d.ts diff --git a/jsnox/jsnox-tests.ts b/types/jsnox/jsnox-tests.ts similarity index 100% rename from jsnox/jsnox-tests.ts rename to types/jsnox/jsnox-tests.ts diff --git a/jsnox/tsconfig.json b/types/jsnox/tsconfig.json similarity index 100% rename from jsnox/tsconfig.json rename to types/jsnox/tsconfig.json diff --git a/json-editor/index.d.ts b/types/json-editor/index.d.ts similarity index 100% rename from json-editor/index.d.ts rename to types/json-editor/index.d.ts diff --git a/json-editor/json-editor-tests.ts b/types/json-editor/json-editor-tests.ts similarity index 100% rename from json-editor/json-editor-tests.ts rename to types/json-editor/json-editor-tests.ts diff --git a/json-editor/tsconfig.json b/types/json-editor/tsconfig.json similarity index 100% rename from json-editor/tsconfig.json rename to types/json-editor/tsconfig.json diff --git a/json-merge-patch/index.d.ts b/types/json-merge-patch/index.d.ts similarity index 100% rename from json-merge-patch/index.d.ts rename to types/json-merge-patch/index.d.ts diff --git a/json-merge-patch/json-merge-patch-tests.ts b/types/json-merge-patch/json-merge-patch-tests.ts similarity index 100% rename from json-merge-patch/json-merge-patch-tests.ts rename to types/json-merge-patch/json-merge-patch-tests.ts diff --git a/json-merge-patch/tsconfig.json b/types/json-merge-patch/tsconfig.json similarity index 100% rename from json-merge-patch/tsconfig.json rename to types/json-merge-patch/tsconfig.json diff --git a/json-patch/index.d.ts b/types/json-patch/index.d.ts similarity index 100% rename from json-patch/index.d.ts rename to types/json-patch/index.d.ts diff --git a/json-patch/json-patch-tests.ts b/types/json-patch/json-patch-tests.ts similarity index 100% rename from json-patch/json-patch-tests.ts rename to types/json-patch/json-patch-tests.ts diff --git a/json-patch/tsconfig.json b/types/json-patch/tsconfig.json similarity index 100% rename from json-patch/tsconfig.json rename to types/json-patch/tsconfig.json diff --git a/json-pointer/index.d.ts b/types/json-pointer/index.d.ts similarity index 100% rename from json-pointer/index.d.ts rename to types/json-pointer/index.d.ts diff --git a/json-pointer/json-pointer-tests.ts b/types/json-pointer/json-pointer-tests.ts similarity index 100% rename from json-pointer/json-pointer-tests.ts rename to types/json-pointer/json-pointer-tests.ts diff --git a/json-pointer/tsconfig.json b/types/json-pointer/tsconfig.json similarity index 100% rename from json-pointer/tsconfig.json rename to types/json-pointer/tsconfig.json diff --git a/json-socket/index.d.ts b/types/json-socket/index.d.ts similarity index 100% rename from json-socket/index.d.ts rename to types/json-socket/index.d.ts diff --git a/json-socket/json-socket-tests.ts b/types/json-socket/json-socket-tests.ts similarity index 100% rename from json-socket/json-socket-tests.ts rename to types/json-socket/json-socket-tests.ts diff --git a/json-socket/tsconfig.json b/types/json-socket/tsconfig.json similarity index 100% rename from json-socket/tsconfig.json rename to types/json-socket/tsconfig.json diff --git a/json-stable-stringify/index.d.ts b/types/json-stable-stringify/index.d.ts similarity index 100% rename from json-stable-stringify/index.d.ts rename to types/json-stable-stringify/index.d.ts diff --git a/json-stable-stringify/json-stable-stringify-tests.ts b/types/json-stable-stringify/json-stable-stringify-tests.ts similarity index 100% rename from json-stable-stringify/json-stable-stringify-tests.ts rename to types/json-stable-stringify/json-stable-stringify-tests.ts diff --git a/json-stable-stringify/tsconfig.json b/types/json-stable-stringify/tsconfig.json similarity index 100% rename from json-stable-stringify/tsconfig.json rename to types/json-stable-stringify/tsconfig.json diff --git a/keycloak-js/tslint.json b/types/json-stable-stringify/tslint.json similarity index 100% rename from keycloak-js/tslint.json rename to types/json-stable-stringify/tslint.json diff --git a/json5/index.d.ts b/types/json5/index.d.ts similarity index 100% rename from json5/index.d.ts rename to types/json5/index.d.ts diff --git a/json5/json5-tests.ts b/types/json5/json5-tests.ts similarity index 100% rename from json5/json5-tests.ts rename to types/json5/json5-tests.ts diff --git a/json5/tsconfig.json b/types/json5/tsconfig.json similarity index 100% rename from json5/tsconfig.json rename to types/json5/tsconfig.json diff --git a/jsoneditor/index.d.ts b/types/jsoneditor/index.d.ts similarity index 100% rename from jsoneditor/index.d.ts rename to types/jsoneditor/index.d.ts diff --git a/jsoneditor/jsoneditor-tests.ts b/types/jsoneditor/jsoneditor-tests.ts similarity index 100% rename from jsoneditor/jsoneditor-tests.ts rename to types/jsoneditor/jsoneditor-tests.ts diff --git a/jsoneditor/tsconfig.json b/types/jsoneditor/tsconfig.json similarity index 100% rename from jsoneditor/tsconfig.json rename to types/jsoneditor/tsconfig.json diff --git a/jsoneditoronline/index.d.ts b/types/jsoneditoronline/index.d.ts similarity index 100% rename from jsoneditoronline/index.d.ts rename to types/jsoneditoronline/index.d.ts diff --git a/jsoneditoronline/jsoneditoronline-tests.ts b/types/jsoneditoronline/jsoneditoronline-tests.ts similarity index 100% rename from jsoneditoronline/jsoneditoronline-tests.ts rename to types/jsoneditoronline/jsoneditoronline-tests.ts diff --git a/jsoneditoronline/tsconfig.json b/types/jsoneditoronline/tsconfig.json similarity index 100% rename from jsoneditoronline/tsconfig.json rename to types/jsoneditoronline/tsconfig.json diff --git a/jsonminify/index.d.ts b/types/jsonminify/index.d.ts similarity index 100% rename from jsonminify/index.d.ts rename to types/jsonminify/index.d.ts diff --git a/jsonminify/jsonminify-tests.ts b/types/jsonminify/jsonminify-tests.ts similarity index 100% rename from jsonminify/jsonminify-tests.ts rename to types/jsonminify/jsonminify-tests.ts diff --git a/jsonminify/tsconfig.json b/types/jsonminify/tsconfig.json similarity index 100% rename from jsonminify/tsconfig.json rename to types/jsonminify/tsconfig.json diff --git a/jsonnet/index.d.ts b/types/jsonnet/index.d.ts similarity index 100% rename from jsonnet/index.d.ts rename to types/jsonnet/index.d.ts diff --git a/jsonnet/jsonnet-tests.ts b/types/jsonnet/jsonnet-tests.ts similarity index 100% rename from jsonnet/jsonnet-tests.ts rename to types/jsonnet/jsonnet-tests.ts diff --git a/jsonnet/tsconfig.json b/types/jsonnet/tsconfig.json similarity index 100% rename from jsonnet/tsconfig.json rename to types/jsonnet/tsconfig.json diff --git a/jsonpath/index.d.ts b/types/jsonpath/index.d.ts similarity index 100% rename from jsonpath/index.d.ts rename to types/jsonpath/index.d.ts diff --git a/jsonpath/jsonpath-tests.ts b/types/jsonpath/jsonpath-tests.ts similarity index 100% rename from jsonpath/jsonpath-tests.ts rename to types/jsonpath/jsonpath-tests.ts diff --git a/jsonpath/tsconfig.json b/types/jsonpath/tsconfig.json similarity index 100% rename from jsonpath/tsconfig.json rename to types/jsonpath/tsconfig.json diff --git a/jsonrpc-serializer/index.d.ts b/types/jsonrpc-serializer/index.d.ts similarity index 100% rename from jsonrpc-serializer/index.d.ts rename to types/jsonrpc-serializer/index.d.ts diff --git a/jsonrpc-serializer/jsonrpc-serializer-tests.ts b/types/jsonrpc-serializer/jsonrpc-serializer-tests.ts similarity index 100% rename from jsonrpc-serializer/jsonrpc-serializer-tests.ts rename to types/jsonrpc-serializer/jsonrpc-serializer-tests.ts diff --git a/jsonrpc-serializer/tsconfig.json b/types/jsonrpc-serializer/tsconfig.json similarity index 100% rename from jsonrpc-serializer/tsconfig.json rename to types/jsonrpc-serializer/tsconfig.json diff --git a/keygrip/tslint.json b/types/jsonrpc-serializer/tslint.json similarity index 100% rename from keygrip/tslint.json rename to types/jsonrpc-serializer/tslint.json diff --git a/jsonstream/index.d.ts b/types/jsonstream/index.d.ts similarity index 100% rename from jsonstream/index.d.ts rename to types/jsonstream/index.d.ts diff --git a/jsonstream/jsonstream-tests.ts b/types/jsonstream/jsonstream-tests.ts similarity index 100% rename from jsonstream/jsonstream-tests.ts rename to types/jsonstream/jsonstream-tests.ts diff --git a/jsonstream/tsconfig.json b/types/jsonstream/tsconfig.json similarity index 100% rename from jsonstream/tsconfig.json rename to types/jsonstream/tsconfig.json diff --git a/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts similarity index 100% rename from jsonwebtoken/index.d.ts rename to types/jsonwebtoken/index.d.ts diff --git a/jsonwebtoken/jsonwebtoken-tests.ts b/types/jsonwebtoken/jsonwebtoken-tests.ts similarity index 97% rename from jsonwebtoken/jsonwebtoken-tests.ts rename to types/jsonwebtoken/jsonwebtoken-tests.ts index 4a939becbc..e591f31159 100644 --- a/jsonwebtoken/jsonwebtoken-tests.ts +++ b/types/jsonwebtoken/jsonwebtoken-tests.ts @@ -1,10 +1,8 @@ -/** - * Test suite created by Maxime LUCE - * +/** + * Test suite created by Maxime LUCE + * * Created by using code samples from https://github.com/auth0/node-jsonwebtoken. - */ - -/// + */ import jwt = require("jsonwebtoken"); import fs = require("fs"); @@ -49,7 +47,7 @@ jwt.verify(token, 'shhhhh', function(err, decoded) { // invalid token jwt.verify(token, 'wrong-secret', function(err, decoded) { - // err + // err // decoded undefined }); diff --git a/jsonwebtoken/tsconfig.json b/types/jsonwebtoken/tsconfig.json similarity index 100% rename from jsonwebtoken/tsconfig.json rename to types/jsonwebtoken/tsconfig.json diff --git a/jspdf/index.d.ts b/types/jspdf/index.d.ts similarity index 100% rename from jspdf/index.d.ts rename to types/jspdf/index.d.ts diff --git a/jspdf/jspdf-tests.ts b/types/jspdf/jspdf-tests.ts similarity index 100% rename from jspdf/jspdf-tests.ts rename to types/jspdf/jspdf-tests.ts diff --git a/jspdf/tsconfig.json b/types/jspdf/tsconfig.json similarity index 100% rename from jspdf/tsconfig.json rename to types/jspdf/tsconfig.json diff --git a/jsplumb/index.d.ts b/types/jsplumb/index.d.ts similarity index 100% rename from jsplumb/index.d.ts rename to types/jsplumb/index.d.ts diff --git a/jsplumb/tsconfig.json b/types/jsplumb/tsconfig.json similarity index 100% rename from jsplumb/tsconfig.json rename to types/jsplumb/tsconfig.json diff --git a/jsrender/index.d.ts b/types/jsrender/index.d.ts similarity index 100% rename from jsrender/index.d.ts rename to types/jsrender/index.d.ts diff --git a/jsrender/jsrender-tests.ts b/types/jsrender/jsrender-tests.ts similarity index 97% rename from jsrender/jsrender-tests.ts rename to types/jsrender/jsrender-tests.ts index d728f968ae..7b5bf5a525 100644 --- a/jsrender/jsrender-tests.ts +++ b/types/jsrender/jsrender-tests.ts @@ -1,5 +1,3 @@ -/// - $.views.converters("upper", function(val) { return val.toUpperCase(); }); diff --git a/jsrender/tsconfig.json b/types/jsrender/tsconfig.json similarity index 100% rename from jsrender/tsconfig.json rename to types/jsrender/tsconfig.json diff --git a/jss/index.d.ts b/types/jss/index.d.ts similarity index 100% rename from jss/index.d.ts rename to types/jss/index.d.ts diff --git a/jss/jss-tests.ts b/types/jss/jss-tests.ts similarity index 100% rename from jss/jss-tests.ts rename to types/jss/jss-tests.ts diff --git a/jss/tsconfig.json b/types/jss/tsconfig.json similarity index 100% rename from jss/tsconfig.json rename to types/jss/tsconfig.json diff --git a/jssha/index.d.ts b/types/jssha/index.d.ts similarity index 100% rename from jssha/index.d.ts rename to types/jssha/index.d.ts diff --git a/jssha/jssha-tests.ts b/types/jssha/jssha-tests.ts similarity index 100% rename from jssha/jssha-tests.ts rename to types/jssha/jssha-tests.ts diff --git a/jssha/tsconfig.json b/types/jssha/tsconfig.json similarity index 100% rename from jssha/tsconfig.json rename to types/jssha/tsconfig.json diff --git a/jstimezonedetect/index.d.ts b/types/jstimezonedetect/index.d.ts similarity index 100% rename from jstimezonedetect/index.d.ts rename to types/jstimezonedetect/index.d.ts diff --git a/jstimezonedetect/jstimezonedetect-tests.ts b/types/jstimezonedetect/jstimezonedetect-tests.ts similarity index 100% rename from jstimezonedetect/jstimezonedetect-tests.ts rename to types/jstimezonedetect/jstimezonedetect-tests.ts diff --git a/jstimezonedetect/tsconfig.json b/types/jstimezonedetect/tsconfig.json similarity index 100% rename from jstimezonedetect/tsconfig.json rename to types/jstimezonedetect/tsconfig.json diff --git a/jstorage/index.d.ts b/types/jstorage/index.d.ts similarity index 100% rename from jstorage/index.d.ts rename to types/jstorage/index.d.ts diff --git a/jstorage/jstorage-tests.ts b/types/jstorage/jstorage-tests.ts similarity index 100% rename from jstorage/jstorage-tests.ts rename to types/jstorage/jstorage-tests.ts diff --git a/jstorage/tsconfig.json b/types/jstorage/tsconfig.json similarity index 100% rename from jstorage/tsconfig.json rename to types/jstorage/tsconfig.json diff --git a/jstree/index.d.ts b/types/jstree/index.d.ts similarity index 100% rename from jstree/index.d.ts rename to types/jstree/index.d.ts diff --git a/jstree/jstree-tests.ts b/types/jstree/jstree-tests.ts similarity index 100% rename from jstree/jstree-tests.ts rename to types/jstree/jstree-tests.ts diff --git a/jstree/tsconfig.json b/types/jstree/tsconfig.json similarity index 100% rename from jstree/tsconfig.json rename to types/jstree/tsconfig.json diff --git a/jsts/index.d.ts b/types/jsts/index.d.ts similarity index 100% rename from jsts/index.d.ts rename to types/jsts/index.d.ts diff --git a/jsts/jsts-tests.ts b/types/jsts/jsts-tests.ts similarity index 100% rename from jsts/jsts-tests.ts rename to types/jsts/jsts-tests.ts diff --git a/jsts/tsconfig.json b/types/jsts/tsconfig.json similarity index 100% rename from jsts/tsconfig.json rename to types/jsts/tsconfig.json diff --git a/jsuite/index.d.ts b/types/jsuite/index.d.ts similarity index 100% rename from jsuite/index.d.ts rename to types/jsuite/index.d.ts diff --git a/jsuite/tsconfig.json b/types/jsuite/tsconfig.json similarity index 100% rename from jsuite/tsconfig.json rename to types/jsuite/tsconfig.json diff --git a/jsuri/index.d.ts b/types/jsuri/index.d.ts similarity index 100% rename from jsuri/index.d.ts rename to types/jsuri/index.d.ts diff --git a/jsuri/jsuri-tests.ts b/types/jsuri/jsuri-tests.ts similarity index 100% rename from jsuri/jsuri-tests.ts rename to types/jsuri/jsuri-tests.ts diff --git a/jsuri/tsconfig.json b/types/jsuri/tsconfig.json similarity index 100% rename from jsuri/tsconfig.json rename to types/jsuri/tsconfig.json diff --git a/jsurl/index.d.ts b/types/jsurl/index.d.ts similarity index 100% rename from jsurl/index.d.ts rename to types/jsurl/index.d.ts diff --git a/jsurl/jsurl-tests.ts b/types/jsurl/jsurl-tests.ts similarity index 100% rename from jsurl/jsurl-tests.ts rename to types/jsurl/jsurl-tests.ts diff --git a/jsurl/tsconfig.json b/types/jsurl/tsconfig.json similarity index 100% rename from jsurl/tsconfig.json rename to types/jsurl/tsconfig.json diff --git a/jsx-chai/index.d.ts b/types/jsx-chai/index.d.ts similarity index 100% rename from jsx-chai/index.d.ts rename to types/jsx-chai/index.d.ts diff --git a/jsx-chai/jsx-chai-tests.ts b/types/jsx-chai/jsx-chai-tests.ts similarity index 80% rename from jsx-chai/jsx-chai-tests.ts rename to types/jsx-chai/jsx-chai-tests.ts index d421ae0874..48c49e7b25 100644 --- a/jsx-chai/jsx-chai-tests.ts +++ b/types/jsx-chai/jsx-chai-tests.ts @@ -1,5 +1,3 @@ -/// - import chai = require('chai'); import jsxChai = require('jsx-chai'); diff --git a/jsx-chai/tsconfig.json b/types/jsx-chai/tsconfig.json similarity index 100% rename from jsx-chai/tsconfig.json rename to types/jsx-chai/tsconfig.json diff --git a/jszip/index.d.ts b/types/jszip/index.d.ts similarity index 100% rename from jszip/index.d.ts rename to types/jszip/index.d.ts diff --git a/jszip/jszip-tests.ts b/types/jszip/jszip-tests.ts similarity index 100% rename from jszip/jszip-tests.ts rename to types/jszip/jszip-tests.ts diff --git a/jszip/tsconfig.json b/types/jszip/tsconfig.json similarity index 100% rename from jszip/tsconfig.json rename to types/jszip/tsconfig.json diff --git a/jug/index.d.ts b/types/jug/index.d.ts similarity index 100% rename from jug/index.d.ts rename to types/jug/index.d.ts diff --git a/jug/jug-tests.ts b/types/jug/jug-tests.ts similarity index 100% rename from jug/jug-tests.ts rename to types/jug/jug-tests.ts diff --git a/jug/tsconfig.json b/types/jug/tsconfig.json similarity index 100% rename from jug/tsconfig.json rename to types/jug/tsconfig.json diff --git a/jui-core/index.d.ts b/types/jui-core/index.d.ts similarity index 99% rename from jui-core/index.d.ts rename to types/jui-core/index.d.ts index 0f1184c0a3..6d15361d8e 100644 --- a/jui-core/index.d.ts +++ b/types/jui-core/index.d.ts @@ -132,7 +132,6 @@ interface UtilBase { */ typeCheck(typeName: string, value: any): boolean; - typeCheckObj(uiObj: any, list: any): void; /** @@ -318,7 +317,6 @@ interface UtilBase { inArray(target: any, list: any[]): number; - trim(text: string): string; ready: ((...args: any[]) => void); @@ -398,7 +396,6 @@ interface JuiStatic { */ add(uiIns: any): void; - /** * @method emit * Generates a custom event to an applicable component @@ -443,7 +440,6 @@ interface UICollection { } interface UICore { - tpl?: any; event?: any; @@ -543,7 +539,6 @@ interface UICore { //noinspection TypeScriptUnresolvedVariable export interface UIEvent extends UICore { - root?: any; /** @@ -809,7 +804,6 @@ interface UtilMath { matrix3d(a: T[], b: T[]): T[]; inverseMatrix3d(a: any[]): any[]; - } export interface UtilScaleOrdinal extends Function { diff --git a/jui-core/jui-core-tests.ts b/types/jui-core/jui-core-tests.ts similarity index 84% rename from jui-core/jui-core-tests.ts rename to types/jui-core/jui-core-tests.ts index c0677926e6..a5d4f23bcb 100644 --- a/jui-core/jui-core-tests.ts +++ b/types/jui-core/jui-core-tests.ts @@ -1,4 +1,4 @@ -import {jui, UtilColor, UtilBase} from "./index"; +import {jui, UtilColor, UtilBase} from "jui-core"; jui.ready(["util.color"], (color: UtilColor) => { console.log(color.rgb("#ff0000")); diff --git a/jui-core/tsconfig.json b/types/jui-core/tsconfig.json similarity index 100% rename from jui-core/tsconfig.json rename to types/jui-core/tsconfig.json diff --git a/koa-basic-auth/tslint.json b/types/jui-core/tslint.json similarity index 100% rename from koa-basic-auth/tslint.json rename to types/jui-core/tslint.json diff --git a/jui-grid/index.d.ts b/types/jui-grid/index.d.ts similarity index 99% rename from jui-grid/index.d.ts rename to types/jui-grid/index.d.ts index 0fee7cc271..31b3ca2b51 100644 --- a/jui-grid/index.d.ts +++ b/types/jui-grid/index.d.ts @@ -232,7 +232,6 @@ export interface GridTable extends UIEvent { * Determines whether to use the move function when you fire row draggable event. */ moveRow?: boolean, - }): this; root?: any; @@ -612,9 +611,7 @@ export interface GridTable extends UIEvent { } export interface GridXTable extends UIEvent { - (selector: any, options?: { - - }): this; + (selector: any, options?: {}): this; render(isTree?: boolean): void; diff --git a/jui-grid/jui-grid-tests.ts b/types/jui-grid/jui-grid-tests.ts similarity index 95% rename from jui-grid/jui-grid-tests.ts rename to types/jui-grid/jui-grid-tests.ts index 1fb65c4b97..2609e94021 100644 --- a/jui-grid/jui-grid-tests.ts +++ b/types/jui-grid/jui-grid-tests.ts @@ -1,8 +1,7 @@ /// import {jui} from 'jui-core'; -import {GridTable, GridXTable, GridRow} from "./index"; - +import {GridTable, GridXTable, GridRow} from "jui-grid"; jui.ready([ "grid.table" ], (table: GridTable) => { const table_1: GridTable = table("#table_1", { @@ -41,7 +40,7 @@ jui.ready([ "grid.table" ], (table: GridTable) => { ]); const table_3_submit: Function = (index: number) => { - var name = $(table_3.root).find(".name").val(), + const name = $(table_3.root).find(".name").val(), age = $(table_3.root).find(".age").val(), location = $(table_3.root).find(".location").val(); @@ -52,7 +51,7 @@ jui.ready([ "grid.table" ], (table: GridTable) => { }); jui.ready([ "grid.xtable" ], (xtable: GridXTable) => { - var page = 1; + let page = 1; const xtable_2: GridXTable = xtable("#xtable_2", { fields: [ "name", "age", "location" ], @@ -63,9 +62,9 @@ jui.ready([ "grid.xtable" ], (xtable: GridXTable) => { }); const xtable_2_submit: Function = () => { - var result: any[] = []; + const result: any[] = []; - for (var i = 0; i < 1000000; i++) { + for (let i = 0; i < 1000000; i++) { result.push({ name: "Alvin" + i, age: Math.floor(Math.random() * 100) + 1, location: "LA" }); } @@ -81,7 +80,6 @@ jui.ready([ "grid.xtable" ], (xtable: GridXTable) => { }; }); - jui.ready([ "grid.xtable" ], (xtable: GridXTable) => { const xtable_4: GridXTable = xtable("#xtable_4", { fields: [ "name", "age", "location" ], @@ -130,9 +128,9 @@ jui.ready([ "grid.xtable" ], (xtable: GridXTable) => { }); const xtable_6_submit: Function = () => { - var result: any[] = []; + const result: any[] = []; - for (var i = 0; i < 1000000; i++) { + for (let i = 0; i < 1000000; i++) { result.push({ name: "Alvin" + i, age: Math.floor(Math.random() * 100) + 1, location: "LA" }); } @@ -178,5 +176,4 @@ jui.ready([ "grid.xtable" ], (xtable: GridXTable) => { { index: "0.5", type: "fold", data: { url: "/sitemap.xml", count: 10 } }, { index: "0.6", type: "fold", data: { url: "/package.json", count: 5 } } ]); - }); diff --git a/jui-grid/tsconfig.json b/types/jui-grid/tsconfig.json similarity index 100% rename from jui-grid/tsconfig.json rename to types/jui-grid/tsconfig.json diff --git a/jui-grid/tslint.json b/types/jui-grid/tslint.json similarity index 100% rename from jui-grid/tslint.json rename to types/jui-grid/tslint.json diff --git a/jui/index.d.ts b/types/jui/index.d.ts similarity index 99% rename from jui/index.d.ts rename to types/jui/index.d.ts index c1dec57e39..24e5ed215c 100644 --- a/jui/index.d.ts +++ b/types/jui/index.d.ts @@ -6,7 +6,6 @@ import {UIEvent} from 'jui-core'; export interface UIAccordion extends UIEvent { - (selector: any, options?: { tpl?: any, event?: any, @@ -91,10 +90,8 @@ export interface UIColorPicker { getColor(type: string): string|{}; setColor(value: string|{}): void; - } - export interface UICombo { (selector: any, options?: { tpl?: any, @@ -201,7 +198,6 @@ export interface UICombo { reload(): void; } - export interface UIDatePicker { (selector: any, options?: { tpl?: any, @@ -399,7 +395,6 @@ export interface UIDropdown { reload(): void; } - export interface UIModal { (selector: any, options?: { tpl?: any, @@ -460,7 +455,6 @@ export interface UIModal { resize(): void; } - export interface UINotify { (selector: any, options?: { tpl?: any, @@ -611,7 +605,6 @@ export interface UIProgress { setStriped(isStriped: boolean): void; setValue(v: number): void; getValue(): number; - } export interface UIProperty { @@ -716,7 +709,6 @@ export interface UISlider { tooltip?: boolean, format?: string, progress?: boolean - }): this; /** @@ -750,10 +742,8 @@ export interface UISlider { * @return {Number} value */ getToValue(): number; - } - export interface UISplitter { (selector: any, options?: { tpl?: any, @@ -849,7 +839,6 @@ export interface UISwitch { } export interface UITab { - (selector: any, options?: { tpl?: any, event?: any, @@ -1011,7 +1000,6 @@ export interface UITooltip { * Sets the content of a tooltip (referring to the title properties in markup) */ title?: string, - }): this; /** diff --git a/jui/jui-tests.ts b/types/jui/jui-tests.ts similarity index 99% rename from jui/jui-tests.ts rename to types/jui/jui-tests.ts index 8a7a5d03f4..5cc6dd93f2 100644 --- a/jui/jui-tests.ts +++ b/types/jui/jui-tests.ts @@ -118,5 +118,4 @@ jui.ready([ }); console.log(selectInstance.getValue()); - }); diff --git a/jui/tsconfig.json b/types/jui/tsconfig.json similarity index 100% rename from jui/tsconfig.json rename to types/jui/tsconfig.json diff --git a/koa-json-error/tslint.json b/types/jui/tslint.json similarity index 100% rename from koa-json-error/tslint.json rename to types/jui/tslint.json diff --git a/types/jump.js/index.d.ts b/types/jump.js/index.d.ts new file mode 100644 index 0000000000..111c41d59a --- /dev/null +++ b/types/jump.js/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for jump.js 1.0 +// Project: https://github.com/callmecavs/jump.js +// Definitions by: rhysd +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = jump; + +declare function jump(target: string | Element | number, opts?: jump.Options): void; + +declare namespace jump { + type TransitionFunc = (t: number, b: number, c: number, d: number) => number; + interface Options { + duration?: number; + offset?: number; + callback?: () => void; + easing?: TransitionFunc; + a11y?: boolean; + } +} diff --git a/jump.js/jump.js-tests.ts b/types/jump.js/jump.js-tests.ts similarity index 100% rename from jump.js/jump.js-tests.ts rename to types/jump.js/jump.js-tests.ts diff --git a/jump.js/tsconfig.json b/types/jump.js/tsconfig.json similarity index 100% rename from jump.js/tsconfig.json rename to types/jump.js/tsconfig.json diff --git a/koa-jwt/tslint.json b/types/jump.js/tslint.json similarity index 100% rename from koa-jwt/tslint.json rename to types/jump.js/tslint.json diff --git a/jwplayer/index.d.ts b/types/jwplayer/index.d.ts similarity index 100% rename from jwplayer/index.d.ts rename to types/jwplayer/index.d.ts diff --git a/jwplayer/tsconfig.json b/types/jwplayer/tsconfig.json similarity index 100% rename from jwplayer/tsconfig.json rename to types/jwplayer/tsconfig.json diff --git a/jwt-client/index.d.ts b/types/jwt-client/index.d.ts similarity index 100% rename from jwt-client/index.d.ts rename to types/jwt-client/index.d.ts diff --git a/jwt-client/jwt-client-tests.ts b/types/jwt-client/jwt-client-tests.ts similarity index 100% rename from jwt-client/jwt-client-tests.ts rename to types/jwt-client/jwt-client-tests.ts diff --git a/jwt-client/tsconfig.json b/types/jwt-client/tsconfig.json similarity index 100% rename from jwt-client/tsconfig.json rename to types/jwt-client/tsconfig.json diff --git a/jwt-decode/index.d.ts b/types/jwt-decode/index.d.ts similarity index 100% rename from jwt-decode/index.d.ts rename to types/jwt-decode/index.d.ts diff --git a/jwt-decode/jwt-decode-tests.ts b/types/jwt-decode/jwt-decode-tests.ts similarity index 100% rename from jwt-decode/jwt-decode-tests.ts rename to types/jwt-decode/jwt-decode-tests.ts diff --git a/jwt-decode/tsconfig.json b/types/jwt-decode/tsconfig.json similarity index 100% rename from jwt-decode/tsconfig.json rename to types/jwt-decode/tsconfig.json diff --git a/jwt-simple/index.d.ts b/types/jwt-simple/index.d.ts similarity index 89% rename from jwt-simple/index.d.ts rename to types/jwt-simple/index.d.ts index 1ae8f18519..b70aa8c720 100644 --- a/jwt-simple/index.d.ts +++ b/types/jwt-simple/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jwt-simple v0.5.0 +// Type definitions for jwt-simple v0.5.1 // Project: https://github.com/hokaccha/node-jwt-simple // Definitions by: Ken Fukuyama , Gael Magnan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,7 +11,7 @@ * @param algorithm default is HS256 * @api public */ -export function decode(token: any, key: string, noVerify?: boolean): any; +export function decode(token: any, key: string, noVerify?: boolean, algorithm?: string): any; /** * Encode jwt * @param payload diff --git a/jwt-simple/jwt-simple-tests.ts b/types/jwt-simple/jwt-simple-tests.ts similarity index 100% rename from jwt-simple/jwt-simple-tests.ts rename to types/jwt-simple/jwt-simple-tests.ts diff --git a/jwt-simple/tsconfig.json b/types/jwt-simple/tsconfig.json similarity index 100% rename from jwt-simple/tsconfig.json rename to types/jwt-simple/tsconfig.json diff --git a/kafka-node/index.d.ts b/types/kafka-node/index.d.ts similarity index 90% rename from kafka-node/index.d.ts rename to types/kafka-node/index.d.ts index a9992ccc52..7523f88c6f 100644 --- a/kafka-node/index.d.ts +++ b/types/kafka-node/index.d.ts @@ -63,7 +63,7 @@ export declare class HighLevelConsumer { close(force: boolean, cb: () => any): void; } -export declare class ConsumerGroup { +export declare class ConsumerGroup extends HighLevelConsumer { constructor(options: ConsumerGroupOptions, topics: string[]); on(eventName: string, cb: (message: string) => any): void; on(eventName: string, cb: (error: any) => any): void; @@ -131,11 +131,22 @@ export interface ConsumerGroupOptions { ssl?: boolean; id: string; groupId: string; - sessionTimeout: number; - protocol: Array<"roundrobin" | "range" | CustomPartitionAssignmentProtocol>; - fromOffset: "earliest" | "latest" | "none"; - migrateHLC: false; - migrateRolling: true; + sessionTimeout?: number; + protocol?: Array<"roundrobin" | "range" | CustomPartitionAssignmentProtocol>; + fromOffset?: "earliest" | "latest" | "none"; + migrateHLC?: boolean; + migrateRolling?: boolean; + autoCommit?: boolean; + autoCommitIntervalMs?: number; + fetchMaxWaitMs?: number; + paused?: boolean; + maxNumSegments?: number; + fetchMinBytes?: number; + fetchMaxBytes?: number; + retries?: number; + retryFactor?: number; + retryMinTimeout?: number; + connectOnReady?: boolean; } export interface Topic { diff --git a/kafka-node/kafka-node-tests.ts b/types/kafka-node/kafka-node-tests.ts similarity index 100% rename from kafka-node/kafka-node-tests.ts rename to types/kafka-node/kafka-node-tests.ts diff --git a/kafka-node/tsconfig.json b/types/kafka-node/tsconfig.json similarity index 100% rename from kafka-node/tsconfig.json rename to types/kafka-node/tsconfig.json diff --git a/karma-chai-sinon/index.d.ts b/types/karma-chai-sinon/index.d.ts similarity index 100% rename from karma-chai-sinon/index.d.ts rename to types/karma-chai-sinon/index.d.ts diff --git a/karma-chai-sinon/karma-chai-sinon-tests.ts b/types/karma-chai-sinon/karma-chai-sinon-tests.ts similarity index 100% rename from karma-chai-sinon/karma-chai-sinon-tests.ts rename to types/karma-chai-sinon/karma-chai-sinon-tests.ts diff --git a/karma-chai-sinon/tsconfig.json b/types/karma-chai-sinon/tsconfig.json similarity index 100% rename from karma-chai-sinon/tsconfig.json rename to types/karma-chai-sinon/tsconfig.json diff --git a/karma-coverage/index.d.ts b/types/karma-coverage/index.d.ts similarity index 100% rename from karma-coverage/index.d.ts rename to types/karma-coverage/index.d.ts diff --git a/karma-coverage/karma-coverage-tests.ts b/types/karma-coverage/karma-coverage-tests.ts similarity index 100% rename from karma-coverage/karma-coverage-tests.ts rename to types/karma-coverage/karma-coverage-tests.ts diff --git a/karma-coverage/tsconfig.json b/types/karma-coverage/tsconfig.json similarity index 88% rename from karma-coverage/tsconfig.json rename to types/karma-coverage/tsconfig.json index 57290fb7be..404aa4ec66 100644 --- a/karma-coverage/tsconfig.json +++ b/types/karma-coverage/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/karma-fixture/index.d.ts b/types/karma-fixture/index.d.ts similarity index 100% rename from karma-fixture/index.d.ts rename to types/karma-fixture/index.d.ts diff --git a/karma-fixture/karma-fixture-tests.ts b/types/karma-fixture/karma-fixture-tests.ts similarity index 100% rename from karma-fixture/karma-fixture-tests.ts rename to types/karma-fixture/karma-fixture-tests.ts diff --git a/karma-fixture/tsconfig.json b/types/karma-fixture/tsconfig.json similarity index 100% rename from karma-fixture/tsconfig.json rename to types/karma-fixture/tsconfig.json diff --git a/karma-jasmine/index.d.ts b/types/karma-jasmine/index.d.ts similarity index 100% rename from karma-jasmine/index.d.ts rename to types/karma-jasmine/index.d.ts diff --git a/karma-jasmine/karma-jasmine-tests.ts b/types/karma-jasmine/karma-jasmine-tests.ts similarity index 100% rename from karma-jasmine/karma-jasmine-tests.ts rename to types/karma-jasmine/karma-jasmine-tests.ts diff --git a/karma-jasmine/tsconfig.json b/types/karma-jasmine/tsconfig.json similarity index 100% rename from karma-jasmine/tsconfig.json rename to types/karma-jasmine/tsconfig.json diff --git a/karma/index.d.ts b/types/karma/index.d.ts similarity index 100% rename from karma/index.d.ts rename to types/karma/index.d.ts diff --git a/karma/karma-tests.ts b/types/karma/karma-tests.ts similarity index 100% rename from karma/karma-tests.ts rename to types/karma/karma-tests.ts diff --git a/karma/tsconfig.json b/types/karma/tsconfig.json similarity index 88% rename from karma/tsconfig.json rename to types/karma/tsconfig.json index 2c74d40398..b2d5e469ba 100644 --- a/karma/tsconfig.json +++ b/types/karma/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/katex/index.d.ts b/types/katex/index.d.ts similarity index 100% rename from katex/index.d.ts rename to types/katex/index.d.ts diff --git a/katex/katex-tests.ts b/types/katex/katex-tests.ts similarity index 100% rename from katex/katex-tests.ts rename to types/katex/katex-tests.ts diff --git a/katex/tsconfig.json b/types/katex/tsconfig.json similarity index 100% rename from katex/tsconfig.json rename to types/katex/tsconfig.json diff --git a/kcors/index.d.ts b/types/kcors/index.d.ts similarity index 70% rename from kcors/index.d.ts rename to types/kcors/index.d.ts index e2618f63cb..e4e9e53fa6 100644 --- a/kcors/index.d.ts +++ b/types/kcors/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for kcors 2.2 // Project: https://github.com/koajs/cors -// Definitions by: Xavier Stouder +// Definitions by: Xavier Stouder , Izayoi Ko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as Koa from "koa"; @@ -10,10 +10,10 @@ export = cors; declare namespace cors { interface Options { - origin?: (req: Koa.Request) => string | string; + origin?: ((req: Koa.Request) => string) | string; allowMethods?: string[] | string; exposeHeaders?: string[] | string; - allowHeaders: string[] | string; + allowHeaders?: string[] | string; maxAge?: number | string; credentials?: boolean; keepHeadersOnError?: boolean; diff --git a/kcors/kcors-tests.ts b/types/kcors/kcors-tests.ts similarity index 100% rename from kcors/kcors-tests.ts rename to types/kcors/kcors-tests.ts diff --git a/kcors/tsconfig.json b/types/kcors/tsconfig.json similarity index 100% rename from kcors/tsconfig.json rename to types/kcors/tsconfig.json diff --git a/koa-pug/tslint.json b/types/kcors/tslint.json similarity index 100% rename from koa-pug/tslint.json rename to types/kcors/tslint.json diff --git a/kefir/index.d.ts b/types/kefir/index.d.ts similarity index 100% rename from kefir/index.d.ts rename to types/kefir/index.d.ts diff --git a/kefir/kefir-tests.ts b/types/kefir/kefir-tests.ts similarity index 100% rename from kefir/kefir-tests.ts rename to types/kefir/kefir-tests.ts diff --git a/kefir/tsconfig.json b/types/kefir/tsconfig.json similarity index 100% rename from kefir/tsconfig.json rename to types/kefir/tsconfig.json diff --git a/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts similarity index 100% rename from kendo-ui/index.d.ts rename to types/kendo-ui/index.d.ts diff --git a/kendo-ui/kendo-ui-tests.ts b/types/kendo-ui/kendo-ui-tests.ts similarity index 91% rename from kendo-ui/kendo-ui-tests.ts rename to types/kendo-ui/kendo-ui-tests.ts index d1cc528edb..0b79f87954 100644 --- a/kendo-ui/kendo-ui-tests.ts +++ b/types/kendo-ui/kendo-ui-tests.ts @@ -1,6 +1,3 @@ -/// - - var is = { string: (msg: string) => { return true; diff --git a/kendo-ui/tsconfig.json b/types/kendo-ui/tsconfig.json similarity index 100% rename from kendo-ui/tsconfig.json rename to types/kendo-ui/tsconfig.json diff --git a/keyboardjs/index.d.ts b/types/keyboardjs/index.d.ts similarity index 100% rename from keyboardjs/index.d.ts rename to types/keyboardjs/index.d.ts diff --git a/keyboardjs/tsconfig.json b/types/keyboardjs/tsconfig.json similarity index 100% rename from keyboardjs/tsconfig.json rename to types/keyboardjs/tsconfig.json diff --git a/keycloak-js/index.d.ts b/types/keycloak-js/index.d.ts similarity index 94% rename from keycloak-js/index.d.ts rename to types/keycloak-js/index.d.ts index 540084d6fd..9f7e817df1 100644 --- a/keycloak-js/index.d.ts +++ b/types/keycloak-js/index.d.ts @@ -14,13 +14,13 @@ export = Keycloak; declare function Keycloak(config?: string|{}): Keycloak.KeycloakInstance; declare namespace Keycloak { - export type KeycloakAdapterName = 'cordova'|'default'; - export type KeycloakOnLoad = 'login-required'|'check-sso'; - export type KeycloakResponseMode = 'query'|'fragment'; - export type KeycloakResponseType = 'code'|'id_token token'|'code id_token token'; - export type KeycloakFlow = 'standard'|'implicit'|'hybrid'; + type KeycloakAdapterName = 'cordova'|'default'; + type KeycloakOnLoad = 'login-required'|'check-sso'; + type KeycloakResponseMode = 'query'|'fragment'; + type KeycloakResponseType = 'code'|'id_token token'|'code id_token token'; + type KeycloakFlow = 'standard'|'implicit'|'hybrid'; - export interface KeycloakInitOptions { + interface KeycloakInitOptions { /** * @private Undocumented. */ @@ -81,7 +81,7 @@ declare namespace Keycloak { flow?: KeycloakFlow; } - export interface KeycloakLoginOptions { + interface KeycloakLoginOptions { /** * @private Undocumented. */ @@ -131,9 +131,9 @@ declare namespace Keycloak { locale?: string; } - export type KeycloakPromiseCallback = (result: T) => void; + type KeycloakPromiseCallback = (result: T) => void; - export interface KeycloakPromise { + interface KeycloakPromise { /** * Function to call if the promised action succeeds. */ @@ -145,12 +145,12 @@ declare namespace Keycloak { error(callback: KeycloakPromiseCallback): KeycloakPromise; } - export interface KeycloakError { + interface KeycloakError { error: string; error_description: string; } - export interface KeycloakAdapter { + interface KeycloakAdapter { login(options?: KeycloakLoginOptions): KeycloakPromise; logout(options?: any): KeycloakPromise; register(options?: KeycloakLoginOptions): KeycloakPromise; @@ -158,7 +158,7 @@ declare namespace Keycloak { redirectUri(options: { redirectUri: string; }, encodeHash: boolean): string; } - export interface KeycloakProfile { + interface KeycloakProfile { id?: string; username?: string; email?: string; @@ -176,7 +176,7 @@ declare namespace Keycloak { * A client for the Keycloak authentication server. * @see {@link https://keycloak.gitbooks.io/securing-client-applications-guide/content/topics/oidc/javascript-adapter.html|Keycloak JS adapter documentation} */ - export interface KeycloakInstance { + interface KeycloakInstance { /** * Is true if the user is authenticated, false otherwise. */ diff --git a/keycloak-js/keycloak-authz.d.ts b/types/keycloak-js/keycloak-authz.d.ts similarity index 92% rename from keycloak-js/keycloak-authz.d.ts rename to types/keycloak-js/keycloak-authz.d.ts index 4db057ad97..b15c505257 100644 --- a/keycloak-js/keycloak-authz.d.ts +++ b/types/keycloak-js/keycloak-authz.d.ts @@ -11,11 +11,11 @@ export = KeycloakAuthorization; declare function KeycloakAuthorization(keycloak: Keycloak.KeycloakInstance): KeycloakAuthorization.KeycloakAuthorizationInstance; declare namespace KeycloakAuthorization { - export interface KeycloakAuthorizationPromise { + interface KeycloakAuthorizationPromise { then(onGrant: (rpt: string) => void, onDeny: () => void, onError: () => void): void; } - export interface KeycloakAuthorizationInstance { + interface KeycloakAuthorizationInstance { rpt: any; config: { rpt_endpoint: string }; diff --git a/keycloak-js/keycloak-js-tests.ts b/types/keycloak-js/keycloak-js-tests.ts similarity index 100% rename from keycloak-js/keycloak-js-tests.ts rename to types/keycloak-js/keycloak-js-tests.ts diff --git a/keycloak-js/tsconfig.json b/types/keycloak-js/tsconfig.json similarity index 100% rename from keycloak-js/tsconfig.json rename to types/keycloak-js/tsconfig.json diff --git a/later/tslint.json b/types/keycloak-js/tslint.json similarity index 100% rename from later/tslint.json rename to types/keycloak-js/tslint.json diff --git a/keygrip/index.d.ts b/types/keygrip/index.d.ts similarity index 89% rename from keygrip/index.d.ts rename to types/keygrip/index.d.ts index b5929aaec6..4c858839c9 100644 --- a/keygrip/index.d.ts +++ b/types/keygrip/index.d.ts @@ -3,13 +3,13 @@ // Definitions by: jKey Lu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare interface Keygrip { +interface Keygrip { sign(data: any): string; verify(data: any, digest: string): boolean; index(data: any, digest: string): number; } -declare interface KeygripFunction { +interface KeygripFunction { new (keys: string[], algorithm?: string, encoding?: string): Keygrip; (keys: string[], algorithm?: string, encoding?: string): Keygrip; } diff --git a/keygrip/keygrip-tests.ts b/types/keygrip/keygrip-tests.ts similarity index 100% rename from keygrip/keygrip-tests.ts rename to types/keygrip/keygrip-tests.ts diff --git a/keygrip/tsconfig.json b/types/keygrip/tsconfig.json similarity index 100% rename from keygrip/tsconfig.json rename to types/keygrip/tsconfig.json diff --git a/leaflet-imageoverlay-rotated/tslint.json b/types/keygrip/tslint.json similarity index 100% rename from leaflet-imageoverlay-rotated/tslint.json rename to types/keygrip/tslint.json diff --git a/keymaster/index.d.ts b/types/keymaster/index.d.ts similarity index 100% rename from keymaster/index.d.ts rename to types/keymaster/index.d.ts diff --git a/keymaster/keymaster-tests.ts b/types/keymaster/keymaster-tests.ts similarity index 100% rename from keymaster/keymaster-tests.ts rename to types/keymaster/keymaster-tests.ts diff --git a/keymaster/tsconfig.json b/types/keymaster/tsconfig.json similarity index 100% rename from keymaster/tsconfig.json rename to types/keymaster/tsconfig.json diff --git a/keymirror/index.d.ts b/types/keymirror/index.d.ts similarity index 100% rename from keymirror/index.d.ts rename to types/keymirror/index.d.ts diff --git a/keymirror/keymirror-tests.ts b/types/keymirror/keymirror-tests.ts similarity index 100% rename from keymirror/keymirror-tests.ts rename to types/keymirror/keymirror-tests.ts diff --git a/keymirror/tsconfig.json b/types/keymirror/tsconfig.json similarity index 100% rename from keymirror/tsconfig.json rename to types/keymirror/tsconfig.json diff --git a/keypress/index.d.ts b/types/keypress/index.d.ts similarity index 100% rename from keypress/index.d.ts rename to types/keypress/index.d.ts diff --git a/keypress/keypress-tests.ts b/types/keypress/keypress-tests.ts similarity index 100% rename from keypress/keypress-tests.ts rename to types/keypress/keypress-tests.ts diff --git a/keypress/tsconfig.json b/types/keypress/tsconfig.json similarity index 100% rename from keypress/tsconfig.json rename to types/keypress/tsconfig.json diff --git a/keytar/index.d.ts b/types/keytar/index.d.ts similarity index 100% rename from keytar/index.d.ts rename to types/keytar/index.d.ts diff --git a/keytar/keytar-tests.ts b/types/keytar/keytar-tests.ts similarity index 100% rename from keytar/keytar-tests.ts rename to types/keytar/keytar-tests.ts diff --git a/keytar/tsconfig.json b/types/keytar/tsconfig.json similarity index 100% rename from keytar/tsconfig.json rename to types/keytar/tsconfig.json diff --git a/kii-cloud-sdk/index.d.ts b/types/kii-cloud-sdk/index.d.ts similarity index 88% rename from kii-cloud-sdk/index.d.ts rename to types/kii-cloud-sdk/index.d.ts index 26decd07a0..0879b355bd 100644 --- a/kii-cloud-sdk/index.d.ts +++ b/types/kii-cloud-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kii Cloud SDK v2.4.6 +// Type definitions for Kii Cloud SDK v2.4.9 // Project: http://en.kii.com/ // Definitions by: Kii Consortium // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,9 +10,12 @@ declare namespace KiiCloud { KiiACLBucketActionDropBucket, KiiACLObjectActionRead, KiiACLObjectActionWrite, + KiiACLBucketActionReadObjects, + KiiACLSubscribeToTopic, + KiiACLSendMessageToTopic, } - export enum KiiSite { + enum KiiSite { US, JP, CN, @@ -21,7 +24,7 @@ declare namespace KiiCloud { EU } - export enum KiiAnalyticsSite { + enum KiiAnalyticsSite { US, JP, CN, @@ -44,7 +47,7 @@ declare namespace KiiCloud { } | { oauth_token: string, oauth_token_secret: string - } + }; interface KiiSocialAccountInfo { createdAt: number; @@ -195,10 +198,16 @@ declare namespace KiiCloud { portWSS: number; } + interface KiiError { + status: number; + code: string; + message: string; + } + /** * The main SDK class */ - export class Kii { + class Kii { /** * Kii SDK Build Number * @@ -245,7 +254,9 @@ declare namespace KiiCloud { * @example * Kii.setAccessTokenExpiration(3600); */ - static setAccessTokenExpiration(expiresIn: number): void; + static setAccessTokenExpiration( + expiresIn: number + ): void; /** * Returns access token lifetime in seconds. @@ -266,7 +277,9 @@ declare namespace KiiCloud { * @param appID The application ID found in your Kii developer console * @param appKey The application key found in your Kii developer console * @param site Can be one of the constants KiiSite.US, KiiSite.JP, KiiSite.CN or KiiSite.SG depending on your location. - * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or with analyticsOption.deviceId.
    If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly. + * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or + * with analyticsOption.deviceId.
    If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link + * KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly. * * @example * // Disable KiiAnalytics @@ -279,7 +292,12 @@ declare namespace KiiCloud { * // Enable KiiAnalytics without deviceId * Kii.initializeWithSite("my-app-id", "my-app-key", KiiSite.JP, {}); */ - static initializeWithSite(appID: string, appKey: string, site: KiiSite, analyticsOption?: any): void; + static initializeWithSite( + appID: string, + appKey: string, + site: KiiSite, + analyticsOption?: any + ): void; /** * Initialize the Kii SDK @@ -289,7 +307,9 @@ declare namespace KiiCloud { * * @param appID The application ID found in your Kii developer console * @param appKey The application key found in your Kii developer console - * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or with analyticsOption.deviceId.
    If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly. + * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or + * with analyticsOption.deviceId.
    If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link + * KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly. * * @example * // Disable KiiAnalytics @@ -302,7 +322,11 @@ declare namespace KiiCloud { * // Enable KiiAnalytics without deviceId * Kii.initialize("my-app-id", "my-app-key", {}); */ - static initialize(appID: string, appKey: string, analyticsOption?: any): void; + static initialize( + appID: string, + appKey: string, + analyticsOption?: any + ): void; /** * Creates a reference to a bucket for this app @@ -316,7 +340,9 @@ declare namespace KiiCloud { * @example * var bucket = Kii.bucketWithName("myBucket"); */ - static bucketWithName(bucketName: string): KiiBucket; + static bucketWithName( + bucketName: string + ): KiiBucket; /** * Creates a reference to a encrypted bucket for this app @@ -330,7 +356,9 @@ declare namespace KiiCloud { * @example * var bucket = Kii.encryptedBucketWithName("myBucket"); */ - static encryptedBucketWithName(bucketName: string): KiiBucket; + static encryptedBucketWithName( + bucketName: string + ): KiiBucket; /** * Creates a reference to a group with the given name @@ -342,7 +370,9 @@ declare namespace KiiCloud { * @example * var group = new Kii.groupWithName("myGroup"); */ - static groupWithName(groupName: string): KiiGroup; + static groupWithName( + groupName: string + ): KiiGroup; /** * Creates a reference to a group with the given name and a list of default members @@ -355,7 +385,10 @@ declare namespace KiiCloud { * @example * var group = new KiiGroup.groupWithName("myGroup", members); */ - static groupWithNameAndMembers(groupName: string, members: KiiUser[]): KiiGroup; + static groupWithNameAndMembers( + groupName: string, + members: KiiUser[] + ): KiiGroup; /** * Authenticate as app admin. @@ -405,7 +438,11 @@ declare namespace KiiCloud { * } * ); */ - static authenticateAsAppAdmin(clientId: string, clientSecret: string, callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(error: string, statusCode: number): any; }): Promise; + static authenticateAsAppAdmin( + clientId: string, + clientSecret: string, + callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(error: string, statusCode: number): any; } + ): Promise; /** * Instantiate KiiServerCodeEntry with specified entry name. @@ -422,7 +459,9 @@ declare namespace KiiCloud { * @example * var entry = Kii.serverCodeEntry("main"); */ - static serverCodeEntry(entryName: string): KiiServerCodeEntry; + static serverCodeEntry( + entryName: string + ): KiiServerCodeEntry; /** * Instantiate serverCodeEntryWithVersion with specified entry name and version. @@ -440,7 +479,10 @@ declare namespace KiiCloud { * @example * var entry = Kii.serverCodeEntryWithVersion("main", "gulsdf6ful8jvf8uq6fe7vjy6"); */ - static serverCodeEntryWithVersion(entryName: string, version: string): KiiServerCodeEntry; + static serverCodeEntryWithVersion( + entryName: string, + version: string + ): KiiServerCodeEntry; /** * Instantiate topic belongs to application. @@ -449,13 +491,16 @@ declare namespace KiiCloud { * * @return topic instance. */ - static topicWithName(topicName: string): KiiTopic; + static topicWithName( + topicName: string + ): KiiTopic; /** * Gets a list of topics in app scope * * @param callbacks An object with callback methods defined - * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success or fullfill callback of promise. If empty string or no string object is provided, this API regards no paginationKey specified. + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success or fullfill callback of promise. If empty string or no string object is + * provided, this API regards no paginationKey specified. * * @return return promise object. *
      @@ -513,7 +558,10 @@ declare namespace KiiCloud { * } * ); */ - static listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + static listTopics( + callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, + paginationKey?: string + ): Promise<[KiiTopic[], string]>; /** * Authenticate as Thing. @@ -562,7 +610,11 @@ declare namespace KiiCloud { * } * ); */ - static authenticateAsThing(vendorThingID: string, password: string, callbacks?: { success(thingAuthContext: KiiThingContext): any; failure(error: Error): any; }): Promise; + static authenticateAsThing( + vendorThingID: string, + password: string, + callbacks?: { success(thingAuthContext: KiiThingContext): any; failure(error: Error): any; } + ): Promise; /** * Create a KiiThingContext reference @@ -611,13 +663,17 @@ declare namespace KiiCloud { * } * ); */ - static authenticateAsThingWithToken(thingID: string, token: string, callbacks?: { success(thingContext: KiiThingContext): any; failure(error: Error): any; }): Promise; + static authenticateAsThingWithToken( + thingID: string, + token: string, + callbacks?: { success(thingContext: KiiThingContext): any; failure(error: Error): any; } + ): Promise; } /** * Represents a KiiACL object */ - export class KiiACL { + class KiiACL { /** * Get the list of active ACLs associated with this object from the server * @@ -666,10 +722,13 @@ declare namespace KiiCloud { * // do something with the error response * }); */ - listACLEntries(callbacks?: { success(theACL: KiiACL, theEntries: KiiACLEntry[]): any; failure(theACL: KiiACL, anErrorString: string): any; }): Promise<[KiiACL, KiiACLEntry[]]>; + listACLEntries( + callbacks?: { success(theACL: KiiACL, theEntries: KiiACLEntry[]): any; failure(theACL: KiiACL, anErrorString: string): any; } + ): Promise<[KiiACL, KiiACLEntry[]]>; /** - * Add a KiiACLEntry to the local object, if not already present. This does not explicitly grant any permissions, which should be done through the KiiACLEntry itself. This method simply adds the entry to the local ACL object so it can be saved to the server. + * Add a KiiACLEntry to the local object, if not already present. This does not explicitly grant any permissions, which should be done through the KiiACLEntry itself. This method simply adds + * the entry to the local ACL object so it can be saved to the server. * * @param entry The KiiACLEntry to add * @@ -680,10 +739,13 @@ declare namespace KiiCloud { * var acl = . . .; // a KiiACL object * acl.putACLEntry(aclEntry); */ - putACLEntry(entry: KiiACLEntry): void; + putACLEntry( + entry: KiiACLEntry + ): void; /** - * Remove a KiiACLEntry to the local object. This does not explicitly revoke any permissions, which should be done through the KiiACLEntry itself. This method simply removes the entry from the local ACL object and will not be saved to the server. + * Remove a KiiACLEntry to the local object. This does not explicitly revoke any permissions, which should be done through the KiiACLEntry itself. This method simply removes the entry from the + * local ACL object and will not be saved to the server. * * @param entry The KiiACLEntry to remove * @@ -694,7 +756,9 @@ declare namespace KiiCloud { * var acl = . . .; // a KiiACL object * acl.removeACLEntry(aclEntry); */ - removeACLEntry(entry: KiiACLEntry): void; + removeACLEntry( + entry: KiiACLEntry + ): void; /** * Save the list of ACLEntry objects associated with this ACL object to the server @@ -737,13 +801,15 @@ declare namespace KiiCloud { * // do something with the error response * }); */ - save(callbacks?: { success(theSavedACL: KiiACL): any; failure(theACL: KiiACL, anErrorString: string): any; }): Promise; + save( + callbacks?: { success(theSavedACL: KiiACL): any; failure(theACL: KiiACL, anErrorString: string): any; } + ): Promise; } /** * Represents a KiiACLEntry object */ - export class KiiACLEntry { + class KiiACLEntry { /** * The action that is being permitted/restricted. Possible values: *

      @@ -760,7 +826,9 @@ declare namespace KiiCloud { * * @throws If the value is not one of the permitted values */ - setAction(value: KiiACLAction): void; + setAction( + value: KiiACLAction + ): void; /** * Get the action that is being permitted/restricted in this entry @@ -776,7 +844,9 @@ declare namespace KiiCloud { * * @throws If the value is not one of the permitted values */ - setSubject(subject: KiiACLSubject): void; + setSubject( + subject: KiiACLSubject + ): void; /** * Get the subject that is being permitted/restricted in this entry @@ -792,7 +862,9 @@ declare namespace KiiCloud { * * @throws If the value is not a boolean type */ - setGrant(value: boolean): void; + setGrant( + value: boolean + ): void; /** * Get whether or not the action is being permitted to the subject @@ -817,13 +889,16 @@ declare namespace KiiCloud { * @throws If specified subject is invalid. * @throws If the specified action is invalid. */ - static entryWithSubject(Subject: KiiACLSubject, action: KiiACLAction): KiiACLEntry; + static entryWithSubject( + Subject: KiiACLSubject, + action: KiiACLAction + ): KiiACLEntry; } /** * The main SDK class */ - export class KiiAnalytics { + class KiiAnalytics { /** * Retrieve the current app ID * @@ -839,7 +914,8 @@ declare namespace KiiCloud { static getAppKey(): string; /** - * Get the deviceId. If deviceId has not specified while initialization, it returns SDK generated deviceId.It is recommended to retrieve the deviceId and store it to identify the device properly. + * Get the deviceId. If deviceId has not specified while initialization, it returns SDK generated deviceId.It is recommended to retrieve the deviceId and store it to identify the device + * properly. * * @return deviceId. */ @@ -862,7 +938,9 @@ declare namespace KiiCloud { * @example * KiiAnalytics.setLogging(true); */ - static setLogging(True: boolean): void; + static setLogging( + True: boolean + ): void; /** * @@ -874,7 +952,8 @@ declare namespace KiiCloud { * @param appID The application ID found in your Kii developer console * @param appKey The application key found in your Kii developer console * @param site Can be one of the constants KiiAnalyticsSite.US, KiiAnalyticsSite.JP, KiiAnalyticsSite.CN, KiiAnalyticsSite.CN3 or KiiAnalyticsSite.SG depending on your location. - * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events.deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to retrieve the deviceId and store it to identify the device properly. + * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events.deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to + * retrieve the deviceId and store it to identify the device properly. * * @example * // initialize without deviceId @@ -882,7 +961,12 @@ declare namespace KiiCloud { * // initialize with deviceId * Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id"); */ - static initializeWithSite(appID: string, appKey: string, site: KiiAnalyticsSite, deviceid: string): void; + static initializeWithSite( + appID: string, + appKey: string, + site: KiiAnalyticsSite, + deviceid: string + ): void; /** * @@ -893,7 +977,8 @@ declare namespace KiiCloud { * * @param appID The application ID found in your Kii developer console * @param appKey The application key found in your Kii developer console - * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events. deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to retrieve the deviceId and store it to identify the device properly. + * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events. deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to + * retrieve the deviceId and store it to identify the device properly. * * @example * // initialize without deviceId @@ -901,7 +986,11 @@ declare namespace KiiCloud { * // initialize with deviceId * Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id"); */ - static initialize(appID: string, appKey: string, deviceid: string): void; + static initialize( + appID: string, + appKey: string, + deviceid: string + ): void; /** * Utilize the KiiAnalytics logger to track SDK-specific actions @@ -913,7 +1002,9 @@ declare namespace KiiCloud { * @example * KiiAnalytics.logger("My message"); */ - static logger(message: string): void; + static logger( + message: string + ): void; /** * Log a single event to be uploaded to KiiAnalytics @@ -932,7 +1023,9 @@ declare namespace KiiCloud { * *
    */ - static trackEvent(eventName: string): Promise; + static trackEvent( + eventName: string + ): Promise; /** * Log a single event to be uploaded to KiiAnalytics @@ -955,7 +1048,10 @@ declare namespace KiiCloud { * * */ - static trackEventWithExtras(eventName: string, extras: any): Promise; + static trackEventWithExtras( + eventName: string, + extras: any + ): Promise; /** * Log a single event to be uploaded to KiiAnalytics @@ -979,7 +1075,11 @@ declare namespace KiiCloud { * * */ - static trackEventWithExtrasAndCallbacks(eventName: string, extras: any, callbacks?: { success(): any; failure(error: Error): any; }): Promise; + static trackEventWithExtrasAndCallbacks( + eventName: string, + extras: any, + callbacks?: { success(): any; failure(error: Error): any; } + ): Promise; /** * @@ -988,7 +1088,9 @@ declare namespace KiiCloud { * * @param url A string containing the desired endpoint */ - static setBaseURL(url: string): void; + static setBaseURL( + url: string + ): void; /** * @@ -1005,7 +1107,7 @@ declare namespace KiiCloud { * * When retrieving ACL from an object, test for this class to determine the subject type. */ - export class KiiAnonymousUser { + class KiiAnonymousUser { /** * Returns the ID of Anonymous user. */ @@ -1017,7 +1119,7 @@ declare namespace KiiCloud { * * When retrieving ACL from an object, test for this class to determine the subject type. Example: */ - export class KiiAnyAuthenticatedUser { + class KiiAnyAuthenticatedUser { /** * Returns the ID of AuthenticatedUser user. */ @@ -1034,7 +1136,7 @@ declare namespace KiiCloud { * * Application administrator context. Entities obtained from this class will be manipulated by application admin. */ - export class KiiAppAdminContext { + class KiiAppAdminContext { /** * Creates a reference to a bucket operated by app admin. *

    The bucket will be created/accessed within this app's scope @@ -1054,7 +1156,9 @@ declare namespace KiiCloud { * } * }); */ - bucketWithName(bucketName: string): KiiBucket; + bucketWithName( + bucketName: string + ): KiiBucket; /** * Creates a reference to a encrypted bucket operated by app admin. @@ -1075,7 +1179,9 @@ declare namespace KiiCloud { * } * }); */ - encryptedBucketWithName(bucketName: string): KiiBucket; + encryptedBucketWithName( + bucketName: string + ): KiiBucket; /** * Creates a reference to a group operated by app admin. @@ -1099,7 +1205,9 @@ declare namespace KiiCloud { * } * }); */ - groupWithName(group: string): KiiGroup; + groupWithName( + group: string + ): KiiGroup; /** * Creates a reference to a user operated by app admin. @@ -1119,7 +1227,9 @@ declare namespace KiiCloud { * } * }); */ - userWithID(user: string): KiiUser; + userWithID( + user: string + ): KiiUser; /** * Creates a reference to an object operated by app admin using object`s URI. @@ -1130,7 +1240,9 @@ declare namespace KiiCloud { * * @throws If the URI is null, empty or does not have correct format. */ - objectWithURI(object: string): KiiObject; + objectWithURI( + object: string + ): KiiObject; /** * Creates a reference to a group operated by app admin using group's ID. @@ -1157,7 +1269,9 @@ declare namespace KiiCloud { * } * }); */ - groupWithID(group: string): KiiGroup; + groupWithID( + group: string + ): KiiGroup; /** * Register new group own by specified user on Kii Cloud with specified ID. @@ -1216,7 +1330,13 @@ declare namespace KiiCloud { * } * ); */ - registerGroupWithOwnerAndID(groupID: string, groupName: string, user: string, members: KiiUser[], callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise; + registerGroupWithOwnerAndID( + groupID: string, + groupName: string, + user: string, + members: KiiUser[], + callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; } + ): Promise; /** * Creates a reference to a group operated by app admin using group's URI. @@ -1243,7 +1363,9 @@ declare namespace KiiCloud { * } * }); */ - groupWithURI(group: string): KiiGroup; + groupWithURI( + group: string + ): KiiGroup; /** * Find registered KiiUser with the email.
    @@ -1317,7 +1439,10 @@ declare namespace KiiCloud { * } * ); */ - findUserByEmail(email: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>; + findUserByEmail( + email: string, + callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; } + ): Promise<[KiiAppAdminContext, KiiUser]>; /** * Find registered KiiUser with the phone.
    @@ -1391,7 +1516,10 @@ declare namespace KiiCloud { * } * ); */ - findUserByPhone(phone: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>; + findUserByPhone( + phone: string, + callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; } + ): Promise<[KiiAppAdminContext, KiiUser]>; /** * Find registered KiiUser with the user name.
    @@ -1463,7 +1591,10 @@ declare namespace KiiCloud { * } * ); */ - findUserByUsername(username: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>; + findUserByUsername( + username: string, + callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; } + ): Promise<[KiiAppAdminContext, KiiUser]>; /** * Register thing by app admin. @@ -1533,7 +1664,10 @@ declare namespace KiiCloud { * } * ); */ - registerThing(fields: KiiThingFields, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + registerThing( + fields: KiiThingFields, + callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; } + ): Promise; /** * Creates a reference to a thing operated by app admin. @@ -1546,7 +1680,9 @@ declare namespace KiiCloud { * // Assume you already have adminContext instance. * adminContext.thingWithID(thingID); */ - thingWithID(thing: string): KiiThing; + thingWithID( + thing: string + ): KiiThing; /** * Register user/group as owner of specified thing by app admin. @@ -1599,7 +1735,11 @@ declare namespace KiiCloud { * } * ); */ - registerOwnerWithThingID(thingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise; + registerOwnerWithThingID( + thingID: string, + owner: T, + callbacks?: { success(group: T): any; failure(error: Error): any; } + ): Promise; /** * Register user/group as owner of specified thing by app admin. @@ -1651,7 +1791,11 @@ declare namespace KiiCloud { * } * ); */ - registerOwnerWithVendorThingID(vendorThingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise; + registerOwnerWithVendorThingID( + vendorThingID: string, + owner: T, + callbacks?: { success(group: T): any; failure(error: Error): any; } + ): Promise; /** * Load thing with vendor thing ID by app admin. @@ -1698,7 +1842,10 @@ declare namespace KiiCloud { * } * ); */ - loadThingWithVendorThingID(vendorThingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + loadThingWithVendorThingID( + vendorThingID: string, + callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; } + ): Promise; /** * Load thing with thing ID by app admin. @@ -1745,7 +1892,10 @@ declare namespace KiiCloud { * } * ); */ - loadThingWithThingID(thingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + loadThingWithThingID( + thingID: string, + callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; } + ): Promise; /** * Creates a reference to a topic operated by app admin @@ -1754,13 +1904,16 @@ declare namespace KiiCloud { * * @return topic instance. */ - topicWithName(topicName: string): KiiTopic; + topicWithName( + topicName: string + ): KiiTopic; /** * Gets a list of topics in app scope * * @param callbacks An object with callback methods defined - * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified. + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no + * paginationKey specified. * * @return return promise object. *