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/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/angular-material/index.d.ts b/angular-material/index.d.ts index 0e27fe3b60..a8196269a4 100644 --- a/angular-material/index.d.ts +++ b/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-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts index bc80d96b5a..1e4d15d282 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/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/async/index.d.ts b/async/index.d.ts index e3fbe7e512..62e047b209 100644 --- a/async/index.d.ts +++ b/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; @@ -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/async/test/explicit.ts b/async/test/explicit.ts index 80343cf6b1..b9ea9c84ed 100644 --- a/async/test/explicit.ts +++ b/async/test/explicit.ts @@ -1,44 +1,74 @@ -interface StringCallback { (err: Error, result: string): void; } +interface StringCallback { (err?: Error, result?: string): void; } interface AsyncStringGetter { (callback: StringCallback): void; } var taskArray: AsyncStringGetter[] = [ function (callback) { setTimeout(function () { - callback(null, 'one'); + callback(undefined, 'one'); }, 200); }, function (callback) { setTimeout(function () { - callback(null, 'two'); + callback(undefined, '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/)) }); +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 NumberCallback { (err?: Error, result?: number): void; } interface AsyncNumberGetter { (callback: NumberCallback): void; } var taskDict: Lookup = { one: function(callback){ setTimeout(function(){ - callback(null, 1); + callback(undefined, 1); }, 200); }, two: function(callback){ setTimeout(function(){ - callback(null, 2); + callback(undefined, 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)) }); +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/async/test/index.ts index 8c6be303e4..b30ca4c7ba 100644 --- a/async/test/index.ts +++ b/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/async/tsconfig.json b/async/tsconfig.json index 851293fccf..5b8f42c6d2 100644 --- a/async/tsconfig.json +++ b/async/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +20,4 @@ "test/index.ts", "test/explicit.ts" ] -} \ No newline at end of file +} diff --git a/atom/index.d.ts b/atom/index.d.ts index 7c984bd812..05c9794eec 100644 --- a/atom/index.d.ts +++ b/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/atom/tsconfig.json index 3bb8fe9761..6c1bb13aef 100644 --- a/atom/tsconfig.json +++ b/atom/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/autobahn/autobahn-tests.ts b/autobahn/autobahn-tests.ts index 141a43547e..d753e960fe 100644 --- a/autobahn/autobahn-tests.ts +++ b/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/autobahn/index.d.ts index e93d3c065f..8a37bdf21b 100644 --- a/autobahn/index.d.ts +++ b/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/aws-serverless-express/aws-serverless-express-tests.ts b/aws-serverless-express/aws-serverless-express-tests.ts index c46056ed25..97d236e043 100644 --- a/aws-serverless-express/aws-serverless-express-tests.ts +++ b/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/aws-serverless-express/index.d.ts index e4601e6ccd..db49e6ca6b 100644 --- a/aws-serverless-express/index.d.ts +++ b/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/aws-serverless-express/middleware.d.ts b/aws-serverless-express/middleware.d.ts new file mode 100644 index 0000000000..ff33b4c6ea --- /dev/null +++ b/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/aws-serverless-express/tsconfig.json index a62cead1a1..62885fcda3 100644 --- a/aws-serverless-express/tsconfig.json +++ b/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/service_worker_api/tslint.json b/aws-serverless-express/tslint.json similarity index 100% rename from service_worker_api/tslint.json rename to aws-serverless-express/tslint.json diff --git a/axel/axel-tests.ts b/axel/axel-tests.ts new file mode 100644 index 0000000000..553973b210 --- /dev/null +++ b/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/axel/index.d.ts b/axel/index.d.ts new file mode 100644 index 0000000000..751e2c33fa --- /dev/null +++ b/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/axel/tsconfig.json b/axel/tsconfig.json new file mode 100644 index 0000000000..0ac3689676 --- /dev/null +++ b/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/bluebird-global/index.d.ts b/bluebird-global/index.d.ts index e4c4920501..a705222e9d 100644 --- a/bluebird-global/index.d.ts +++ b/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/bluebird-tests.ts b/bluebird/bluebird-tests.ts index c08a7bdc6b..b9fc8d0cef 100644 --- a/bluebird/bluebird-tests.ts +++ b/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/bluebird/index.d.ts index ecacedfd0d..3508a4e742 100644 --- a/bluebird/index.d.ts +++ b/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. */ diff --git a/bookshelf/index.d.ts b/bookshelf/index.d.ts index 4aa6fd38b5..c7947579c8 100644 --- a/bookshelf/index.d.ts +++ b/bookshelf/index.d.ts @@ -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/bootbox/bootbox-tests.ts b/bootbox/bootbox-tests.ts index b5f32931ae..f5604d5312 100644 --- a/bootbox/bootbox-tests.ts +++ b/bootbox/bootbox-tests.ts @@ -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/bootbox/index.d.ts index d5ceb5ef62..28d30e2ba0 100644 --- a/bootbox/index.d.ts +++ b/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 /// @@ -44,6 +44,7 @@ interface BootboxPromptOptions extends BootboxBaseOptions { 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/business-rules-engine/Validation.d.ts b/business-rules-engine/Validation.d.ts index 0dd8283dc2..7f61f517be 100644 --- a/business-rules-engine/Validation.d.ts +++ b/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/index.d.ts b/business-rules-engine/index.d.ts index 4f71b43dfb..a74bcf180d 100644 --- a/business-rules-engine/index.d.ts +++ b/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/business-rules-engine/node-validators.d.ts index 73746eef92..fa2b9cb39e 100644 --- a/business-rules-engine/node-validators.d.ts +++ b/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/tsconfig.json b/business-rules-engine/tsconfig.json index 008e622d1f..a80b05099b 100644 --- a/business-rules-engine/tsconfig.json +++ b/business-rules-engine/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/c3/c3-tests.ts b/c3/c3-tests.ts index 4a0695af1f..d9057eabb6 100644 --- a/c3/c3-tests.ts +++ b/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/c3/index.d.ts index 5edb096395..748b19bfc5 100644 --- a/c3/index.d.ts +++ b/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/chart.js/index.d.ts b/chart.js/index.d.ts index 7595c7660b..43192689c1 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -3,9 +3,14 @@ // 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: () => {}; diff --git a/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/compression-webpack-plugin/compression-webpack-plugin-tests.ts new file mode 100644 index 0000000000..3939bf5847 --- /dev/null +++ b/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/compression-webpack-plugin/index.d.ts b/compression-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..536a77b8e9 --- /dev/null +++ b/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 { + export 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/compression-webpack-plugin/tsconfig.json b/compression-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..70383d3658 --- /dev/null +++ b/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/compression-webpack-plugin/tslint.json b/compression-webpack-plugin/tslint.json new file mode 100644 index 0000000000..70cee1ba88 --- /dev/null +++ b/compression-webpack-plugin/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "../tslint.json" +} + \ No newline at end of file diff --git a/cordova-plugin-app-version/index.d.ts b/cordova-plugin-app-version/index.d.ts index e295724474..b30beef9c6 100644 --- a/cordova-plugin-app-version/index.d.ts +++ b/cordova-plugin-app-version/index.d.ts @@ -3,14 +3,11 @@ // 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; + getAppName: () => Promise; + getPackageName: () => Promise; + getVersionCode: () => Promise; + getVersionNumber: () => Promise; }; } diff --git a/cordova-plugin-ibeacon/index.d.ts b/cordova-plugin-ibeacon/index.d.ts index bfbfe607d4..3530ccb70d 100644 --- a/cordova-plugin-ibeacon/index.d.ts +++ b/cordova-plugin-ibeacon/index.d.ts @@ -3,95 +3,97 @@ // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import * as Q from "q"; -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; +declare global { + interface CordovaPlugins { + locationManager: BeaconPlugin.LocationManager; } - export interface PluginResult { - eventType: string; - region: Region; - beacons: Beacon[]; - authorizationStatus: string; - state: string; - error: string; - } + 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 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 PluginResult { + eventType: string; + region: Region; + beacons: Beacon[]; + authorizationStatus: string; + state: string; + error: string; + } - export interface Region { - identifier: string; - new (identifier: string): Region; - } + 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 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 Region { + identifier: string; + new (identifier: string): Region; + } - export interface CircularRegion extends Region { - latitude: number; - longitude: number; - radius: number; - new (identifier: string, latitude: number, longitude: number, radius: number): CircularRegion; - } + 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 Beacon { - uuid: string; - major: string; - minor: string; - proximity: string; - tx: number; - rssi: number; - accuracy: number; + 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/cordova-plugin-ibeacon/tsconfig.json index 603b991c64..af70edc7f5 100644 --- a/cordova-plugin-ibeacon/tsconfig.json +++ b/cordova-plugin-ibeacon/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/csprng/csprng-tests.ts b/csprng/csprng-tests.ts new file mode 100644 index 0000000000..aafddc4021 --- /dev/null +++ b/csprng/csprng-tests.ts @@ -0,0 +1,5 @@ +import csprng = require("csprng"); + +let rngStr: string; + +rngStr = csprng(32, 16); diff --git a/csprng/index.d.ts b/csprng/index.d.ts new file mode 100644 index 0000000000..90aa83b017 --- /dev/null +++ b/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/numbro/tsconfig.json b/csprng/tsconfig.json similarity index 86% rename from numbro/tsconfig.json rename to csprng/tsconfig.json index 4a55ffe0ab..0877c1ab25 100644 --- a/numbro/tsconfig.json +++ b/csprng/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "numbro-tests.ts" + "csprng-tests.ts" ] -} \ No newline at end of file +} diff --git a/csprng/tslint.json b/csprng/tslint.json new file mode 100644 index 0000000000..ec365f164b --- /dev/null +++ b/csprng/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} diff --git a/css-modules-require-hook/css-modules-require-hook-tests.ts b/css-modules-require-hook/css-modules-require-hook-tests.ts index ea80474dc5..93da1326bd 100644 --- a/css-modules-require-hook/css-modules-require-hook-tests.ts +++ b/css-modules-require-hook/css-modules-require-hook-tests.ts @@ -62,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/dir-resolve/dir-resolve-tests.ts b/dir-resolve/dir-resolve-tests.ts new file mode 100644 index 0000000000..d84f9d0efc --- /dev/null +++ b/dir-resolve/dir-resolve-tests.ts @@ -0,0 +1,3 @@ +import resolve = require("dir-resolve"); + +resolve("module/package"); diff --git a/dir-resolve/index.d.ts b/dir-resolve/index.d.ts new file mode 100644 index 0000000000..0b8f425b0b --- /dev/null +++ b/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/node-form/tsconfig.json b/dir-resolve/tsconfig.json similarity index 85% rename from node-form/tsconfig.json rename to dir-resolve/tsconfig.json index 1bb627df73..1748792b1d 100644 --- a/node-form/tsconfig.json +++ b/dir-resolve/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "node-form-tests.ts" + "dir-resolve-tests.ts" ] } \ No newline at end of file diff --git a/xmpp-jid/tslint.json b/dir-resolve/tslint.json similarity index 100% rename from xmpp-jid/tslint.json rename to dir-resolve/tslint.json diff --git a/easy-api-request/index.d.ts b/easy-api-request/index.d.ts index 8f4ca0d553..f04b68be3a 100644 --- a/easy-api-request/index.d.ts +++ b/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/easy-api-request/tsconfig.json b/easy-api-request/tsconfig.json index 663d9a15d0..0f8b3873e0 100644 --- a/easy-api-request/tsconfig.json +++ b/easy-api-request/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/electron/index.d.ts b/electron/index.d.ts index 0b98ae1944..11103b3a18 100644 --- a/electron/index.d.ts +++ b/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/main.ts b/electron/test/main.ts index 276a15d851..35a85a81dc 100644 --- a/electron/test/main.ts +++ b/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/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 82a8dc9822..c7323766f7 100644 --- a/enzyme/enzyme-tests.tsx +++ b/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/enzyme/index.d.ts index fc498ca78a..abb57e36ef 100644 --- a/enzyme/index.d.ts +++ b/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/event-stream/tsconfig.json b/event-stream/tsconfig.json index 208ff51fe0..768497bcd8 100644 --- a/event-stream/tsconfig.json +++ b/event-stream/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/faker/faker-tests.ts b/faker/faker-tests.ts index 4dc2a3735f..5fb6a53746 100644 --- a/faker/faker-tests.ts +++ b/faker/faker-tests.ts @@ -52,6 +52,11 @@ 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'); @@ -80,6 +85,8 @@ 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(); @@ -110,6 +117,8 @@ 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(); @@ -128,12 +137,18 @@ 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); @@ -169,6 +184,13 @@ 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" ); diff --git a/faker/index.d.ts b/faker/index.d.ts index 01e01b8b8b..ccca40e51a 100644 --- a/faker/index.d.ts +++ b/faker/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for faker v3.1 +// Type definitions for faker v4.1.0 // Project: http://marak.com/faker.js/ -// Definitions by: Bas Pennings , Yuki Kokubun +// Definitions by: Ben Swartz , Bas Pennings , Yuki Kokubun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var fakerStatic: Faker.FakerStatic; @@ -52,6 +52,13 @@ declare namespace Faker { 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; @@ -72,6 +79,8 @@ declare namespace Faker { currencyCode(): string; currencyName(): string; currencySymbol(): string; + bitcoinAddress(): string; + bic(): string }; hacker: { @@ -116,11 +125,13 @@ declare namespace Faker { 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; @@ -128,6 +139,7 @@ declare namespace Faker { domainSuffix(): string; domainWord(): string; ip(): string; + ipv6(): string; userAgent(): string; color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; mac(): string; @@ -138,9 +150,12 @@ declare namespace Faker { 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: { @@ -171,6 +186,11 @@ declare namespace Faker { 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: { @@ -275,6 +295,14 @@ 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; } @@ -351,6 +379,10 @@ declare module "faker/locale/ge" { export = fakerStatic; } +declare module "faker/locale/id_ID" { + export = fakerStatic; +} + declare module "faker/locale/it" { export = fakerStatic; } diff --git a/faker/tsconfig.json b/faker/tsconfig.json index c2ce14c941..0589e5dc54 100644 --- a/faker/tsconfig.json +++ b/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/v3/faker-tests.ts b/faker/v3/faker-tests.ts new file mode 100644 index 0000000000..4dc2a3735f --- /dev/null +++ b/faker/v3/faker-tests.ts @@ -0,0 +1,183 @@ + + +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(); + +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.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.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.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.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.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/faker/v3/index.d.ts b/faker/v3/index.d.ts new file mode 100644 index 0000000000..01e01b8b8b --- /dev/null +++ b/faker/v3/index.d.ts @@ -0,0 +1,416 @@ +// Type definitions for faker v3.1 +// Project: http://marak.com/faker.js/ +// Definitions by: 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; + }; + + 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; + }; + + 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; + }; + + internet: { + avatar(): string; + email(firstName?: string, lastName?: string, provider?: string): string; + userName(firstName?: string, lastName?: string): string; + protocol(): string; + url(): string; + domainName(): string; + domainSuffix(): string; + domainWord(): string; + ip(): 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; + sentences(sentenceCount?: number): string; + paragraph(sentenceCount?: number): string; + paragraphs(paragraphCount?: number, separator?: string): 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; + }; + + 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/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/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/v3/tsconfig.json b/faker/v3/tsconfig.json new file mode 100644 index 0000000000..052493a9c7 --- /dev/null +++ b/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/firebase-client/firebase-client-tests.ts b/firebase-client/firebase-client-tests.ts index 0b79ec75d6..987b4b638b 100644 --- a/firebase-client/firebase-client-tests.ts +++ b/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/firebase-client/index.d.ts index d2c58bb5ba..b766fc2478 100644 --- a/firebase-client/index.d.ts +++ b/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/firebase-client/tsconfig.json b/firebase-client/tsconfig.json index fdb35ab929..b439fb8310 100644 --- a/firebase-client/tsconfig.json +++ b/firebase-client/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts index 621ca6f056..1d389d59e9 100644 --- a/gapi.auth2/gapi.auth2-tests.ts +++ b/gapi.auth2/gapi.auth2-tests.ts @@ -1,6 +1,6 @@ +/// - -function test_init(){ +function test_init() { var auth = gapi.auth2.init({ client_id: 'my-id', cookie_policy: 'single_host_origin', @@ -9,7 +9,7 @@ function test_init(){ }); } -function test_getAuthInstance(){ +function test_getAuthInstance() { gapi.auth2.init({ client_id: 'my-id', cookie_policy: 'single_host_origin', @@ -19,14 +19,14 @@ function test_getAuthInstance(){ var auth = gapi.auth2.getAuthInstance(); } -function test_signIn(){ +function test_signIn() { gapi.auth2.getAuthInstance().signIn({ scope: 'email profile', prompt: 'content' }); } -function test_signInOptionsBuild(){ +function test_signInOptionsBuild() { var options = new gapi.auth2.SigninOptionsBuilder(); options.setAppPackageName('com.example.app'); options.setFetchBasicProfile(true); @@ -35,13 +35,13 @@ function test_signInOptionsBuild(){ gapi.auth2.getAuthInstance().signIn(options); } -function test_getAuthResponse(){ +function test_getAuthResponse() { var user = gapi.auth2.getAuthInstance().currentUser.get(); var authResponse = user.getAuthResponse(); var authResponseWithAuth = user.getAuthResponse(true); } -function test_render(){ +function test_render() { var success = (googleUser: gapi.auth2.GoogleUser): void => { console.log(googleUser); }; @@ -59,3 +59,87 @@ function test_render(){ 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/gapi.auth2/index.d.ts index 6146a87e28..402da68699 100644 --- a/gapi.auth2/index.d.ts +++ b/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.calendar/gapi.calendar-tests.ts b/gapi.calendar/gapi.calendar-tests.ts new file mode 100644 index 0000000000..0438e5dc06 --- /dev/null +++ b/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/gapi.calendar/index.d.ts b/gapi.calendar/index.d.ts new file mode 100644 index 0000000000..bd0e3b0d17 --- /dev/null +++ b/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/gapi.calendar/tsconfig.json b/gapi.calendar/tsconfig.json new file mode 100644 index 0000000000..7613ee5b3d --- /dev/null +++ b/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.people/gapi.people-tests.ts b/gapi.people/gapi.people-tests.ts new file mode 100644 index 0000000000..65b6339765 --- /dev/null +++ b/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/gapi.people/index.d.ts b/gapi.people/index.d.ts new file mode 100644 index 0000000000..86bf930beb --- /dev/null +++ b/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/gapi.people/tsconfig.json b/gapi.people/tsconfig.json new file mode 100644 index 0000000000..93fcfc59b6 --- /dev/null +++ b/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/gapi.plus/gapi.plus-tests.ts b/gapi.plus/gapi.plus-tests.ts new file mode 100644 index 0000000000..12368dd63c --- /dev/null +++ b/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/gapi.plus/index.d.ts b/gapi.plus/index.d.ts new file mode 100644 index 0000000000..3e24b79ce1 --- /dev/null +++ b/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/gapi.plus/tsconfig.json b/gapi.plus/tsconfig.json new file mode 100644 index 0000000000..1fc2401de1 --- /dev/null +++ b/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/gapi-tests.ts b/gapi/gapi-tests.ts new file mode 100644 index 0000000000..3c70b9850d --- /dev/null +++ b/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/gapi/index.d.ts index 28d5c990bc..8f8e621fa3 100644 --- a/gapi/index.d.ts +++ b/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/gapi/tsconfig.json b/gapi/tsconfig.json index 27e01ecd7b..22f5738c1a 100644 --- a/gapi/tsconfig.json +++ b/gapi/tsconfig.json @@ -2,11 +2,12 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "gapi-tests.ts" ] -} \ No newline at end of file +} diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index e8d6d8dc2b..fee406b348 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -2276,7 +2276,7 @@ declare namespace google.maps { } export interface PlaceDetailsRequest { - placeId: string; + placeid: string; } export interface PlaceGeometry { diff --git a/gulp-angular-templatecache/tsconfig.json b/gulp-angular-templatecache/tsconfig.json index eda0469b48..869b08da9a 100644 --- a/gulp-angular-templatecache/tsconfig.json +++ b/gulp-angular-templatecache/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-autoprefixer/tsconfig.json b/gulp-autoprefixer/tsconfig.json index 955f890f2b..35ad131268 100644 --- a/gulp-autoprefixer/tsconfig.json +++ b/gulp-autoprefixer/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-batch/gulp-batch-tests.ts b/gulp-batch/gulp-batch-tests.ts index a1e305c03b..c5936eb031 100644 --- a/gulp-batch/gulp-batch-tests.ts +++ b/gulp-batch/gulp-batch-tests.ts @@ -1,7 +1,7 @@ import * as gulp from "gulp"; import * as batch from "gulp-batch"; -gulp.task('default', function() { +gulp.task('default', () => { gulp.watch([ 'lib/**', 'test/**' ], batch((events: any, cb: any) => { events.on('data', console.log).on('end', cb); })); diff --git a/gulp-batch/tsconfig.json b/gulp-batch/tsconfig.json index eb09ea4f9c..1406137b98 100644 --- a/gulp-batch/tsconfig.json +++ b/gulp-batch/tsconfig.json @@ -15,6 +15,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-cache/tsconfig.json b/gulp-cache/tsconfig.json index 3126e1ef38..368718e5d1 100644 --- a/gulp-cache/tsconfig.json +++ b/gulp-cache/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-cached/tsconfig.json b/gulp-cached/tsconfig.json index 32f3759409..77ef9c0aa1 100644 --- a/gulp-cached/tsconfig.json +++ b/gulp-cached/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-changed/tsconfig.json b/gulp-changed/tsconfig.json index 4185d001ef..ab8e90a21d 100644 --- a/gulp-changed/tsconfig.json +++ b/gulp-changed/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-cheerio/tsconfig.json b/gulp-cheerio/tsconfig.json index 254698a94e..d6cdfaac69 100644 --- a/gulp-cheerio/tsconfig.json +++ b/gulp-cheerio/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-coffeeify/tsconfig.json b/gulp-coffeeify/tsconfig.json index 54406ca98a..67e213beda 100644 --- a/gulp-coffeeify/tsconfig.json +++ b/gulp-coffeeify/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-coffeelint/tsconfig.json b/gulp-coffeelint/tsconfig.json index 2cc883884b..f1d388ddb7 100644 --- a/gulp-coffeelint/tsconfig.json +++ b/gulp-coffeelint/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-concat/tsconfig.json b/gulp-concat/tsconfig.json index 1f4acfd285..0d4c2e1c52 100644 --- a/gulp-concat/tsconfig.json +++ b/gulp-concat/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-copy/tsconfig.json b/gulp-copy/tsconfig.json index cc4c620b9f..0111f96820 100644 --- a/gulp-copy/tsconfig.json +++ b/gulp-copy/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-csso/tsconfig.json b/gulp-csso/tsconfig.json index 706fd106af..9519eac9b6 100644 --- a/gulp-csso/tsconfig.json +++ b/gulp-csso/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-debug/tsconfig.json b/gulp-debug/tsconfig.json index accf822a92..dac4ba0725 100644 --- a/gulp-debug/tsconfig.json +++ b/gulp-debug/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-dtsm/tsconfig.json b/gulp-dtsm/tsconfig.json index 6003ac335b..872e75dd19 100644 --- a/gulp-dtsm/tsconfig.json +++ b/gulp-dtsm/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-espower/tsconfig.json b/gulp-espower/tsconfig.json index 1140a956aa..92f4388198 100644 --- a/gulp-espower/tsconfig.json +++ b/gulp-espower/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-file-include/tsconfig.json b/gulp-file-include/tsconfig.json index d166690ec5..d08b25fa2e 100644 --- a/gulp-file-include/tsconfig.json +++ b/gulp-file-include/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-filter/tsconfig.json b/gulp-filter/tsconfig.json index f217497fa9..c48a36bb69 100644 --- a/gulp-filter/tsconfig.json +++ b/gulp-filter/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-flatten/tsconfig.json b/gulp-flatten/tsconfig.json index 484a4e3aef..72d3110eaa 100644 --- a/gulp-flatten/tsconfig.json +++ b/gulp-flatten/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-gh-pages/tsconfig.json b/gulp-gh-pages/tsconfig.json index a6f5d411b1..44cffa6d99 100644 --- a/gulp-gh-pages/tsconfig.json +++ b/gulp-gh-pages/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-gzip/tsconfig.json b/gulp-gzip/tsconfig.json index 07e07f0cf5..4eea3f8d72 100644 --- a/gulp-gzip/tsconfig.json +++ b/gulp-gzip/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-help-doc/tsconfig.json b/gulp-help-doc/tsconfig.json index 646e8ad141..283808fe7b 100644 --- a/gulp-help-doc/tsconfig.json +++ b/gulp-help-doc/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-help/tsconfig.json b/gulp-help/tsconfig.json index d0647ad22a..f8e499e793 100644 --- a/gulp-help/tsconfig.json +++ b/gulp-help/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-html-replace/tsconfig.json b/gulp-html-replace/tsconfig.json index 25eff60770..e074dcc546 100644 --- a/gulp-html-replace/tsconfig.json +++ b/gulp-html-replace/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-htmlmin/tsconfig.json b/gulp-htmlmin/tsconfig.json index 5d12b48035..964d06a7a1 100644 --- a/gulp-htmlmin/tsconfig.json +++ b/gulp-htmlmin/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-if/tsconfig.json b/gulp-if/tsconfig.json index f9db5297cf..6ea4d6a30b 100644 --- a/gulp-if/tsconfig.json +++ b/gulp-if/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-inject/tsconfig.json b/gulp-inject/tsconfig.json index 0201da00d9..c243f76d43 100644 --- a/gulp-inject/tsconfig.json +++ b/gulp-inject/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-insert/tsconfig.json b/gulp-insert/tsconfig.json index e548f022fa..aa58483b8a 100644 --- a/gulp-insert/tsconfig.json +++ b/gulp-insert/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-install/tsconfig.json b/gulp-install/tsconfig.json index 0b4494f7cd..79ecdd6cf1 100644 --- a/gulp-install/tsconfig.json +++ b/gulp-install/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-istanbul/tsconfig.json b/gulp-istanbul/tsconfig.json index f7ca4e96c7..f860b33143 100644 --- a/gulp-istanbul/tsconfig.json +++ b/gulp-istanbul/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-jade/tsconfig.json b/gulp-jade/tsconfig.json index b746e232bf..6b9c5c22c4 100644 --- a/gulp-jade/tsconfig.json +++ b/gulp-jade/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-jasmine-browser/tsconfig.json b/gulp-jasmine-browser/tsconfig.json index e5b112e90f..c347d86d35 100644 --- a/gulp-jasmine-browser/tsconfig.json +++ b/gulp-jasmine-browser/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-json-editor/tsconfig.json b/gulp-json-editor/tsconfig.json index 85846b46fd..8d6021c6f8 100644 --- a/gulp-json-editor/tsconfig.json +++ b/gulp-json-editor/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-jspm/tsconfig.json b/gulp-jspm/tsconfig.json index fbf318afab..e52189d99a 100644 --- a/gulp-jspm/tsconfig.json +++ b/gulp-jspm/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-less/tsconfig.json b/gulp-less/tsconfig.json index be38992302..4c9110c114 100644 --- a/gulp-less/tsconfig.json +++ b/gulp-less/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-load-plugins/tsconfig.json b/gulp-load-plugins/tsconfig.json index 77238a0e61..4e3ea0ba8c 100644 --- a/gulp-load-plugins/tsconfig.json +++ b/gulp-load-plugins/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-minify-css/tsconfig.json b/gulp-minify-css/tsconfig.json index 2d59793675..0b04647f28 100644 --- a/gulp-minify-css/tsconfig.json +++ b/gulp-minify-css/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-minify-html/tsconfig.json b/gulp-minify-html/tsconfig.json index 3e37896bd2..2b5f377a6c 100644 --- a/gulp-minify-html/tsconfig.json +++ b/gulp-minify-html/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-mocha/tsconfig.json b/gulp-mocha/tsconfig.json index aef5d2d758..3405efd531 100644 --- a/gulp-mocha/tsconfig.json +++ b/gulp-mocha/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-newer/tsconfig.json b/gulp-newer/tsconfig.json index ac02863c9b..53fd3b5fd5 100644 --- a/gulp-newer/tsconfig.json +++ b/gulp-newer/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-ng-annotate/tsconfig.json b/gulp-ng-annotate/tsconfig.json index 16f68955bb..b8b4d4fc6d 100644 --- a/gulp-ng-annotate/tsconfig.json +++ b/gulp-ng-annotate/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-nodemon/tsconfig.json b/gulp-nodemon/tsconfig.json index dc91f8e066..9af358b797 100644 --- a/gulp-nodemon/tsconfig.json +++ b/gulp-nodemon/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-plumber/tsconfig.json b/gulp-plumber/tsconfig.json index 878facc1f7..9f00169b06 100644 --- a/gulp-plumber/tsconfig.json +++ b/gulp-plumber/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-protractor/tsconfig.json b/gulp-protractor/tsconfig.json index 1141cf2042..667da98b75 100644 --- a/gulp-protractor/tsconfig.json +++ b/gulp-protractor/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-remember/tsconfig.json b/gulp-remember/tsconfig.json index e8ecc18bdc..f8ae755cca 100644 --- a/gulp-remember/tsconfig.json +++ b/gulp-remember/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-rename/tsconfig.json b/gulp-rename/tsconfig.json index 8a3a2c34dd..7276696b70 100644 --- a/gulp-rename/tsconfig.json +++ b/gulp-rename/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-replace/tsconfig.json b/gulp-replace/tsconfig.json index 5624a977d3..8b78b80dcc 100644 --- a/gulp-replace/tsconfig.json +++ b/gulp-replace/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-rev-replace/tsconfig.json b/gulp-rev-replace/tsconfig.json index b3fb130952..dfbd0d502f 100644 --- a/gulp-rev-replace/tsconfig.json +++ b/gulp-rev-replace/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-rev/tsconfig.json b/gulp-rev/tsconfig.json index ea7647e39a..b1f1715d28 100644 --- a/gulp-rev/tsconfig.json +++ b/gulp-rev/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-ruby-sass/tsconfig.json b/gulp-ruby-sass/tsconfig.json index 9465184b37..b6c74a2dd8 100644 --- a/gulp-ruby-sass/tsconfig.json +++ b/gulp-ruby-sass/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-sass/tsconfig.json b/gulp-sass/tsconfig.json index 26e1b2af4c..bec0180414 100644 --- a/gulp-sass/tsconfig.json +++ b/gulp-sass/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-shell/tsconfig.json b/gulp-shell/tsconfig.json index 81356de73d..ac0bc0cf3a 100644 --- a/gulp-shell/tsconfig.json +++ b/gulp-shell/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-size/tsconfig.json b/gulp-size/tsconfig.json index b1be4ca1dc..fe93b09ba6 100644 --- a/gulp-size/tsconfig.json +++ b/gulp-size/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-sort/tsconfig.json b/gulp-sort/tsconfig.json index 87097c7ad2..1921a1884c 100644 --- a/gulp-sort/tsconfig.json +++ b/gulp-sort/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-sourcemaps/tsconfig.json b/gulp-sourcemaps/tsconfig.json index e9c6d80281..9ce9bf808f 100644 --- a/gulp-sourcemaps/tsconfig.json +++ b/gulp-sourcemaps/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-strip-debug/tsconfig.json b/gulp-strip-debug/tsconfig.json index db20e2db69..572113b3cf 100644 --- a/gulp-strip-debug/tsconfig.json +++ b/gulp-strip-debug/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-svg-sprite/tsconfig.json b/gulp-svg-sprite/tsconfig.json index 381d78b150..82b417934a 100644 --- a/gulp-svg-sprite/tsconfig.json +++ b/gulp-svg-sprite/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-task-listing/tsconfig.json b/gulp-task-listing/tsconfig.json index 1f3b796968..fb06f0a926 100644 --- a/gulp-task-listing/tsconfig.json +++ b/gulp-task-listing/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-tsd/tsconfig.json b/gulp-tsd/tsconfig.json index a5738eb561..813e29fd74 100644 --- a/gulp-tsd/tsconfig.json +++ b/gulp-tsd/tsconfig.json @@ -11,6 +11,12 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-tslint/tsconfig.json b/gulp-tslint/tsconfig.json index 91d3edf8a3..46befdb599 100644 --- a/gulp-tslint/tsconfig.json +++ b/gulp-tslint/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-typedoc/tsconfig.json b/gulp-typedoc/tsconfig.json index 9d0f620269..f60478c1fa 100644 --- a/gulp-typedoc/tsconfig.json +++ b/gulp-typedoc/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-typescript/tsconfig.json b/gulp-typescript/tsconfig.json index fa6cbbc908..120791965a 100644 --- a/gulp-typescript/tsconfig.json +++ b/gulp-typescript/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-uglify/tsconfig.json b/gulp-uglify/tsconfig.json index 43db40e019..d0ae9de799 100644 --- a/gulp-uglify/tsconfig.json +++ b/gulp-uglify/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-useref/tsconfig.json b/gulp-useref/tsconfig.json index 132913f9d8..67e8c2aaed 100644 --- a/gulp-useref/tsconfig.json +++ b/gulp-useref/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-util/tsconfig.json b/gulp-util/tsconfig.json index 06b269e0ed..44b42dbad1 100644 --- a/gulp-util/tsconfig.json +++ b/gulp-util/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp-watch/tsconfig.json b/gulp-watch/tsconfig.json index 7062be6f7e..9822101d39 100644 --- a/gulp-watch/tsconfig.json +++ b/gulp-watch/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/gulp/index.d.ts b/gulp/index.d.ts index 9f3e7d96ba..fefd5b0fda 100644 --- a/gulp/index.d.ts +++ b/gulp/index.d.ts @@ -10,7 +10,6 @@ import Orchestrator = require("orchestrator"); import VinylFile = require("vinyl"); - declare type Strings = string|string[]; declare namespace gulp { diff --git a/gulp/tsconfig.json b/gulp/tsconfig.json index f6670453d1..01afedbf29 100644 --- a/gulp/tsconfig.json +++ b/gulp/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/htmlescape/htmlescape-tests.ts b/htmlescape/htmlescape-tests.ts new file mode 100644 index 0000000000..c3e174787c --- /dev/null +++ b/htmlescape/htmlescape-tests.ts @@ -0,0 +1,8 @@ +import * as htmlescape from "htmlescape"; +import { sanitize } from "htmlescape"; + +// === '{"x":"a\\u0026\\u003c\\u003e\\u2028\\u2029"}' +htmlescape({ x: "a&<>\u2028\u2029" }); + +// === 'a&<>\\u2028\\u2029' +sanitize("a&<>\u2028\u2029"); diff --git a/htmlescape/index.d.ts b/htmlescape/index.d.ts new file mode 100644 index 0000000000..51d8eae58d --- /dev/null +++ b/htmlescape/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for htmlescape 1.1 +// Project: https://github.com/zertosh/htmlescape +// Definitions by: bouzuya +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function htmlescape(o: any): string; +declare namespace htmlescape { + export function sanitize(s: string): string; +} + +export = htmlescape; +export as namespace htmlescape; diff --git a/x2js/tsconfig.json b/htmlescape/tsconfig.json similarity index 79% rename from x2js/tsconfig.json rename to htmlescape/tsconfig.json index 15e948c2ac..6ba5d9819a 100644 --- a/x2js/tsconfig.json +++ b/htmlescape/tsconfig.json @@ -2,12 +2,11 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +17,6 @@ }, "files": [ "index.d.ts", - "x2js-tests.ts" + "htmlescape-tests.ts" ] -} \ No newline at end of file +} diff --git a/htmlescape/tslint.json b/htmlescape/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/htmlescape/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/http-errors/http-errors-tests.ts b/http-errors/http-errors-tests.ts index e8c12126b4..51017828a1 100644 --- a/http-errors/http-errors-tests.ts +++ b/http-errors/http-errors-tests.ts @@ -83,3 +83,4 @@ var err = new createError.MisdirectedRequest(); var err = new createError.MisdirectedRequest('Where should this go?'); let error: createError.HttpError; +console.log(error instanceof createError.HttpError); diff --git a/http-errors/index.d.ts b/http-errors/index.d.ts index 176703f23f..aff5b312dd 100644 --- a/http-errors/index.d.ts +++ b/http-errors/index.d.ts @@ -23,6 +23,8 @@ declare module 'http-errors' { [code: string]: new (msg?: string) => HttpError; (...args: Array): HttpError; + + HttpError: HttpErrorConstructor; Continue: HttpErrorConstructor; SwitchingProtocols: HttpErrorConstructor; diff --git a/hystrixjs/index.d.ts b/hystrixjs/index.d.ts index d4a738b999..39fef977e1 100644 --- a/hystrixjs/index.d.ts +++ b/hystrixjs/index.d.ts @@ -3,146 +3,141 @@ // Definitions by: Igor Sechyn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// +import * as Q from "q"; +import * as RX from "rx"; -declare namespace HystrixJS { +export as namespace hystrixjs; +export as 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 - } +export 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 } -declare var hystrixjs: { - commandFactory: HystrixJS.CommandFactory, - metricsFactory: HystrixJS.MetricsFactory, - circuitFactory: HystrixJS.CircuitFactory, - hystrixSSEStream: HystrixJS.HystrixSSEStream, - hystrixConfig: HystrixJS.HystrixConfig -}; -declare module "hystrixjs" { - export = hystrixjs; +export 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; } + +export interface Command { + execute(...args: any[]): Q.Promise; +} + +export 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; +} + +export interface CommandFactory { + getOrCreate(commandKey: string, commandGroup?: string): CommandBuilder; + resetCache(): void; +} + +export interface HealthCounts { + totalCount: number; + errorCount: number; + errorPercentage: number; +} + +export 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; +} + +export interface MetricsProperties { + commandKey: string, + commandGroup: string, + statisticalWindowTimeInMilliSeconds?: number, + statisticalWindowNumberOfBuckets?: number, + percentileWindowTimeInMilliSeconds?: number, + percentileWindowNumberOfBuckets?: number +} + +export interface MetricsFactory { + getOrCreate(config: MetricsProperties): CommandMetrics; + resetCache(): void; + getAllMetrics(): Array; +} + +export interface CirctuiBreakerConfig { + circuitBreakerSleepWindowInMilliseconds: number, + commandKey: string, + circuitBreakerErrorThresholdPercentage: number, + circuitBreakerRequestVolumeThreshold: number, + commandGroup: string, + circuitBreakerForceClosed: boolean, + circuitBreakerForceOpened: boolean +} + +export interface CircuitBreaker { + allowRequest(): boolean; + allowSingleTest(): boolean; + isOpen(): boolean; + markSuccess(): void; +} + +export interface CircuitFactory { + getOrCreate(config: CirctuiBreakerConfig): CircuitBreaker; + getCache(): Array; + resetCache(): void; +} + +export interface HystrixSSEStream { + toObservable(): Rx.Observable +} + +export var commandFactory: CommandFactory; +export var metricsFactory: MetricsFactory; +export var circuitFactory: CircuitFactory; +export var hystrixSSEStream: HystrixSSEStream; +export var hystrixConfig: HystrixConfig; \ No newline at end of file diff --git a/hystrixjs/tsconfig.json b/hystrixjs/tsconfig.json index c23c0c6875..e1cb1a7c4d 100644 --- a/hystrixjs/tsconfig.json +++ b/hystrixjs/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/jasmine-es6-promise-matchers/index.d.ts b/jasmine-es6-promise-matchers/index.d.ts index 89e3146c2c..7d61d4d660 100644 --- a/jasmine-es6-promise-matchers/index.d.ts +++ b/jasmine-es6-promise-matchers/index.d.ts @@ -13,7 +13,7 @@ declare namespace JasminePromiseMatchers { declare namespace jasmine { - interface Matchers { + interface Matchers { /** * Verifies that a Promise is (or has been) rejected. */ diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index c2ee7e0ee5..ca5c2dbfc3 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -1,93 +1,154 @@ -// Type definitions for jasmine-expect 2.0 +// Type definitions for jasmine-expect 3.6.0 // Project: https://github.com/JamieMason/Jasmine-Matchers -// Definitions by: UserPixel +// Definitions by: GeneralCss // 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; + interface Matchers { + // toBe + toBeArray(): boolean; + toBeArrayOfBooleans(): boolean; + toBeArrayOfNumbers(): boolean; + toBeArrayOfObjects(): boolean; + toBeArrayOfSize(size: number): boolean; + toBeArrayOfStrings(): boolean; + toBeEmptyArray(): boolean; + toBeNonEmptyArray(): boolean; - toEndWith(subString: string): boolean; + // Booleans + toBeBoolean(): boolean; + toBeFalse(): boolean; + toBeTrue(): 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; + // Dates + toBeAfter(date: Date): boolean + toBeBefore(date: Date): boolean + toBeDate(): boolean; + toBeValidDate(): boolean; - toImplement(api: {}): boolean; + // Functions + toBeFunction(): boolean; + toThrowAnyError(): boolean; + toThrowErrorOfType(constructorName: string): boolean - toStartWith(subString: string): boolean; + // Numbers + toBeCalculable(): boolean; + toBeEvenNumber(): boolean; + toBeGreaterThanOrEqualTo(number: number): boolean; + toBeLessThanOrEqualTo(number: number): boolean; + toBeNear(number: number, epsilon: number): boolean; + toBeNumber(): boolean; + toBeOddNumber(): boolean + toBeWholeNumber(): boolean; + toBeWithinRange(floor: number, ceiling: number): boolean; - toThrowAnyError(): boolean; - toThrowErrorOfType(type: string): boolean; - } + // Strings + toBeEmptyString(): boolean; + toBeHtmlString(): boolean; + toBeIso8601(): boolean; + toBeJsonString(): boolean; + toBeLongerThan(string: string): boolean; + toBeNonEmptyString(): boolean; + toBeSameLengthAs(string: string): boolean; + toBeShorterThan(string: string): boolean; + toBeString(): boolean; + toBeWhitespace(): boolean; + toEndWith(string: string): boolean; + toStartWith(string: string): boolean; + + // Objects + toBeEmptyObject(): boolean; + toBeNonEmptyObject(): boolean; + toBeObject(): boolean; + + // Regular Expression + toBeRegExp(): boolean; + + // Members, Properties, Methods + toHaveArray(memberName: string): boolean; + toHaveArrayOfBooleans(memberName: string): boolean; + toHaveArrayOfNumbers(memberName: string): boolean; + toHaveArrayOfObjects(memberName: string): boolean; + toHaveArrayOfSize(memberName: string, size: number): boolean; + toHaveArrayOfStrings(memberName: string): boolean; + toHaveBoolean(memberName: string): boolean; + toHaveCalculable(memberName: string): boolean; + toHaveDate(memberName: string): boolean; + toHaveDateAfter(memberName: string, date: Date): boolean; + toHaveDateBefore(memberName: string, date: Date): boolean; + toHaveEmptyArray(memberName: string): boolean; + toHaveEmptyObject(memberName: string): boolean; + toHaveEmptyString(memberName: string): boolean; + toHaveEvenNumber(memberName: string): boolean; + toHaveFalse(memberName: string): boolean; + toHaveHtmlString(memberName: string): boolean; + toHaveIso8601(memberName: string): boolean; + toHaveJsonString(memberName: string): boolean; + toHaveMember(memberName: string): boolean; + toHaveMethod(memberName: string): boolean; + toHaveNonEmptyArray(memberName: string): boolean; + toHaveNonEmptyObject(memberName: string): boolean; + toHaveNonEmptyString(memberName: string): boolean; + toHaveNumber(memberName: string): boolean; + toHaveNumberWithinRange(memberName: string, floor: number, ceiling: number): boolean; + toHaveObject(memberName: string): boolean; + toHaveOddNumber(memberName: string): boolean; + toHaveString(memberName: string): boolean; + toHaveStringLongerThan(memberName: string, string: string): boolean; + toHaveStringSameLengthAs(memberName: string, string: string): boolean; + toHaveStringShorterThan(memberName: string, string: string): boolean; + toHaveTrue(memberName: string): boolean; + toHaveUndefined(memberName: string): boolean; + toHaveWhitespaceString(memberName: string): boolean; + toHaveWholeNumber(memberName: string): boolean; + } + + interface AssymetricMatchers { + + // Arrays + arrayOfBooleans(): boolean; + arrayOfNumbers(): boolean; + arrayOfObjects(): boolean; + arrayOfSize(number: number): boolean; + arrayOfStrings(): boolean; + emptyArray(): boolean; + nonEmptyArray(): boolean; + + // Dates + after(date: Date): boolean; + before(date: Date): boolean; + + // Numbers + calculable(): boolean; + evenNumber(): boolean; + greaterThanOrEqualTo(number: number): boolean; + lessThanOrEqualTo(number: number): boolean; + oddNumber(): boolean; + wholeNumber(): boolean; + withinRange(floor: number, ceiling: number): boolean; + + // Strings + endingWith(string: string): boolean; + iso8601(): boolean; + jsonString(): boolean; + longerThan(string: string): boolean; + nonEmptyString(string: string): boolean; + sameLengthAs(string: string): boolean; + shorterThan(string: string): boolean; + startingWith(string: string): boolean; + whitespace(): boolean; + + //Objects + emptyObject(): boolean; + nonEmptyObject(): boolean; + + // Regular expressions + regExp(): boolean; + } } + +declare var any: jasmine.AssymetricMatchers; + diff --git a/jasmine-expect/jasmine-expect-tests.ts b/jasmine-expect/jasmine-expect-tests.ts index e64f9198bf..4a8cbb3855 100644 --- a/jasmine-expect/jasmine-expect-tests.ts +++ b/jasmine-expect/jasmine-expect-tests.ts @@ -870,9 +870,11 @@ describe('toHaveArrayOfSize', function() { describeToHaveArrayX('toHaveArrayOfSize', function() { describe('when number of expected items does not match', function() { it('should deny', function() { - expect({ + var xpToFail = expect; + xpToFail({ memberName: '' }).not.toHaveArrayOfSize('memberName'); + expect({ memberName: ['bar'] }).not.toHaveArrayOfSize('memberName', 0); @@ -1874,40 +1876,6 @@ describe('toHaveWholeNumber', function() { }); }); -describe('toImplement', function() { - describe('when invoked', function() { - describe('when subject IS an Object containing all of the supplied members', function() { - it('should confirm', function() { - expect({ - a: 1, - b: 2 - }).toImplement({ - a: 1, - b: 2 - }); - expect({ - a: 1, - b: 2 - }).toImplement({ - a: 1 - }); - }); - }); - describe('when subject is NOT an Object containing all of the supplied members', function() { - it('should deny', function() { - expect({ - a: 1 - }).not.toImplement({ - c: 3 - }); - expect(null).not.toImplement({ - a: 1 - }); - }); - }); - }); -}); - describe('toStartWith', function() { describe('when invoked', function() { describe('when subject is NOT an undefined or empty string', function() { diff --git a/jasmine-jquery/index.d.ts b/jasmine-jquery/index.d.ts index fb91e0c37b..14eb26b380 100644 --- a/jasmine-jquery/index.d.ts +++ b/jasmine-jquery/index.d.ts @@ -81,7 +81,7 @@ declare namespace jasmine { proxyCallTo_(methodName: string, passedArguments: any): any; } - interface Matchers { + interface Matchers { /** * Check if DOM element has class. * @@ -232,7 +232,7 @@ declare namespace jasmine { * */ toHaveData(key : string, expectedValue : string): boolean; - toBe(selector: JQuery): boolean; + toBe(selector: T): boolean; /** * Check if DOM element is matched by the given selector. @@ -241,7 +241,7 @@ declare namespace jasmine { * // returns true * expect($('

')).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/jasmine-jquery/jasmine-jquery-tests.ts index 2e507d85fd..440dff1b6c 100644 --- a/jasmine-jquery/jasmine-jquery-tests.ts +++ b/jasmine-jquery/jasmine-jquery-tests.ts @@ -1,14 +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-matchers/index.d.ts b/jasmine-matchers/index.d.ts index ac44d25c1c..d4cad3b77c 100644 --- a/jasmine-matchers/index.d.ts +++ b/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-promise-matchers/index.d.ts b/jasmine-promise-matchers/index.d.ts index c511019b62..ffe4f65142 100644 --- a/jasmine-promise-matchers/index.d.ts +++ b/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/index.d.ts b/jasmine/index.d.ts index c0db55d100..caa1d12635 100644 --- a/jasmine/index.d.ts +++ b/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/jasmine/jasmine-tests.ts index 4632eb8b4c..1c9d5366e1 100644 --- a/jasmine/jasmine-tests.ts +++ b/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/v1/index.d.ts b/jasmine/v1/index.d.ts index 5cbb2a9f83..3f51240f63 100644 --- a/jasmine/v1/index.d.ts +++ b/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/jasmine/v1/jasmine-tests.ts index 9177679f8a..c47fc84007 100644 --- a/jasmine/v1/jasmine-tests.ts +++ b/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/jasminewd2/index.d.ts b/jasminewd2/index.d.ts index 9d8ecde76e..3b8760709c 100644 --- a/jasminewd2/index.d.ts +++ b/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/jointjs/index.d.ts b/jointjs/index.d.ts index 95e2b2b7e3..5ce0f187f0 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -6,891 +6,892 @@ /// +import * as Backbone from "backbone"; -declare namespace joint { - export var g: any; - export var V: any; +export as namespace joint; - namespace dia { - interface Size { - width: number; - height: number; - } +export var g: any; +export var V: any; - interface Point { - x: number; - y: number; - } +export namespace dia { + interface Size { + width: number; + height: number; + } - interface BBox extends Point, Size { } + interface Point { + x: number; + y: number; + } - interface TranslateOptions { - restrictedArea?: BBox; - transition?: TransitionOptions; - } + interface BBox extends Point, Size { } - interface TransitionOptions { - delay?: number; - duration?: number; - timingFunction?: (t: number) => number; - valueFunction?: (a: any, b: any) => (t: number) => any; - } + interface TranslateOptions { + restrictedArea?: BBox; + transition?: TransitionOptions; + } - interface DfsBfsOptions { - inbound?: boolean; - outbound?: boolean; - deep?: boolean; - } + interface TransitionOptions { + delay?: number; + duration?: number; + timingFunction?: (t: number) => number; + valueFunction?: (a: any, b: any) => (t: number) => any; + } - interface ExploreOptions { - breadthFirst?: boolean; - deep?: boolean; - } + interface DfsBfsOptions { + inbound?: boolean; + outbound?: 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; - } + interface ExploreOptions { + breadthFirst?: boolean; + deep?: boolean; + } - 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; - } + 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; + } - type Padding = number | { - top?: number; - right?: number; - bottom?: number; - left?: number - }; + 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; + } - 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; - } + type Padding = number | { + top?: number; + right?: number; + bottom?: number; + left?: number + }; - interface CSSSelector { - [key: string]: string | number | Object; // Object added to support special attributes like filter http://jointjs.com/api#SpecialAttributes:filter - } + 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 SVGAttributes { - [selector: string]: CSSSelector; - } + interface CSSSelector { + [key: string]: string | number | Object; // Object added to support special attributes like filter http://jointjs.com/api#SpecialAttributes:filter + } - interface CellAttributes { - [key: string]: any; - } + interface SVGAttributes { + [selector: string]: CSSSelector; + } - interface TextAttrs extends SVGAttributes { - text?: { - [key: string]: string | number; - text?: string; - }; - } + interface CellAttributes { + [key: string]: any; + } - 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; + interface TextAttrs extends SVGAttributes { + text?: { + [key: string]: string | number; 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; + }; + } + + 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; - "x-alignment"?: 'middle' | 'right' | number; - "y-alignment"?: 'middle' | 'bottom' | number; + 'ref-x'?: number | string; + 'ref-dx'?: number | string; + 'ref-y'?: number | string; + 'ref-dy'?: number | string; + magnet?: boolean; + 'class'?: string; 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; + interface IOAttrs extends dia.TextAttrs { + circle?: LogicAttrs; } - - 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; + 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 ui { } - - namespace shapes { - interface GenericAttributes extends dia.CellAttributes { - position?: dia.Point; - size?: dia.Size; - angle?: number; - attrs?: T; + namespace org { + interface MemberAttrs { + rect?: ShapeAttrs; + image?: ShapeAttrs; } - 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 + class Member extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); } - - 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); - } + class Arrow extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); } } - namespace util { - - namespace format { - export function number(specifier: string, value: number): string; + 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); } - - 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; + namespace uml { + interface ClassAttributes extends GenericAttributes { + name: string[]; + attributes: string[]; + methods: string[]; } - - export class DirectedGraph { - static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox; + 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/jquery-toastmessage-plugin/jquery-toastmessage-plugin-tests.ts b/jquery-toastmessage-plugin/jquery-toastmessage-plugin-tests.ts index d1feba15ce..f11813cfbb 100644 --- a/jquery-toastmessage-plugin/jquery-toastmessage-plugin-tests.ts +++ b/jquery-toastmessage-plugin/jquery-toastmessage-plugin-tests.ts @@ -1,6 +1,3 @@ -/// - - /* code examples from documentation */ $().toastmessage('showNoticeToast', 'some message here'); diff --git a/jwt-simple/index.d.ts b/jwt-simple/index.d.ts index 1ae8f18519..b70aa8c720 100644 --- a/jwt-simple/index.d.ts +++ b/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/karma-coverage/tsconfig.json b/karma-coverage/tsconfig.json index 57290fb7be..404aa4ec66 100644 --- a/karma-coverage/tsconfig.json +++ b/karma-coverage/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/karma/tsconfig.json b/karma/tsconfig.json index 2c74d40398..b2d5e469ba 100644 --- a/karma/tsconfig.json +++ b/karma/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/knuddels-userapps-api/knuddels-userapps-api-tests.ts b/knuddels-userapps-api/knuddels-userapps-api-tests.ts index 1faaa193e5..a940b7f19b 100644 --- a/knuddels-userapps-api/knuddels-userapps-api-tests.ts +++ b/knuddels-userapps-api/knuddels-userapps-api-tests.ts @@ -1,5 +1,3 @@ -/// - class Server implements App { private usersPlaying: { [nick: string]: number } = {}; diff --git a/koa-cache-control/index.d.ts b/koa-cache-control/index.d.ts new file mode 100644 index 0000000000..19329fcfec --- /dev/null +++ b/koa-cache-control/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for koa-cache-control 2.0 +// Project: https://github.com/DaMouse404/koa-cache-control +// Definitions by: Peter Safranek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as Koa from "koa"; + +declare function cacheControl(options?: { + private?: boolean; + public?: boolean; + noStore?: boolean; + noCache?: boolean; + noTransform?: boolean; + mustRevalidate?: boolean; + staleIfError?: number; + staleWhileRevalidate?: number; + maxAge?: number; + sMaxAge?: number; +}): Koa.Middleware; + +declare namespace cacheControl {} + +export = cacheControl; diff --git a/koa-cache-control/koa-cache-control-tests.ts b/koa-cache-control/koa-cache-control-tests.ts new file mode 100644 index 0000000000..c99f4fe862 --- /dev/null +++ b/koa-cache-control/koa-cache-control-tests.ts @@ -0,0 +1,19 @@ +import * as Koa from "koa"; +import * as cacheControl from "koa-cache-control"; + +const app = new Koa(); + +app.use(cacheControl()); +app.use(cacheControl({})); +app.use(cacheControl({ + private: true, + public: true, + noStore: true, + noCache: true, + noTransform: true, + mustRevalidate: true, + staleIfError: 0, + staleWhileRevalidate: 0, + maxAge: 0, + sMaxAge: 0, +})); diff --git a/promises-a-plus/tsconfig.json b/koa-cache-control/tsconfig.json similarity index 91% rename from promises-a-plus/tsconfig.json rename to koa-cache-control/tsconfig.json index d5ccf86f75..ae4aea7b85 100644 --- a/promises-a-plus/tsconfig.json +++ b/koa-cache-control/tsconfig.json @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "promises-a-plus-tests.ts" + "koa-cache-control-tests.ts" ] -} \ No newline at end of file +} diff --git a/koa-cache-control/tslint.json b/koa-cache-control/tslint.json new file mode 100644 index 0000000000..eb88e553a5 --- /dev/null +++ b/koa-cache-control/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../tslint.json", + + "noImplicitAny": "true", + "noImplicitThis": "true", + "strictNullChecks": "true" +} diff --git a/lazypipe/tsconfig.json b/lazypipe/tsconfig.json index 675e6f38cc..801cf4648a 100644 --- a/lazypipe/tsconfig.json +++ b/lazypipe/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true 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/main-bower-files/tsconfig.json b/main-bower-files/tsconfig.json index fcdebedf3d..04b363ffc6 100644 --- a/main-bower-files/tsconfig.json +++ b/main-bower-files/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/merge2/tsconfig.json b/merge2/tsconfig.json index 4fd4d60c3f..64cf45c2a6 100644 --- a/merge2/tsconfig.json +++ b/merge2/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/meteor/README.md b/meteor/README.md index f560dd005e..374a6213e7 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -2,7 +2,7 @@ ## Description -These are the definitions for version 1.4 of Meteor. These definitions were generated from the from the same [Meteor data.js file] (https://github.com/meteor/meteor/blob/devel/docs/client/data.js) that is used to generate the official [Meteor docs] (http://docs.meteor.com/). The code that generates these definitions can be found [here](https://github.com/meteor-typescript/meteor-typescript-libs/). +These are the definitions for version 1.4 of Meteor. These definitions were generated from the same [Meteor data.js file](https://github.com/meteor/meteor/blob/devel/docs/client/data.js) that is used to generate the official [Meteor docs](http://docs.meteor.com/). The code that generates these definitions can be found [here](https://github.com/meteor-typescript/meteor-typescript-libs/). ## Upcoming Meteor `typescript` package @@ -33,19 +33,21 @@ Compilation will be much faster and code will be cleaner - it's always better to With the exception of the **body** and **head** templates, Meteor's Template dot notation cannot be used (ie. *Template.mytemplate*). Thanks to Typescript static typing checks, you will need to use the *bracket notation* to access the Template. - Template['myTemplateName'].helpers({ - foo: function () { - return Session.get("foo"); - } - }); - - Template['myTemplateName'].onRendered(function ( ) { ... }); +```js +Template['myTemplateName'].helpers({ + foo: function () { + return Session.get("foo"); + } +}); +Template['myTemplateName'].onRendered(function ( ) { ... }); +``` The same is true for `Meteor.settings`: - Meteor.settings.public[''] - +```ts +Meteor.settings.public[''] +``` ### Form fields @@ -55,11 +57,11 @@ Form fields typically need to be cast to ``. For instance to r ### Global variables Preface any global variable declarations with a TypeScript `declare var` statement (or place the statement in a definition file): - - declare var NavbarHelpers; - NavbarHelpers = {}; - NavbarHelpers.someMethod = function() {...} - +```ts +declare var NavbarHelpers; +NavbarHelpers = {}; +NavbarHelpers.someMethod = function() {...} +``` ### Collections @@ -67,18 +69,21 @@ The majority of extra work required to use TypeScript with Meteor is creating an To define collections, you will need to create an interface representing the collection and then declare a Collection type variable with that interface type (as a generic): - interface JobDAO { - _id?: string; - name: string; - status?: string; - queuedAt?: string; - } - - declare var Jobs: Mongo.Collection; - Jobs = new Mongo.Collection('jobs'); +```js +interface JobDAO { + _id?: string; + name: string; + status?: string; + queuedAt?: string; +} +declare var Jobs: Mongo.Collection; +Jobs = new Mongo.Collection('jobs'); +``` Finally, any TypeScript file using collections will need to contain a reference at the top pointing to the collection definitions: - /// - /// +```ts +/// +/// +``` diff --git a/microsoft-sdk-soap/index.d.ts b/microsoft-sdk-soap/index.d.ts index 9effce35ad..de1c43db12 100644 --- a/microsoft-sdk-soap/index.d.ts +++ b/microsoft-sdk-soap/index.d.ts @@ -3,2968 +3,2869 @@ // 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. +import * as Q from "q"; + +declare global { + 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. - * @param query */ - public setQuery( query: Sdk.Query.QueryBase ): void; + 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); + } } - /** - * 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; + 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 setValueArgs An array of Date values. + * @param args An array of Date values. */ - public setValues( setValueArgs: Date[] ): void; - } + class Dates extends ValueBase { + constructor(args: Date[]); - /** - * 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 the type of value with namespace prefix. - */ - public getType(): string; + /** + * Returns an Sdk.Collection of Date values. + */ + public getValues(): Sdk.Collection; - /** - * Returns an Sdk.Collection of number 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 setValueArgs An array of number values. + * @param args An array of Decimal values. */ - public setValues( setValueArgs: number[] ): void; - } + class Decimals extends ValueBase { + constructor(args: number[]); - /** - * 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 the type of value with namespace prefix. - */ - public getType(): string; + /** + * Returns an Sdk.Collection of number values. + */ + public getValues(): Sdk.Collection; - /** - * 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 setValueArgs An array of number values. + * @param args An array of Double values. */ - public setValues( setValueArgs: number[] ): void; - } + class Doubles extends ValueBase { + constructor(args: number[]); - /** - * 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 Double values to be compared in the query. + * @param setValueArgs An array of number values. + */ + public setValues(setValueArgs: number[]): void; + } /** - * Returns the type of value with namespace prefix. + * Specifies the Int values to be compared in the query. + * @param args An array of Int values. */ - public getType(): string; + class Ints extends ValueBase { + constructor(args: number[]); - /** - * Returns an Sdk.Collection of number values. - */ - public getValues(): Sdk.Collection; + /** + * Returns the type of value with namespace prefix. + */ + public getType(): string; - /** - * Specifies the Int values to be compared in the query - * @param setValueArgs An array of number values. - */ - public setValues( setValueArgs: number[] ): void; - } + /** + * Returns an Sdk.Collection of number values. + */ + public getValues(): Sdk.Collection; - /** - * 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 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 setValueArgs An array of number values. + * @param args An array of Long values. */ - public setValues( setValueArgs: number[] ): void; - } + class Longs extends ValueBase { + constructor(args: number[]); - /** - * 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 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; + } /** - * Returns the type of value with namespace prefix. + * Specifies the Sdk.EntityReference values to be compared in the query. + * @param args An array of Sdk.EntityReference values. */ - public getType(): string; + 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; + } /** - * Returns an Sdk.Collection of Sdk.EntityReference values. + * Specifies the Sdk.Query.Guids values to be compared in the query. + * @param args An array of GUID string values. */ - public getValues(): Sdk.Collection; + class Guids extends ValueBase { + constructor(args: string[]); - /** - * Specifies the Long values to be compared in the query. - * @param setValueArgs An array of Sdk.EntityReference values. - */ - public setValues( setValueArgs: Sdk.EntityReference[] ): void; - } + /** + * Returns the type of value with namespace prefix. + */ + public getType(): string; - /** - * 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 an Sdk.Collection of GUID string values. + */ + public getValues(): Sdk.Collection; - /** - * 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 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 setValueArgs An array of number values. + * @param args An array of number values. */ - public setValues( setValueArgs: number[] ): void; - } + class Money extends ValueBase { + constructor(args: number[]); - /** - * 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 the type of value with namespace prefix. - */ - public getType(): string; + /** + * Returns an Sdk.Collection of number values. + */ + public getValues(): Sdk.Collection; - /** - * 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 setValueArgs An array of number values. + * @param args An array of number values. */ - public setValues( setValueArgs: number[] ): void; - } + class OptionSets extends ValueBase { + constructor(args: number[]); - /** - * 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 the type of value with namespace prefix. - */ - public getType(): string; + /** + * Returns an Sdk.Collection of number values. + */ + public getValues(): Sdk.Collection; - /** - * Returns an Sdk.Collection of String 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 setValueArgs An array of String values. + * @param args An array of String values. */ - public setValues( setValueArgs: string[] ): void + 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, + } } - 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 ); + namespace Sdk.Util { + /** + * Verifies the parameter is a string formatted as a GUID. + * @param value The value to check. + */ + function isGuid(value: string): boolean; /** - * 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. + * Verifies the parameter is a string formatted as a GUID or null. + * @param value The value to check. */ - 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; + 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; } - /** - * 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 ); + namespace Sdk.Xml { } - /** - * 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, + 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); } - export enum AttributeTypeCode - { - BigInt, - Boolean, - CalendarRules, - Customer, - DateTime, - Decimal, - Double, - EntityName, - Integer, - Lookup, - ManagedProperty, - Memo, - Money, - Owner, - PartyList, - Picklist, - State, - Status, - String, - Uniqueidentifier, - Virtual, + /** + * 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 enum AttributeRequiredLevel - { - ApplicationRequired, - None, - Recommended, - SystemRequired, + 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; } - - export enum DateTimeFormat - { - DateAndTime, - DateOnly, + /** + * 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); } - export enum ImeMode - { - Active, - Auto, - Disabled, - Inactive, + /** + * 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); } - - - export enum IntegerFormat - { - Duration, - Language, - Locale, - None, - TimeZone, + /** + * 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); } - - export enum SecurityTypes - { - Append, - Inheritance, - None, - ParentChild, - Pointer, + /** + * Logical operator. + */ + export enum LogicalOperator { + And, + Or, } - export enum StringFormat - { - Email, - PhoneticGuide, - Text, - TextArea, - TickerSymbol, - Url, - VersionNumber, + /** + * 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 -{ } + namespace Sdk.Mdq.ValueEnums + { } +} \ No newline at end of file diff --git a/microsoft-sdk-soap/microsoft-sdk-soap-tests.ts b/microsoft-sdk-soap/microsoft-sdk-soap-tests.ts index 2e55285870..3be28629c3 100644 --- a/microsoft-sdk-soap/microsoft-sdk-soap-tests.ts +++ b/microsoft-sdk-soap/microsoft-sdk-soap-tests.ts @@ -1,4 +1,5 @@ +import * as Q from "q"; // QueryByAttribute var queryByAttribute = new Sdk.Query.QueryByAttribute( "account" ); @@ -17,4 +18,4 @@ queryExpression.addCondition( "account", "accountname", Sdk.Query.ConditionOpera Sdk.Q.retrieveMultiple( queryExpression ).then( entityCollection => { console.log( "Query matches " + entityCollection.getTotalRecordCount() + " records." ); -} ); \ No newline at end of file +} ); \ No newline at end of file diff --git a/microsoft-sdk-soap/tsconfig.json b/microsoft-sdk-soap/tsconfig.json index ef973bcb22..41ffa9a040 100644 --- a/microsoft-sdk-soap/tsconfig.json +++ b/microsoft-sdk-soap/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/mongoose-seeder/tsconfig.json b/mongoose-seeder/tsconfig.json index 143fcc1ce4..8e3f193dbf 100644 --- a/mongoose-seeder/tsconfig.json +++ b/mongoose-seeder/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/msportalfx-test/index.d.ts b/msportalfx-test/index.d.ts index a3fbc2d26f..c2d64f95d4 100644 --- a/msportalfx-test/index.d.ts +++ b/msportalfx-test/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: Julio Casal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - import * as Q from "q"; export = MsPortalTestFx; diff --git a/msportalfx-test/tsconfig.json b/msportalfx-test/tsconfig.json index 115af8c6ef..16c68ed3a8 100644 --- a/msportalfx-test/tsconfig.json +++ b/msportalfx-test/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/nanoscroller/nanoscroller-tests.ts b/nanoscroller/nanoscroller-tests.ts index 3b9eeea820..46e61c1aaf 100644 --- a/nanoscroller/nanoscroller-tests.ts +++ b/nanoscroller/nanoscroller-tests.ts @@ -1,5 +1,3 @@ -/// - $('.nano').nanoScroller(); $('.nano').nanoScroller({ diff --git a/nedb/index.d.ts b/nedb/index.d.ts index 23519d3579..790f3f6d06 100644 --- a/nedb/index.d.ts +++ b/nedb/index.d.ts @@ -1,34 +1,31 @@ -// Type definitions for NeDB +// Type definitions for NeDB 1.8 // Project: https://github.com/louischatriot/nedb // Definitions by: Stefan Steinhart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export = NeDBDataStore; +export = Nedb; export as namespace Nedb; -declare namespace NeDBDataStore { } -declare class NeDBDataStore { - constructor(); - constructor(path:string); - constructor(options:NeDB.DataStoreOptions); +declare class Nedb { + constructor(pathOrOptions?: string | Nedb.DataStoreOptions); - persistence:NeDB.Persistence; + persistence: Nedb.Persistence; /** * Load the database from the datafile, and trigger the execution of buffered commands if any */ - loadDatabase(cb?:(err:Error)=>void):void; + loadDatabase(cb?: (err: Error) => void): void; /** * Get an array of all the data in the database */ - getAllData():Array; + getAllData(): Array; /** * Reset all currently defined indexes */ - resetIndexes(newData:any):void; + resetIndexes(newData: any): void; /** * Ensure an index is kept for this field. Same parameters as lib/indexes @@ -39,34 +36,32 @@ declare class NeDBDataStore { * @param {Boolean} options.sparse * @param {Function} cb Optional callback, signature: err */ - ensureIndex(options:NeDB.EnsureIndexOptions, cb?:(err:Error)=>void):void; + 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; + 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; + addToIndexes(doc: T | T[]): void; /** * Remove one or several document(s) from all indexes */ - removeFromIndexes(doc:T):void; - removeFromIndexes(doc:Array):void; + removeFromIndexes(doc: T | T[]): 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; + updateIndexes(oldDoc: T, newDoc: T): void; + updateIndexes(updates: Array<{oldDoc: T; newDoc: T}>): void; /** * Return the list of candidates for a given query @@ -77,20 +72,20 @@ declare class NeDBDataStore { * * TODO: needs to be moved to the Cursor module */ - getCandidates(query:any):void; + 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; + 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; + count(query: any, callback: (err: Error, n: number) => void): void; + count(query: any): Nedb.CursorCount; /** * Find all documents matching the query @@ -98,61 +93,61 @@ declare class NeDBDataStore { * @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(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(query: any, callback: (err: Error, documents: Array) => void): void; /** * 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; + 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; + findOne(query: any, callback: (err: Error, document: T) => void): void; /** - * Update all docs matching query v1.7.4 and prior signature. + * Update all docs matching query v1.7.4 and prior signature. * For now, very naive implementation (recalculating the whole database) * @param {any} query * @param {any} updateQuery * @param {Object} options Optional options * options.multi If true, can update multiple documents (defaults to false) * options.upsert If true, document is inserted if the query doesn't match anything - * @param {Function} cb Optional callback, signature: err, - * numReplaced, - * upsert (set to true if the update was in fact an upsert) + * @param {Function} cb Optional callback, signature: err, + * numReplaced, + * upsert (set to true if the update was in fact an upsert) * * @api private Use Datastore.update which has the same signature */ - update(query:any, updateQuery:any, options?:NeDB.UpdateOptions, cb?:(err:Error, numberOfUpdated:number, upsert:boolean)=>void):void; - /** - * Update all docs matching query v1.8 signature. - * For now, very naive implementation (recalculating the whole database) - * @param {any} query - * @param {any} updateQuery - * @param {Object} options Optional options - * options.multi If true, can update multiple documents (defaults to false) - * options.upsert If true, document is inserted if the query doesn't match anything - * @param {Function} cb Optional callback, signature: err, - * numAffected, - * affectedDocuments (when returnUpdatedDocs is set to true), obj or array - * upsert (set to true if the update was in fact an upsert) - * - * @api private Use Datastore.update which has the same signature - */ - update(query:any, updateQuery:any, options?:NeDB.UpdateOptions, cb?:(err:Error, numberOfUpdated:number, affectedDocuments:any, upsert:boolean)=>void):void; + 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 @@ -164,32 +159,45 @@ declare class NeDBDataStore { * * @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; + 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 { +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; + 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; + 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 + 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 + // 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 + onload?: (error: Error) => any + // (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) + afterSerialization?: (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) + beforeDeserialization?: (line: string) => string; + // (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 + corruptAlertThreshold?: number; } /** @@ -206,18 +214,18 @@ declare namespace NeDB { * 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 + multi?: boolean } interface EnsureIndexOptions { - fieldName:string; - unique?:boolean; - sparse?:boolean; + fieldName: string; + unique?: boolean; + sparse?: boolean; } interface Persistence { - compactDatafile():void; - setAutocompactionInterval(interval:number):void; - stopAutocompaction():void; + compactDatafile(): void; + setAutocompactionInterval(interval: number): void; + stopAutocompaction(): void; } } diff --git a/nedb/nedb-tests.ts b/nedb/nedb-tests.ts index 5faa3d0ffb..e90b682c68 100644 --- a/nedb/nedb-tests.ts +++ b/nedb/nedb-tests.ts @@ -2,193 +2,152 @@ * Created by stefansteinhart on 31.01.15. */ -/// /// - import * as es6styleimport from 'nedb'; -import Q = require('q'); import nedb = require('nedb'); class BaseCollection { + private dataStore: nedb; - private dataStore:nedb; - - constructor(dataStore:nedb) { - + constructor(dataStore: nedb) { this.dataStore = dataStore; } - public insert(document:T):Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.insert(document, function (err:Error, newDoc:T) { // Callback is optional - // newDoc is the newly inserted document, including its _id - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(newDoc); - } + insert(document: T): Promise { + return new Promise((resolve, reject) => { + this.dataStore.insert(document, (err: Error, newDoc: T) => { // Callback is optional + // newDoc is the newly inserted document, including its _id + if (err) { + reject(err); + } else { + resolve(newDoc); + } + }); }); - - return deferred.promise; } - public count():Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.count({}, function (err:Error, count:number) { - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(count); - } + count(): Promise { + return new Promise((resolve, reject) => { + this.dataStore.count({}, (err: Error, count: number) => { + if (err) { + reject(err); + } else { + resolve(count); + } + }); }); - - return deferred.promise; } - public countBy(criteria:any):Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.count(criteria, function (err:Error, count:number) { - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(count); - } + countBy(criteria: any): Promise { + return new Promise((resolve, reject) => { + this.dataStore.count(criteria, (err: Error, count: number) => { + if (err) { + reject(err); + } else { + resolve(count); + } + }); }); - - return deferred.promise; } - public findByID(id:string):Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.findOne({_id: id}, function (err:Error, doc:T) { - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(doc); - } + findByID(id: string): Promise { + return new Promise((resolve, reject) => { + this.dataStore.findOne({_id: id}, (err: Error, doc: T) => { + if (err) { + reject(err); + } else { + resolve(doc); + } + }); }); - - return deferred.promise; } - public findOne(criteria:any):Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.findOne(criteria, function (err:Error, doc:T) { - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(doc); - } + findOne(criteria: any): Promise { + return new Promise((resolve, reject) => { + this.dataStore.findOne(criteria, (err: Error, doc: T) => { + if (err) { + reject(err); + } else { + resolve(doc); + } + }); }); - - return deferred.promise; } - public find(criteria:any):Q.Promise> { - - var deferred = Q.defer>(); - - this.dataStore.find(criteria, function (err:Error, docs:Array) { - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(docs); - } + find(criteria: any): Promise { + return new Promise((resolve, reject) => { + this.dataStore.find(criteria, (err: Error, docs: T[]) => { + if (err) { + reject(err); + } + else { + resolve(docs); + } + }); }); - - return deferred.promise; } - public all():Q.Promise> { - - var deferred = Q.defer>(); - - this.dataStore.find({}, function (err:Error, docs:Array) { - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(docs); - } + all(): Promise { + return new Promise((resolve, reject) => { + this.dataStore.find({}, (err: Error, docs: T[]) => { + if (err) { + reject(err); + } else { + resolve(docs); + } + }); }); - - return deferred.promise; } - public upsert(query:any, updateQuery:any):Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.update(query, updateQuery, {upsert: true}, function (err:Error, numberOfUpdated:number, upsert: boolean) { - if (err) { - deferred.reject(err); - } - else { - //deferred.resolve(newDoc); - } + upsert(query: any, updateQuery: any): Promise { + const a: Promise = new Promise((resolve, reject) => { + this.dataStore.update(query, updateQuery, {upsert: true}, (err: Error, numberOfUpdated: number, upsert: boolean) => { + if (err) { + reject(err); + } else { + //resolve(newDoc); + } + }); }); - this.dataStore.update(query, updateQuery, {upsert: true}, function (err:Error, numberOfUpdated:number, affectedDocs:any, upsert: boolean) { - if (err) { - deferred.reject(err); - } - else { - //deferred.resolve(newDoc); - } + const b: Promise = new Promise((resolve, reject) => { + this.dataStore.update(query, updateQuery, {upsert: true}, (err: Error, numberOfUpdated: number, affectedDocs: any, upsert: boolean) => { + if (err) { + reject(err); + } else { + //resolve(newDoc); + } + }); }); - return deferred.promise; + return a || b; } - public update(query:Object, updateQuery:Object, options?:any):Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.update(query, updateQuery, options, function (err:Error, numberOfUpdated:number) { - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(numberOfUpdated); - } + update(query: {}, updateQuery: {}, options?: any): Promise { + return new Promise((resolve, reject) => { + this.dataStore.update(query, updateQuery, options, (err: Error, numberOfUpdated: number) => { + if (err) { + reject(err); + } else { + resolve(numberOfUpdated); + } + }); }); - - return deferred.promise; } - public remove(criteria:any):Q.Promise { - - var deferred = Q.defer(); - - this.dataStore.remove(criteria, function (err:Error, numberOfDeletedEntrys:number) { - - if (err) { - deferred.reject(err); - } - else { - deferred.resolve(numberOfDeletedEntrys); - } + remove(criteria: any): Promise { + return new Promise((resolve, reject) => { + this.dataStore.remove(criteria, (err: Error, numberOfDeletedEntrys: number) => { + if (err) { + reject(err); + } + else { + resolve(numberOfDeletedEntrys); + } + }); }); - - return deferred.promise; } } @@ -199,7 +158,7 @@ var db = new Datastore(); // Type 2: Persistent datastore with manual loading db = new Datastore({filename: 'path/to/datafile'}); -db.loadDatabase(function (err) { // Callback is optional +db.loadDatabase((err) => { // Callback is optional // Now commands will be executed }); @@ -217,7 +176,7 @@ db = new Datastore({filename: path.join(require('nw.gui').App.dataPath, 'somethi // Of course you can create multiple datastores if you need several // collections. In this case it's usually a good idea to use autoload for all collections. -var dbContainer:any = {}; +var dbContainer: any = {}; dbContainer.users = new Datastore('path/to/users.db'); dbContainer.robots = new Datastore('path/to/robots.db'); @@ -225,7 +184,7 @@ dbContainer.robots = new Datastore('path/to/robots.db'); dbContainer.users.loadDatabase(); dbContainer.robots.loadDatabase(); -var doc:any = { +var doc: any = { hello: 'world' , n: 5 , today: new Date() @@ -236,151 +195,151 @@ var doc:any = { , infos: {name: 'nedb'} }; -db.insert(doc, function (err:Error, newDoc:any) { // Callback is optional +db.insert(doc, (err: Error, newDoc: any) => { // Callback is optional // newDoc is the newly inserted document, including its _id // newDoc has no key called notToBeSaved since its value was undefined }); -db.insert([{a: 5}, {a: 42}], function (err:Error, newdocs:Array) { +db.insert([{a: 5}, {a: 42}], (err: Error, newdocs: any[]) => { // Two documents were inserted in the database // newDocs is an array with these documents, augmented with their _id }); // If there is a unique constraint on field 'a', this will fail -db.insert([{a: 5}, {a: 42}, {a: 5}], function (err:Error) { +db.insert([{a: 5}, {a: 42}, {a: 5}], (err: Error) => { // err is a 'uniqueViolated' error // The database was not modified }); // Finding all planets in the solar system -db.find({system: 'solar'}, function (err:Error, docs:Array) { +db.find({system: 'solar'}, (err: Error, docs: any[]) => { // docs is an array containing documents Mars, Earth, Jupiter // If no document is found, docs is equal to [] }); // Finding all planets whose name contain the substring 'ar' using a regular expression -db.find({planet: /ar/}, function (err:Error, docs:Array) { +db.find({planet: /ar/}, (err: Error, docs: any[]) => { // docs contains Mars and Earth }); // Finding all inhabited planets in the solar system -db.find({system: 'solar', inhabited: true}, function (err:Error, docs:Array) { +db.find({system: 'solar', inhabited: true}, (err: Error, docs: any[]) => { // docs is an array containing document Earth only }); // Use the dot-notation to match fields in subdocuments -db.find({"humans.genders": 2}, function (err:Error, docs:Array) { +db.find({"humans.genders": 2}, (err: Error, docs: any[]) => { // docs contains Earth }); // Use the dot-notation to navigate arrays of subdocuments -db.find({"completeData.planets.name": "Mars"}, function (err:Error, docs:Array) { +db.find({"completeData.planets.name": "Mars"}, (err: Error, docs: any[]) => { // docs contains document 5 }); -db.find({"completeData.planets.name": "Jupiter"}, function (err:Error, docs:Array) { +db.find({"completeData.planets.name": "Jupiter"}, (err: Error, docs: any[]) => { // docs is empty }); -db.find({"completeData.planets.0.name": "Earth"}, function (err:Error, docs:Array) { +db.find({"completeData.planets.0.name": "Earth"}, (err: Error, docs: any[]) => { // docs contains document 5 // If we had tested against "Mars" docs would be empty because we are matching against a specific array element }); // You can also deep-compare objects. Don't confuse this with dot-notation! -db.find({humans: {genders: 2}}, function (err:Error, docs:Array) { +db.find({humans: {genders: 2}}, (err: Error, docs: any[]) => { // docs is empty, because { genders: 2 } is not equal to { genders: 2, eyes: true } }); // Find all documents in the collection -db.find({}, function (err:Error, docs:Array) { +db.find({}, (err: Error, docs: any[]) => { }); // The same rules apply when you want to only find one document -db.findOne({_id: 'id1'}, function (err:Error, doc:any) { +db.findOne({_id: 'id1'}, (err: Error, doc: any) => { // doc is the document Mars // If no document is found, doc is null }); // $lt, $lte, $gt and $gte work on numbers and strings -db.find({"humans.genders": {$gt: 5}}, function (err:Error, docs:Array) { +db.find({"humans.genders": {$gt: 5}}, (err: Error, docs: any[]) => { // docs contains Omicron Persei 8, whose humans have more than 5 genders (7). }); // When used with strings, lexicographical order is used -db.find({planet: {$gt: 'Mercury'}}, function (err:Error, docs:Array) { +db.find({planet: {$gt: 'Mercury'}}, (err: Error, docs: any[]) => { // docs contains Omicron Persei 8 }) // Using $in. $nin is used in the same way -db.find({planet: {$in: ['Earth', 'Jupiter']}}, function (err:Error, docs:Array) { +db.find({planet: {$in: ['Earth', 'Jupiter']}}, (err: Error, docs: any[]) => { // docs contains Earth and Jupiter }); // Using $exists -db.find({satellites: {$exists: true}}, function (err:Error, docs:Array) { +db.find({satellites: {$exists: true}}, (err: Error, docs: any[]) => { // docs contains only Mars }); // Using $regex with another operator -db.find({planet: {$regex: /ar/, $nin: ['Jupiter', 'Earth']}}, function (err:Error, docs:Array) { +db.find({planet: {$regex: /ar/, $nin: ['Jupiter', 'Earth']}}, (err: Error, docs: any[]) => { // docs only contains Mars because Earth was excluded from the match by $nin }); // Using an array-specific comparison function // Note: you can't use nested comparison functions, e.g. { $size: { $lt: 5 } } will throw an error -db.find({satellites: {$size: 2}}, function (err:Error, docs:Array) { +db.find({satellites: {$size: 2}}, (err: Error, docs: any[]) => { // docs contains Mars }); -db.find({satellites: {$size: 1}}, function (err:Error, docs:Array) { +db.find({satellites: {$size: 1}}, (err: Error, docs: any[]) => { // docs is empty }); // If a document's field is an array, matching it means matching any element of the array -db.find({satellites: 'Phobos'}, function (err:Error, docs:Array) { +db.find({satellites: 'Phobos'}, (err: Error, docs: any[]) => { // docs contains Mars. Result would have been the same if query had been { satellites: 'Deimos' } }); // This also works for queries that use comparison operators -db.find({satellites: {$lt: 'Amos'}}, function (err:Error, docs:Array) { +db.find({satellites: {$lt: 'Amos'}}, (err: Error, docs: any[]) => { // docs is empty since Phobos and Deimos are after Amos in lexicographical order }); // This also works with the $in and $nin operator -db.find({satellites: {$in: ['Moon', 'Deimos']}}, function (err:Error, docs:Array) { +db.find({satellites: {$in: ['Moon', 'Deimos']}}, (err: Error, docs: any[]) => { // docs contains Mars (the Earth document is not complete!) }); -db.find({$or: [{planet: 'Earth'}, {planet: 'Mars'}]}, function (err:Error, docs:Array) { +db.find({$or: [{planet: 'Earth'}, {planet: 'Mars'}]}, (err: Error, docs: any[]) => { // docs contains Earth and Mars }); -db.find({$not: {planet: 'Earth'}}, function (err:Error, docs:Array) { +db.find({$not: {planet: 'Earth'}}, (err: Error, docs: any[]) => { // docs contains Mars, Jupiter, Omicron Persei 8 }); db.find({ - $where: function () { + $where() { return parseInt(Object.keys(this)[0]) > 6; } -}, function (err:Error, docs:Array) { +}, (err: Error, docs: any[]) => { // docs with more than 6 properties }); // You can mix normal queries, comparison queries and logical operators -db.find({$or: [{planet: 'Earth'}, {planet: 'Mars'}], inhabited: true}, function (err:Error, docs:Array) { +db.find({$or: [{planet: 'Earth'}, {planet: 'Mars'}], inhabited: true}, (err: Error, docs: any[]) => { // docs contains Earth }); // No query used means all results are returned (before the Cursor modifiers) -db.find({}).sort({planet: 1}).skip(1).limit(2).exec(function (err:Error, docs:Array) { +db.find({}).sort({planet: 1}).skip(1).limit(2).exec((err: Error, docs: any[]) => { // docs is [doc3, doc1] }); // You can sort in reverse order like this -db.find({system: 'solar'}).sort({planet: -1}).exec(function (err:Error, docs:Array) { +db.find({system: 'solar'}).sort({planet: -1}).exec((err: Error, docs: any[]) => { // docs is [doc1, doc3, doc2] }); @@ -390,38 +349,38 @@ db.find({}).sort({firstField: 1, secondField: -1}); // Same database as above // Keeping only the given fields -db.find({planet: 'Mars'}, {planet: 1, system: 1}, function (err:Error, docs:Array) { +db.find({planet: 'Mars'}, {planet: 1, system: 1}, (err: Error, docs: any[]) => { // docs is [{ planet: 'Mars', system: 'solar', _id: 'id1' }] }); // Keeping only the given fields but removing _id -db.find({planet: 'Mars'}, {planet: 1, system: 1, _id: 0}, function (err:Error, docs:Array) { +db.find({planet: 'Mars'}, {planet: 1, system: 1, _id: 0}, (err: Error, docs: any[]) => { // docs is [{ planet: 'Mars', system: 'solar' }] }); // Omitting only the given fields and removing _id -db.find({planet: 'Mars'}, {planet: 0, system: 0, _id: 0}, function (err:Error, docs:Array) { +db.find({planet: 'Mars'}, {planet: 0, system: 0, _id: 0}, (err: Error, docs: any[]) => { // docs is [{ inhabited: false, satellites: ['Phobos', 'Deimos'] }] }); // Failure: using both modes at the same time -db.find({planet: 'Mars'}, {planet: 0, system: 1}, function (err:Error, docs:Array) { +db.find({planet: 'Mars'}, {planet: 0, system: 1}, (err: Error, docs: any[]) => { // err is the error message, docs is undefined }); // You can also use it in a Cursor way but this syntax is not compatible with MongoDB // If upstream compatibility is important don't use this method -db.find({planet: 'Mars'}).projection({planet: 1, system: 1}).exec(function (err:Error, docs:Array) { +db.find({planet: 'Mars'}).projection({planet: 1, system: 1}).exec((err: Error, docs: any[]) => { // docs is [{ planet: 'Mars', system: 'solar', _id: 'id1' }] }); // Count all planets in the solar system -db.count({system: 'solar'}, function (err:Error, count:number) { +db.count({system: 'solar'}, (err: Error, count: number) => { // count equals to 3 }); // Count all documents in the datastore -db.count({}, function (err:Error, count:number) { +db.count({}, (err: Error, count: number) => { // count equals to 4 }); @@ -432,7 +391,7 @@ db.count({}, function (err:Error, count:number) { // { _id: 'id4', planet: 'Omicron Persia 8', system: 'futurama', inhabited: true } // Replace a document by another -db.update({planet: 'Jupiter'}, {planet: 'Pluton'}, {}, function (err:Error, numReplaced:number) { +db.update({planet: 'Jupiter'}, {planet: 'Pluton'}, {}, (err: Error, numReplaced: number) => { // numReplaced = 1 // The doc #3 has been replaced by { _id: 'id3', planet: 'Pluton' } // Note that the _id is kept unchanged, and the document has been replaced @@ -440,19 +399,19 @@ db.update({planet: 'Jupiter'}, {planet: 'Pluton'}, {}, function (err:Error, numR }); // Set an existing field's value -db.update({system: 'solar'}, {$set: {system: 'solar system'}}, {multi: true}, function (err:Error, numReplaced:number) { +db.update({system: 'solar'}, {$set: {system: 'solar system'}}, {multi: true}, (err: Error, numReplaced: number) => { // numReplaced = 3 // Field 'system' on Mars, Earth, Jupiter now has value 'solar system' }); // Setting the value of a non-existing field in a subdocument by using the dot-notation -db.update({planet: 'Mars'}, {$set: {"data.satellites": 2, "data.red": true}}, {}, function () { +db.update({planet: 'Mars'}, {$set: {"data.satellites": 2, "data.red": true}}, {}, () => { // Mars document now is { _id: 'id1', system: 'solar', inhabited: false // , data: { satellites: 2, red: true } // } // Not that to set fields in subdocuments, you HAVE to use dot-notation // Using object-notation will just replace the top-level field - db.update({planet: 'Mars'}, {$set: {data: {satellites: 3}}}, {}, function () { + db.update({planet: 'Mars'}, {$set: {data: {satellites: 3}}}, {}, () => { // Mars document now is { _id: 'id1', system: 'solar', inhabited: false // , data: { satellites: 3 } // } @@ -461,7 +420,7 @@ db.update({planet: 'Mars'}, {$set: {"data.satellites": 2, "data.red": true}}, {} }); // Deleting a field -db.update({planet: 'Mars'}, {$unset: {planet: true}}, {}, function () { +db.update({planet: 'Mars'}, {$unset: {planet: true}}, {}, () => { // Now the document for Mars doesn't contain the planet field // You can unset nested fields with the dot notation of course }); @@ -470,14 +429,14 @@ db.update({planet: 'Mars'}, {$unset: {planet: true}}, {}, function () { db.update({planet: 'Pluton'}, { planet: 'Pluton', inhabited: false -}, {upsert: true}, function (err:Error, numReplaced:number, upsert:boolean) { +}, {upsert: true}, (err: Error, numReplaced: number, upsert: boolean) => { // numReplaced = 1, upsert = { _id: 'id5', planet: 'Pluton', inhabited: false } // A new document { _id: 'id5', planet: 'Pluton', inhabited: false } has been added to the collection }); // If you upsert with a modifier, the upserted doc is the query modified by the modifier // This is simpler than it sounds :) -db.update({planet: 'Pluton'}, {$inc: {distance: 38}}, {upsert: true}, function () { +db.update({planet: 'Pluton'}, {$inc: {distance: 38}}, {upsert: true}, () => { // A new document { _id: 'id5', planet: 'Pluton', distance: 38 } has been added to the collection }); @@ -485,12 +444,12 @@ db.update({planet: 'Pluton'}, {$inc: {distance: 38}}, {upsert: true}, function ( // let's see how we can modify the array field atomically // $push inserts new elements at the end of the array -db.update({_id: 'id6'}, {$push: {fruits: 'banana'}}, {}, function () { +db.update({_id: 'id6'}, {$push: {fruits: 'banana'}}, {}, () => { // Now the fruits array is ['apple', 'orange', 'pear', 'banana'] }); // $pop removes an element from the end (if used with 1) or the front (if used with -1) of the array -db.update({_id: 'id6'}, {$pop: {fruits: 1}}, {}, function () { +db.update({_id: 'id6'}, {$pop: {fruits: 1}}, {}, () => { // Now the fruits array is ['apple', 'orange'] // With { $pop: { fruits: -1 } }, it would have been ['orange', 'pear'] }); @@ -498,23 +457,23 @@ db.update({_id: 'id6'}, {$pop: {fruits: 1}}, {}, function () { // $addToSet adds an element to an array only if it isn't already in it // Equality is deep-checked (i.e. $addToSet will not insert an object in an array already containing the same object) // Note that it doesn't check whether the array contained duplicates before or not -db.update({_id: 'id6'}, {$addToSet: {fruits: 'apple'}}, {}, function () { +db.update({_id: 'id6'}, {$addToSet: {fruits: 'apple'}}, {}, () => { // The fruits array didn't change // If we had used a fruit not in the array, e.g. 'banana', it would have been added to the array }); // $pull removes all values matching a value or even any NeDB query from the array -db.update({_id: 'id6'}, {$pull: {fruits: 'apple'}}, {}, function () { +db.update({_id: 'id6'}, {$pull: {fruits: 'apple'}}, {}, () => { // Now the fruits array is ['orange', 'pear'] }); -db.update({_id: 'id6'}, {$pull: {fruits: {$in: ['apple', 'pear']}}}, {}, function () { +db.update({_id: 'id6'}, {$pull: {fruits: {$in: ['apple', 'pear']}}}, {}, () => { // Now the fruits array is ['orange'] }); // $each can be used to $push or $addToSet multiple values at once // This example works the same way with $addToSet -db.update({_id: 'id6'}, {$push: {fruits: {$each: ['banana', 'orange']}}}, {}, function () { +db.update({_id: 'id6'}, {$push: {fruits: {$each: ['banana', 'orange']}}}, {}, () => { // Now the fruits array is ['apple', 'orange', 'pear', 'banana', 'orange'] }); @@ -526,33 +485,33 @@ db.update({_id: 'id6'}, {$push: {fruits: {$each: ['banana', 'orange']}}}, {}, fu // Remove one document from the collection // options set to {} since the default for multi is false -db.remove({_id: 'id2'}, {}, function (err:Error, numRemoved:number) { +db.remove({_id: 'id2'}, {}, (err: Error, numRemoved: number) => { // numRemoved = 1 }); // Remove multiple documents -db.remove({system: 'solar'}, {multi: true}, function (err:Error, numRemoved:number) { +db.remove({system: 'solar'}, {multi: true}, (err: Error, numRemoved: number) => { // numRemoved = 3 // All planets from the solar system were removed }); -db.ensureIndex({fieldName: 'somefield'}, function (err:Error) { +db.ensureIndex({fieldName: 'somefield'}, (err: Error) => { // If there was an error, err is not null }); // Using a unique constraint with the index -db.ensureIndex({fieldName: 'somefield', unique: true}, function (err:Error) { +db.ensureIndex({fieldName: 'somefield', unique: true}, (err: Error) => { }); // Using a sparse unique index -db.ensureIndex({fieldName: 'somefield', unique: true, sparse: true}, function (err:Error) { +db.ensureIndex({fieldName: 'somefield', unique: true, sparse: true}, (err: Error) => { }); // Format of the error message when the unique constraint is not met -db.insert({somefield: 'nedb'}, function (err:Error) { +db.insert({somefield: 'nedb'}, (err: Error) => { // err is null - db.insert({somefield: 'nedb'}, function (err:Error) { + db.insert({somefield: 'nedb'}, (err: Error) => { // err is { errorType: 'uniqueViolated' // , key: 'name' // , message: 'Unique constraint violated for key name' } @@ -560,5 +519,5 @@ db.insert({somefield: 'nedb'}, function (err:Error) { }); // Remove index on field somefield -db.removeIndex('somefield', function (err:Error) { +db.removeIndex('somefield', (err: Error) => { }); \ No newline at end of file diff --git a/nedb/tslint.json b/nedb/tslint.json new file mode 100644 index 0000000000..192203ab54 --- /dev/null +++ b/nedb/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file diff --git a/ng-file-upload/index.d.ts b/ng-file-upload/index.d.ts index d9aadbd2d5..cc5a59b2bf 100644 --- a/ng-file-upload/index.d.ts +++ b/ng-file-upload/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Angular File Upload 11.1.1 +// Type definitions for Angular File Upload 12.2 // Project: https://github.com/danialfarid/ng-file-upload -// Definitions by: John Reilly +// Definitions by: John Reilly , +// Eduardo Garcia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -103,10 +104,12 @@ declare module 'angular' { interface FileResizeOptions { centerCrop?: boolean; height?: number; - ratio?: number; + pattern?: string; + ratio?: number | string; resizeIf?: ResizeIfFunction; restoreExif?: boolean; quality?: number; + type?: string; width?: number; } diff --git a/ng-file-upload/ng-file-upload-tests.ts b/ng-file-upload/ng-file-upload-tests.ts index 08fbafdb6b..cc7f98d5bf 100644 --- a/ng-file-upload/ng-file-upload-tests.ts +++ b/ng-file-upload/ng-file-upload-tests.ts @@ -85,9 +85,11 @@ class UploadController { ratio: 0.9, centerCrop: true, restoreExif: true, - resizeIf: (width: number, height: number) => { + resizeIf: (width: number, height: number) => { return true; - } + }, + pattern: '.jpg', + type: 'image/jpeg' }) .then((resizedFile) => { console.log(resizedFile); 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-persist/index.d.ts b/node-persist/index.d.ts index 42d72fe587..bb8df33369 100644 --- a/node-persist/index.d.ts +++ b/node-persist/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// import * as Q from "q"; diff --git a/node-persist/tsconfig.json b/node-persist/tsconfig.json index f6bd656274..b2563c2ac3 100644 --- a/node-persist/tsconfig.json +++ b/node-persist/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/notNeededPackages.json b/notNeededPackages.json index 049791856c..af2743bacb 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1,94 +1,34 @@ { "packages": [ { - "libraryName": "Moment", - "typingsPackageName": "moment", - "sourceRepoURL": "https://github.com/moment/moment", - "asOfVersion": "2.13.0" + "libraryName": "ajv", + "typingsPackageName": "ajv", + "sourceRepoURL": "https://github.com/epoberezkin/ajv", + "asOfVersion": "1.0.0" + }, + { + "libraryName": "Numbro", + "typingsPackageName": "numbro", + "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", + "asOfVersion": "1.9.3" }, { - "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": "antd", + "typingsPackageName": "antd", + "sourceRepoURL": "https://github.com/ant-design/ant-design", "asOfVersion": "1.0.0" }, { - "libraryName": "TypeScript", - "typingsPackageName": "typescript", - "sourceRepoURL": "https://github.com/Microsoft/TypeScript", - "asOfVersion": "2.0.0" + "libraryName": "Argon2", + "typingsPackageName": "argon2", + "sourceRepoURL": "https://github.com/ranisalt/node-argon2", + "asOfVersion": "0.15.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", - "asOfVersion": "1.0.0" - }, - { - "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": "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 +48,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 +144,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 +180,30 @@ "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": "param-case", "typingsPackageName": "param-case", @@ -156,18 +222,90 @@ "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": "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-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 +318,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 +342,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,64 +355,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": "pixi-spine", - "typingsPackageName": "pixi-spine", - "sourceRepoURL": "https://github.com/pixijs/pixi-spine", - "asOfVersion": "1.4.2" - }, - { - "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": "FineUploader", - "typingsPackageName": "fine-uploader", - "sourceRepoURL": "http://fineuploader.com/", - "asOfVersion": "5.14.0" - }, - { - "libraryName": "mobservable", - "typingsPackageName": "mobservable", - "sourceRepoURL": "github.com/mweststrate/mobservable", - "asOfVersion": "1.2.5" + "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/o.js/index.d.ts b/o.js/index.d.ts index eaa6732c40..00a5f2b5ae 100644 --- a/o.js/index.d.ts +++ b/o.js/index.d.ts @@ -3,9 +3,9 @@ // Definitions by: Matteo Antony Mistretta , Brad Zacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - declare module 'o.js' { + import Q = require("q"); + interface Options { endpoint : string json ?: boolean diff --git a/o.js/tsconfig.json b/o.js/tsconfig.json index a72850afef..b16d5111e8 100644 --- a/o.js/tsconfig.json +++ b/o.js/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/orchestrator/index.d.ts b/orchestrator/index.d.ts index 23c8a0f507..c1eae16416 100644 --- a/orchestrator/index.d.ts +++ b/orchestrator/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - import * as Q from "q"; declare type Strings = string|string[]; diff --git a/orchestrator/tsconfig.json b/orchestrator/tsconfig.json index 1ce0c08b62..d3af83cd62 100644 --- a/orchestrator/tsconfig.json +++ b/orchestrator/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/pathwatcher/index.d.ts b/pathwatcher/index.d.ts index 0a44ee596b..61f084b6ca 100644 --- a/pathwatcher/index.d.ts +++ b/pathwatcher/index.d.ts @@ -4,8 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +import { EventEmitter } from "events"; import * as Q from "q"; export as namespace PathWatcher; @@ -28,7 +28,7 @@ export interface IFile { getBaseName():string; write(text:string):void; readSync(flushCache:boolean):string; - read(flushCache?:boolean):Q.Promise; + read(flushCache?:boolean): Promise; // exists():boolean; existsSync():boolean; setDigest(contents:string):void; @@ -62,10 +62,7 @@ export interface IDirectory { isPathPrefixOf(prefix:string, fullPath:string):boolean; } - -import events = require("events"); - -export interface IHandleWatcher extends events.EventEmitter { +export interface IHandleWatcher extends EventEmitter { onEvent(event:any, filePath:any, oldFilePath:any):any; start():void; closeIfNoListener():void; diff --git a/pathwatcher/tsconfig.json b/pathwatcher/tsconfig.json index 199b1ce4e0..00b8e7052f 100644 --- a/pathwatcher/tsconfig.json +++ b/pathwatcher/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true 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 c8772b115c..0000000000 --- a/paymentrequest/paymentrequest-tests.ts +++ /dev/null @@ -1,116 +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/platform/index.d.ts b/platform/index.d.ts index c02615b932..fd995a085e 100644 --- a/platform/index.d.ts +++ b/platform/index.d.ts @@ -1,10 +1,9 @@ -// Type definitions for Platform 1.0.0 +// Type definitions for Platform 1.3 // Project: https://github.com/bestiejs/platform.js // Definitions by: Jake Hickman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface PlatformStatic { +declare interface Platform { description?: string; layout?: string; manufacturer?: string; @@ -13,18 +12,19 @@ interface PlatformStatic { product?: string; ua?: string; version?: string; - os?: PlatformOS; - parse?(ua: string): PlatformStatic; + os?: { + architecture?: number; + family?: string; + version?: string; + toString(): string; + }; + parse?(ua: string): Platform; toString?(): string; } -interface PlatformOS { - architecture?: number; //platform's docs say this is a string, but their code doesn't agree - family?: string; - version?: string; - toString(): string; +declare var platform: Platform; + +declare module "platform" { + export = platform; } -declare var platform: PlatformStatic; - - diff --git a/platform/platform-tests.ts b/platform/platform-tests.ts index ce24ada335..65433ffb13 100644 --- a/platform/platform-tests.ts +++ b/platform/platform-tests.ts @@ -1,11 +1,8 @@ - - -interface ITestContainer { - [name: string]: PlatformStatic; +interface TestContainer { + [name: string]: Platform; } - -var tests: ITestContainer = { +var tests: TestContainer = { 'Chrome Mobile 16.0.912.77 on Android 4.0.3': { description: "Chrome Mobile 16.0.912.77 on Android 4.0.3", layout: "WebKit", @@ -40,41 +37,36 @@ var tests: ITestContainer = { function runTests() { - var t: PlatformStatic; - var p: PlatformStatic; + var t: Platform; + var p: Platform; var x: string; var px: any; var res: boolean; var onFalse: (name: string) => () => any; - for (var n in tests) { - + for (const [n, value] of Object.entries(tests)) { t = tests[n]; p = platform.parse(t.ua); - onFalse = (name: string) => { return () => { console.log('\tfailed on prop "' + name + '" for "' + n + '"'); - } - } + }; + }; console.log('Starting tests for: ' + n); - falsy(() => { return t.description === p.description }, onFalse('description')); - falsy(() => { return t.layout === p.layout }, onFalse('layout')); - falsy(() => { return t.name === p.name }, onFalse('name')); - falsy(() => { return t.prerelease === p.prerelease }, onFalse('prerelease')); - falsy(() => { return t.ua === p.ua }, onFalse('ua')); - falsy(() => { return t.version === p.version }, onFalse('version')); - - falsy(() => { return t.os.architecture === p.os.architecture }, onFalse('os.architecture')); - falsy(() => { return t.os.family === p.os.family }, onFalse('os.family')); - falsy(() => { return t.os.version === p.os.version }, onFalse('os.version')); + falsy(() => t.description === p.description, onFalse('description')); + falsy(() => t.layout === p.layout, onFalse('layout')); + falsy(() => t.name === p.name, onFalse('name')); + falsy(() => t.prerelease === p.prerelease, onFalse('prerelease')); + falsy(() => t.ua === p.ua, onFalse('ua')); + falsy(() => t.version === p.version, onFalse('version')); + falsy(() => t.os.architecture === p.os.architecture, onFalse('os.architecture')); + falsy(() => t.os.family === p.os.family, onFalse('os.family')); + falsy(() => t.os.version === p.os.version, onFalse('os.version')); console.log('Finished tests for: ' + n); - - } } diff --git a/platform/tsconfig.json b/platform/tsconfig.json index c7a29f12be..2efb10866a 100644 --- a/platform/tsconfig.json +++ b/platform/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", + "es2017", "dom" ], "noImplicitAny": true, diff --git a/promise-pg/index.d.ts b/promise-pg/index.d.ts index 5deba594a1..d93f13d8c0 100644 --- a/promise-pg/index.d.ts +++ b/promise-pg/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// import * as stream from 'stream'; import * as pg from 'pg'; diff --git a/promise-pg/tsconfig.json b/promise-pg/tsconfig.json index 0f74dbb52b..b28fb9baa9 100644 --- a/promise-pg/tsconfig.json +++ b/promise-pg/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/promise-pool/index.d.ts b/promise-pool/index.d.ts index 810b629ee2..51af449480 100644 --- a/promise-pool/index.d.ts +++ b/promise-pool/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// import * as Q from "q"; /** diff --git a/promise-pool/tsconfig.json b/promise-pool/tsconfig.json index b72557a58b..f7be6ce41d 100644 --- a/promise-pool/tsconfig.json +++ b/promise-pool/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": 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/protractor-helpers/protractor-helpers-tests.ts b/protractor-helpers/protractor-helpers-tests.ts index 9b03e43005..543991392b 100644 --- a/protractor-helpers/protractor-helpers-tests.ts +++ b/protractor-helpers/protractor-helpers-tests.ts @@ -1,5 +1,3 @@ -/// - import helpers = require('protractor-helpers'); declare var $$: any, $: any, by: any, element: any; // ?? diff --git a/q-io/index.d.ts b/q-io/index.d.ts index b69a9c72e0..783f70ddc4 100644 --- a/q-io/index.d.ts +++ b/q-io/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// //TODO add support for q-io/http-apps //TODO add verified support for q-io/fs-mock @@ -15,94 +14,94 @@ 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; //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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 canonical(path: string): Q.Promise; + export function readLink(path: string): Q.Promise; - export function contains(parent:string, child:string):boolean; + export function contains(parent: string, child: string): boolean; - export function relative(source:string, target:string):Q.Promise; + 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 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 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; + 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 reroot(path: string): typeof QioFS; - export function toObject(path:string):{[path:string]:Buffer}; + export function toObject(path: string): { [path: string]: Buffer }; //listed but not implemented by Q-io //export function glob(pattern):Q.Promise; @@ -110,116 +109,116 @@ declare namespace QioFS { //TODO link this to node.js FS module (no lazy clones) interface Stats { - node:NodeStats; - size:number; + 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; + 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 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 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; + 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; + url: string; + path: string; + scriptName: string; + pathInfo: string; + version: string[]; + method: string; + scheme: string; - host:string; - port:number; - remoteHost:string; - remotePort:number; + host: string; + port: number; + remoteHost: string; + remotePort: number; - headers:Headers; - agent:any; - body:any; - node:any; + headers: Headers; + agent: any; + body: any; + node: any; } interface Response { - status:number; - headers:Headers; - body:Qio.Reader - onclose:() => void; - node:any; + status: number; + headers: Headers; + body: Qio.Reader + onclose: () => void; + node: any; } interface Headers { - [name:string]:any; + [name: string]: any; // [name:string]:any[]; } interface Body extends Qio.Stream { } interface Application { - (req:Request):Q.Promise; + (req: Request): Q.Promise; } } declare namespace Qio { interface ForEachCallback { - (chunk:Buffer):Q.Promise; - (chunk:string):Q.Promise; + (chunk: Buffer): Q.Promise; + (chunk: string): Q.Promise; } interface ForEach { - forEach(callback:ForEachCallback):Q.Promise; + forEach(callback: ForEachCallback): Q.Promise; } interface Reader extends ForEach { - read(charset:string):Q.Promise; - read():Q.Promise; - close():void; + 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; + 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; + 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 { @@ -227,31 +226,32 @@ declare namespace Qio { } } interface QioBufferReader { - new ():Qio.Reader; - read(stream:Qio.Reader, charset:string):string; - read(stream:Qio.Reader):Buffer; - join(buffers:Buffer[]):Buffer; + 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; + (writer: Buffer): Qio.Writer; + Writer: Qio.Writer; } interface QioBufferStream { - (buffer:Buffer, encoding:string):Qio.Stream + (buffer: Buffer, encoding: string): Qio.Stream } declare module "q-io/http" { -export = QioHTTP; + import * as Q from "q"; + export = QioHTTP; } declare module "q-io/fs" { -export = QioFS; + export = QioFS; } declare module "q-io/reader" { -export = QioBufferReader; + export = QioBufferReader; } declare module "q-io/writer" { -export = QioBufferWriter; + export = QioBufferWriter; } declare module "q-io/buffer-stream" { -export = QioBufferStream; + export = QioBufferStream; } diff --git a/q-io/q-io-tests.ts b/q-io/q-io-tests.ts index ae6d14d623..fb5e7e97c2 100644 --- a/q-io/q-io-tests.ts +++ b/q-io/q-io-tests.ts @@ -1,5 +1,3 @@ -import * as Q from 'q'; - var fs:typeof QioFS = require('q-io/fs'); var http:typeof QioHTTP = require('q-io/http'); diff --git a/q-io/tsconfig.json b/q-io/tsconfig.json index a0afa359c6..cccbe944b1 100644 --- a/q-io/tsconfig.json +++ b/q-io/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/q-retry/index.d.ts b/q-retry/index.d.ts index dbdf914b6c..2d06f97f2e 100644 --- a/q-retry/index.d.ts +++ b/q-retry/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: VILIC VANE // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - import * as Q from 'q'; export = Q; diff --git a/q-retry/tsconfig.json b/q-retry/tsconfig.json index 8b9a3250f4..19c7cb8412 100644 --- a/q-retry/tsconfig.json +++ b/q-retry/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/q/index.d.ts b/q/index.d.ts index c6f2a068a7..c4c1af5ec0 100644 --- a/q/index.d.ts +++ b/q/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for Q +// Type definitions for Q 1.0 // Project: https://github.com/kriskowal/q // Definitions by: Barrie Nemetchek , Andrew Gaspar , John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 export = Q; export as namespace Q; @@ -21,12 +22,12 @@ declare function Q(value: T): Q.Promise; declare function Q(): Q.Promise; declare namespace Q { - type IWhenable = IPromise | T; - interface IPromise { + export type IWhenable = IPromise | T; + export interface IPromise { then(onFulfill?: (value: T) => IWhenable, onReject?: (error: any) => IWhenable): IPromise; } - interface Deferred { + export interface Deferred { promise: Promise; resolve(value?: IWhenable): void; reject(reason: any): void; @@ -34,7 +35,7 @@ declare namespace Q { makeNodeResolver(): (reason: any, value: T) => void; } - interface Promise { + export interface Promise { /** * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. @@ -167,11 +168,8 @@ declare namespace Q { inspect(): PromiseState; } - interface PromiseState { - /** - * "fulfilled", "rejected", "pending" - */ - state: string; + export interface PromiseState { + state: "fulfilled" | "rejected" | "pending"; value?: T; reason?: any; } @@ -185,11 +183,8 @@ declare namespace Q { // If a non-promise value is provided, it will not reject or progress export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: (reason: any) => IWhenable, onProgress?: (progress: any) => any): Promise; - /** - * Currently "impossible" (and I use the term loosely) to implement due to TypeScript limitations as it is now. - * See: https://github.com/Microsoft/TypeScript/issues/1784 for discussion on it. - */ - // export function try(method: Function, ...args: any[]): Promise; + function _try(method: Function, ...args: any[]): Promise; + export { _try as try }; export function fbind(method: (...args: any[]) => IWhenable, ...args: any[]): (...args: any[]) => Promise; diff --git a/q/q-tests.ts b/q/q-tests.ts index 7ebc35adb3..5f79d7f1e4 100644 --- a/q/q-tests.ts +++ b/q/q-tests.ts @@ -224,3 +224,14 @@ var p2: Q.Promise<[string, number]> = y1.then(val => Q.all(val)); var p3: Q.Promise<[string, number]> = Q.all(y1); var p5: Q.Promise<[string, number]> = y2.then(val => Q.all(val)); var p6: Q.Promise<[string, number]> = Q.all(y2); + + +Q.try(function () { + if (Math.random() % 2) { + throw new Error("The cloud is down!"); + } + return true; +}) +.catch(function (error) { + console.error("Couldn't sync to the cloud", error); +}); \ No newline at end of file diff --git a/q/v0/index.d.ts b/q/v0/index.d.ts new file mode 100644 index 0000000000..6b2deb3161 --- /dev/null +++ b/q/v0/index.d.ts @@ -0,0 +1,357 @@ +// Type definitions for Q +// Project: https://github.com/kriskowal/q +// Definitions by: Barrie Nemetchek , Andrew Gaspar , John Reilly +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = Q; +export as namespace Q; + +/** + * If value is a Q promise, returns the promise. + * If value is a promise from another library it is coerced into a Q promise (where possible). + */ +declare function Q(promise: Q.IPromise): Q.Promise; +/** + * If value is not a promise, returns a promise that is fulfilled with value. + */ +declare function Q(value: T): Q.Promise; +/** + * Calling with nothing at all creates a void promise + */ +declare function Q(): Q.Promise; + +declare namespace Q { + type IWhenable = IPromise | T; + interface IPromise { + then(onFulfill?: (value: T) => IWhenable, onReject?: (error: any) => IWhenable): IPromise; + } + + interface Deferred { + promise: Promise; + resolve(value?: IWhenable): void; + reject(reason: any): void; + notify(value: any): void; + makeNodeResolver(): (reason: any, value: T) => void; + } + + interface Promise { + /** + * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. + + * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise returned from callback is finished. + */ + fin(finallyCallback: () => any): Promise; + /** + * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. + + * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise returned from callback is finished. + */ + finally(finallyCallback: () => any): Promise; + + /** + * The then method from the Promises/A+ specification, with an additional progress handler. + */ + then(onFulfill?: (value: T) => IWhenable, onReject?: (error: any) => IWhenable, onProgress?: Function): Promise; + + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * + * This is especially useful in conjunction with all + */ + spread(onFulfill: (...args: any[]) => IWhenable, onReject?: (reason: any) => IWhenable): Promise; + + fail(onRejected: (reason: any) => IWhenable): Promise; + + /** + * A sugar method, equivalent to promise.then(undefined, onRejected). + */ + catch(onRejected: (reason: any) => IWhenable): Promise; + + /** + * A sugar method, equivalent to promise.then(undefined, undefined, onProgress). + */ + progress(onProgress: (progress: any) => any): Promise; + + /** + * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, either because promise is rejected and no onRejected callback was provided, or because onFulfilled or onRejected threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a future turn of the event loop. + * + * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions thrown in then callbacks are consumed and transformed into rejections, exceptions at the end of the chain are easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the event loop, so that it won't be caught, it causes an onerror event on the browser window, or an uncaughtException event on Node.js's process object. + * + * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, exceptions will be delivered there instead of thrown in a future turn. + * + * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends with you, call done to terminate it. + */ + done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; + + /** + * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. If callback is not a function, simply returns promise. + */ + nodeify(callback: (reason: any, value: any) => void): Promise; + + /** + * Returns a promise to get the named property of an object. Essentially equivalent to + * + * promise.then(function (o) { + * return o[propertyName]; + * }); + */ + get(propertyName: String): Promise; + set(propertyName: String, value: any): Promise; + delete(propertyName: String): Promise; + /** + * Returns a promise for the result of calling the named method of an object with the given array of arguments. The object itself is this in the function, just like a synchronous method call. Essentially equivalent to + * + * promise.then(function (o) { + * return o[methodName].apply(o, args); + * }); + */ + post(methodName: String, args: any[]): Promise; + /** + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. The object itself is this in the function, just like a synchronous method call. + */ + invoke(methodName: String, ...args: any[]): Promise; + fapply(args: any[]): Promise; + fcall(...args: any[]): Promise; + + /** + * Returns a promise for an array of the property names of an object. Essentially equivalent to + * + * promise.then(function (o) { + * return Object.keys(o); + * }); + */ + keys(): Promise; + + /** + * A sugar method, equivalent to promise.then(function () { return value; }). + */ + thenResolve(value: U): Promise; + /** + * A sugar method, equivalent to promise.then(function () { throw reason; }). + */ + thenReject(reason: any): Promise; + + /** + * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for that same value, perhaps deferred but not replaced by the promise returned by the onFulfilled handler. + */ + tap(onFulfilled: (value: T) => any): Promise; + + timeout(ms: number, message?: string): Promise; + /** + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + */ + delay(ms: number): Promise; + + /** + * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. + */ + isFulfilled(): boolean; + /** + * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. + */ + isRejected(): boolean; + /** + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + */ + isPending(): boolean; + + valueOf(): any; + + /** + * Returns a "state snapshot" object, which will be in one of three forms: + * + * - { state: "pending" } + * - { state: "fulfilled", value: } + * - { state: "rejected", reason: } + */ + inspect(): PromiseState; + } + + interface PromiseState { + state: "fulfilled" | "rejected" | "pending"; + value?: T; + reason?: any; + } + + // If no value provided, returned promise will be of void type + export function when(): Promise; + + // if no fulfill, reject, or progress provided, returned promise will be of same type + export function when(value: IWhenable): Promise; + + // If a non-promise value is provided, it will not reject or progress + export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: (reason: any) => IWhenable, onProgress?: (progress: any) => any): Promise; + + /** + * Currently "impossible" (and I use the term loosely) to implement due to TypeScript limitations as it is now. + * See: https://github.com/Microsoft/TypeScript/issues/1784 for discussion on it. + */ + // export function try(method: Function, ...args: any[]): Promise; + + export function fbind(method: (...args: any[]) => IWhenable, ...args: any[]): (...args: any[]) => Promise; + + export function fcall(method: (...args: any[]) => T, ...args: any[]): Promise; + + export function send(obj: any, functionName: string, ...args: any[]): Promise; + export function invoke(obj: any, functionName: string, ...args: any[]): Promise; + export function mcall(obj: any, functionName: string, ...args: any[]): Promise; + + export function denodeify(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; + export function nbind(nodeFunction: Function, thisArg: any, ...args: any[]): (...args: any[]) => Promise; + export function nfbind(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; + export function nfcall(nodeFunction: Function, ...args: any[]): Promise; + export function nfapply(nodeFunction: Function, args: any[]): Promise; + + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function npost(nodeModule: any, functionName: string, args: any[]): Promise; + export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; + + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: IWhenable<[IWhenable, IWhenable, IWhenable, IWhenable, IWhenable, IWhenable]>): Promise<[A, B, C, D, E, F]>; + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: IWhenable<[IWhenable, IWhenable, IWhenable, IWhenable, IWhenable]>): Promise<[A, B, C, D, E]>; + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: IWhenable<[IWhenable, IWhenable, IWhenable, IWhenable]>): Promise<[A, B, C, D]>; + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: IWhenable<[IWhenable, IWhenable, IWhenable]>): Promise<[A, B, C]>; + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: IWhenable<[IWhenable, IWhenable]>): Promise<[A, B]>; + /** + * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. + */ + export function all(promises: IWhenable[]>): Promise; + + /** + * Returns a promise for the first of an array of promises to become settled. + */ + export function race(promises: IWhenable[]): Promise; + + /** + * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. + */ + export function allSettled(promises: IWhenable[]>): Promise[]>; + + export function allResolved(promises: IWhenable[]>): Promise[]>; + + /** + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. + * This is especially useful in conjunction with all. + */ + export function spread(promises: IWhenable[], onFulfilled: (...args: T[]) => IWhenable, onRejected?: (reason: any) => IWhenable): Promise; + + /** + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". + */ + export function timeout(promise: Promise, ms: number, message?: string): Promise; + + /** + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + */ + export function delay(promise: Promise, ms: number): Promise; + /** + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + */ + export function delay(value: T, ms: number): Promise; + /** + * Returns a promise that will be fulfilled with undefined after at least ms milliseconds have passed. + */ + export function delay(ms: number): Promise ; + /** + * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. + */ + export function isFulfilled(promise: Promise): boolean; + /** + * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. + */ + export function isRejected(promise: Promise): boolean; + /** + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + */ + export function isPending(promise: Promise): boolean; + + /** + * Returns a "deferred" object with a: + * promise property + * resolve(value) method + * reject(reason) method + * notify(value) method + * makeNodeResolver() method + */ + export function defer(): Deferred; + + /** + * Returns a promise that is rejected with reason. + */ + export function reject(reason?: any): Promise; + + export function Promise(resolver: (resolve: (val: IWhenable) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; + + /** + * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their fulfillment values before calling the original func. The returned version also always returns a promise: if func does a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. + * + * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that the function always returns a promise even in the face of unintentional thrown exceptions. + */ + export function promised(callback: (...args: any[]) => T): (...args: any[]) => Promise; + + /** + * Returns whether the given value is a Q promise. + */ + export function isPromise(object: any): boolean; + /** + * Returns whether the given value is a promise (i.e. it's an object with a then function). + */ + export function isPromiseAlike(object: any): boolean; + /** + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + */ + export function isPending(object: any): boolean; + /** + * If an object is not a promise, it is as "near" as possible. + * If a promise is rejected, it is as "near" as possible too. + * If it’s a fulfilled promise, the fulfillment value is nearer. + * If it’s a deferred promise and the deferred has been resolved, the + * resolution is "nearer". + */ + export function nearer(promise: Promise): T; + + /** + * This is an experimental tool for converting a generator function into a deferred function. This has the potential of reducing nested callbacks in engines that support yield. + */ + export function async(generatorFunction: any): (...args: any[]) => Promise; + export function nextTick(callback: Function): void; + + /** + * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the event loop, usually as a result of done. Can be useful for getting the full stack trace of an error in browsers, which is not usually possible with window.onerror. + */ + export var onerror: (reason: any) => void; + /** + * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked across asynchronous promise operations, so that if an uncaught error is thrown by done or a rejection reason's stack property is inspected in a rejection callback, a long stack trace is produced. + */ + export var longStackSupport: boolean; + + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ + export function resolve(object: IWhenable): Promise; + + /** + * Resets the global "Q" variable to the value it has before Q was loaded. + * This will either be undefined if there was no version or the version of Q which was already loaded before. + * @returns { The last version of Q. } + */ + export function noConflict(): typeof Q; +} diff --git a/q/v0/q-tests.ts b/q/v0/q-tests.ts new file mode 100644 index 0000000000..7ebc35adb3 --- /dev/null +++ b/q/v0/q-tests.ts @@ -0,0 +1,226 @@ +/// + + +import Q = require('q'); + +Q(8).then(x => console.log(x.toExponential())); +Q().then(() => console.log("nothing")); + +var delay = function (delay: number) { + var d = Q.defer(); + setTimeout(d.resolve, delay); + return d.promise; +}; + +Q.when(delay(1000), function (val: void) { + console.log('Hello, World!'); + return; +}); + +// Note from Q documentation: a deferred can be resolved with a value or a promise. +var otherPromise = Q.defer().promise; +Q.defer().resolve(otherPromise); + +Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then(d => d.toJSON()); + +Q.delay(Q(8), 1000).then(x => x.toExponential()); +Q.delay(8, 1000).then(x => x.toExponential()); +Q.delay(Q("asdf"), 1000).then(x => x.length); +Q.delay("asdf", 1000).then(x => x.length); + +var eventualAdd = Q.promised((a?: number, b?: number) => a + b); +eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); + +function eventually(eventually: T) { + return Q.delay(eventually, 1000); +}; + +var x = Q.all([1, 2, 3].map(eventually)); +Q.when(x, function (x) { + console.log(x); +}); + +Q.all([ + eventually(10), + eventually(20) +]).spread(function (x: number, y: number) { + console.log(x, y); +}); + +Q.all([ + eventually(10), + eventually(20) +]).then(function (results) { + let [x, y] = results; + console.log(x, y); +}); + + +Q.fcall(function () { }) + .then(function () { }) + .then(function () { }) + .then(function () { }) + .then(function (value4) { + // Do something with value4 + }, function (error) { + // Handle any error from step1 through step4 + }).done(); + +Q.allResolved([]) +.then(function (promises: Q.Promise[]) { + promises.forEach(function (promise) { + if (promise.isFulfilled()) { + var value = promise.valueOf(); + } else { + var exception = promise.valueOf().exception; + } + }) +}); + +Q(42) + .tap(() => "hello") + .tap(x => { + console.log(x); + }) + .then(x => { + console.log("42 == " + x); + }); + +declare var arrayPromise: Q.IPromise; +declare var stringPromise: Q.IPromise; +declare function returnsNumPromise(text: string): Q.Promise; +declare function returnsNumPromise(text: string): JQueryPromise; + +Q(arrayPromise) // type specification required + .then(arr => arr.join(',')) + .then(returnsNumPromise) // requires specification + .then(num => num.toFixed()); + +declare var jPromise: JQueryPromise; + +// if jQuery promises definition supported generics, this could be more interesting example +Q(jPromise).then(str => str.split(',')); +jPromise.then(returnsNumPromise); + +// watch the typing flow through from jQueryPromise to Q.Promise +Q(jPromise).then(str => str.split(',')); + +declare var promiseArray: Q.IPromise[]; +var qPromiseArray = promiseArray.map(p => Q(p)); +var myNums: any[] = [2, 3, Q(4), 5, Q(6), Q(7)]; + +Q.all(promiseArray).then(nums => nums.map(num => num.toPrecision(2)).join(',')); + +Q.all(myNums).then(nums => nums.map(Math.round)); + +Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); + +Q.when(8, num => num + "!"); +Q.when(Q(8), num => num + "!").then(str => str.split(',')); +var voidPromise: Q.Promise = Q.when(); + +declare function saveToDisk(): Q.Promise; +declare function saveToCloud(): Q.Promise; +Q.allSettled([saveToDisk(), saveToCloud()]).spread(function (disk: any, cloud: any) { + console.log("saved to disk:", disk.state === "fulfilled"); + console.log("saved to cloud:", cloud.state === "fulfilled"); + + if (disk.state === "fulfilled") { + console.log("value was " + disk.value); + } + else if (disk.state === "rejected") { + console.log("rejected because " + disk.reason); + } +}).done(); + +var nodeStyle = (input: string, cb: Function) => { + cb(null, input); +}; + +Q.nfapply(nodeStyle, ["foo"]).done((result: string) => {}); +Q.nfcall(nodeStyle, "foo").done((result: string) => {}); +Q.denodeify(nodeStyle)('foo').done((result: string) => {}); +Q.nfbind(nodeStyle)('foo').done((result: string) => {}); + + +class Repo { + private items: any[] = [ + { name: 'Max', cute: false }, + { name: 'Annie', cute: true } + ]; + + find(options: any): Q.Promise { + var result = this.items; + + for (var key in options) { + result = result.filter(i => i[key] == options[key]); + } + + return Q(result); + } +} + +var kitty = new Repo(); +Q.nbind(kitty.find, kitty)({ cute: true }).done((kitties: any[]) => {}); + + +/* + * Test: Can "rethrow" rejected promises + */ +namespace TestCanRethrowRejectedPromises { + + interface Foo { + a: number; + } + + function nestedBar(): Q.Promise { + var deferred = Q.defer(); + + return deferred.promise; + } + + function bar(): Q.Promise { + return nestedBar() + .then((foo:Foo) => { + console.log("Lorem ipsum"); + }) + .fail((error) => { + console.log("Intermediate error handling"); + + /* + * Cannot do this, because: + * error TS2322: Type 'Promise' is not assignable to type 'Promise' + */ + //throw error; + + return Q.reject(error); + }) + ; + } + + bar() + .finally(() => { + console.log("Cleanup") + }) + .done() + ; + +} + +// test Q.Promise.all +var y1 = Q().then(() => { + var s = Q("hello"); + var n = Q(1); + return <[typeof s, typeof n]>[s, n]; +}); + +var y2 = Q().then(() => { + var s = "hello"; + var n = Q(1); + return <[typeof s, typeof n]>[s, n]; +}); + +var p2: Q.Promise<[string, number]> = y1.then(val => Q.all(val)); +var p3: Q.Promise<[string, number]> = Q.all(y1); +var p5: Q.Promise<[string, number]> = y2.then(val => Q.all(val)); +var p6: Q.Promise<[string, number]> = Q.all(y2); diff --git a/service_worker_api/tsconfig.json b/q/v0/tsconfig.json similarity index 75% rename from service_worker_api/tsconfig.json rename to q/v0/tsconfig.json index 0c7c7ed734..c44ffeb935 100644 --- a/service_worker_api/tsconfig.json +++ b/q/v0/tsconfig.json @@ -8,16 +8,19 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "service_worker_api-tests.ts" + "q-tests.ts" ] } \ No newline at end of file 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/qlik-visualizationextensions/index.d.ts b/qlik-visualizationextensions/index.d.ts new file mode 100644 index 0000000000..e5d5850423 --- /dev/null +++ b/qlik-visualizationextensions/index.d.ts @@ -0,0 +1,2505 @@ +// Type definitions for qlik-visualizationextensions 3.2 +// Project: http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/Extensions/Content/extensions-introduction.htm +// Definitions by: Konrad Mattheis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace BackendAPI { + type StateType = "L" | "S" | "O" | "D" | "A" | "X" | "XS" | "XL"; + type SortIndicatorType = "N" | "A" | "D"; + type DimensionType = "D" | "N" | "T"; + type GroupingType = "N" | "H" | "C"; + type FieldAttributesType = "U" | "A" | "I" | "R" | "F" | "M" | "D" | "T" | "TS" | "IV"; + type PatchType = "Add" | "Remove" | "Replace"; + + interface ICharRange { + /** + * Position of the first search occurrence + * Integer + */ + qCharPos: number; + + /** + * Number of occurrences found + * Integer + */ + qCharCount: number; + } + + interface INxHighlightRanges { + /** + * Ranges of highlighted values + * Array of CharRange + */ + qRanges: ICharRange[]; + } + + interface INxSimpleValue { + /** + * Text related to the attribute expression value. + * This property is optional. No text is returned if the attribute expression value is a numeric. + * String + */ + qText: string; + + /** + * Numeric value of the attribute expression. + * This property is set to NaN (Not a Number) if the attribute expression value is not a numeric. + * Numerical values are not returned as text. + * Double precision floating point + */ + qNum: number; + } + + interface INxAttributeExpressionValues { + /** + * List of attribute expressions values. + * Array of NxSimpleValue + */ + qValues: INxSimpleValue[]; + } + + interface INxSimpleDimValue { + /** + * Text related to the attribute expression value. + * This property is optional. No text is returned if the attribute expression value is a numeric. + * String + */ + qText: string; + + /** + * Element number. + * Integer + */ + qElemNo: number; + } + + interface INxAttributeDimValues { + /** + * List of values. + * Array of NxSimpleDimValue + */ + qValues: INxSimpleDimValue[]; + } + + interface INxCell { + /** + * Some text. + * This parameter is optional. + */ + qText?: string; + + /** + * A value. + * This parameter is optional. + */ + qNum?: number; + + /** + * Rank number of the value, starting from 0. + * If the element number is a negative number, it means that the returned value is not an element number. + * You can get the following negative values: + * # -1: the cell is a Total cell. It shows a total. + * # -2: the cell is collapsed. Applies to pivot tables. + * # -3: the cell belongs to the group Others. + * # -4: the cell is empty. Applies to pivot tables. + */ + qElemNumber: number; + + /** + * State of the value. + * The default state for a measure is L. + * L for Locked + * S for Selected + * O for Optional + * D for Deselected + * A for Alternative + * X for eXcluded + * XS for eXcluded Selected + * XL for eXcluded Locked + */ + qState: StateType; + + /** + * Is set to true, if qText and qNum are empty. + * This parameter is optional. The default value is false. + */ + qIsEmpty: boolean; + + /** + * Is set to true if a total is displayed in the cell. + * This parameter is optional. The default value is false. + * Not applicable to list objects. + */ + qIsTotalCell: boolean; + + /** + * Is set to true if the cell belongs to the group Others. + * Dimension values can be set as Others depending on what has been defined in OtherTotalSpecProp. + * This parameter is optional. The default value is false. + * Not applicable to list objects. + */ + qIsOtherCell: boolean; + + /** + * Frequency of the value. + * This parameter is optional. + */ + qFrequency: string; + + /** + * Search hits. + * The search hits are highlighted. + * This parameter is optional. + */ + qHighlightRanges: INxHighlightRanges; + + /** + * Attribute expression values. + */ + qAttrExps: INxAttributeExpressionValues; + + /** + * Is set to true if the value is Null. + */ + qIsNull: boolean; + + /** + * Attribute dimensions values. + */ + qAttrDims: INxAttributeDimValues; + } + + interface INxPage { + /** + * Position from the left. + * Corresponds to the first column. + */ + qLeft: number; + + /** + * Position from the top. + * Corresponds to the first row. + */ + qTop: number; + + /** + * Number of columns in the page. The indexing of the columns may vary depending on whether + * the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). + */ + qWidth: number; + + /** + * Number of rows or elements in the page. The indexing of the rows may vary depending on + * whether the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). + */ + qHeight: number; + } + + interface INxAttrDimInfo { + /** + * Cardinality of the attribute expression. + * Integer + */ + qCardinal: number; + + /** + * Number of rows. + * Size + */ + qSize: number; + + /** + * The title for the attribute dimension. + * String + */ + qFallbackTitle: string; + + /** + * The Locked value of the dimension. + * Boolean + */ + qLocked: boolean; + + /** + * Validation error. + * REF(NxValidationError) + */ + //?Type = REF(NxValidationError)? + qError: INxValidationError; + } + + interface INxDimensionInfo { + /** + * Corresponds to the label of the dimension that is selected. + * If the label is not defined then the field name is used. + * String + */ + qFallbackTitle: string; + + /** + * Length of the longest value in the field. + * Integer + */ + qApprMaxGlyphCount: number; + + /** + * Number of distinct field values. + * Integer + */ + qCardinal: number; + + /** + * Is set to true if the field is locked. + * Boolean + */ + qLocked: boolean; + + /** + * Sort indicator. + * This parameter is optional. + * The default value is no sorting. + * One of: + * # N for no sorting + * # A for sorting ascending + * # D for sorting descending + */ + qSortIndicator: SortIndicatorType; + + /** + * Array of dimension labels. + * Contains the labels of all dimensions in a hierarchy group + * (for example the labels of all dimensions in a drill down group). + * Array of String + */ + qGroupFallbackTitles: string[]; + + /** + * Index of the dimension that is currently in use. + * qGroupPos is set to 0 if there are no hierarchical groups (drill-down groups) or cycle groups. + * Integer + */ + qGroupPos: number; + + /** + * Number of values in a particular state. + * NxStateCounts + */ + qStateCounts: INxStateCounts; + + /** + * Gives information on a field. For example, it can return the type of the field. + * Examples: key, text, ASCII + * Array of String + */ + qTags: string[]; + + /** + * This parameter is optional. + * Gives information on the error. + * Null or NxValidationError + */ + qError: INxValidationError; + + /** + * Binary format of the field. + * One of: + * # D for discrete (String) + * # N for numeric (Double) + * # T for Time (Timestamp) + */ + qDimensionType: DimensionType; + + /** + * If set to true, it inverts the sort criteria in the field. + * Boolean + */ + qReverseSort: boolean; + + /** + * Defines the grouping. + * One of: + * # N for no grouping + * # H for drill-down + * # C for cyclic + */ + qGrouping: GroupingType; + + /** + * If set to true, it means that the field is a semantic. + * Boolean + */ + qIsSemantic: boolean; + + /** + * Format of the field. + * This parameter is optional. + * FieldAttributes + */ + qNumFormat: FieldAttributesType; + + /** + * This parameter is set to true if qNumFormat is set to U (unknown). + * The engine guesses the type of the field based on the field's definition. + * Boolean + */ + qIsAutoFormat: boolean; + + /** + * Array of field names. + * Array of String + */ + qGroupFieldDefs: string[]; + + /** + * Array of attribute expressions. + * Array of NxAttrExprInfo + */ + qAttrExprInfo: INxAttrExprInfo; + + /** + * Minimum value. + * Double + */ + qMin: number; + + /** + * Maximum value. + * Double + */ + qMax: number; + + /** + * Is continuous axis used. + * Boolean + */ + qContinuousAxes: boolean; + + /** + * Is a cyclic dimension used. + * Boolean + */ + qIsCyclic: boolean; + + /** + * Is derived field is used as a dimension. + * Boolean + */ + qDerivedField: boolean; + + /** + * Array of attribute dimensions. + * Array of NxAttrDimInfo + */ + qAttrDimInfo: INxAttrDimInfo; + } + + interface INxAttrExprInfo { + /** + * Minimum value. + */ + qMin: number; + + /** + * Maximum value. + */ + qMax: number; + + /** + * Is continuous axis used. + */ + qContinuousAxes: boolean; + + /** + * Is a cyclic dimension used. + */ + qIsCyclic: boolean; + + /** + * Corresponds to the label of the dimension that is selected. + */ + qFallbackTitle: string; + } + + interface INxStateCounts { + /** + * Number of values in locked state. + * Integer + */ + qLocked: number; + + /** + * Number of values in selected state. + * Integer + */ + qSelected: number; + + /** + * Number of values in optional state. + * Integer + */ + qOption: number; + + /** + * Number of values in deselected state. + * Integer + */ + qDeselected: number; + + /** + * Number of values in alternative state. + * Integer + */ + qAlternative: number; + + /** + * Number of values in excluded state + * Integer + */ + qExcluded: number; + + /** + * Number of values in selected excluded state. + * Integer + */ + qSelectedExcluded: number; + + /** + * Number of values in locked excluded state. + * Integer + */ + qLockedExcluded: number; + } + + interface INxValidationError { + /** + * Error code. + * This parameter is always displayed in case of error. + * Integer + */ + qErrorCode: number; + + /** + * Context related to the error, from the user app domain. + * It can be the identifier of an object, a field name, a table name. + * This parameter is optional. + * String + */ + qContext: string; + + /** + * Internal information from the server. + * This parameter is optional. + * String + */ + qExtendedMessage: string; + } + + interface IFieldAttributes { + /** + * Type of the field. + * Default is U. + * One of: + * # U for UNKNOWN type. + * # A for ASCII; Numeric fields values contain only standard ASCII characters. + * # I for INTEGER; Numeric fields values are shown as integer numbers. + * # R for REAL; Numeric fields values are shown as real numbers. + * # F for FIX; Numeric fields values are shown as numbers with a fix number of decimals. + * # M for MONEY; Numeric fields values are shown as in the money format. + * # D for DATE; Numeric fields values are shown as dates. + * # T for TIME; Numeric fields values are shown as times. + * # TS TIMESTAMP; Numeric fields values are shown as time stamps. + * # IV for INTERVAL; Numeric fields values are shown as intervals. + */ + qType: FieldAttributesType; + + /** + * Number of decimals. + * Default is 10. + * Integer between 0 and 15. + */ + qnDec: number; + + /** + * Defines whether or not a thousands separator must be used. + * Default is 0. + * One of: 0 for false | 1 for true + */ + qUseThou: boolean; + + /** + * Defines the format pattern that applies to qText. + * Is used in connection to the type of the field (parameter qType). + * For more information, see Struct FieldAttributes. + * Example: YYYY-MM-DD for a date + */ + qFmt: string; + + /** + * Defines the decimal separator. + * Example: . + */ + qDec: string; + + /** + * Defines the thousand separator (if any). + * Is used if qUseThou is set to 1. + * Example: , + */ + qThou: string; + + /** + * Array + */ + qSAFEARRAY: any[]; + } + + interface INxMeasureInfo { + /** + * Corresponds to the label of the measure. If the label is not defined then the measure name is used. + * String + */ + qFallbackTitle: string; + + /** + * Length of the longest value in the field. + * Integer + */ + qApprMaxGlyphCount: number; + + /** + * Number of distinct field values. + * Integer + */ + qCardinal: number; + + /** + * Sort indicator. This parameter is optional. The default value is no sorting. + */ + qSortIndicator: SortIndicatorType; + + /** + * Format of the field. This parameter is optional. + * One of: N for no sorting, A for sorting ascending, D for sorting descending + */ + qNumFormat: IFieldAttributes; + + /** + * This parameter is set to true if qNumFormat is set to U (unknown). + * The engine guesses the type of the field based on the field's expression. + */ + qIsAutoFormat: boolean; + + /** + * Lowest value in the range. + */ + qMin: number; + + /** + * Highest value in the range. + */ + qMax: number; + + /** + * This parameter is optional. Gives information on the error. + */ + qError: INxValidationError; + + /** + * If set to true, it inverts the sort criteria in the field. + */ + qReverseSort: boolean; + + /** + * List of attribute expressions. + */ + qAttrExprInfo: INxAttrExprInfo[]; + + /** + * List of attribute dimensions. + */ + qAttrDimInfo: INxMeasureInfo[]; + } + + interface IRange { + /** + * Lowest value in the range + * Double + */ + qMin: number; + + /** + * Highest value in the range + * Double + */ + qMax: number; + + /** + * If set to true, the range includes the lowest value in the range of + * selections (Equals to ). [bn(50500)] + * Example: The range is [1,10]. If qMinInclEq is set to true it means + * that 1 is included in the range of selections. + */ + qMinInclEq: boolean; + + /** + * If set to true, the range includes the highest value in the range of + * selections (Equals to ). [bn(50500)] + * Example: The range is [1,10]. If qMinInclEq is set to true it means + * that 10 is included in the range of selections. + */ + qMaxInclEq: boolean; + } + + interface INxPatch { + /** + * Operation to perform. + * One of: + * # Add + * # Remove + * # Replace + */ + qOp: PatchType; + + /** + * Path to the property to add, remove or replace. + * String + */ + qPath: string; + + /** + * This parameter is not used in a remove operation. Corresponds to the value of the + * property to add or to the new value of the property to update. + * Examples: "false", "2", "\"New title\"" + * String + */ + qValue: string; + } + + interface IBackend { + /** + * Aborts the result of a search in a list object. Clears the existing search and returns the + * object to the state it was in prior to the search started. + */ + abortSearch(): void; + + /** + * Accepts the result of a search in a list object and the search result is selected in the field. + * @param {boolean} toggleMode - If true, toggle state for selected values + */ + acceptSearch(toggleMode: boolean): void; + + /** + * Updates the properties for this object. + * @param {array} qPatches - Array of patches. Each path contains: + * #qOp: Add/Remove/Replace + * #qPath: Path to property + * #qValue: The new value in string format. Strings need to be surrounded by \". + * @param {boolean} qSoftPatch - Set to True if properties should be soft, that is not persisted. + * @return {Promise} - A promise of a Qlik engine reply. + */ + applyPatches(qPatches: any[], qSoftPatch: boolean): ng.IPromise; + + /** + * Clears unconfirmed selections for this object. + */ + clearSelections(): void; + + /** + * Clears all soft patches that has previously been applied for this object using the + * applyPatches method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearSoftPatches(): ng.IPromise; + + /** + * Collapse the left dimensions of a pivot table. Only works for hypercubes with + * qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + collapseLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Collapse the top dimensions of a pivot table. Only works for hypercubes with + * qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + collapseTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Loops through data rows for this object. Only rows that are available client side will be used. + * @param {function} callback - Function to call for each row. + * Parameters are row number and row data as an array of NxCell objects. + * The loop is terminated if the function returns false. + * @return {NxCell[]} - An array of NxCell. + */ + eachDataRow(callback: any): INxCell[]; + + /** + * Expands the left dimensions of a pivot table. Only works for hypercubes with + * qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + expandLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Expands the top dimensions of a pivot table. Only works for hypercubes with + * qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + expandTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Geta data from Qlik engine for this object. + * @param {array} qPages - An array of NxPage objects. + * @return {Promise} - A promise of qDataPages. + */ + getData(qPages: INxPage[]): ng.IPromise; + + /** + * Gets a data row for this object. + * @param {number} rownum - The row number. + * @return {NxCell} - A row of NxCell or null if the row is not available client side + * and need to be fetched with getData method. + */ + getDataRow(rownum: number): INxCell; + + /** + * Gets qDimensionInfo for this object. + * @return {NxDimensionInfo[]} - An array of qDimensionInfo objects. + */ + getDimensionInfos(): INxDimensionInfo[]; + + /** + * Gets qMeasureInfo for this object. + * @return {NxMeasureInfo} - An array of qMeasureInfo objects. + */ + getMeasureInfos(): INxMeasureInfo; + + /** + * Gets pivot data from the Qlik engine for this object. Only works for hypercubes with qMode = P. + * @param {array} qPages - An array of request page objects. + * @return {Promise} - A promise of pivot data pages. + */ + getPivotData(qPages: INxPage[]): ng.IPromise; + + /** + * Get properties for this object. + * @return {Promise} - A promise of object properties. + */ + getProperties(): ng.IPromise; + + /** + * Get reduced data from the Qlik engine for this object. This method is intended for preserving the + * shape of the data, not for viewing the actual data points. + * @param {array} qPages - An array of request page objects. + * @param {number} qZoomFactor - Zoom factor. + * If set to -1, the Qlik engine decides of the zoom factor. + * If qReductionMode is D1 or S, the zoom factor is 2n. + * If the zoom factor is 5, the data are reduced by a factor 32. + * If qReductionMode is C, the zoom factor defines the number of centroids. + * @param {string} qReductionMode - Reduction mode.Can be: + * # N for no data reduction. + * # D1 to reduce a bar chart or line chart. + * The profile of the chart is reduced whatever the number of dimensions in the chart. + * # S to reduce the resolution of a scatter plot. + * # C to reduce the data of a scatter plot chart. + * # ST to reduce the data of a stacked pivot table. + * @return {Promise} - A promise of reduced data pages. + */ + getReducedData(qPages: INxPage[], qZoomFactor: number, qReductionMode: string): ng.IPromise; + + /** + * Get total number of data rows for this object. + * @return {Number} - A number. + */ + getRowCount(): number; + + /** + * Get stacked data from the Qlik engine for this object. Only works for hypercubes with qMode = S. + * @param {array} qPages - An array of request page objects. + * @param {number} qMaxNbrCells - Maximum number of cells at outer level. + * @return {Promise} - A promise of stack data pages. + */ + getStackedData(qPages: INxPage[], qMaxNbrCells: number): ng.IPromise; + + /** + * Find out if there are unconfirmed selections for this object. + * @return {boolean} - True if there are unconfirmed selections. + */ + hasSelections(): boolean; + + /** + * Save this object. + * @return {Promise} - A promise. In case of success, it returns "undefined". In case of failure it returns the error. + */ + save(): ng.IPromise; + + /** + * Search for a term in a list object. Results in an updated layout, containing only matching records. + * @param {string} term - Term to search for. + */ + search(term: string): void; + + /** + * Select values in this object using ranges. + * @param {array} qRanges - Array of ranges to select. + * @param {boolean} qOrMode - If true only one of the measures needs to be in range. + */ + selectRange(qRanges: IRange[], qOrMode: boolean): void; + + /** + * Select values in this object with a Qlik engine call which triggers a repaint of the object. + * @param {number} qDimNo - Dimension number. 0 = first dimension. + * @param {array} qValues - Array of values (qElemNumber in the matrix from the Qlik engine) to select or deselect. + * @param {boolean} qToggleMode - If true, values in the field are selected in addition to any previously selected items. + * If false, values in the field are selected while previously selected items are deselected. + */ + selectValues(qDimNo: number, qValues: any[], qToggleMode: boolean): void; + + /** + * Set properties for this object. + * @param {object} props - The properties to set. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setProperties(props: any): ng.IPromise; + } +} + +declare namespace RootAPI { + interface IAppConfig { + /** + * Optional Qlik host. + */ + host?: string; + + /** + * Port number. + */ + port: string | number; + + /** + * Optional. Qlik virtual proxy. "/" if no proxy. + */ + prefix?: string; + + /** + * Optional. Use SSL. + */ + isSecure?: boolean; + + /** + * Optional. Open app without loading data. Introduced in version 1.1. + */ + openWithoutData?: boolean; + + /** + * Optional. Unique identity for the session. If omitted, the session will be shared. + */ + identity?: string; + } + + interface IGlobalConfig { + /** + * Qlik Sense host + */ + host: string; + + /** + * Port number + */ + port: string; + + /** + * Qlik Sense virtual proxy. / if no virtual proxy + */ + prefix: string; + + /** + * Use SSL + */ + isSecure: boolean; + + /** + * Unique identity for the session. If omitted, the session will be shared. + */ + identity: string; + } + + interface IRoot { + /** + * Calls the Qlik Sense repository. + * @param {string} path - Path to the Qlik Sense repository. + * Refer to Qlik Sense repository documentation for the available paths. + * @param {string} [method] - Optional. HTTP method. Default is GET. + * @param {string} [body] - Optional. Body of the post. + * @return {Promise} - A promise of a Qlik engine reply. + */ + callRepository(path: string, method?: string, body?: string): ng.IPromise; + + /** currApp + * Gets a reference to the current app. Use the currApp method in an extension to get a reference to the app currently displayed. + * @param {object} [reference] - Optional. Reference to extension object. Introduced in version 1.1. + * @return {IApp} - An App JavaScript object with app methods. + */ + currApp(object?: any): AppAPI.IApp; + + /** + * Gets a list of Qlik Sense apps that you potentially can connect to and registers a callback to receive the data. + * The getAppList method opens a WebSocket, gets the app list, and then closes the WebSocket. + * @param {function} callback - Callback method. + * @param {object} [config] - Optional. Additional configuration parameters: + * Name | Type | Descr | Name + * host | String | Optional. Qlik host. | host + * port | String or integer | Port number. | port + * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. | prefix + * isSecure | Boolean | Optional. Use SSL. | isSecure + * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. | openWithoutData + * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. | identity + */ + getAppList(callback: any, config?: any): void; + + /** + * Gets a list of extensions installed for Qlik Sense. The reply contains all extensions, + * that is widget libraries, visualization extensions and mashups. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getExtensionList(callback?: any): ng.IPromise; + + /** + * Opens a WebSocekt connection to the Qlik engine for global methods. + * @param {object} [config] - Optional. Parameters: + * Name | Type | Description + * host | String | Qlik Sense host + * port | String | Port number + * prefix | String | Qlik Sense virtual proxy. / if no virtual proxy + * isSecure | Boolean | Use SSL + * identity | String | Unique identity for the session. If omitted, the session will be shared. + * @return {ANY} - A global JavaScript object with global methods. + */ + getGlobal(config: any): any; + + /** Opens a Qlik Sense app. You can open multiple apps. + * Most other methods are defined on the app. Returns: App JavaScript object with app methods. + * @param {string} appId The app id. + * @param {object} [config] Optional. Additional configuration parameters: + * Name | Type | Descr + * host | String | Optional. Qlik host. + * port | String or Integer | Port number. + * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. + * isSecure | Boolean | Optional. Use SSL. + * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. + * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. + * Parameter updated in version 2.2. + * @return {any} - App JavaScript object with app methods. + */ + openApp(appId: string, config?: any): any; + + /** + * Registers an extension for use in this mashup. The extension is not installed on the + * Qlik Sense server and only available in the session where it is created. + * As long as a JavaScript module is created in the correct format, it can be sent to + * the registerExtension function. + * @param {string} id - Set the ID of the visualization extension. + * @param {object} impl - Set the extension implementation. + * @param {object} [metadata] - Optional. Extension meta-data, same format as the QEXT file. Default: {"type":"visualization"} + */ + registerExtension(id: string, impl: any, metadata?: any): void; + + /** + * Sends a resize event to all Qlik Sense objects. + * @param {string} [ID] - Object id. Optional: if no ID resize event will be sent to all objects. + */ + resize(ID?: string): void; + + /** + * Sets a specific language for the Qlik Sense session. + * Language should be defined before the app is opened meaning the setLanguage + * method should be called before the openApp method is called. + * @param {string} lang - Language code. Can be: + * # German: short: de long: de-DE + * # English: short: en long: en-US + * # Spanish: short: es long: es-ES + * # French: short: fr long: fr-FR + * # Italian: short: it long: it-IT + * # Japanese: short: ja long: ja-JP + * # Korean: (introduced in version 3.0) short: ko long: ko-KR + * # Dutch: short: nl long: nl-NL + * # Polish: (introduced in version 3.0) short: pl long: pl-PL + * # Brazilian Portuguese: short: pt long: pt-BR + * # Russian: short: ru long: ru-RU + * # Swedish: short: sv long: sv-SE + * # Turkish: (introduced in version 3.0) short: tr long: tr-TR + * # Simplified Chinese: short: Do not use! long: zh-CN + * # Traditional Chinese: (introduced in version 3.0) short: Do not use! long: zh-TW + */ + setLanguage(lang: string): void; + + /** + * Registers a callback for error handling. Standard Qlik Sense error + * handling is used if this method is not called. + * @param {function} onError - Error handling function + * @param {function} [onWarning] - Optional. Warning handling function. Introduced in version 2.1. + */ + setOnError(onError: any, onWarning?: any): void; + + /** + * Create a QTable object that wraps data in your extension and provides an object oriented interface. + * @param {object} ext - Extension or angular scope for the extension. + * @param {string} [path] - Optional. Path to the hypercube. Default: qHyperCube + * @return {QTable} - A QTable object that holds data and options for the table. + */ + table(ext: any, path?: string): TableAPI.IQTable; + + navigation: NavigationAPI.INavigation; + } +} + +declare namespace AppAPI { + interface IApp { + /** + * Adds an alternate state in the app. Multiple states within a Qlik Sense + * app can be created and applied to specific objects within the app. + * Objects in a given state are not affected by user selection in the other states. + * @param {string} qStateName - Mandatory. Alternate state name. + * @return {Promise} - A promise of a Qlik engine reply. + */ + addAlternateState(qStateName: string): ng.IPromise; + + /** + * Steps back in the list of selections. + * @return {Promise} - A promise of a Qlik engine reply. + */ + back(): ng.IPromise; + + /** + * Clears all selections in all fields of the current Qlik Sense app. + * @param {boolean} [lockedAlso] - Optional. Alternate state name. Default: false Introduced in version 2.1. + * @param {string} [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearAll(lockedAlso?: boolean, state?: string): ng.IPromise; + + /** + * Closes a Qlik Sense app. Also closes the WebSocket and clears out client side data. + */ + close(): void; + + /** + * Defines a hypercube and registers a callback to receive the data. + * @param {object} qHyperCubeDef - Cube definition. + * @param {function} [callback] - Optional. Callback method. Parameter will contain a qHyperCube. + * @return {Promise} - A promise of an object model. + */ + createCube(qHyperCubeDef: any, callback?: any): ng.IPromise; + + /** + * Creates a generic object and registers a callback to receive the data. The generic object can contain the following: + * # qHyperCubeDef + * # qListObjectDef + * # qStringExpression + * # qValueExpression + * The callback method will be called whenever the selection state changes + * in a way that affects the generic object. + * The parameter will be the evaluated version of the definition. + * @param {object} [def] - Optional. Generic object definition + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of an object model. + */ + createGenericObject(def?: any, callback?: any): ng.IPromise; + + /** + * Defines a list of field values and registers a callback to receive the data. + * @param {object} qListObjectDef - List definition. + * @param {function} [callback] - Optional. Callback method. Parameter will contain a qListObject. + * @return {Promise} - A promise of an object model. + */ + createList(qListObjectDef: any, callback?: any): ng.IPromise; + + /** + * Defines a hypercube for a table and is the entry point to the Table API. + * It creates a table object that wraps the hypercube. + * @param {Array.} dimensions - Dimensions to use. + * Should, for each entry, be a field name or a NxDimension structure. + * @param {Array.} measures - Measures to use. + * Should, for each entry, be an expression or a NxMeasure structure. + * @param {object} [options] - Optional. Options to set. + * @return {QTable} - A table object of type QTable, which is initially + * empty but that eventually will contain data. + * The table object will be updated when selection state changes. + */ + createTable(dimensions: string[] | any[], measures: string[] | any[], options?: any): TableAPI.IQTable; + + /** + * Destroys a Qlik Sense session object created with the createGenericObject + * method or any of createCube, createList or getList methods. + * Calling this method removes the object from the Qlik engine, + * no more updates are sent to the client and all methods on the object are invalid. + * @param {string} id - Session object id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + destroySessionObject(id: string): ng.IPromise; + + /** + * Reloads the data in a Qlik Sense app. + * @param {string} [qMode] - Optional. Error handling mode: + * # 0 = default mode. + * # 1 = attempt recovery on all errors. + * # 2 = fail on all errors. + * @param {boolean} [qPartial] - Optional. Set to true for partial reload. + * @param {boolean} [qDebug] - Optional. Set to true if debug breakpoints are honored. Execution of the script will be in debug mode. + * @return {Promise} - A promise of a Qlik engine reply. + */ + doReload(qMode?: string, qPartial?: boolean, qDebug?: boolean): ng.IPromise; + + /** + * Saves a Qlik Sense app, including all objects and data in the data model. + * @param {string} [qFileName] - Optional. File name of the file to save. + * @return {Promise} - A promise of a Qlik engine reply. + */ + doSave(qFileName?: string): ng.IPromise; + + /** + * Gets a field reference with methods that can be used to manipulate the field. + * @param {string} [field] - Optional. Name of the field. + * @param {string} [state] - Optional. Alternate state name. Default is $. + * @return {QField} - A QField object with methods and properties that can be used to manipulate the field. + */ + field(field?: string, state?: string): FieldAPI.IQField; + + /** + * Step forward in list of selections. + * @return {Promise} - A promise of a Qlik engine reply. + */ + forward(): ng.IPromise; + + /** + * Gets a layout for this Qlik Sense app and registers a callback to receive the data. + * Returns the dynamic properties (if any) in addition to the fixed properties. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getAppLayout(callback?: any): ng.IPromise; + + /** + * Gets a list of sheets and visualizations and registers a callback to receive the data. + * @param {string} [field] - Optional. Type of object. One of: + * # sheet + * # masterobject + * Default is sheet. + * @param {function} [callback] - Optional. Callback method. + */ + getAppObjectList(type?: string, callback?: any): void; + + /** + * Gets properties for a generic object, the children of the generic object + * and the bookmarks and/or embedded snapshots of the generic object. + * @param {string} id - Object id. + * @return {Promise} - A promise of an object model. + */ + getFullPropertyTree(id: string): ng.IPromise; + + /** + * Gets a list of internal Qlik Sense objects and registers a callback to receive the data. + * @param {string} type - Type of object: + * # FieldList + * # MeasureList + * # DimensionList + * # BookmarkList + * # SelectionObject + * # SnapshotList (Introduced in version 1.1) + * # MediaList (Introduced in version 1.1) + * # Sheet (Introduced in version 1.1) + * # MasterObject (Introduced in version 1.1) + * # VariableList (Introduced in version 2.0) + * # story (Introduced in version 2.1) + * @param {function} [callback] - Optional. Registers a callback that is executed every time data is returned. + * @return {Promise} - A promise of an object model. + */ + getList(type: string, callback?: any): ng.IPromise; + + /** + * Retrieves a Qlik Sense object from the Qlik Sense application and inserts + * it into a HTML element. The object fills the HTML object, so you can size + * and position the element to determine how large the Qlik Sense object will be. + * If you supply only one parameter, you get the model without displaying the object. + * @param {string} id - Object id or 'CurrentSelections' if used for Selections bar. + * @param {Element | string} [elem] - Optional. HTML element. + * Since version 1.1 it is also possible to define a string of the HTML element id. + * @param {object} [options] - Optional. + * Name | Type | Description + * noInteraction | Boolean | Set to true if you want to disable interaction, + * including selections, in the visualization. + * Introduced in version 1.1 and updated in version 3.0. + * noSelections | Boolean | Set to true if you want to disable selections in the visualization. + * Introduced in version 3.0. + * @return {Promise} - A promise of an object model. + */ + getObject(id: string, elem?: any | string, options?: any): ng.IPromise; + + /** + * Gets properties for a Qlik Sense object. + * @param {string} id - Object id. + * @return {Promise} - A promise of an object model. + */ + getObjectProperties(id: string): ng.IPromise; + + /** + * Inserts a Qlik Sense snapshot into a HTML element. The snapshot fills + * the HTML object so you can size and position the element to determine + * how large the Qlik Sense object will be. If you only supply one parameter, + * you will just get the model without displaying the object. + * @param {string} id - Snapshot ID. + * @param {element | string} [elem] - Optional. HTML element or string with HTML element id. + * @return {Promise} - A promise of an object model. + */ + getSnapshot(id: string, elem?: any | string): ng.IPromise; + + /** + * Locks all selections. + * @param {string} [state=$] - Optional. Alternate state name. + * Default: $ + * Introduced in version 2.1. + * @return {Promise} - A promise of a Qlik engine reply. + */ + lockAll(state?: string): ng.IPromise; + + /** + * Removes an alternate state in the app. + * @param {string} qStateName - Alternate state name. + * @return {Promise} - A promise of a Qlik engine reply. + */ + removeAlternateState(qStateName: string): ng.IPromise; + + /** + * Searches for one or more terms in the values of a Qlik Sense app. + * @param {array} qTerms - Terms to search for. + * @param {object} qPage - Properties: + * Name | Type | Description + * qOffset | Number | Position from the top, starting from 0. + * qCount | Number | Number of search results to return. + * qMaxNbrFieldMatches | Number | Maximum number of matching values to return per search result. + * @param {object} qOptions - Properties + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * qContext | | Search context. Can be one of: + * # Cleared: In this mode, the first step is to clear any current selections in the app. + * The second step is to search for one or more terms in the values of the app. + * # LockedFieldsOnly: In this mode, the search applies only to the values associated + * with the selections made in locked fields, ignoring selections + * in any unlocked field. If no locked fields, the behavior is + * identical to the Cleared context. You cannot make any new selections + * in a locked field. You can get search hits for the associated values + * of a locked field but you cannot get the search hits for the non associative values. + * # CurrentSelections:In this mode, the current selections are kept (if any). Search + * for one or more terms in the values of the app. New selections + * are made on top of the current selections. If no selections were + * made before the search, this mode is identical to the Cleared context. + * | | Default value is LockedFieldsOnly. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchAssociations(qTerms: any[], qPage: any, qOptions: any, callback?: any): ng.IPromise; + + /** + * Searches for one or more terms in the values of a Qlik Sense app. + * @param {array} qTerms - Terms to search for. + * @param {object} qPage - Properties: + * Name | Type | Description + * qOffset | Number | Position from the top, starting from 0. + * qCount | Number | Number of search results to return. + * qGroupOptions | Array | This parameter is optional. Options of the search groups. If this property is not set, all values are returned. + * qGroupItemOptions | Array | This parameter is optional. Options of the search group items. If this property is not set, all values are returned. + * qOptions | Object | Optional. Search options. Properties: + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * qContext | | Search context. Can be one of: + * # Cleared: In this mode, the first step is to clear any current selections in the app. + * The second step is to search for one or more terms in the values of the app. + * # LockedFieldsOnly: In this mode, the search applies only to the values associated + * with the selections made in locked fields, ignoring selections + * in any unlocked field. If no locked fields, the behavior is + * identical to the Cleared context. You cannot make any new selections + * in a locked field. You can get search hits for the associated values + * of a locked field but you cannot get the search hits for the non associative values. + * # CurrentSelections:In this mode, the current selections are kept (if any). Search + * for one or more terms in the values of the app. New selections + * are made on top of the current selections. If no selections were + * made before the search, this mode is identical to the Cleared context. + * | | Default value is LockedFieldsOnly. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchResults(qTerms: any[], qPage: any, qOptions?: any, callback?: any): ng.IPromise; + + /** + * Returns suggestions of words from the values entered in the search. Acts as a helper for the searchAssociations method. + * @param {array} qTerms - Terms to search for. + * @param {object} [qOptions] - Optional. Search options. Properties: + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchSuggest(qTerms: any[], qOptions?: any, callback?: any): ng.IPromise; + + /** + * Makes a selection based on searchAssociation results. + * @param {number} qMatchIx - Index to search result. + * @param {array} qTerms - Values to select. + * @param {object} qOptions - Values to select. + * @param {array} [qTerms] - Optional. Parameter sent to the Qlik engine containing information about the search fields and the search context. + * @param {object} [qSoftLock] - Optional. This parameter was deprecated in version 2.0 and is ignored in newer versions. Use the qOtions.qContext parameter instead. + * @return {Promise} - A promise of a Qlik engine reply. + */ + selectAssociations(qMatchIx: number, qTerms: any[], qOptions?: any, qSoftLock?: any): ng.IPromise; + + /** + * Creates a QSelectionState object that encapsulates the selection state. Entry point to the Selection API. + * @param {string} [state] - Optional. Sets the state. Default is $. + */ + selectionState(state?: string): SelectionStateAPI.IQSelectionState; + + /** + * Unlocks all selections that has previously been locked. + * @param {string} [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. + */ + unlockAll(state?: string): ng.IPromise; + } +} + +declare namespace BookmarkAPI { + interface IBookmark { + /** + * Applies a bookmark. + * @param {string} id - Bookmark id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + apply(id: string): ng.IPromise; + + /** + * Creates a bookmark based on the current selection. + * @param {string} title - Bookmark title. + * @param {string} description - Bookmark description. + * @param {string} [sheetId] - Optional. Bookmark sheet id. Introduced in version 2.2. + * @return {Promise} - A promise of a Qlik engine reply. + */ + create(title: string, description: string, sheetId?: string): ng.IPromise; + + /** + * Removes a bookmark. + * @param {string} id - Bookmark id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + remove(id: string): ng.IPromise; + } +} + +declare namespace FieldAPI { + interface IQField { + /** + * Clears a field selection. + * @return {Promise} - A promise. + */ + clear(): ng.IPromise; + + /** + * Clears all fields except the selected one. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + clearOther(softlock?: boolean): ng.IPromise; + + /** + * Gets field data. The values are available as QFieldValue in array + * field.rows and will updated when the selection state changes. + * Notification OnData will be triggered after each update. + * @param {boolean} [options] - Optional. Properties: + * Name | Type | Description + * rows | Number | Number of rows to fetch. Default: 200. + * frequencyMode | String | Can be one of: + * # V=Absolute + * # P=Percent + * # R=Relative + * # N=No frequency + * | | Default: V. + * @return {IQField} - The field object. + */ + getData(options?: boolean): IQField; + + /** + * Gets more data for your field. Notification OnData is triggered when complete. + * @return {IQField} - The field object. + */ + getMoreData(): IQField; + + /** + * Locks a field selection. + * @return {Promise} - A promise. + */ + lock(): ng.IPromise; + + /** + * Selects field values using indexes. + * @param {number[]} Array - Array of index values to select + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + select(Array: number[], toggle?: boolean, softlock?: boolean): ng.IPromise; + + /** + * Selects all values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectAll(softlock?: boolean): ng.IPromise; + + /** + * Selects alternative values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectAlternative(softlock?: boolean): ng.IPromise; + + /** + * Selects excluded values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectExcluded(softlock?: boolean): ng.IPromise; + + /** + * Selects matching field values. + * @param {string} match - Match string. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectMatch(match: string, softlock?: boolean): ng.IPromise; + + /** + * Selects possible values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectPossible(softlock?: boolean): ng.IPromise; + + /** + * Selects specific values in a field. + * @param {array} array - Array of qFieldValues to select. A simplified syntax with + * strings or numbers also works since version 1.1. + * For a numeric field you need to provide the numeric value. + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectValues(array: IQFieldValue[], toggle?: boolean, softlock?: boolean): ng.IPromise; + + /** + * Toggles a field selection. + * @param {string} match - Match string. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + toggleSelect(match: string, softlock?: boolean): ng.IPromise; + + /** + * Unlocks field selections. + * @return {Promise} - A promise. + */ + unlock(): ng.IPromise; + + /** + * Field values. You need to call getData() method to make this available. Introduced in 2.1. + */ + rows: IQFieldValue[]; + + /** + * Optional. Number of different values. Only after getData() call. Introduced in 2.1. + */ + rowCount: number; + + /** + * Optional. Object with number of values in different states. + * Only after getData() call. Introduced in 2.1. + */ + qStateCounts: any; + } + + interface IQFieldValue { + /** + * Cell value formatted as set up in properties. + */ + qText: string; + + /** + * Cell value index. + */ + qElemNumber: number; + + /** + * Cell state. + */ + qState: any; + + /** + * Optional. Cell numeric value, if cell is numeric. + */ + qNum?: number; + + /** + * Optional. Frequency, if calculated by the Qlik engine. + */ + qFrequency?: string; + + /** + * Selects a field value. + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + select(toggle?: boolean, softlock?: boolean): ng.IPromise; + } +} + +declare namespace GlobalAPI { + interface IGlobal { + /** + * Cancels an ongoing reload. The reload of the app is stopped. + * @return {Promise} - A promise of a Qlik engine reply. + */ + cancelReload(): ng.IPromise; + + /** + * Gets a list of Qlik Sense apps that you potentially can connect to and + * registers a callback to receive the data. Calling the getAppList method + * opens a WebSocket, gets the app list, and then keeps the WebSocket open + * for you to make other calls as well. + * @param {Function} callback - Callback method. + */ + getAppList(callback: any): void; + + /** + * Gets information (user directory and user id) about the authenticated user. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getAuthenticatedUser(callback?: any): ng.IPromise; + + /** + * Gets information about progress of doReload and doSave calls. + * @param {Number} qRequestId - Request id from doReload call or 0. + * Complete information is returned if the identifier of the request is specified. + * If qRequestId = 0, less information is returned. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getProgress(qRequestId: number, callback?: any): ng.IPromise; + + /** + * Gets the product version. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getProductVersion(callback?: any): ng.IPromise; + + /** + * Gets the Qlik product name. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getQTProduct(callback?: any): ng.IPromise; + + /** + * Gets the Qlik Sense version number. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise. + */ + getQvVersion(callback?: any): ng.IPromise; + + /** + * Gets information if the user is working in personal mode + * (returns true if Qlik Sense Desktop is used) or not + * (returns false if Qlik Sense Desktop is not used). + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + isPersonalMode(callback?: any): ng.IPromise; + } +} + +declare namespace NavigationAPI { + type NavigationModeType = "ANALYSIS" | "EDIT"; + type NavigationErrorType = "NOSUCHSHEET" | "NOCURRENTSHEET" | "NOSUCHSTORY"; + + /** + * The navigation result object. + */ + interface NavigationResult { + /** + * Returns true if successful. + */ + success: boolean; + + /** + * The new sheet ID. + */ + sheetId: string; + + /** + * The new story ID. + */ + storyId: string; + + /** + * The new mode. + */ + mode: string; + + /** + * Error code. Can be: NOSUCHSHEET | NOCURRENTSHEET | NOSUCHSTORY + */ + error: NavigationErrorType; + + /** + * Error message, for example 'No current sheet'. + */ + errorMsg: string; + } + + /** Navigation API for Qlik Sense. The Navigation API allows you to navigate + * within a Qlik Sense app, and is meant to be used in visualization extensions + * and will not work in Mashup scenarios. + */ + interface INavigation { + /** + * Used for analysis mode. + */ + edit: "edit"; + + /** + * Used for edit mode. + */ + analysis: "analysis"; + + /** + * Gets the current sheet ID. + * @return {NavigationResult} - A navigation result object. + */ + getCurrentSheetId(): NavigationResult; + + /** + * Gets the current mode. + * @return {string} - The current mode as a string. + */ + getMode(): string; + + /** + * Navigate to a given sheet in the current app. + * The method will return before the actual navigation takes place. + * @param {string} sheetId - Set the sheet ID to navigate to. + * @return {NavigationResult} - A navigation result object. + */ + gotoSheet(sheetId: string): NavigationResult; + + /** + * Navigate to a given story in the current app. + * The method will return before the actual navigation takes place. + * @param {string} storyId - Set the story ID to navigate to. + * @return {NavigationResult} - A navigation result object. + */ + gotoStory(storyId: string): NavigationResult; + + /** + * Checks if a given mode is allowed. + * @param {NavigationModeType} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {boolean} - A Boolean value (true or false). + */ + isModeAllowed(mode: NavigationModeType): boolean; + + /** + * Go to the next sheet in the current app. + * It will do nothing if you do not have sheets in the current context. + * The method will return before the actual navigation takes place. + * @return {NavigationResult} - A navigation result object. + */ + nextSheet(): NavigationResult; + + /** + * Jumps to the previous sheet in the current app. + * It will do nothing if you do not have sheets in the current context. + * The method will return before the actual navigation takes place + * @return {NavigationResult} - A navigation result object. + */ + prevSheet(): NavigationResult; + + /** + * Sets the current working mode of Qlik Sense. + * @param {string | constant} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {NavigationResult} - A navigation result object. + */ + setMode(mode: string): NavigationResult; + + /** + * Switches the working mode of Qlik Sense. + * @param {NavigationModeType} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {NavigationResult} - A navigation result object. + */ + switchMode(mode: NavigationModeType): NavigationResult; + } +} + +declare namespace SelectionStateAPI { + interface IQFieldSelections { + /** + * Selection state for a field. + */ + fieldName: string; + + /** + * Sort index. Starting from 0. + */ + qSortIndex: number; + + /** + * Reference to the field. + */ + field: FieldAPI.IQField; + + /** + * Defines if the field is locked. + */ + locked: boolean; + + /** + * Defines if the field is numeric. + */ + isNumeric: boolean; + + /** + * Total number of values in the field. + */ + totalCount: number; + + /** + * Number of selected values. + */ + selectedCount: number; + + /** + * Number of values that will be listed. + */ + qSelectionThreshold: number; + + /** + * Object with number of values in different states. + */ + qStateCounts: any; + + /** + * Concatenated string of selected values if number of values are less + * than the threshold, or if the string is of format "7 of 123". + */ + qSelected: string; + + /** + * Array with maximum of qSelectionThreshold values that are selected. + * For each value, the text plus the selection mode (NORMAL/AND/NOT) + */ + selectedValues: number[]; + + /** + * Array with maximum of qSelectionThreshold values that are not selected. + * For each value, the text plus the selection mode (NORMAL/AND/NOT) + */ + notSelectedValues: number[]; + } + + interface IQSelectionState { + /** + * State name. $ for default state. + */ + stateName: string; + + /** + * Selections + */ + selections: IQFieldSelections; + + /** + * Number of back steps available. + */ + backCount: number; + + /** + * Number of forward steps available. OnData notification will be triggered after each update. + */ + forwardCount: number; + + /** + * Cleara all selections in this state. + * @param {boolean} lockedAlso - Use to also clear locked fields. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearAll(lockedAlso: boolean): ng.IPromise; + + /** + * Locks all selections in this state. + * @return {Promise} - A promise of a Qlik engine reply. + */ + lockAll(): ng.IPromise; + + /** + * Unlocks all selections in this state. + * @return {Promise} - A promise of a Qlik engine reply. + */ + unlockAll(): ng.IPromise; + } +} + +declare namespace TableAPI { + interface IQTable { + /** + * Data rows. + */ + rows: IQRow[]; + + /** + * Header information. + */ + headers: IQHeader[]; + + /** + * Total information for measures. + */ + totals: IQMeasureCell[]; + + /** + * Total number of rows for the qHyperCube, including rows not fetched from the server. + */ + rowCount: number; + + /** + * Total number of columns for the qHyperCube. + */ + colCount: number; + + /** + * Exports data of the underlying hypercube in OOXML or CSV format. + * @param {object} [options] - Optional. Properties: + * Name | Type | Description + * format | String | Data format. Can be one of: + * # OOXML: open XML, default + * # CSV_C: comma separated CSV + * # CSV_T: tab separated CSV + * filename | String | Name of the exported file after download from browser. + * This parameter is optional and only used in desktop. + * state | String | Can be: + * # A: all values + * # P: possible values (default) + * download | Boolean | Automatically start download of file (with window.open). + * @param {Function} [callback] - Optional. Callback function returning the link to the exported file. + */ + exportData(options?: any, callback?: any): void; + + /** + * Gets the column number for a given field name. + * @param {string} fld - Field name. + * @return {number} - Column number, starting with zero. Undefined if no column with that name exists. + */ + getColByName(fld: string): number; + + /** + * Gets more data for your qHyperCube. + */ + getMoreData(): any; + } + + interface IQHeader { + /** + * Column title. + */ + qFallbackTitle: string; + + /** + * Can be: + * # A: ascending + * # D: descending + */ + qSortIndicator: string; + + /** + * True indicates if this is the first column for sorting. + */ + isOrderedBy: boolean; + + /** + * True indicates if the sort order is reversed for this column. + */ + qReverseSort: boolean; + + /** + * Column number. + */ + col: number; + + /** + * Optional. Number of different values. Only used for dimensions. + */ + qCardinal?: number; + + /** + * Optional. Object with number of values in different states. + * Only used for dimensions. + */ + qStateCounts?: any; + + /** + * Optional. Field object with methods to manipulate the underlying field. + * Only used for dimensions. + */ + field?: any; + + /** + * Optional. Minimum value. Only used for measures. + */ + qMin?: number; + + /** + * Optional. Maximum value. Only used for measures. + */ + qMax?: number; + + /** + * Optional. Error code for this column. + * Only if column has an error. Introduced in version 2.2. + */ + errorCode?: number; + + /** + * Error message for this column. + * Only if column has an error. Introduced in version 2.2. + */ + errorMessage: number; + + /** + * Sets this column to be the first in the sort order. + */ + orderBy(): void; + + /** + * Reverses the sort order for this column. + */ + reverseOrder(): void; + + /** + * Select a range in this measure. + * @param {number} min - Sets the minimum value of the range. + * @param {number} max - Sets the maximum value of the range. + * @param {boolean} [inclMin] - Optional. Set to true to include minimum value. + * @param {boolean} [inclMax] - Optional. Set to true to include maximum value. + * @return {Promise} - A promise. + */ + selectRange(min: number, max: number, inclMin?: boolean, inclMax?: boolean): ng.IPromise; + } + + interface IQRow { + /** + * Dimension cells. + */ + dimensions: IQDimensionCell[]; + + /** + * Measure cells. + */ + measures: IQMeasureCell[]; + + /** + * All cells, in the order they are defined in the properties. + */ + cells: any[]; + } + + interface IQDimensionCell extends IQMeasureCell { + /** + * Cell value index. + */ + qElemNumber: number; + + /** + * Cell state. + */ + qState: string; + + /** + * Selects the value in this cell. + */ + select(): void; + } + + interface IQMeasureCell { + /** + * Cell value formatted as set up in properties. + */ + qText: string; + + /** + * Optional. Cell numeric value, if cell is numeric. + */ + qNum?: number; + + /** + * Gets the value of this cell as a percentage of the total. + * Might be more than 100% if this is an average. + */ + getPercent(): number; + + /** + * Gets the value of this cell as a percentage of the maximum. + */ + getPercentOfMax(): number; + } +} + +declare namespace VariableAPI { + interface IVariable { + /** + * Creates a variable. + * @param {string | object} qProp - Variable name or properties. Properties: + * Name | Type | Description + * qInfo.qId | String | Optional. Variable id. If the selected ID is already in use, a new ID is automatically set by the engine. + * qName | String | Variable name. The name must be unique. + * qComment | String | Optional. Comment related to the variable. + * qDefinition | String | Optional. Variable definition. + * qNumberPresentation | Object | Optional. Defines the format of the value. + * qIncludeInBookmark | Boolean | Optional. Set to true to update the variable when applying a bookmark. The variable value will be persisted in the bookmark. + * @return {Promise} - Returns a promise of a variable model. + */ + create(qProp: string | any): ng.IPromise; + + /** + * Creates a session variable, that is a temporary variable which is not + * persisted and needs to be recreated for each new session. + * @param {object} qProp - Variable properties: + * Name | Type | Description + * qInfo.qId | String | Optional. Variable id. + * qName | String | Variable name. + * qComment | String | Optional. Comment. + * qDefinition | String | Optional. Variable definition. + * qNumberPresentation | Object | Optional. + * qIncludeInBookmark | Boolean | Optional. Include in bookmark flag. + * @return {Promise} - A promise of a variable model. + */ + createSessionVariable(qProp: any): ng.IPromise; + + /** + * Gets a variable by id. + * @param {string} qId - Variable id. + * @return {Promise} - A promise of a variable model. + */ + get(qId: string): ng.IPromise; + + /** + * Gets a variable by name. + * @param {string} qName - Variable name. + * @return {Promise} - A promise of a variable model. + */ + getByName(qName: string): ng.IPromise; + + /** + * Gets variable content. + * @param {string} name - Variable name. + * @param {Function} callback - Callback to receive the content. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getContent(name: string, callback: any): ng.IPromise; + + /** + * Sets the content of a variable. + * @param {string} name - Variable name. + * @param {string} content - Variable content. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setContent(name: string, content: string): ng.IPromise; + + /** + * Sets a numeric value as a variable. + * @param {string} qName - Variable name. + * @param {Number} qVal - Variable value. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setNumValue(qName: string, qVal: number): ng.IPromise; + + /** + * Sets variable string value. + * @param {string} qName - Variable name. + * @param {string} qVal - Variable value. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setStringValue(qName: string, qVal: string): ng.IPromise; + } +} + +declare namespace VisualizationAPI { + type VisualizationType = "barchart" | "combochart" | "gauge" | "kpi" | "linechart" | "piechart" | "pivot-table" | + "scatterplot" | "table" | "treemap" | "extension"; + + interface IVisualization { + /** + * Create a new visualization on the fly based on a session object + * and will not be persisted in the app. + * @param {VisualizationType} type - Visualization type. Can be: + * # barchart + * # combochart + * # gauge + * # kpi + * # linechart + * # piechart + * # pivot-table + * # scatterplot + * # table + * # treemap + * # extension + * @param {array} [cols] - Optional. Column definitions, dimensions and measures. + Each entry can be of the following structures: + * # String + * # NxDimension + * # NxMeasure + * If the NxDimension or the NxMeasure refer to a library dimension + * or a library measure, you also need to add qType : "measure" or "dimension". + * @param {object} [options] - Optional. Options to set. + * @return {Promise} - A promise of a QVisualization. + */ + create(type: VisualizationType, cols?: any[], options?: any): ng.IPromise; + + /** + * Gets an existing visualization. + * @param {string} id - Id for an existing visualization. + * @return {Promise} - A promise of a QVisualization. + */ + get(id: string): ng.IPromise; + } + + interface IQVisualization { + /** + * Table object for this visualization. + * Only for visualizations built on a hypercube. + */ + table: TableAPI.IQTable; + + /** + * Closes a visualization and releases the session object. + * @return {Promise} - A promise. + */ + close(): ng.IPromise; + + /** + * Tells the visualization it has been resized and should re-paint. + */ + resize(): void; + + /** + * Sets options for a visualization. + * @param {object} options - Options to set (using applyPatches). + */ + setOptions(options?: any): void; + + /** + * Shows the visualization in an HTML element. + * @param {Element | string} [element] - Optional. HTML element or HTML element ID. + * @param {object} [options] - Optional. + * Name | Type | Description + * noInteraction | Boolean | Set to true if you want to disable all interaction, including selections, in the visualization. + * noSelections | Boolean | Set to true if you want to disable selections in the visualization. + * | | Parameter introduced in version 3.0. + */ + show(element?: any | string, options?: any): void; + } +} + +declare namespace ExtensionAPI { + + + interface IExtensionModel { + + } + + interface IExtensionComponent { + model: IExtensionModel; + } + + interface IExtensionScope extends ng.IScope { + component: IExtensionComponent; + } + + + //ExtensionAPI + type SelectionModeType = "CONFIRM" | "QUICK"; + + interface IInitialProperties { + qHyperCubeDef?: any; //IHyperCubeDef; + qListObjectDef?: any; //IListObjectDef; + fixed?: boolean; + width?: number; + percent?: boolean; + selectionMode?: SelectionModeType; + } + + interface ISupport { + snapshot?: boolean; + export?: boolean; + exportData?: boolean; + } + + interface IExtension { + definition?: IDefinition; + paint?: ($element: HTMLElement, layout?: any) => void; + initialProperties?: IInitialProperties; + template?: string; + controller?: any; + support?: ISupport; + } + + interface ISupport { + snapshot?: boolean; // | () => boolean; + export?: boolean; // | () => boolean; + canTakeSnapshot?: boolean; + } + + interface IInitialProperties { + // qHyperCubeDef: IVisualizationHyperCubeDef; + // qListObjectDef: IVis + + //[""]: + } + + //#region IDefinition + type ExpressionType = "always" | "optional" | ""; + + type func = () => T; + type valueOrfunc = T | func; + + //#region Controls + interface ICustomControlOption { + value: string; + label: string; + } + + interface ICustomControl { + type: string; + label: string; + ref: string; + } + + interface ICustomString extends ICustomControl { + defaultValue: string; + expression: ExpressionType; + show: valueOrfunc; + maxlength: number; + } + + interface ICustomNumber extends ICustomControl { + defaultValue: number; + min: number; + max: number; + } + + interface ICustomInteger extends ICustomNumber { + } + + interface ICustomArray extends ICustomControl { + itemTitleRef: string; + addTranslation: string; + allowAdd: boolean; + allowMove: boolean; + allowRemove: boolean; + } + + interface ICustomButton extends ICustomControl { + label: string; + component: "button"; + action: valueOrfunc; + } + + interface ICustomButtonGroup extends ICustomControl { + component: "buttongroup"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomCheckBox extends ICustomControl { + component: "checkbox"; + defaultValue: boolean; + } + + interface ICustomColorPicker extends ICustomControl { + component: "color-picker"; + defaultValue: number; + } + + interface ICustomDropDownList extends ICustomControl { + component: "dropdown"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomLink { + type: string; + component: "link"; + label: string; + url: string; + } + + interface ICustomMedia extends ICustomControl { + component: "media"; + layoutRef: string; + } + + interface ICustomRadioButton extends ICustomControl { + component: "radiobuttons"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomSlider extends ICustomControl { + component: "slider"; + defaultValue: number; + min: number; + max: number; + step: number; + } + + interface ICustomRangeSlider extends ICustomControl { + component: "slider"; + defaultValue: number[]; + min: number; + max: number; + step: number; + } + + interface ICustomSwitch { + component: "switch"; + defaultValue: boolean; + options: valueOrfunc; + } + + interface ICustomText { + type: "text"; + component: "text"; + label: string; + } + + interface ICustomTextArea extends ICustomControl { + component: "textarea"; + rows: number; + maxlength: number; + defaultValue: string; + show: valueOrfunc; + } + //#endregion + + interface IDefinition { + type: "items"; + component: "accordion"; + items: IItems; + } + + interface IItems { + dimentions?: IDimensions; + measures?: IMeasures; + appearance?: IAppearance; + sorting?: ISorting; + AddOns?: IAddOns; + [other: string]: any; + } + + interface IAddOns { + uses: "addons"; + } + + interface ISorting { + uses: "sorting"; + } + + interface IDimensions { + uses: "dimensions"; + min?: number; + max?: number; + } + + interface IAppearance { + uses: "settings"; + min?: number; + max?: number; + items: any; + } + + //?Das selbe wie Appearance? + interface ISettings { + uses: "settings"; + min?: number; + max?: number; + } + + interface IMeasures { + uses: "measures"; + min?: number; + max?: number; + } + + //#endregion +} + +declare module "qlik" { + var e: RootAPI.IRoot; export = e; +} + +interface IQVAngular { + /** + * Register a new directive with the compiler. + * + * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) + * @param directiveFactory An injectable directive factory function. + */ + directive(name: string, directiveFactory: ng.Injectable): void; + directive(object: { [directiveName: string]: ng.Injectable }): void; + + filter(name: string, filterFactoryFunction: ng.Injectable): void; + filter(object: { [name: string]: ng.Injectable }): void; + + /** + * Register a service constructor, which will be invoked with new to create + * the service instance. This is short for registering a service where its + * provider's $get property is a factory function that returns an instance + * instantiated by the injector from the service constructor function. + * @param name The name of the instance. + * @param serviceConstructor An injectable class (constructor function) that will be instantiated. + * @return Returns the constructed singleton of the service class/function. + */ + service(name: string, serviceConstructor: ng.Injectable): T; + service(object: { [name: string]: ng.Injectable }): T; + + //provider(name: string, serviceProviderFactory: ng.IServiceProviderFactory): void; + //provider(name: string, serviceProviderConstructor: ng.IServiceProviderClass): void; +} + +declare module "qvangular" { + var e: IQVAngular; export = e; +} \ No newline at end of file diff --git a/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts new file mode 100644 index 0000000000..76a71d22dc --- /dev/null +++ b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts @@ -0,0 +1,3 @@ +import qlik = require("qlik"); + +const t = qlik.currApp(); \ No newline at end of file diff --git a/qajax/tsconfig.json b/qlik-visualizationextensions/tsconfig.json similarity index 83% rename from qajax/tsconfig.json rename to qlik-visualizationextensions/tsconfig.json index 8ba8578ef5..c71a5c597d 100644 --- a/qajax/tsconfig.json +++ b/qlik-visualizationextensions/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" + "qlik-visualizationextensions-tests.ts" ] } \ No newline at end of file diff --git a/qlik-visualizationextensions/tslint.json b/qlik-visualizationextensions/tslint.json new file mode 100644 index 0000000000..cae1bdf2ad --- /dev/null +++ b/qlik-visualizationextensions/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false, + "no-empty-interface": false, + "interface-name": false + } +} \ No newline at end of file diff --git a/rappid/index.d.ts b/rappid/index.d.ts index 5cbf07b995..d70023e055 100644 --- a/rappid/index.d.ts +++ b/rappid/index.d.ts @@ -5,33 +5,36 @@ /// -declare namespace joint { - namespace ui { - interface Handle { - name: string; - position: string; - icon: string; - } +import * as joint from 'jointjs'; +import * as Backbone from "backbone"; - class SelectionView extends Backbone.Model { +export as namespace joint; + +export 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; + 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; - 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; - } + addHandle(handle: Handle): void; + removeHandle(name: string): void; + changeHandle(name: string, handle: Handle): void; } } diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 35a7eae5ce..29dd9fa780 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -734,6 +734,7 @@ declare module "react" { export interface TextStyleAndroid extends ViewStyle { textAlignVertical?: "auto" | "top" | "bottom" | "center" + includeFontPadding?: boolean } // @see https://facebook.github.io/react-native/docs/text.html#style @@ -2500,9 +2501,9 @@ declare module "react" { /** * Specifies the side of the screen from which the drawer will slide in. - * enum(DrawerConsts.DrawerPosition.Left, DrawerConsts.DrawerPosition.Right) + * enum(DrawerLayoutAndroid.positions.Left, DrawerLayoutAndroid.positions.Right) */ - drawerPosition?: any; + drawerPosition?: number; /** * Specifies the width of the drawer, more precisely the width of the @@ -2563,8 +2564,18 @@ declare module "react" { ref?: Ref } + interface DrawerPosition { + Left: number + Right: number + } + export interface DrawerLayoutAndroidStatic extends NativeMethodsMixin, React.ClassicComponentClass { + /** + * drawer's positions. + */ + positions: DrawerPosition + /** * Opens the drawer. */ @@ -7644,7 +7655,7 @@ declare module "react" { onNavigateBack?(): void; } - type SubViewRenderer = (subViewProps: SubViewProps) => JSX.Element; + type SubViewRenderer = (subViewProps: SubViewProps) => JSX.Element | null; export interface NavigationHeaderProps extends NavigationSceneRendererProps { onNavigateBack?(): void, diff --git a/react-paginate/index.d.ts b/react-paginate/index.d.ts index aaa3931b74..363aeb8ea1 100644 --- a/react-paginate/index.d.ts +++ b/react-paginate/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for react-paginate 2.1.3 +// Type definitions for react-paginate v4.2.0 // Project: https://github.com/AdeleD/react-paginate -// Definitions by: Simon Hartcher +// Definitions by: Simon Hartcher , Wouter Hardeman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -10,7 +10,7 @@ interface ReactPaginateProps { /** * The total number of pages. */ - pageNum: number; + pageCount: number; /** * The range of pages displayed. @@ -43,19 +43,24 @@ interface ReactPaginateProps { breakClassName?: string | JSX.Element; /** - * The method to call when a page is clicked. + * The method to call when a page is clicked. Exposes the current page object as an argument. */ - clickCallback?: Function; + onPageChange?: Function; /** * The initial page selected. */ - initialSelected?: number; + initialPage?: number; /** * To override selected page with parent prop. */ - forceSelected?: number; + forcePage?: number; + + /** + * Disable `onPageChange` callback with initial page. Default: `false` + */ + disableInitialCallback?: boolean /** * The classname of the pagination container. @@ -101,6 +106,11 @@ interface ReactPaginateProps { * The classname for disabled `previous` and `next` buttons. */ disabledClassName?: string; + + /** + * The method is called to generate the `href` attribute value on tag `a` of each page element. + */ + hrefBuilder?: Function; } declare const ReactPaginate: React.ComponentClass; diff --git a/react-paginate/react-paginate-tests.tsx b/react-paginate/react-paginate-tests.tsx index 2ae495eacf..42a7c49c30 100644 --- a/react-paginate/react-paginate-tests.tsx +++ b/react-paginate/react-paginate-tests.tsx @@ -5,7 +5,7 @@ class Test extends React.Component<{}, {}> { public render() { return ( diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 9c45ed9c7c..a693527e3e 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -7,13 +7,15 @@ declare module "react-relay" { import * as React from "react"; + type ClientMutationID = string; + /** Fragments are a hash of functions */ interface Fragments { [query: string]: ((variables?: RelayVariables) => string) } interface CreateContainerOpts { - initialVariables?: Object + initialVariables?: any fragments: Fragments prepareVariables?(prevVariables: RelayVariables): RelayVariables } @@ -31,6 +33,24 @@ declare module "react-relay" { response: any } + type RelayMutationStatus = + 'UNCOMMITTED' | // Transaction hasn't yet been sent to the server. Transaction can be committed or rolled back. + 'COMMIT_QUEUED' | // Transaction was committed but another transaction with the same collision key is pending, so the transaction has been queued to send to the server. + 'COLLISION_COMMIT_FAILED' | //Transaction was queued for commit but another transaction with the same collision key failed. All transactions in the collision queue, including this one, have been failed. Transaction can be recommitted or rolled back. + 'COMMITTING' | // Transaction is waiting for the server to respond. + 'COMMIT_FAILED'; + + class RelayMutationTransaction { + applyOptimistic(): RelayMutationTransaction; + commit(): RelayMutationTransaction | null; + recommit(): void; + rollback(): void; + getError(): Error; + getStatus(): RelayMutationStatus; + getHash(): string; + getID(): ClientMutationID; + } + interface RelayMutationRequest { getQueryString(): string getVariables(): RelayVariables @@ -104,7 +124,7 @@ declare module "react-relay" { renderFailure?(error: Error, retry: Function): JSX.Element } - type ReadyStateEvent = + type ReadyStateEvent = 'ABORT' | 'CACHE_RESTORED_REQUIRED' | 'CACHE_RESTORE_FAILED' | @@ -128,7 +148,13 @@ declare module "react-relay" { } interface RelayProp { - variables: any - setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void + readonly route: { name: string; }; // incomplete, also has params and queries + readonly variables: any; + readonly pendingVariables?: any | null; + setVariables(variables: any, onReadyStateChange?: OnReadyStateChange): void; + forceFetch(variables: any, onReadyStateChange?: OnReadyStateChange): void; + hasOptimisticUpdate(record: any): boolean; + getPendingTransactions(record: any): RelayMutationTransaction[]; + commitUpdate: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; } } diff --git a/react-relay/react-relay-tests.tsx b/react-relay/react-relay-tests.tsx index 7160e60b0a..091909cabd 100644 --- a/react-relay/react-relay-tests.tsx +++ b/react-relay/react-relay-tests.tsx @@ -74,10 +74,17 @@ class StubbedArtwork extends React.Component { const props = { artwork: { title: "CHAMPAGNE FORMICA FLAG" }, relay: { + route: { + name: "champagne" + }, variables: { artworkID: "champagne-formica-flag", }, setVariables: () => {}, + forceFetch: () => {}, + hasOptimisticUpdate: () => false, + getPendingTransactions: (): Relay.RelayMutationTransaction[] => undefined, + commitUpdate: () => {}, } } return diff --git a/react-svg-pan-zoom/index.d.ts b/react-svg-pan-zoom/index.d.ts new file mode 100644 index 0000000000..837890a507 --- /dev/null +++ b/react-svg-pan-zoom/index.d.ts @@ -0,0 +1,198 @@ +// Type definitions for react-svg-pan-zoom 2.5 +// Project: https://github.com/chrvadala/react-svg-pan-zoom#readme +// Definitions by: Huy Nguyen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +import * as React from 'react'; + +declare module 'react-svg-pan-zoom' { + + // String constants: + const MODE_IDLE = 'idle'; + const MODE_PANNING = 'panning'; + const MODE_ZOOMING = 'zooming'; + + export const TOOL_AUTO = 'auto'; + export const TOOL_NONE = 'none'; + export const TOOL_PAN = 'pan'; + export const TOOL_ZOOM_IN = 'zoom-in'; + export const TOOL_ZOOM_OUT = 'zoom-out'; + + export const POSITION_NONE = 'none'; + export const POSITION_TOP = 'top'; + export const POSITION_RIGHT = 'right'; + export const POSITION_BOTTOM = 'bottom'; + export const POSITION_LEFT = 'left'; + + export type Mode = typeof MODE_IDLE | typeof MODE_PANNING | typeof MODE_ZOOMING; + + export interface Value { + version: 2, + mode: Mode, + focus: boolean, + a: number, + b: number, + c: number, + d: number, + e: number, + f: number, + viewerWidth: number, + viewerHeight: number, + SVGWidth: number, + SVGHeight: number, + startX?: number | null, + startY?: number | null, + endX?: number | null, + endY?: number | null, + + } + + export type Tool = typeof TOOL_AUTO | typeof TOOL_NONE | typeof TOOL_PAN | + typeof TOOL_ZOOM_IN | typeof TOOL_ZOOM_OUT + export type ToolbarPosition = typeof POSITION_NONE | typeof POSITION_TOP | typeof POSITION_RIGHT | + typeof POSITION_BOTTOM | typeof POSITION_LEFT + + + export interface OptionalProps { + //background of the viewer + background: React.CSSProperties, + + //background of the svg + SVGBackground: string, + + //value of the viewer (current point of view) + value: Value | null, + + //CSS style of the Viewer + style: object, + + //className of the Viewer + className: string, + + //detect zoom operation performed trough pinch gesture or mouse scroll + detectWheel: boolean, + + //perform PAN if the mouse is on viewer border + detectAutoPan: boolean, + + //toolbar position + toolbarPosition: ToolbarPosition, + + //handler something changed + onChangeValue: (value: Value) => void, + + //handler tool changed + onChangeTool: (tool: Tool) => void, + + // Note: The `T` type parameter is the type of the `target` of the event: + //handler click + onClick: (event: ViewerMouseEvent) => void, + + //handler double click + onDoubleClick: (event: ViewerMouseEvent) => void, + + //handler mouseup + onMouseUp: (event: ViewerMouseEvent) => void, + + //handler mousemove + onMouseMove: (event: ViewerMouseEvent) => void, + + //handler mousedown + onMouseDown: (event: ViewerMouseEvent) => void, + + //if disabled the user can move the image outside the viewer + preventPanOutside: boolean, + + //how much scale in or out + scaleFactor: number, + + //current active tool (TOOL_NONE, TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT) + tool: Tool, + + //modifier keys //https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState + modifierKeys: string[], + + //override default toolbar component + // TODO: specify function type more clearly + customToolbar: React.Component | React.StatelessComponent, + + // How about touch events? They are in README but not in `propTypes`. + } + + export interface RequiredProps { + //width of the viewer displayed on screen + width: number, + //height of the viewer displayed on screen + height: number, + + //accept only one node SVG + // TODO: Figure out how to constrain `children` or maybe just leave it commented out + // because `children` is already implicit props + // children: () => any + } + + export type Props = RequiredProps & Partial + + class ReactSVGPanZoom extends React.Component { + pan(SVGDeltaX: number, SVGDeltaY: number): void + zoom(SVGPointX: number, SVGPointY: number, scaleFactor: number): void + fitSelection(selectionSVGPointX: number, selectionSVGPointY: number, selectionWidth: number, selectionHeight: number): void + fitToViewer(): void + setPointOnViewerCenter(SVGPointX: number, SVGPointY: number, zoomLevel: number): void + reset(): void + zoomOnViewerCenter(scaleFactor: number): void + getValue(): Value + setValue(value: Value): void + getTool(): Tool + setTool(tool: Tool): void + } + + + export interface Point { + x: number, + y: number, + } + + export interface ViewerMouseEvent{ + originalEvent: React.MouseEvent, + SVGViewer: SVGSVGElement, + point: Point, + x: number, + y: number, + scaleFactor: number, + translationX: number, + translationY: number, + preventDefault(): void + stopPropagation(): void + } + + export interface ViewerTouchEvent { + originalEvent: React.TouchEvent, + SVGViewer: SVGSVGElement, + points: Point[], + changedPoints: Point[], + scaleFactor: number, + translationX: number, + translationY: number, + preventDefault(): void + stopPropagation(): void + } + + // Utility functions exposed: + export function pan(value: Value, SVGDeltaX: number, SVGDeltaY: number, panLimit?: number): Value + + export function zoom(value: Value, SVGPointX: number, SVGPointY: number, scaleFactor: number): Value + + export function fitSelection( + value: Value, selectionSVGPointX: number, selectionSVGPointY: number, selectionWidth: number, selectionHeight: number): Value + + export function fitToViewer(value: Value): Value + + export function zoomOnViewerCenter(value: Value, scaleFactor: number): Value + + export function setPointOnViewerCenter(value: Value, SVGPointX: number, SVGPointY: number, zoomLevel: number): Value + + export function reset(value: Value): Value +} + + diff --git a/react-svg-pan-zoom/react-svg-pan-zoom-tests.tsx b/react-svg-pan-zoom/react-svg-pan-zoom-tests.tsx new file mode 100644 index 0000000000..dbe8f0d55e --- /dev/null +++ b/react-svg-pan-zoom/react-svg-pan-zoom-tests.tsx @@ -0,0 +1,57 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import { + ReactSVGPanZoom, + Props, + fitToViewer, + ViewerMouseEvent +} from 'react-svg-pan-zoom'; + + +class Example1 extends React.Component<{}, {}> { + Viewer: ReactSVGPanZoom + constructor(props: Props) { + super(props); + } + + componentDidMount() { + this.Viewer.fitToViewer(); + } + + render() { + return ( +
+ + + + +
+ + this.Viewer = Viewer} + onClick={(event: ViewerMouseEvent) => console.log('click', event.x, event.y, event.originalEvent)} + onMouseUp={(event: ViewerMouseEvent) => console.log('up', event.x, event.y)} + onMouseMove={(event: ViewerMouseEvent) => console.log('move', event.x, event.y)} + onMouseDown={(event: ViewerMouseEvent) => console.log('down', event.x, event.y)}> + + + + + + + + + + + + +
+ ); + } +} + +ReactDOM.render( + , + document.getElementById('app') +); diff --git a/paymentrequest/tsconfig.json b/react-svg-pan-zoom/tsconfig.json similarity index 80% rename from paymentrequest/tsconfig.json rename to react-svg-pan-zoom/tsconfig.json index e5754a139a..c1b72dd378 100644 --- a/paymentrequest/tsconfig.json +++ b/react-svg-pan-zoom/tsconfig.json @@ -1,14 +1,14 @@ { "compilerOptions": { "module": "commonjs", + "jsx": "react", "lib": [ "es6", "dom" ], - "target": "es6", "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "paymentrequest-tests.ts" + "react-svg-pan-zoom-tests.tsx" ] -} \ No newline at end of file +} diff --git a/react-svg-pan-zoom/tslint.json b/react-svg-pan-zoom/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/react-svg-pan-zoom/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/react/index.d.ts b/react/index.d.ts index 3bd624521e..cf3afd9661 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -437,7 +437,7 @@ declare namespace React { interface ChangeTargetHTMLProps extends ChangeTargetHTMLAttributes, ClassAttributes { } - interface SVGProps extends SVGAttributes, ClassAttributes { + interface SVGProps extends SVGAttributes, ClassAttributes { } interface DOMAttributes { @@ -2211,7 +2211,25 @@ declare namespace React { // - "number | string" // - "string" // - union of string literals - interface SVGAttributes extends HTMLAttributes { + interface SVGAttributes extends DOMAttributes { + // Attributes which also defined in HTMLAttributes + // See comment in SVGDOMPropertyConfig.js + className?: string; + color?: string; + height?: number | string; + id?: string; + lang?: string; + max?: number | string; + media?: string; + method?: string; + min?: number | string; + name?: string; + style?: CSSProperties; + target?: string; + type?: string; + width?: number | string; + + // SVG Specific attributes accentHeight?: number | string; accumulate?: "none" | "sum"; additive?: "replace" | "sum"; @@ -2404,7 +2422,6 @@ declare namespace React { textRendering?: number | string; to?: number | string; transform?: string; - type?: string; u1?: number | string; u2?: number | string; underlinePosition?: number | string; @@ -2802,61 +2819,61 @@ declare global { wbr: React.HTMLProps; // SVG - svg: React.SVGProps; + svg: React.SVGProps; - animate: React.SVGProps; - circle: React.SVGProps; - clipPath: React.SVGProps; - defs: React.SVGProps; - desc: React.SVGProps; - ellipse: React.SVGProps; - feBlend: React.SVGProps; - feColorMatrix: React.SVGProps; - feComponentTransfer: React.SVGProps; - feComposite: React.SVGProps; - feConvolveMatrix: React.SVGProps; - feDiffuseLighting: React.SVGProps; - feDisplacementMap: React.SVGProps; - feDistantLight: React.SVGProps; - feFlood: React.SVGProps; - feFuncA: React.SVGProps; - feFuncB: React.SVGProps; - feFuncG: React.SVGProps; - feFuncR: React.SVGProps; - feGaussianBlur: React.SVGProps; - feImage: React.SVGProps; - feMerge: React.SVGProps; - feMergeNode: React.SVGProps; - feMorphology: React.SVGProps; - feOffset: React.SVGProps; - fePointLight: React.SVGProps; - feSpecularLighting: React.SVGProps; - feSpotLight: React.SVGProps; - feTile: React.SVGProps; - feTurbulence: React.SVGProps; - filter: React.SVGProps; - foreignObject: React.SVGProps; - g: React.SVGProps; - image: React.SVGProps; - line: React.SVGProps; - linearGradient: React.SVGProps; - marker: React.SVGProps; - mask: React.SVGProps; - metadata: React.SVGProps; - path: React.SVGProps; - pattern: React.SVGProps; - polygon: React.SVGProps; - polyline: React.SVGProps; - radialGradient: React.SVGProps; - rect: React.SVGProps; - stop: React.SVGProps; - switch: React.SVGProps; - symbol: React.SVGProps; - text: React.SVGProps; - textPath: React.SVGProps; - tspan: React.SVGProps; - use: React.SVGProps; - view: React.SVGProps; + animate: React.SVGProps; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now. + circle: React.SVGProps; + clipPath: React.SVGProps; + defs: React.SVGProps; + desc: React.SVGProps; + ellipse: React.SVGProps; + feBlend: React.SVGProps; + feColorMatrix: React.SVGProps; + feComponentTransfer: React.SVGProps; + feComposite: React.SVGProps; + feConvolveMatrix: React.SVGProps; + feDiffuseLighting: React.SVGProps; + feDisplacementMap: React.SVGProps; + feDistantLight: React.SVGProps; + feFlood: React.SVGProps; + feFuncA: React.SVGProps; + feFuncB: React.SVGProps; + feFuncG: React.SVGProps; + feFuncR: React.SVGProps; + feGaussianBlur: React.SVGProps; + feImage: React.SVGProps; + feMerge: React.SVGProps; + feMergeNode: React.SVGProps; + feMorphology: React.SVGProps; + feOffset: React.SVGProps; + fePointLight: React.SVGProps; + feSpecularLighting: React.SVGProps; + feSpotLight: React.SVGProps; + feTile: React.SVGProps; + feTurbulence: React.SVGProps; + filter: React.SVGProps; + foreignObject: React.SVGProps; + g: React.SVGProps; + image: React.SVGProps; + line: React.SVGProps; + linearGradient: React.SVGProps; + marker: React.SVGProps; + mask: React.SVGProps; + metadata: React.SVGProps; + path: React.SVGProps; + pattern: React.SVGProps; + polygon: React.SVGProps; + polyline: React.SVGProps; + radialGradient: React.SVGProps; + rect: React.SVGProps; + stop: React.SVGProps; + switch: React.SVGProps; + symbol: React.SVGProps; + text: React.SVGProps; + textPath: React.SVGProps; + tspan: React.SVGProps; + use: React.SVGProps; + view: React.SVGProps; } } } diff --git a/react/test/index.ts b/react/test/index.ts index 1bf6c8dcc2..f0fee7a00b 100644 --- a/react/test/index.ts +++ b/react/test/index.ts @@ -342,6 +342,9 @@ React.DOM.svg({ xmlns: "http://www.w3.org/2000/svg" }, React.DOM.rect({ + className: 'foobar', + id: 'foo', + color: 'black', x: 22, y: 10, width: 4, diff --git a/redux-action/index.d.ts b/redux-action/index.d.ts new file mode 100644 index 0000000000..eff19178e9 --- /dev/null +++ b/redux-action/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for redux-action 1.2 +// Project: https://github.com/coderhaoxin/redux-action +// Definitions by: newraina +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * inspired by @types/redux-actions, thanks. + */ + +import * as Redux from 'redux'; + +export as namespace ReduxAction; + +interface BaseAction { + type: string; +} + +interface Action extends BaseAction { + payload: Payload; +} + +interface MetaAction extends Action { + meta: Meta; +} + +type ThunkAction = (dispatch: Redux.Dispatch, getState: () => any) => Promise>; +type ThunkMetaAction = (dispatch: Redux.Dispatch, getState: () => any) => Promise>; + +/** argument inferring borrowed from redux-actions definitions */ +type ActionFunction0 = () => R; +type ActionFunction1 = (t1: T1) => R; +type ActionFunction2 = (t1: T1, t2: T2) => R; +type ActionFunction3 = (t1: T1, t2: T2, t3: T3) => R; +type ActionFunctionAny = (...args: any[]) => R; + +type ReducerHandler =
(payload: any, state?: State, action?: A) => S; + +interface ReducerHandlers { + [type: string]: ReducerHandler; +} + +export function createAction( + type: string, + payloadCreator: ActionFunctionAny | Payload>, +): ActionFunctionAny>; + +export function createAction( + payloadCreator: ActionFunctionAny | Payload>, +): ActionFunctionAny>; + +export function createAction( + payloadCreator: ActionFunction1 | Payload>, +): ActionFunction1>; + +export function createAction( + payloadCreator: ActionFunction2 | Payload>, +): ActionFunction2>; + +export function createAction( + payloadCreator: ActionFunction3 | Payload>, +): ActionFunction3>; + +export function createAction( + type: string, + payloadCreator: ActionFunctionAny | Payload>, + metaCreator: ActionFunctionAny +): ActionFunctionAny>; + +export function createAction( + payloadCreator: ActionFunctionAny | Payload>, + metaCreator: ActionFunctionAny +): ActionFunctionAny>; + +export function createAction( + type?: string, +): ActionFunction1>; + +export function createAction( + type?: string, +): ActionFunction1>; + +export function createSyncAction( + type: string, + payloadCreator?: ActionFunctionAny, +): ActionFunctionAny>; + +export function createSyncAction( + type: string, + payloadCreator: ActionFunctionAny, + metaCreator: ActionFunctionAny +): ActionFunctionAny>; + +export function createReducer(defaultState: State, handlers: ReducerHandlers): Redux.Reducer; diff --git a/redux-action/package.json b/redux-action/package.json new file mode 100644 index 0000000000..973078f95d --- /dev/null +++ b/redux-action/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "redux": "^3.6.0", + "redux-thunk": "^2.2.0" + } +} diff --git a/redux-action/redux-action-tests.ts b/redux-action/redux-action-tests.ts new file mode 100644 index 0000000000..cad92bba34 --- /dev/null +++ b/redux-action/redux-action-tests.ts @@ -0,0 +1,84 @@ + +import * as ReduxAction from 'redux-action'; +import * as ReduxThunk from 'redux-thunk'; +import * as Redux from 'redux'; + +interface Payload { + name: string; + id: number; +} + +const dispatch: Redux.Dispatch = (...args: any[]): any => { }; + +const actionCreator0 = ReduxAction.createAction('get items'); + +dispatch(actionCreator0(1)) + .then(action => { + const type: string = action.type; + const payload: Payload = action.payload; + }); + +const actionCreator1 = ReduxAction.createAction(); + +dispatch(actionCreator1(1)) + .then(action => { + const type: string = action.type; + const payload: Payload = action.payload; + }); + +const actionCreator2 = ReduxAction.createAction('get items', (name: string) => name); + +dispatch(actionCreator2(1)) + .then(action => { + const type: string = action.type; + const payload: string = action.payload; + }); + +const actionCreator3 = ReduxAction.createAction('get items', (name: string) => Promise.resolve(name)); + +dispatch(actionCreator3(1)) + .then(action => { + const type: string = action.type; + const payload: string = action.payload; + }); + +const actionCreator4 = ReduxAction.createAction((name: string) => name); + +dispatch(actionCreator4(1)) + .then(action => { + const type: string = action.type; + const payload: string = action.payload; + }); + +const actionCreator5 = ReduxAction.createAction((name: string) => 1); + +dispatch(actionCreator5('items')) + .then(action => { + const type: string = action.type; + const payload: number = action.payload; + }); + +const actionCreator6 = ReduxAction.createAction((name: string) => 1); + +dispatch(actionCreator6('items', false)) + .then(action => { + const type: string = action.type; + const payload: number = action.payload; + }); + +const syncActionCreator0 = ReduxAction.createSyncAction('get items'); +const syncAction0: ReduxAction.Action = dispatch(syncActionCreator0(1)); + +const syncActionCreator1 = ReduxAction.createSyncAction('get items', (name: string) => name); +const syncAction1: ReduxAction.Action = dispatch(syncActionCreator1(1)); + +interface State { + name: string; +} +const reducer = ReduxAction.createReducer({ name: 'name' }, { + 'get items': () => { + return 'new name'; + } +}); + +const combinedReducer: Redux.Reducer = Redux.combineReducers({ reducer }); diff --git a/localforage/tsconfig.json b/redux-action/tsconfig.json similarity index 85% rename from localforage/tsconfig.json rename to redux-action/tsconfig.json index 1e3cbf9e63..0acc89b041 100644 --- a/localforage/tsconfig.json +++ b/redux-action/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "localforage-tests.ts" + "redux-action-tests.ts" ] -} \ No newline at end of file +} diff --git a/redux-action/tslint.json b/redux-action/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/redux-action/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/rheostat/index.d.ts b/rheostat/index.d.ts new file mode 100644 index 0000000000..372e5c6f1b --- /dev/null +++ b/rheostat/index.d.ts @@ -0,0 +1,49 @@ +// Type definitions for rheostat 2.1 +// Project: https://github.com/airbnb/rheostat +// Definitions by: Sasha Bayan , Wil Lee +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import * as React from 'react'; + +export type Orientation = 'horizontal' | 'vertical'; + +export interface Algorithm { + getPosition(value: number, min: number, max: number): number; + getValue(pos: number, min: number, max: number): number; +} + +export interface PublicState { + max: number; + min: number; + values: number[]; +} + +export interface Events { + onClick?: () => any; + onChange?: (publicState: PublicState) => any; + onKeyPress?: () => any; + onSliderDragEnd?: () => any; + onSliderDragMove?: () => any; + onSliderDragStart?: () => any; + onValuesUpdated?: (publicState: PublicState) => any; +} + +export interface Props extends Events { + algorithm?: Algorithm; + className?: string; + disabled?: boolean; + handle?: React.ReactType; + max?: number; + min?: number; + orientation?: Orientation; + pitComponent?: React.ReactType; + pitPoints?: number[]; + progressBar?: React.ReactType; + snap?: boolean; + snapPoints?: number[]; + values?: number[]; +} + +export default class Rheostat extends React.Component {} + diff --git a/rheostat/rheostat-tests.tsx b/rheostat/rheostat-tests.tsx new file mode 100644 index 0000000000..1116861943 --- /dev/null +++ b/rheostat/rheostat-tests.tsx @@ -0,0 +1,74 @@ +import * as React from 'react'; +import Rheostat, {Orientation, Algorithm, PublicState} from 'rheostat'; + +type Element = React.ReactElement; + +function Basic(props: {}): Element { + return ; +} + +function MultiHandles(props: {}): Element { + return ( + + ); +} + +function CustomAlgorithm(props: {}): Element { + const geometric: Algorithm = { + getPosition(x: number, min: number, max: number) { + return ((max / (max - min)) ** 0.5) * (((x - min) / max) ** 0.5) * 100; + }, + + getValue(x: number, min: number, max: number) { + return (Math.floor(((x / 100) ** 2) * (max - min)) + min); + } + }; + + return ; +} + +function ComponentOverrides(props: {}): Element { + function Bar(props: {}): Element { return
; } + return ( + + ); +} + +function Vertical(props: {}): Element { + return ; +} + +function Pits(props: {}): Element { + function Pit(props: {}): Element { return ; } + return ( + + ); +} + +function CustomValues(props: {}): Element { + return ( + + ); +} + +function Handlers(props: {}): Element { + function handler(data: PublicState): void {} + return ( + + ); +} diff --git a/xmpp-jid/tsconfig.json b/rheostat/tsconfig.json similarity index 81% rename from xmpp-jid/tsconfig.json rename to rheostat/tsconfig.json index f4d02187a2..384dce128d 100644 --- a/xmpp-jid/tsconfig.json +++ b/rheostat/tsconfig.json @@ -1,9 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6", "dom"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -12,11 +10,12 @@ "../" ], "types": [], + "jsx": "react", "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "xmpp-jid-tests.ts" + "rheostat-tests.tsx" ] -} \ No newline at end of file +} diff --git a/rheostat/tslint.json b/rheostat/tslint.json new file mode 100644 index 0000000000..ec365f164b --- /dev/null +++ b/rheostat/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} diff --git a/riot/index.d.ts b/riot/index.d.ts index 3abb3fa147..3c76a0b1d0 100644 --- a/riot/index.d.ts +++ b/riot/index.d.ts @@ -205,8 +205,9 @@ declare namespace riot { * Register a shared mixin, globally available to be used in any tag using `TagInstance.mixin(mixinName)` * @param mixinName Name of the mixin * @param mixinObject Mixin object + * @param isGlobal Is global mixin? */ - function mixin(mixinName: string, mixinObject: TagMixin): void; + function mixin(mixinName: string, mixinObject: TagMixin, isGlobal?: boolean): void; /** * Create a new custom tag “manually” without the compiler. Returns name of the tag. diff --git a/run-sequence/tsconfig.json b/run-sequence/tsconfig.json index b03e01e277..2d7e6640db 100644 --- a/run-sequence/tsconfig.json +++ b/run-sequence/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/scripts/not-needed.js b/scripts/not-needed.js index f5b5cc8e6a..2462f3f2e2 100644 --- a/scripts/not-needed.js +++ b/scripts/not-needed.js @@ -16,6 +16,7 @@ if (process.argv.length !== 5 && process.argv.length !== 6) { rmdirRecursive(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/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/session-file-store/session-file-store-tests.ts b/session-file-store/session-file-store-tests.ts index b268aea8b0..ffe3c79bee 100644 --- a/session-file-store/session-file-store-tests.ts +++ b/session-file-store/session-file-store-tests.ts @@ -1,14 +1,13 @@ import FileStore = require("session-file-store"); -const options:FileStore.Options = { +const options: FileStore.Options = { path: "./tmp/sessions/", - logFn:function(a:string) { - + logFn: (a: string) => { } }; const sessionStore = new FileStore(options); -sessionStore.list(function (err: any, file: Array) { +sessionStore.list((err: any, file: Array) => { -}); +}); \ No newline at end of file diff --git a/sinon/index.d.ts b/sinon/index.d.ts index 7c44ab9d7a..e4ba1ad612 100644 --- a/sinon/index.d.ts +++ b/sinon/index.d.ts @@ -102,6 +102,7 @@ declare namespace Sinon { throws(type?: string): SinonStub; throws(obj: any): SinonStub; callsArg(index: number): SinonStub; + callThrough(): SinonStub; callsArgOn(index: number, context: any): SinonStub; callsArgWith(index: number, ...args: any[]): SinonStub; callsArgOnWith(index: number, context: any, ...args: any[]): SinonStub; diff --git a/sparkpost/index.d.ts b/sparkpost/index.d.ts index c88fab5d92..fc6e408949 100644 --- a/sparkpost/index.d.ts +++ b/sparkpost/index.d.ts @@ -1,9 +1,8 @@ -// Type definitions for sparkpost v1.3 +// Type definitions for sparkpost 2.1 // Project: https://github.com/SparkPost/node-sparkpost -// Definitions by: Joshua DeVinney +// Definitions by: Joshua DeVinney , Bond // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// import * as Request from "request"; @@ -16,25 +15,48 @@ declare class SparkPost { * List all your inbound domains. * @param callback The request callback with Domain results array */ - all(callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; + /** + * List all your inbound domains. + * @returns Promise The Domain results array + */ + list(): SparkPost.ResultsPromise; /** * Retrieve an inbound domain by specifying its domain name in the URI path. * @param domain Domain name * @param callback The request callback with Domain results */ - find(domain: string, callback: SparkPost.ResultsCallback): void; + get(domain: string, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve an inbound domain by specifying its domain name in the URI path. + * @param domain Domain name + * @returns Promise The Domain results + */ + get(domain: string): SparkPost.ResultsPromise; /** * Create an inbound domain by providing an inbound domains object as the POST request body. - * @param domain Domain name + * @param createOpts a hash of [inbound domain attributes]{@link https://developers.sparkpost.com/api/inbound-domains#header-inbound-domains-attributes} * @param callback The request callback */ - create(domain: string, callback: SparkPost.Callback): void; + create(createOpts: SparkPost.CreateOpts, callback: SparkPost.Callback): void; + /** + * Create an inbound domain by providing an inbound domains object as the POST request body. + * @param createOpts a hash of [inbound domain attributes]{@link https://developers.sparkpost.com/api/inbound-domains#header-inbound-domains-attributes} + * @returns Promise void + */ + create(createOpts: SparkPost.CreateOpts): Promise; /** * Delete an inbound domain by specifying its domain name in the URI path. * @param domain Domain name * @param callback The request callback */ delete(domain: string, callback: SparkPost.Callback): void; + /** + * Delete an inbound domain by specifying its domain name in the URI path. + * @param domain Domain name + * @returns Promise void + */ + delete(domain: string): Promise; }; /** The Message Events API provides the means to search the raw events generated by SparkPost. */ messageEvents: { @@ -44,29 +66,57 @@ declare class SparkPost { * @param callback The request callback with MessageEvent results array */ search(parameters: SparkPost.MessageEventParameters, callback: SparkPost.ResultsCallback): void; + /** + * Retrieves list of message events according to given params + * @param parameters Query parameters + * @returns Promise The MessageEvent results array + */ + search(parameters: SparkPost.MessageEventParameters): SparkPost.ResultsPromise; }; /** A recipient list is a collection of recipients that can be used in a transmission. */ recipientLists: { /** * List a summary of all recipient lists. The recipients for each list are not included in the results. - * To retrieve recipient details, use the RETRIEVE API for a specified recipient list. + * To retrieve recipient details, use the [Retrieve a Recipient List endpoint]{@link https://developers.sparkpost.com/api/recipient-lists.html#recipient-lists-retrieve-get}, + * and specify the recipient list. + * * @param callback The request callback with RecipientList results array */ - all(callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; + /** + * List a summary of all recipient lists. The recipients for each list are not included in the results. + * To retrieve recipient details, use the [Retrieve a Recipient List endpoint]{@link https://developers.sparkpost.com/api/recipient-lists.html#recipient-lists-retrieve-get}, + * and specify the recipient list. + * + * @returns Promise The RecipientList results array + */ + list(): SparkPost.ResultsPromise; /** * Retrieve details about a specified recipient list by specifying its id in the URI path. * To retrieve the recipients contained in a list, the show_recipients parameter must be set to true. - * @param options The find options - * @param callback The request callback with RecipientList results + * + * @param {string} id + * @param {{ show_recipients?: boolean }} specifies whether to retrieve the recipients. Defaults to false + * @param {SparkPost.Callback} callback */ - find(options: { id: string, show_recipients?: false }, callback: SparkPost.Callback): void; + get(id: string, options: { show_recipients?: boolean }, callback: SparkPost.Callback): void; /** * Retrieve details about a specified recipient list by specifying its id in the URI path. * To retrieve the recipients contained in a list, the show_recipients parameter must be set to true. - * @param options The find options - * @param callback The request callback with RecipientList results (with recipients) + * + * @param {string} id + * @param {SparkPost.Callback} callback */ - find(options: { id: string, show_recipients: true }, callback: SparkPost.Callback): void; + get(id: string, callback: SparkPost.Callback): void; + /** + * Retrieve details about a specified recipient list by specifying its id in the URI path. + * To retrieve the recipients contained in a list, the show_recipients parameter must be set to true. + * + * @param {string} id + * @param {{ show_recipients?: boolean }} [options] specifies whether to retrieve the recipients. Defaults to false + * @returns {Promise} + */ + get(id: string, options?: { show_recipients?: boolean }): SparkPost.ResultsPromise; /** * Create a recipient list by providing a recipient list object as the POST request body. * At a minimum, the “recipients” array is required, which must contain a valid “address”. @@ -76,19 +126,47 @@ declare class SparkPost { * @param callback The request callback with metadata results */ create(options: SparkPost.CreateRecipientList, callback: SparkPost.ResultsCallback): void; + /** + * Create a recipient list by providing a recipient list object as the POST request body. + * At a minimum, the “recipients” array is required, which must contain a valid “address”. + * If the recipient list “id” is not provided in the POST request body, one will be generated and returned in the results body. + * Use the num_rcpt_errors parameter to limit the number of recipient errors returned. + * @param options The create options + * @returns Promise metadata results + */ + create(options: SparkPost.CreateRecipientList): SparkPost.ResultsPromise; /** * Update an existing recipient list by specifying its ID in the URI path and use a recipient list object as the PUT request body. * Use the num_rcpt_errors parameter to limit the number of recipient errors returned. + * + * @param {string} id Identifier of the recipient list * @param options The update options * @param callback The request callback with metadata results */ - update(options: SparkPost.UpdateRecipientList, callback: SparkPost.ResultsCallback): void; + update(id: string, options: SparkPost.UpdateRecipientList, callback: SparkPost.ResultsCallback): void; + /** + * Update an existing recipient list by specifying its ID in the URI path and use a recipient list object as the PUT request body. + * Use the num_rcpt_errors parameter to limit the number of recipient errors returned. + * + * @param {string} id Identifier of the recipient list + * @param {SparkPost.UpdateRecipientList} options + * @returns {SparkPost.ResultsPromise} + */ + update(id: string, options: SparkPost.UpdateRecipientList): SparkPost.ResultsPromise; /** * Permanently delete the specified recipient list. + * * @param id The list id * @param callback The request callback */ delete(id: string, callback: SparkPost.Callback): void; + /** + * Permanently delete the specified recipient list. + * + * @param id The list id + * @returns Promise void + */ + delete(id: string): Promise; }; /** Relay Webhooks are a way to instruct SparkPost to accept inbound email on your behalf and forward it to you over HTTP for your own consumption. */ relayWebhooks: { @@ -96,68 +174,142 @@ declare class SparkPost { * List all your relay webhooks. * @param callback The request callback with RelayWebhook results array */ - all(callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; + /** + * List all your relay webhooks. + * @returns Promise The RelayWebhook results array + */ + list(): SparkPost.ResultsPromise; /** * Delete a relay webhook by specifying the webhook ID in the URI path. * @param relayWebhookId The webhook id * @param callback The request callback with RelayWebhook results */ - find(relayWebhookId: string, callback: SparkPost.ResultsCallback): void; + get(relayWebhookId: string, callback: SparkPost.ResultsCallback): void; + /** + * Delete a relay webhook by specifying the webhook ID in the URI path. + * @param relayWebhookId The webhook id + * @returns Promise The RelayWebhook results + */ + get(relayWebhookId: string): SparkPost.ResultsPromise; /** * Create a relay webhook by providing a relay webhooks object as the POST request body. * @param options The create options * @param callback The request callback with webhook id results */ create(options: SparkPost.RelayWebhook, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Create a relay webhook by providing a relay webhooks object as the POST request body. + * @param options The create options + * @returns Promise The webhook id results + */ + create(options: SparkPost.RelayWebhook): SparkPost.ResultsPromise<{ id: string }>; /** * Update a relay webhook by specifying the webhook ID in the URI path. * @param options The update options * @param callback The request callback with webhook id results */ - update(options: SparkPost.UpdateRelayWebhook & { relayWebhookId: string }, callback: SparkPost.ResultsCallback<{ id: string }>): void; + update(id: string, options: SparkPost.UpdateRelayWebhook, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Update a relay webhook by specifying the webhook ID in the URI path. + * @param options The update options + * @returns Promise The webhook id results + */ + update(id: string, options: SparkPost.UpdateRelayWebhook): SparkPost.ResultsPromise<{ id: string }>; /** * Delete a relay webhook by specifying the webhook ID in the URI path. * @param relayWebhookId The webhook id * @param callback The request callback */ delete(relayWebhookId: string, callback: SparkPost.Callback): void; + /** + * Delete a relay webhook by specifying the webhook ID in the URI path. + * @param relayWebhookId The webhook id + * @returns Promise void + */ + delete(relayWebhookId: string): Promise; }; sendingDomains: { /** * List an overview of all sending domains in the system. * @param callback The request callback with SendingDomain results array */ - all(callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; + /** + * List an overview of all sending domains in the system. + * + * @returns The SendingDomain results array + */ + list(): SparkPost.ResultsPromise; /** * Retrieve a sending domain by specifying its domain name in the URI path. The response includes details about its DKIM key configuration. * @param domain The domain * @param callback The request callback with SendingDomain results */ - find(domain: string, callback: SparkPost.ResultsCallback): void; + get(domain: string, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve a sending domain by specifying its domain name in the URI path. The response includes details about its DKIM key configuration. + * + * @param domain The domain + * @returns Promise The SendingDomain results + */ + get(domain: string): SparkPost.ResultsPromise; /** * Create a sending domain by providing a sending domain object as the POST request body. * @param options The create options * @param callback The request callback with basic info results */ create(options: SparkPost.CreateSendingDomain, callback: SparkPost.ResultsCallback<{ message: string, domain: string }>): void; + /** + * Create a sending domain by providing a sending domain object as the POST request body. + * + * @param options The create options + * @returns Promise The basic info results + */ + create(options: SparkPost.CreateSendingDomain): SparkPost.ResultsPromise<{ message: string, domain: string }>; /** * Update the attributes of an existing sending domain by specifying its domain name in the URI path and use a sending domain object as the PUT request body. - * @param options The update options + * @param domain The domain + * @param updateOpts The update options * @param callback The request callback with basic info results */ - update(options: SparkPost.UpdateSendingDomain, callback: SparkPost.ResultsCallback<{ message: string, domain: string }>): void; + update(domain: string, updateOpts: SparkPost.UpdateSendingDomain, callback: SparkPost.ResultsCallback<{ message: string, domain: string }>): void; + /** + * Update the attributes of an existing sending domain by specifying its domain name in the URI path and use a sending domain object as the PUT request body. + * + * @param domain The domain + * @param updateOpts The update options + * @returns Promise The basic info results + */ + update(domain: string, updateOpts: SparkPost.UpdateSendingDomain): SparkPost.ResultsPromise<{ message: string, domain: string }>; /** * Delete an existing sending domain. * @param domain The domain * @param callback The request callback */ delete(domain: string, callback: SparkPost.Callback): void; + /** + * Delete an existing sending domain. + * + * @param domain The domain + * @returns Promise void + */ + delete(domain: string): Promise; /** * Verify a Sending Domain - * @param options The verify options + * @param domain The domain + * @param options a hash of [verify attributes]{@link https://developers.sparkpost.com/api/sending-domains#header-verify-attributes} * @param callback The request callback with verify results */ - verify(options: SparkPost.VerifyOptions, callback: SparkPost.ResultsCallback): void; + verify(domain: string, options: SparkPost.VerifyOptions, callback: SparkPost.ResultsCallback): void; + /** + * Verify a Sending Domain + * + * @param domain The domain + * @param options a hash of [verify attributes]{@link https://developers.sparkpost.com/api/sending-domains#header-verify-attributes} + * @returns Promise The verify results + */ + verify(domain: string, options: SparkPost.VerifyOptions): SparkPost.ResultsPromise; }; subaccounts: { /** @@ -165,164 +317,412 @@ declare class SparkPost { * This endpoint only returns information about the subaccounts themselves, not the data associated with the subaccount. * @param callback The request callback with subaccount information results array */ - all(callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; /** - * - * @param subaccountId The webhook id + * Endpoint for retrieving a list of your subaccounts. + * This endpoint only returns information about the subaccounts themselves, not the data associated with the subaccount. + * + * @returns Promise The subaccount information results array + */ + list(): SparkPost.ResultsPromise; + /** + * Get details about a specified subaccount by its id + * + * @param id the id of the subaccount you want to look up * @param callback The request callback with subaccount information results */ - find(subaccountId: string | number, callback: SparkPost.ResultsCallback): void; + get(id: string | number, callback: SparkPost.ResultsCallback): void; + /** + * Get details about a specified subaccount by its id + * + * @param id the id of the subaccount you want to look up + * @returns Promise The subaccount information results + */ + get(id: string | number): SparkPost.ResultsPromise; /** * Provisions a new subaccount and an initial subaccount API key. - * @param options The create options + * @param subaccount The create options * @param callback The request callback with basic subaccount information results */ - create(options: SparkPost.CreateSubaccount, callback: SparkPost.ResultsCallback): void; + create(subaccount: SparkPost.CreateSubaccount, callback: SparkPost.ResultsCallback): void; + /** + * Provisions a new subaccount and an initial subaccount API key. + * + * @param subaccount The create options + * @returns Promise The basic subaccount information results + */ + create(subaccount: SparkPost.CreateSubaccount): SparkPost.ResultsPromise; /** * Update an existing subaccount’s information. - * @param options The create options + * + * @param id the id of the subaccount you want to update + * @param subaccount an object of [updatable subaccount attributes]{@link https://developers.sparkpost.com/api/subaccounts#header-request-body-attributes-1} * @param callback The request callback with webhook id results */ - update(options: SparkPost.UpdateSubaccount, callback: SparkPost.ResultsCallback<{ message: string }>): void; + update(id: string, subaccount: SparkPost.UpdateSubaccount, callback: SparkPost.ResultsCallback<{ message: string }>): void; + /** + * Update an existing subaccount’s information. + * + * @param id the id of the subaccount you want to update + * @param subaccount an object of [updatable subaccount attributes]{@link https://developers.sparkpost.com/api/subaccounts#header-request-body-attributes-1} + * @returns Promise The webhook id results + */ + update(id: string, subaccount: SparkPost.UpdateSubaccount): SparkPost.ResultsPromise<{ message: string }>; }; suppressionList: { /** - * Perform a filtered search for entries in your suppression list. - * @param parameters Object of search parameters - * @param callback The request callback with RelayWebhook results + * List all entries in your suppression list, filtered by an optional set of search parameters. + * + * @param {SparkPost.ResultsCallback} callback The request callback with supression lists. */ - search(parameters: SparkPost.SupressionSearch, callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; /** - * Retrieve the suppression status for a specific recipient by specifying the recipient’s email address in the URI path. - * @param email Email address to check - * @param callback The request callback with webhook id results + * List all entries in your suppression list, filtered by an optional set of search parameters. + * + * @param {SparkPost.SupressionSearchParameters} parameters an object of [search parameters]{@link https://developers.sparkpost.com/api/suppression-list#suppression-list-search-get} + * @param {SparkPost.ResultsCallback} callback The request callback with supression lists. */ - checkStatus(email: string, callback: SparkPost.ResultsCallback): void; + list(parameters: SparkPost.SupressionSearchParameters, callback: SparkPost.ResultsCallback): void; + /** + * List all entries in your suppression list, filtered by an optional set of search parameters. + * + * @param {SparkPost.SupressionSearchParameters} [parameters] an object of [search parameters]{@link https://developers.sparkpost.com/api/suppression-list#suppression-list-search-get} + * @returns {Promise} Promise The supression lists + */ + list(parameters?: SparkPost.SupressionSearchParameters): SparkPost.ResultsPromise; + /** + * Retrieve an entry by recipient email. + * + * @param {string} email address to check + * @returns void + */ + get(email: string, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve an entry by recipient email. + * + * @param {string} email address to check + * @returns void + */ + get(email: string): SparkPost.ResultsPromise; /** * Delete a recipient from the list by specifying the recipient’s email address in the URI path. - * @param email Email address to check - * @param callback The request callback + * + * @param {string} email Recipient email address + * @param callback */ - removeStatus(email: string, callback: SparkPost.Callback): void; + delete(email: string, callback: SparkPost.Callback): void; /** - * Bulk insert or update entries in the customer-specific exclusion list. - * @param parameters The suppression entry list + * Delete a recipient from the list by specifying the recipient’s email address in the URI path. + * + * @param {string} email Recipient email address + * @returns {Promise} void + */ + delete(email: string): Promise; + /** + * Insert or update one or many entries. + * + * @param listEntries The suppression entry list * @param callback The request callback */ - upsert(parameters: SparkPost.CreateSupressionListEntry | SparkPost.CreateSupressionListEntry[], callback: SparkPost.ResultsCallback<{ message: string }>): void; + upsert(listEntries: SparkPost.CreateSupressionListEntry | SparkPost.CreateSupressionListEntry[], callback: SparkPost.ResultsCallback<{ message: string }>): void; + /** + * Insert or update one or many entries. + * + * @param {(SparkPost.CreateSupressionListEntry | SparkPost.CreateSupressionListEntry[])} listEntries The suppression entry list + * @returns {Promise<{ message: string }>} + */ + upsert(listEntries: SparkPost.CreateSupressionListEntry | SparkPost.CreateSupressionListEntry[]): SparkPost.ResultsPromise<{ message: string }>; }; templates: { /** * List a summary of all templates. * @param callback The request callback with TemplateMeta results array */ - all(callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; + /** + * List a summary of all templates. + * + * @returns {SparkPost.ResultsPromise} The TemplateMeta results array + */ + list(): SparkPost.ResultsPromise; /** * Retrieve details about a specified template by its id - * @param options The id and draft status information + * + * @param id the id of the template you want to look up + * @param options specifies a draft or published template * @param callback The request callback with Template results */ - find(options: { id: string, draft?: boolean }, callback: SparkPost.ResultsCallback): void; + get(id: string, options: { draft?: boolean }, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve details about a specified template by its id + * + * @param {string} id the id of the template you want to look up + * @param {SparkPost.ResultsCallback} callback The request callback with Template results + */ + get(id: string, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve details about a specified template by its id + * + * @param {string} id the id of the template you want to look up + * @param {{ draft?: boolean }} [options] specifies a draft or published template + * @returns {SparkPost.ResultsPromise} The Template results + */ + get(id: string, options?: { draft?: boolean }): SparkPost.ResultsPromise; /** * Create a new template - * @param options The create options + * + * @param template an object of [template attributes]{@link https://developers.sparkpost.com/api/templates#header-template-attributes} * @param callback The request callback with template id results */ - create(options: { template: SparkPost.CreateTemplate }, callback: SparkPost.ResultsCallback<{ id: string }>): void; + create(template: SparkPost.CreateTemplate, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Create a new template + * + * @param {SparkPost.CreateTemplate} template an object of [template attributes]{@link https://developers.sparkpost.com/api/templates#header-template-attributes} + * @returns {SparkPost.ResultsPromise<{ id: string }>} The template id results + */ + create(template: SparkPost.CreateTemplate): SparkPost.ResultsPromise<{ id: string }>; /** * Update an existing template - * @param options The create options + * + * @param {string} id the id of the template you want to update + * @param template an object of [template attributes]{@link https://developers.sparkpost.com/api/templates#header-template-attributes} + * @param options The create options. If true, directly overwrite the existing published template. If false, create a new draft * @param callback The request callback with template id results */ - update(options: { - id: string, - template: SparkPost.UpdateTemplate, + update(id: string, template: SparkPost.UpdateTemplate, options: { update_published?: boolean; }, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Update an existing template + * + * @param {string} id the id of the template you want to update + * @param {SparkPost.UpdateTemplate} template an object of [template attributes]{@link https://developers.sparkpost.com/api/templates#header-template-attributes} + * @param {SparkPost.ResultsCallback<{ id: string }>} callback The request callback with template id results + */ + update(id: string, template: SparkPost.UpdateTemplate, + callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Update an existing template + * + * @param {string} id the id of the template you want to update + * @param {SparkPost.UpdateTemplate} template an object of [template attributes]{@link https://developers.sparkpost.com/api/templates#header-template-attributes} + * @param {{ + * update_published?: boolean; + * }} [options] If true, directly overwrite the existing published template. If false, create a new draft + * @returns {SparkPost.ResultsPromise<{ id: string }>} The template id results + */ + update(id: string, template: SparkPost.UpdateTemplate, options?: { + update_published?: boolean; + }): SparkPost.ResultsPromise<{ id: string }>; /** * Delete an existing template * @param id The template id * @param callback The request callback */ delete(id: string, callback: SparkPost.Callback): void; + /** + * Delete an existing template + * + * @param id The template id + * @returns Promise void + */ + delete(id: string): Promise; /** * Preview the most recent version of an existing template by id + * + * @param {string} id the id of the template you want to look up * @param options The preview options * @param callback The request callback with webhook id results */ - preview(options: { id: string, data: any, draft?: boolean }, callback: SparkPost.ResultsCallback): void; + preview(id: string, options: { substitution_data?: any, draft?: boolean }, callback: SparkPost.ResultsCallback): void; + /** + * Preview the most recent version of an existing template by id + * + * @param {string} id the id of the template you want to look up + * @param {SparkPost.ResultsCallback} callback The request callback with webhook id results + */ + preview(id: string, callback: SparkPost.ResultsCallback): void; + /** + * Preview the most recent version of an existing template by id + * + * @param {string} id the id of the template you want to look up + * @param {{ substitution_data: any, draft?: boolean }} [options] + * @returns {SparkPost.ResultsPromise} The webhook id results + */ + preview(id: string, options?: { substitution_data?: any, draft?: boolean }): SparkPost.ResultsPromise; }; transmissions: { /** * List an overview of all transmissions in the account + * * @param callback The request callback with Transmission results array */ - all(callback: SparkPost.ResultsCallback): void; + list(callback: SparkPost.ResultsCallback): void; /** - * List an overview of all transmissions in the account, with added filters - * @param options The search options { campaign_id?, template_id? } - * @param callback The request callback with Transmission results array + * List an overview of all transmissions in the account + * + * @param {{ campaign_id?: string, template_id: string }} options + * @param {SparkPost.ResultsCallback} callback The request callback with Transmission results array */ - all(options: { campaign_id?: string, template_id?: string }, callback: SparkPost.ResultsCallback): void; + list(options: { campaign_id?: string, template_id?: string }, callback: SparkPost.ResultsCallback): void; + /** + * List an overview of all transmissions in the account + * + * @param {{ campaign_id?: string, template_id: string }} [options] + * @returns {SparkPost.ResultsPromise} The Transmission results array + */ + list(options?: { campaign_id?: string, template_id?: string }): SparkPost.ResultsPromise; /** * Retrieve the details about a transmission by its ID - * @param transmissionID The transmission id + * + * @param id The id of the transmission you want to look up * @param callback The request callback with Transmission results */ - find(transmissionID: string, callback: SparkPost.ResultsCallback): void; + get(transmissionID: string, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve the details about a transmission by its ID + * + * @param {string} id The id of the transmission you want to look up + * @returns {SparkPost.ResultsPromise} The Transmission results + */ + get(id: string): SparkPost.ResultsPromise; /** * Sends a message by creating a new transmission - * @param options The create options + * + * @param transmission an object of [transmission attributes]{@link https://developers.sparkpost.com/api/transmissions#header-transmission-attributes} + * @param options The create options. Specify maximum number of recipient errors returned * @param callback The request callback with metadata and id results */ - send(options: { transmissionBody: SparkPost.CreateTransmission, num_rcpt_errors?: number }, callback: SparkPost.ResultsCallback<{ + send(transmission: SparkPost.CreateTransmission, options: { num_rcpt_errors?: number }, callback: SparkPost.ResultsCallback<{ total_rejected_recipients: number; total_accepted_recipients: number; id: string; }>): void; + /** + * + * + * @param {SparkPost.CreateTransmission} transmission an object of [transmission attributes]{@link https://developers.sparkpost.com/api/transmissions#header-transmission-attributes} + * @param {SparkPost.ResultsCallback<{ + * total_rejected_recipients: number; + * total_accepted_recipients: number; + * id: string; + * }>} callback The request callback with metadata and id results + */ + send(transmission: SparkPost.CreateTransmission, callback: SparkPost.ResultsCallback<{ + total_rejected_recipients: number; + total_accepted_recipients: number; + id: string; + }>): void; + /** + * Sends a message by creating a new transmission + * + * @param {SparkPost.CreateTransmission} transmission an object of [transmission attributes]{@link https://developers.sparkpost.com/api/transmissions#header-transmission-attributes} + * @param {{ num_rcpt_errors?: number }} [options] specify maximum number of recipient errors returned + * @returns {SparkPost.ResultsPromise<{ + * total_rejected_recipients: number; + * total_accepted_recipients: number; + * id: string; + * }>} The metadata and id results + */ + send(transmission: SparkPost.CreateTransmission, options?: { num_rcpt_errors?: number }): SparkPost.ResultsPromise<{ + total_rejected_recipients: number; + total_accepted_recipients: number; + id: string; + }>; }; webhooks: { /** * List currently existing webhooks. * @param callback The request callback with RelayWebhook results array */ - all(callback: SparkPost.ResultsCallback>): void; + list(callback: SparkPost.ResultsCallback>): void; /** * List currently existing webhooks. * @param options Object containing optional timezone * @param callback The request callback with RelayWebhook results array */ - all(options: { timezone?: string }, callback: SparkPost.ResultsCallback>): void; + list(options: { timezone?: string }, callback: SparkPost.ResultsCallback>): void; + /** + * List currently existing webhooks.the timezone to use for the last_successful and last_failure properties | Default: UTC + * + * @param {{ timezone?: string }} [options] + * @returns {(SparkPost.ResultsPromise>)} + */ + list(options?: { timezone?: string }): SparkPost.ResultsPromise>; /** * Retrieve details about a specified webhook by its id + * + * @param {string} id The id of the webhook to get * @param options Object containing id and optional timezone * @param callback The request callback with RelayWebhook results */ - describe(options: { id: string, timezone?: string }, callback: SparkPost.ResultsCallback): void; + get(id: string, options: { timezone?: string }, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve details about a specified webhook by its id + * + * @param {string} id The id of the webhook to get + * @param {(SparkPost.ResultsCallback)} callback The request callback with RelayWebhook results + */ + get(id: string, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve details about a specified webhook by its id + * + * @param {string} id The id of the webhook to get + * @param {{ timezone?: string }} [options] the timezone to use for the last_successful and last_failure properties + * @returns {(SparkPost.ResultsPromise)} The RelayWebhook results + */ + get(id: string, options?: { timezone?: string }): SparkPost.ResultsPromise; /** * Create a new webhook - * @param options The create options + * + * @param options a hash of [webhook attributes]{@link https://developers.sparkpost.com/api/webhooks#header-webhooks-object-properties} * @param callback The request callback with webhook id results */ create(options: SparkPost.Webhook, callback: SparkPost.ResultsCallback): void; + /** + * Create a new webhook + * + * @param {SparkPost.Webhook} options a hash of [webhook attributes]{@link https://developers.sparkpost.com/api/webhooks#header-webhooks-object-properties} + * @returns {(SparkPost.ResultsPromise)} The webhook id results + */ + create(options: SparkPost.Webhook): SparkPost.ResultsPromise; /** * Update an existing webhook - * @param options The update options + * @param {string} id the id of the webhook to update + * @param options A hash of [webhook attribues]{@link https://developers.sparkpost.com/api/webhooks#header-webhooks-object-properties} * @param callback The request callback with webhook id results */ - update(options: SparkPost.UpdateWebhook, callback: SparkPost.ResultsCallback): void; + update(id: string, options: SparkPost.UpdateWebhook, callback: SparkPost.ResultsCallback): void; + /** + * Update an existing webhook + * + * @param {string} id + * @param {SparkPost.UpdateWebhook} options + * @returns {(SparkPost.ResultsPromise)} + */ + update(id: string, options: SparkPost.UpdateWebhook): SparkPost.ResultsPromise; /** * Delete an existing webhook * @param id The webhook id * @param callback The request callback */ delete(id: string, callback: SparkPost.Callback): void; + /** + * Delete an existing webhook. + * + * @param {string} id The id of the webhook to delete + * @returns {Promise} + */ + delete(id: string): Promise; /** * Sends an example message event batch from the Webhook API to the target URL - * @param options The webhook id and message + * + * @param {string} id The id of the webhook to validate + * @param options the message (payload) to send to the webhook consumer * @param callback The request callback with validation results */ - validate(options: { id: string, message: any }, callback: SparkPost.ResultsCallback<{ + validate(id: string, options: { message: any }, callback: SparkPost.ResultsCallback<{ msg: string; response: { status: number; @@ -331,21 +731,86 @@ declare class SparkPost { } }>): void; /** - * Sends an example message event batch from the Webhook API to the target URL - * @param options The webhook id and optional limit + * Sends an example message event batch from the Webhook API to the target URL. + * + * @param {string} id The id of the webhook to validate + * @param {{ message: any }} options The message (payload) to send to the webhook consumer + * @returns {SparkPost.ResultsPromise<{ + * msg: string; + * response: { + * status: number; + * headers: any; + * body: string; + * } + * }>} The validation results + */ + validate(id: string, options: { message: any }): SparkPost.ResultsPromise<{ + msg: string; + response: { + status: number; + headers: any; + body: string; + } + }>; + /** + * Gets recent status information about a webhook. + * + * @param {string} id The id of the webhook + * @param options An optional limit that specifies the maximum number of results to return. Defaults to 1000 * @param callback The request callback with status results */ - getBatchStatus(options: { id: string, limit?: number }, callback: SparkPost.ResultsCallback<{ + getBatchStatus(id: string, options: { limit?: number }, callback: SparkPost.ResultsCallback<{ batch_id: string; ts: string; attempts: number; response_code: number; }[]>): void; + /** + * Gets recent status information about a webhook. + * + * @param {string} id The id of the webhook + * @param {SparkPost.ResultsCallback<{ + * batch_id: string; + * ts: string; + * attempts: number; + * response_code: number; + * }[]>} callback The request callback with status results + */ + getBatchStatus(id: string, callback: SparkPost.ResultsCallback<{ + batch_id: string; + ts: string; + attempts: number; + response_code: number; + }[]>): void; + /** + * Gets recent status information about a webhook. + * + * @param {string} id The id of the webhook + * @param {{ limit?: number }} Maximum number of results to return. Defaults to 1000 + * @returns {SparkPost.ResultsPromise<{ + * batch_id: string; + * ts: string; + * attempts: number; + * response_code: number; + * }[]>} The status results + */ + getBatchStatus(id: string, options: { limit?: number }): SparkPost.ResultsPromise<{ + batch_id: string; + ts: string; + attempts: number; + response_code: number; + }[]>; /** * Lists descriptions of the events, event types, and event fields that could be included in a Webhooks post to your target URL. - * @param callback The request callback containing documentation results + * @param callback The request callback containing documentation results */ getDocumentation(callback: SparkPost.ResultsCallback): void; + /** + * Lists descriptions of the events, event types, and event fields that could be included in a Webhooks post to your target URL. + * + * @returns {SparkPost.ResultsPromise} The documentation results + */ + getDocumentation(): SparkPost.ResultsPromise; /** * List an example of the event data that will be posted by a Webhook for the specified events. * @param callback The request callback containing examples @@ -357,6 +822,14 @@ declare class SparkPost { * @param callback The request callback containing examples */ getSamples(options: { events?: string }, callback: SparkPost.Callback): void; + /** + * List an example of the event data that will be posted by a Webhook for the specified events. + * + * @param {{ events?: string }} options [event types]{@link https://support.sparkpost.com/customer/portal/articles/1976204} for which to get a sample payload + * Default: all event types returned + * @returns {Promise>} + */ + getSamples(options?: { events?: string }): Promise>; }; /** @@ -367,10 +840,15 @@ declare class SparkPost { constructor(apiKey?: string, options?: SparkPost.ConstructorOptions); request(options: Request.Options, callback: SparkPost.Callback): void; + request(options: Request.Options): Promise>; get(options: Request.Options, callback: SparkPost.Callback): void; + get(options: Request.Options): Promise>; post(options: Request.Options, callback: SparkPost.Callback): void; + post(options: Request.Options): Promise>; put(options: Request.Options, callback: SparkPost.Callback): void; + put(options: Request.Options): Promise>; delete(options: Request.Options, callback: SparkPost.Callback): void; + delete(options: Request.Options): Promise>; } declare namespace SparkPost { @@ -405,6 +883,7 @@ declare namespace SparkPost { (err: Error | SparkPostError | null, res: Response): void; } export type ResultsCallback = Callback<{ results: T }>; + export type ResultsPromise = Promise<{ results: T }>; export interface Domain { domain: string; @@ -543,10 +1022,8 @@ declare namespace SparkPost { description?: string; /** Recipient list attribute object */ attributes?: any; - /** limit the number of recipient errors returned. */ - num_rcpt_errors?: number; /** Array of recipient objects */ - recipients?: Recipient[]; + recipients: Recipient[]; } export interface BaseRecipient { @@ -564,9 +1041,21 @@ declare namespace SparkPost { address: Address | string; } export interface RecipientWithMultichannelAddresses { - /** Address information for a recipient. At a minimum, address or multichannel_addresses is required. If both address and multichannel_addresses are specified only multichannel_addresses will be used. */ + /** + * Address information for a recipient. At a minimum, address or multichannel_addresses is required. + * If both address and multichannel_addresses are specified only multichannel_addresses will be used. + * + * @type {(Address | string)} + * @memberOf RecipientWithMultichannelAddresses + */ address?: Address | string; - /** Array of Multichannel Address objects for a recipient. At a minimum, address or multichannel_addresses is required. If both address and multichannel_addresses are specified only multichannel_addresses will be used. */ + /** + * Array of Multichannel Address objects for a recipient. At a minimum, address or multichannel_addresses is required. + * If both address and multichannel_addresses are specified only multichannel_addresses will be used. + * + * @type {MultichannelAddress[]} + * @memberOf RecipientWithMultichannelAddresses + */ multichannel_addresses: MultichannelAddress[]; } export type Recipient = (RecipientWithAddress | RecipientWithMultichannelAddresses) & BaseRecipient; @@ -610,7 +1099,7 @@ declare namespace SparkPost { /** User-friendly name no example: Inbound Customer Replies */ name?: string; /** URL of the target to which to POST relay batches */ - target?: string; + target: string; /** Authentication token to present in the X-MessageSystems-Webhook-Token header of POST requests to target */ auth_token?: string; /** Restrict which inbound messages will be relayed to the target */ @@ -661,8 +1150,6 @@ declare namespace SparkPost { } export interface UpdateSendingDomain { - /** Name of the sending domain. */ - domain: string; /** Associated tracking domain. */ tracking_domain?: string; /** JSON object in which DKIM key configuration is defined. */ @@ -704,9 +1191,49 @@ declare namespace SparkPost { } export interface VerifyOptions { - domain: string; - verifyDKIM?: boolean; - verifySPF?: boolean; + /** + * Request verification of DKIM record + * + * @type {boolean} + * @memberOf VerifyOptions + */ + dkim_verify?: boolean; + /** + * Request verification of SPF record + * + * @type {boolean} + * @deprecated + * @memberOf VerifyOptions + */ + spf_verify?: boolean; + /** + * Request an email with a verification link to be sent to the sending domain’s postmaster@ mailbox. + * + * @type {boolean} + * @memberOf VerifyOptions + */ + postmaster_at_verify?: boolean; + /** + * Request an email with a verification link to be sent to the sending domain’s abuse@ mailbox. + * + * @type {boolean} + * @memberOf VerifyOptions + */ + abuse_at_verify?: boolean; + /** + * A token retrieved from the verification link contained in the postmaster@ verification email. + * + * @type {string} + * @memberOf VerifyOptions + */ + postmaster_at_token?: string; + /** + * A token retrieved from the verification link contained in the abuse@ verification email. + * + * @type {string} + * @memberOf VerifyOptions + */ + abuse_at_token?: string; } export interface VerifyResults extends Status { @@ -720,13 +1247,13 @@ declare namespace SparkPost { /** user-friendly name */ name: string; /** user-friendly identifier for subaccount API key */ - keyLabel: string; + key_label: string; /** list of grants to give the subaccount API key */ - keyGrants: string[]; + key_grants: string[]; /** list of IPs the subaccount may be used from */ - keyValidIps?: string[]; + key_valid_ips?: string[]; /** id of the default IP pool assigned to subaccount"s transmissions */ - ipPool?: string; + ip_pool?: string; } export interface CreateSubaccountResponse { @@ -737,14 +1264,12 @@ declare namespace SparkPost { } export interface UpdateSubaccount { - /** the id of the subaccount you want to update */ - subaccountId: string | number; /** user-friendly name */ name: string; /** status of the subaccount */ status: string; /** id of the default IP pool assigned to subaccount"s transmissions */ - ipPool?: string; + ip_pool?: string; } export interface SubaccountInformation { @@ -760,41 +1285,149 @@ declare namespace SparkPost { } export interface CreateSupressionListEntry { + /** + * Email address to be suppressed + * + * @type {string} + * @memberOf CreateSupressionListEntry + */ recipient: string; - /** Whether the recipient requested to not receive any transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + /** + * Type of suppression record + * + * @type {("transactional" | "non_transactional")} + * @memberOf CreateSupressionListEntry + */ + type?: "transactional" | "non_transactional"; + /** + * Whether the recipient requested to not receive any non-transactional messages + * Not required if a valid type is passed + * + * @deprecated Available, but deprecated in favor of type + * @type {boolean} + * @memberOf CreateSupressionListEntry + */ transactional?: boolean; - /** Whether the recipient requested to not receive any non-transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + /** + * Whether the recipient requested to not receive any non-transactional messages + * Not required if a valid type is passed + * + * @deprecated Available, but deprecated in favor of type + * @type {boolean} + * @memberOf CreateSupressionListEntry + */ non_transactional?: boolean; + /** + * Source responsible for inserting the list entry + * no - entries created by the user are marked as Manually Added + * + * @type {("Spam Complaint" | "List Unsubscribe" | "Bounce Rule" | "Unsubscribe Link" | "Manually Added" | "Compliance")} + * @memberOf CreateSupressionListEntry + */ + readonly source?: "Spam Complaint" | "List Unsubscribe" | "Bounce Rule" | "Unsubscribe Link" | "Manually Added" | "Compliance"; /** Short explanation of the suppression */ description?: string; } export interface SupressionListEntry { + /** + * Email address to be suppressed + * + * @type {string} + * @memberOf SupressionListEntry + */ recipient: string; - /** Whether the recipient requested to not receive any transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + /** + * Whether the recipient requested to not receive any transactional messages + * Not required if a valid type is passed + * + * @deprecated Available, but deprecated in favor of type + * @type {boolean} + * @memberOf SupressionListEntry + */ transactional?: boolean; - /** Whether the recipient requested to not receive any non-transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + /** + * Whether the recipient requested to not receive any non-transactional messages + * Not required if a valid type is passed + * + * @deprecated Available, but deprecated in favor of type + * @type {boolean} + * @memberOf SupressionListEntry + */ non_transactional?: boolean; - /** Coming soon */ + /** Type of suppression record: transactional or non_transactional */ type?: "transactional" | "non_transactional"; - /** Source responsible for inserting the list entry. Valid values include: Spam Complaint, List Unsubscribe, Bounce Rule, Unsubscribe Link, Manually Added, Compliance. */ - source?: string; + /** + * Source responsible for inserting the list entry + * + * no - entries created by the user are marked as Manually Added + * + * @type {("Spam Complaint" | "List Unsubscribe" | "Bounce Rule" | "Unsubscribe Link" | "Manually Added" | "Compliance")} + * @memberOf SupressionListEntry + */ + source?: "Spam Complaint" | "List Unsubscribe" | "Bounce Rule" | "Unsubscribe Link" | "Manually Added" | "Compliance"; /** Short explanation of the suppression */ description?: string; created: string; updated: string; } - export interface SupressionSearch { + export interface SupressionSearchParameters { /** Datetime the entries were last updated, in the format of YYYY-MM-DDTHH:mm:ssZ */ to?: string; /** Datetime the entries were last updated, in the format YYYY-MM-DDTHH:mm:ssZ */ from?: string; + /** + * Domain of entries to include in the search. ( Note: SparkPost only) + * + * @type {string} + * @memberOf SupressionSearch + */ + domain?: string; + /** + * The results cursor location to return, to start paging with cursor, use the value of ‘initial’. + * When cursor is provided the page parameter is ignored. (Note: SparkPost only) + * + * @type {string} + * @memberOf SupressionSearch + */ + cursor?: string; + /** + * Maximum number of results to return per page. Must be between 1 and 10,000. + * ( Note: SparkPost only) + * @default 1000 + * @type {string} + * @memberOf SupressionSearch + */ + per_page?: string | number; + /** + * The results page number to return. Used with per_page for paging through results. + * The page parameter works up to 10,000 results. + * You must use the cursor parameter and start with cursor=initial to page result sets larger than 10,000 + * ( Note: SparkPost only) + * + * @type {string} + * @memberOf SupressionSearch + */ + page?: string | number; /** Types of entries to include in the search, i.e. entries with “transactional” and/or “non_transactional” keys set to true */ types?: string; /** Sources of the entries to include in the search, i.e. entries that were added by this source */ sources?: string; - /** Maximum number of results to return. Must be between 1 and 100000. Default value is 100000. */ + /** + * Description of the entries to include in the search, i.e descriptions that include the text submitted. + * ( Note: SparkPost only) + * + * @type {string} + * @memberOf SupressionSearch + */ + description?: string; + /** + * Maximum number of results to return per page. Must be between 1 and 10,000. + * @type {number} + * @deprecated use per_page instead + * @memberOf SupressionSearch + */ limit?: number; } @@ -805,7 +1438,13 @@ declare namespace SparkPost { text: string; /** Email subject line. */ subject: string; - /** Address “from” : "deals@company.com" or JSON object composed of the “name” and “email” fields “from” : { “name” : “My Company”, “email” : "deals@company.com" } used to compose the email’s “From” header. */ + /** + * Address "from" : "deals@company.com" or JSON object composed of the "name" and "email" fields. + * "from" : { "name" : "My Company", "email" : "deals@company.com" } used to compose the email’s "From" header. + * + * @type {(Address | string)} + * @memberOf TemplateContent + */ from: Address | string; /** Email address used to compose the email’s “Reply-To” header. */ reply_to?: string; @@ -820,7 +1459,13 @@ declare namespace SparkPost { text?: string; /** Email subject line. */ subject: string; - /** Address “from” : "deals@company.com" or JSON object composed of the “name” and “email” fields “from” : { “name” : “My Company”, “email” : "deals@company.com" } used to compose the email’s “From” header. */ + /** + * Address "from" : "deals@company.com" or JSON object composed of the "name" and "email" fields. + * "from" : { "name" : "My Company", "email" : "deals@company.com" } used to compose the email’s "From" header. + * + * @type {(Address | string)} + * @memberOf TemplateContent + */ from: Address | string; /** Email address used to compose the email’s “Reply-To” header. */ reply_to?: string; @@ -840,7 +1485,15 @@ declare namespace SparkPost { } export interface Template { - /** Short, unique, alphanumeric ID used to reference the template At a minimum, id or name is required upon creation. It is auto generated if not provided. After a template has been created, this property cannot be changed. Maximum length - 64 bytes */ + /** + * Short, unique, alphanumeric ID used to reference the template. + * At a minimum, id or name is required upon creation. + * It is auto generated if not provided. + * After a template has been created, this property cannot be changed. Maximum length - 64 bytes + * + * @type {string} + * @memberOf Template + */ id: string; /** Content that will be used to construct a message yes For a full description, see the Content Attributes. Maximum length - 20 MBs */ content: TemplateContent | { email_rfc822: string }; @@ -859,7 +1512,15 @@ declare namespace SparkPost { } export interface CreateTemplate { - /** Short, unique, alphanumeric ID used to reference the template At a minimum, id or name is required upon creation. It is auto generated if not provided. After a template has been created, this property cannot be changed. Maximum length - 64 bytes */ + /** + * Short, unique, alphanumeric ID used to reference the template. + * At a minimum, id or name is required upon creation. + * It is auto generated if not provided. + * After a template has been created, this property cannot be changed. Maximum length - 64 bytes + * + * @type {string} + * @memberOf CreateTemplate + */ id?: string; /** Content that will be used to construct a message yes For a full description, see the Content Attributes. Maximum length - 20 MBs */ content: CreateTemplateContent | { email_rfc822: string }; @@ -907,6 +1568,20 @@ declare namespace SparkPost { export interface CreateTransmission { /** JSON object in which transmission options are defined */ options?: TransmissionOptions; + /** + * Recipients to receive a carbon copy of the transmission + * + * @type {Recipient[]} + * @memberOf CreateTransmission + */ + cc?: Recipient[]; + /** + * Recipients to discreetly receive a carbon copy of the transmission + * + * @type {Recipient[]} + * @memberOf CreateTransmission + */ + bcc?: Recipient[]; /** Inline recipient objects or object containing stored recipient list ID */ recipients?: Recipient[] | { list_id: string }; /** Name of the campaign */ @@ -1011,11 +1686,25 @@ declare namespace SparkPost { } export interface Attachment { - /** The MIME type of the attachment; e.g., “text/plain”, “image/jpeg”, “audio/mp3”, “video/mp4”, “application/msword”, “application/pdf”, etc., including the “charset” parameter (text/html; charset=“UTF-8”) if needed. The value will apply “as-is” to the “Content-Type” header of the generated MIME part for the attachment. */ + /** + * The MIME type of the attachment; e.g., “text/plain”, “image/jpeg”, “audio/mp3”, “video/mp4”, “application/msword”, “application/pdf”, etc., + * including the “charset” parameter (text/html; charset=“UTF-8”) if needed. + * The value will apply “as-is” to the “Content-Type” header of the generated MIME part for the attachment. + * + * @type {string} + * @memberOf Attachment + */ type: string; /** The filename of the attachment (for example, “document.pdf”). This is inserted into the filename parameter of the Content-Disposition header. */ name: string; - /** The content of the attachment as a Base64 encoded string. The string should not contain \r\n line breaks. The SparkPost systems will add line breaks as necessary to ensure the Base64 encoded lines contain no more than 76 characters each. */ + /** + * The content of the attachment as a Base64 encoded string. + * The string should not contain \r\n line breaks. + * The SparkPost systems will add line breaks as necessary to ensure the Base64 encoded lines contain no more than 76 characters each. + * + * @type {string} + * @memberOf Attachment + */ data: string; } @@ -1026,6 +1715,14 @@ declare namespace SparkPost { target: string; /** Array of event types this webhook will receive */ events: string[]; + /** + * Reserved for future use + * + * @default {true} + * @type {boolean} + * @memberOf Webhook + */ + active?: boolean; /** Type of authentication to be used during POST requests to target */ auth_type?: string; /** Object containing details needed to request authorization credentials, as necessary */ @@ -1037,13 +1734,13 @@ declare namespace SparkPost { } export interface UpdateWebhook { - id: string; /** User-friendly name for webhook */ name?: string; /** URL of the target to which to POST event batches */ target?: string; /** Array of event types this webhook will receive */ events?: string[]; + active?: boolean; /** Type of authentication to be used during POST requests to target */ auth_type?: string; /** Object containing details needed to request authorization credentials, as necessary */ @@ -1061,6 +1758,16 @@ declare namespace SparkPost { method: string[]; }[]; } + + export interface CreateOpts { + /** + * Domain (or subdomain) name for which SparkPost will receive inbound emails + * + * @type {string} + * @memberOf CreateOpts + */ + domain: string; + } } export = SparkPost; diff --git a/sparkpost/sparkpost-tests.ts b/sparkpost/sparkpost-tests.ts index 9f7f47b44d..d3fef264f0 100644 --- a/sparkpost/sparkpost-tests.ts +++ b/sparkpost/sparkpost-tests.ts @@ -3,6 +3,7 @@ import * as SparkPost from "sparkpost"; let key = "YOURAPIKEY"; let client = new SparkPost(key); +// Callback client.get({ uri: "metrics/domains" }, function(err, data) { @@ -14,7 +15,19 @@ client.get({ console.log(data.body); }); -client.inboundDomains.create("example1.com", function(err, res) { +// Promise +client.get({ + uri: 'metrics/domains' +}) + .then(data => { + console.log(data); + }) + .catch(err => { + console.log(err); + }); + +// Callback +client.inboundDomains.create({ domain: 'example1.com' }, function(err, res) { if (err) { console.log(err); } else { @@ -23,6 +36,18 @@ client.inboundDomains.create("example1.com", function(err, res) { } }); +// Promise +client.inboundDomains.create({ domain: 'example1.com' }) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.inboundDomains.delete("example1.com", function(err, res) { if (err) { console.log(err); @@ -32,7 +57,19 @@ client.inboundDomains.delete("example1.com", function(err, res) { } }); -client.inboundDomains.find("example1.com", function(err, res) { +// Promise +client.inboundDomains.delete('example1.com') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.inboundDomains.get("example1.com", function(err, res) { if (err) { console.log(err); } else { @@ -41,7 +78,19 @@ client.inboundDomains.find("example1.com", function(err, res) { } }); -client.inboundDomains.all(function(err, res) { +// Promise +client.inboundDomains.get('example1.com') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.inboundDomains.list(function(err, res) { if (err) { console.log(err); } else { @@ -50,6 +99,18 @@ client.inboundDomains.all(function(err, res) { } }); +// Promise +client.inboundDomains.list() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.messageEvents.search({}, function(err, res) { if (err) { console.log(err); @@ -59,6 +120,7 @@ client.messageEvents.search({}, function(err, res) { } }); +// Callback client.messageEvents.search({ events: "click", campaign_ids: "monday_mailshot" @@ -71,6 +133,7 @@ client.messageEvents.search({ } }); +// Callback client.messageEvents.search({ from: "2016-01-01T00:00", to: "2016-01-02T23:59", @@ -87,6 +150,50 @@ client.messageEvents.search({ } }); +// Promise +client.messageEvents.search({ + events: 'click', + campaign_ids: 'monday_mailshot' +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Promise +client.messageEvents.search({}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Promise +client.messageEvents.search({ + from: '2016-01-01T00:00', + to: '2016-01-02T23:59', + page: 1, + per_page: 5, + events: ['bounce', 'out_of_band'], + bounce_classes: [10] +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.recipientLists.create({ id: "UNIQUE_TEST_ID", name: "Test Recipient List", @@ -114,6 +221,36 @@ client.recipientLists.create({ } }); +// Promise +client.recipientLists.create({ + id: "UNIQUE_TEST_ID", + name: "Test Recipient List", + recipients: [ + { + address: { + email: "test1@test.com" + } + }, { + address: { + email: "test2@test.com" + } + }, { + address: { + email: "test3@test.com" + } + } + ] +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.recipientLists.delete("UNIQUE_TEST_ID", function(err, res) { if (err) { console.log(err); @@ -123,7 +260,19 @@ client.recipientLists.delete("UNIQUE_TEST_ID", function(err, res) { } }); -client.recipientLists.all(function(err, res) { +// Promise +client.recipientLists.delete('UNIQUE_TEST_ID') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.recipientLists.list(function(err, res) { if (err) { console.log(err); } else { @@ -132,9 +281,19 @@ client.recipientLists.all(function(err, res) { } }); -client.recipientLists.find({ - id: "UNIQUE_TEST_ID" -}, function(err, res) { +// Promise +client.recipientLists.list() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.recipientLists.get('UNIQUE_TEST_ID', function(err, res) { if (err) { console.log(err); } else { @@ -143,8 +302,8 @@ client.recipientLists.find({ } }); -client.recipientLists.find({ - id: "UNIQUE_TEST_ID", +// Callback +client.recipientLists.get('UNIQUE_TEST_ID', { show_recipients: true }, function(err, res) { if (err) { @@ -155,8 +314,32 @@ client.recipientLists.find({ } }); -client.recipientLists.update({ - id: "EXISTING_TEST_ID", +// Promise +client.recipientLists.get('UNIQUE_TEST_ID', { + show_recipients: true +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Promise +client.recipientLists.get('UNIQUE_TEST_ID') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.recipientLists.update('EXISTING_TEST_ID', { name: "Test Recipient List", recipients: [ { @@ -182,6 +365,34 @@ client.recipientLists.update({ } }); +// Promise +client.recipientLists.update('EXISTING_TEST_ID', { + name: "Test Recipient List", + recipients: [ + { + address: { + email: "test1@test.com" + } + }, { + address: { + email: "test2@test.com" + } + }, { + address: { + email: "test3@test.com" + } + } + ] +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log(err); + }); + +// Callback client.relayWebhooks.create({ name: "Test Relay Webhook", target: "http://client.test.com/test-webhook", @@ -197,6 +408,24 @@ client.relayWebhooks.create({ } }); +// Promise +client.relayWebhooks.create({ + name: 'Test Relay Webhook', + target: 'http://client.test.com/test-webhook', + match: { + domain: 'inbound.example.com' + } +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.relayWebhooks.delete("123456789", function(err, res) { if (err) { console.log(err); @@ -206,7 +435,19 @@ client.relayWebhooks.delete("123456789", function(err, res) { } }); -client.relayWebhooks.find("123456789", function(err, res) { +// Promise +client.relayWebhooks.delete('123456789') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.relayWebhooks.get('123456789', function(err, res) { if (err) { console.log(err); } else { @@ -215,7 +456,18 @@ client.relayWebhooks.find("123456789", function(err, res) { } }); -client.relayWebhooks.all(function(err, res) { +// Promise +client.relayWebhooks.get('123456789') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +client.relayWebhooks.list(function(err, res) { if (err) { console.log(err); } else { @@ -224,8 +476,19 @@ client.relayWebhooks.all(function(err, res) { } }); -client.relayWebhooks.update({ - relayWebhookId: "123456789", +// Promise +client.relayWebhooks.list() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.relayWebhooks.update('123456789', { target: "http://client.test.com/test-webhook" }, function(err, res) { if (err) { @@ -236,11 +499,25 @@ client.relayWebhooks.update({ } }); +// Promise +client.relayWebhooks.update('123456789', { + target: 'http://client.test.com/test-webhook' +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.sendingDomains.create({ domain: "example1.com", dkim: { - "private": "MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQABAoGBAITb3BCRPBi5lGhHdn+1RgC7cjUQEbSb4eFHm+ULRwQ0UIPWHwiVWtptZ09usHq989fKp1g/PfcNzm8c78uTS6gCxfECweFCRK6EdO6cCCr1cfWvmBdSjzYhODUdQeyWZi2ozqd0FhGWoV4VHseh4iLj36DzleTLtOZj3FhAo1WJAkEA68T+KkGeDyWwvttYtuSiQCCTrXYAWTQnkIUxduCp7Ap6tVeIDn3TaXTj74UbEgaNgLhjG4bX//fdeDW6PaK9YwJBAM6xJmwHLPMgwNVjiz3u/6fhY3kaZTWcxtMkXCjh1QE82KzDwqyrCg7EFjTtFysSHCAZxXZMcivGl4TZLHnydJUCQQCx16+M+mAatuiCnvxlQUMuMiSTNK6Amzm45u9v53nlZeY3weYMYFdHdfe1pebMiwrT7MI9clKebz6svYJVmdtXAkApDAc8VuR3WB7TgdRKNWdyGJGfoD1PO1ZE4iinOcoKV+IT1UCY99Kkgg6C7j62n/8T5OpRBvd5eBPpHxP1F9BNAkEA5Nf2VO9lcTetksHdIeKK+F7sio6UZn0Rv7iUo3ALrN1D1cGfWIh2dj3ko1iSreyNVSwGW0ePP27qDmU+u6/Y1g==", - "public": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQAB", + "private": "MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/==", + "public": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==", selector: "brisbane", headers: "from:to:subject:date" } @@ -253,7 +530,26 @@ client.sendingDomains.create({ } }); +// Promise +client.sendingDomains.create({ + domain: 'example1.com', + dkim: { + 'private': 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/==', + 'public': 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==', + selector: 'brisbane', + headers: 'from:to:subject:date' + } +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); +// Callback client.sendingDomains.delete("example1.com", function(err, data) { if (err) { console.log(err); @@ -263,7 +559,19 @@ client.sendingDomains.delete("example1.com", function(err, data) { } }); -client.sendingDomains.all(function(err, res) { +// Promise +client.sendingDomains.delete('example1.com') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.sendingDomains.list(function(err, res) { if (err) { console.log(err); } else { @@ -272,7 +580,19 @@ client.sendingDomains.all(function(err, res) { } }); -client.sendingDomains.find("example1.com", function(err, res) { +// Promise +client.sendingDomains.list() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.sendingDomains.get('example1.com', function(err, res) { if (err) { console.log(err); } else { @@ -281,11 +601,22 @@ client.sendingDomains.find("example1.com", function(err, res) { } }); -client.sendingDomains.update({ - domain: "example1.com", +// Promise +client.sendingDomains.get('example1.com') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.sendingDomains.update('example1.com', { dkim: { - "private": "MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQABAoGBAITb3BCRPBi5lGhHdn+1RgC7cjUQEbSb4eFHm+ULRwQ0UIPWHwiVWtptZ09usHq989fKp1g/PfcNzm8c78uTS6gCxfECweFCRK6EdO6cCCr1cfWvmBdSjzYhODUdQeyWZi2ozqd0FhGWoV4VHseh4iLj36DzleTLtOZj3FhAo1WJAkEA68T+KkGeDyWwvttYtuSiQCCTrXYAWTQnkIUxduCp7Ap6tVeIDn3TaXTj74UbEgaNgLhjG4bX//fdeDW6PaK9YwJBAM6xJmwHLPMgwNVjiz3u/6fhY3kaZTWcxtMkXCjh1QE82KzDwqyrCg7EFjTtFysSHCAZxXZMcivGl4TZLHnydJUCQQCx16+M+mAatuiCnvxlQUMuMiSTNK6Amzm45u9v53nlZeY3weYMYFdHdfe1pebMiwrT7MI9clKebz6svYJVmdtXAkApDAc8VuR3WB7TgdRKNWdyGJGfoD1PO1ZE4iinOcoKV+IT1UCY99Kkgg6C7j62n/8T5OpRBvd5eBPpHxP1F9BNAkEA5Nf2VO9lcTetksHdIeKK+F7sio6UZn0Rv7iUo3ALrN1D1cGfWIh2dj3ko1iSreyNVSwGW0ePP27qDmU+u6/Y1g==", - "public": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/xFar2wjmzxp2+SnJ5pspaF77VZveN3P/HVmXZVghr3asoV9WBx/uW1nDIUxU35L4juXiTwsMAbgMyh3NqIKTNKyMDy4P8vpEhtH1iv/BrwMdBjHDVCycB8WnwIDAQAB", + "private": "MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/Y1g==", + "public": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==", selector: "hello_selector", headers: "from:to:subject:date" } @@ -298,8 +629,29 @@ client.sendingDomains.update({ } }); -client.sendingDomains.verify({ - domain: "example1.com" +client.sendingDomains.update('example1.com', { + dkim: { + 'private': 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/Y1g==', + 'public': 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==', + selector: 'hello_selector', + headers: 'from:to:subject:date' + } +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.sendingDomains.verify('example1.com', { + dkim_verify: true, + spf_verify: true, + abuse_at_verify: true, + postmaster_at_verify: true }, function(err, res) { if (err) { console.log(err); @@ -309,9 +661,9 @@ client.sendingDomains.verify({ } }); -client.sendingDomains.verify({ - domain: "example1.com", - verifySPF: false +// Callback +client.sendingDomains.verify('example1.com', { + dkim_verify: false }, function(err, res) { if (err) { console.log(err); @@ -321,22 +673,27 @@ client.sendingDomains.verify({ } }); -client.sendingDomains.verify({ - domain: "example1.com", - verifyDKIM: false -}, function(err, res) { - if (err) { +// Promise +client.sendingDomains.verify('example1.com', { + dkim_verify: true, + spf_verify: true, + abuse_at_verify: true, + postmaster_at_verify: true +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); console.log(err); - } else { - console.log(res.body); - console.log("Congrats you can use our SDK!"); - } }); +// Callback client.subaccounts.create({ name: "Test Subaccount", - keyLabel: "Test Subaccount key", - keyGrants: [ + key_label: 'Test Subaccount key', + key_grants: [ "smtp/inject", "transmissions/modify" ] @@ -349,7 +706,26 @@ client.subaccounts.create({ } }); -client.subaccounts.all(function(err, res) { +// Promise +client.subaccounts.create({ + name: 'Test Subaccount', + key_label: 'Test Subaccount key', + key_grants: [ + 'smtp/inject', + 'transmissions/modify' + ] +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.subaccounts.list(function(err, res) { if (err) { console.log(err); } else { @@ -358,7 +734,19 @@ client.subaccounts.all(function(err, res) { } }); -client.subaccounts.find(123, function(err, res) { +// Promise +client.subaccounts.list() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.subaccounts.get(123, function(err, res) { if (err) { console.log(err); } else { @@ -367,8 +755,19 @@ client.subaccounts.find(123, function(err, res) { } }); -client.subaccounts.update({ - subaccountId: 123, +// Promise +client.subaccounts.get('123') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.subaccounts.update('123', { name: "Test Subaccount", status: "suspended" }, function(err, res) { @@ -380,67 +779,199 @@ client.subaccounts.update({ } }); -client.suppressionList.checkStatus("test@test.com", function(err, res) { +// Promise +client.subaccounts.update('123', { + name: 'Test Subaccount', + status: 'suspended' +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.suppressionList.delete('test@test.com', function(err, data) { if (err) { + console.log('Whoops! Something went wrong'); console.log(err); } else { - console.log(res.body); - console.log("Congrats you can use our client library!"); + console.log('Congrats you can use our client library!'); + console.log(data); } }); -client.suppressionList.removeStatus("test@test.com", function(err, res) { +// Promise +client.suppressionList.delete('test@test.com') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Promise +client.suppressionList.get('test@test.com') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.suppressionList.get('test@test.com', function(err, data) { if (err) { + console.log('Whoops! Something went wrong'); console.log(err); } else { - console.log(res.body); - console.log("Congrats you can use our client library!"); + console.log('Congrats you can use our client library!'); + console.log(data); } }); -client.suppressionList.search({ - from: "2015-05-07T00:00:00+0000", - to: "2015-05-07T23:59:59+0000", - limit: 5 -}, function(err, res) { +// Promise +client.suppressionList.list({ + from: '2015-05-07T00:00:00+0000', + to: '2015-05-07T23:59:59+0000', + limit: 5 +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); + +// Callback +client.suppressionList.list({ + from: '2015-05-07T00:00:00+0000', + to: '2015-05-07T23:59:59+0000', + limit: 5 +}, function(err, data) { if (err) { + console.log('Whoops! Something went wrong'); console.log(err); } else { - console.log(res.body); - console.log("Congrats you can use our client library!"); + console.log('Congrats you can use our client library!'); + console.log(data); } }); -client.suppressionList.upsert([ - { - recipient: "test1@test.com", +// Callback +client.suppressionList.list(function(err, data) { + if (err) { + console.log('Whoops! Something went wrong'); + console.log(err); + } else { + console.log('Congrats you can use our client library!'); + console.log(data); + } +}); + +// Promise +client.suppressionList.upsert({ + recipient: 'test1@test.com', transactional: false, non_transactional: true, - description: "Test description 1" - }, - { - recipient: "test2@test.com", - transactional: true, + description: 'Test description 1' +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); + +// Callback +client.suppressionList.upsert({ + recipient: 'test1@test.com', + transactional: false, non_transactional: true, - description: "Test description 2" - }, - { - recipient: "test3@test.com", - transactional: true, - non_transactional: false, - description: "Test description 3" - } -], function(err, res) { + description: 'Test description 1' +}, function(err, data) { if (err) { + console.log('Whoops! Something went wrong'); console.log(err); } else { - console.log(res.body); - console.log("Congrats you can use our client library!"); + console.log('Congrats you can use our client library!'); + console.log(data); } }); +// Promise +client.suppressionList.upsert([ + { + recipient: 'test1@test.com', + transactional: false, + non_transactional: true, + description: 'Test description 1' + }, + { + recipient: 'test2@test.com', + transactional: true, + non_transactional: true, + description: 'Test description 2' + }, + { + recipient: 'test3@test.com', + transactional: true, + non_transactional: false, + description: 'Test description 3' + } +]) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); + +// Callback +client.suppressionList.upsert([ + { + recipient: 'test1@test.com', + transactional: false, + non_transactional: true, + description: 'Test description 1' + }, + { + recipient: 'test2@test.com', + transactional: true, + non_transactional: true, + description: 'Test description 2' + }, + { + recipient: 'test3@test.com', + transactional: true, + non_transactional: false, + description: 'Test description 3' + } +], function(err, data) { + if (err) { + console.log('Whoops! Something went wrong'); + console.log(err); + } else { + console.log('Congrats you can use our client library!'); + console.log(data); + } +}); + +// Callback client.templates.create({ - template: { id: "TEST_ID", name: "Test Template", content: { @@ -448,7 +979,6 @@ client.templates.create({ subject: "Test email template!", html: "This is a test email template!" } - } }, function(err, res) { if (err) { console.log(err); @@ -458,6 +988,26 @@ client.templates.create({ } }); +// Promise +client.templates.create({ + id: 'TEST_ID', + name: 'Test Template', + content: { + from: 'test@test.com', + subject: 'Test email template!', + html: 'This is a test email template!' + } +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.templates.delete("TEST_ID", function(err, res) { if (err) { console.log(err); @@ -467,8 +1017,19 @@ client.templates.delete("TEST_ID", function(err, res) { } }); +// Promise +client.templates.delete('TEST_ID') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); -client.templates.all(function(err, res) { +// Callback +client.templates.list(function(err, res) { if (err) { console.log(err); } else { @@ -477,8 +1038,19 @@ client.templates.all(function(err, res) { } }); -client.templates.find({ - id: "TEST_ID", +// Promise +client.templates.list() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.templates.get('TEST_ID', { draft: true }, function(err, res) { if (err) { @@ -489,8 +1061,30 @@ client.templates.find({ } }); -client.templates.find({ - id: "TEST_ID" +// Callback +client.templates.get('TEST_ID', function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +// Promise +client.templates.get('TEST_ID') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.templates.preview('TEST_ID', { + substitution_data: {} }, function(err, res) { if (err) { console.log(err); @@ -500,29 +1094,33 @@ client.templates.find({ } }); -client.templates.preview({ - id: "TEST_ID", - data: {} -}, function(err, res) { - if (err) { +// Promise +client.templates.preview('TEST_ID', { + substitution_data: { + name: 'Natalie', + age: 35, + member: true + }, + draft: true +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); console.log(err); - } else { - console.log(res.body); - console.log("Congrats you can use our SDK!"); - } }); -client.templates.update({ - id: "TEST_ID", - template: { +// Callback +client.templates.update('TEST_ID', { content: { from: "test@test.com", subject: "Updated Published Test email template!", html: "This is a published test email template! Updated!" - } - }, - update_published: true -}, function(err, res) { + }, +}, { update_published: true }, +function(err, res) { if (err) { console.log(err); } else { @@ -531,15 +1129,13 @@ client.templates.update({ } }); -client.templates.update({ - id: "TEST_ID", - template: { +// Callback +client.templates.update('TEST_ID', { content: { from: "test@test.com", subject: "Updated Test email template!", html: "This is a test email template! Updated!" } - } }, function(err, res) { if (err) { console.log(err); @@ -549,7 +1145,25 @@ client.templates.update({ } }); -client.transmissions.all(function(err, res) { +// Promise +client.templates.update('TEST_ID', { + content: { + from: 'test@test.com', + subject: 'Updated Test email template!', + html: 'This is a test email template! Updated!' + } +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); + +// Callback +client.transmissions.list(function(err, res) { if (err) { console.log(err); } else { @@ -558,16 +1172,17 @@ client.transmissions.all(function(err, res) { } }); -client.transmissions.find("YOUR-TRANSMISSION-KEY", function(err, res) { - if (err) { +// Promise +client.transmissions.list() + .then(data => { + console.log(data); + console.log('Congrats you can use our client library!'); + }) + .catch(err => { console.log(err); - } else { - console.log(res.body); - console.log("Congrats you can use our SDK!"); - } -}); + }); -client.transmissions.all({ +client.transmissions.list({ campaign_id: "my_campaign" }, function(err, res) { if (err) { @@ -578,7 +1193,7 @@ client.transmissions.all({ } }); -client.transmissions.all({ +client.transmissions.list({ template_id: "my_template" }, function(err, res) { if (err) { @@ -589,8 +1204,29 @@ client.transmissions.all({ } }); +// Callback +client.transmissions.get("YOUR-TRANSMISSION-KEY", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +// Promise +client.transmissions.get('YOUR-TRANSMISSION-KEY') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); + +// Callback client.transmissions.send({ - transmissionBody: { recipients: [{ address: { email: "john.doe@example.com" } }], content: { from: "From Envelope ", @@ -602,7 +1238,6 @@ client.transmissions.send({ open_tracking: true, click_tracking: true } - } }, function(err, res) { if (err) { console.log(err); @@ -612,13 +1247,12 @@ client.transmissions.send({ } }); +// Callback client.transmissions.send({ - transmissionBody: { recipients: [{address: {email: "john.doe@example.com"}}], content: { email_rfc822: "Content-Type: text/plain\nFrom: From Envelope \nSubject: Example Email\n\nHello World" } - } }, function(err, res) { if (err) { console.log(err); @@ -628,8 +1262,8 @@ client.transmissions.send({ } }); +// Callback client.transmissions.send({ - transmissionBody: { options: { open_tracking: true, click_tracking: true @@ -674,9 +1308,8 @@ client.transmissions.send({ "X-Customer-Campaign-ID": "christmas_campaign" }, text: "Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n Hurry, this offer is only to {{customer_type}}\n {{sender}}", - html: "

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

Hurry, this offer is only to {{customer_type}}\n

{{sender}}

" - } - } + html: "

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

" + } }, function(err, res) { if (err) { console.log(err); @@ -686,8 +1319,8 @@ client.transmissions.send({ } }); +// Callback client.transmissions.send({ - transmissionBody: { recipients: [ { address: { @@ -717,7 +1350,6 @@ client.transmissions.send({ text: "An example email using bcc with SparkPost to the {{recipient_type}} recipient.", html: "

An example email using bcc with SparkPost to the {{recipient_type}} recipient.

" } - } }, function(err, res) { if (err) { console.log(err); @@ -727,8 +1359,8 @@ client.transmissions.send({ } }); +// Callback client.transmissions.send({ - transmissionBody: { recipients: [ { address: { @@ -762,7 +1394,6 @@ client.transmissions.send({ text: "An example email using cc with SparkPost to the {{recipient_type}} recipient.", html: "

An example email using cc with SparkPost to the {{recipient_type}} recipient.

" } - } }, function(err, res) { if (err) { console.log(err); @@ -772,8 +1403,8 @@ client.transmissions.send({ } }); +// Callback client.transmissions.send({ - transmissionBody: { recipients: { list_id: "example-list" }, @@ -783,7 +1414,6 @@ client.transmissions.send({ html: "

Hello World

", text: "Hello World!" } - } }, function(err, res) { if (err) { console.log(err); @@ -793,8 +1423,8 @@ client.transmissions.send({ } }); +// Callback client.transmissions.send({ - transmissionBody: { recipients: { list_id: "example-list" }, @@ -803,7 +1433,6 @@ client.transmissions.send({ subject: "Example Email for Stored List and Template", template_id: "my-template" } - } }, function(err, res) { if (err) { console.log(err); @@ -813,15 +1442,15 @@ client.transmissions.send({ } }); +// Callback client.transmissions.send({ - num_rcpt_errors: 3, - transmissionBody: { campaign_id: "ricks-campaign", content: { template_id: "ricks-template" }, recipients: [{ address: { email: "rick.sanchez@rickandmorty100years.com", name: "Rick Sanchez" } }] - } +}, { + num_rcpt_errors: 3 }, function(err, res) { if (err) { console.log(err); @@ -831,6 +1460,111 @@ client.transmissions.send({ } }); + +// Promise +client.transmissions.send({ + options: { + open_tracking: true, + click_tracking: true + }, + campaign_id: 'christmas_campaign', + metadata: { + user_type: 'students' + }, + substitution_data: { + sender: 'Big Store Team' + }, + cc: [], + bcc: [], + recipients: [ + { + address: { + email: 'wilma@flintstone.com', + name: 'Wilma Flintstone' + }, + tags: [ + 'greeting', + 'prehistoric', + 'fred', + 'flintstone' + ], + metadata: { + place: 'Bedrock' + }, + substitution_data: { + customer_type: 'Platinum' + } + } + ], + content: { + from: { + name: 'Fred Flintstone', + email: 'fred@flintstone.com' + }, + subject: 'Big Christmas savings!', + reply_to: 'Christmas Sales ', + headers: { + 'X-Customer-Campaign-ID': 'christmas_campaign' + }, + text: 'Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n Hurry, this offer is only to {{customer_type}}\n {{sender}}', + html: '

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

' + } +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Promise +client.transmissions.send({ + recipients: [ + { + address: { + email: 'original.recipient@example.com', + name: 'Original Recipient' + }, + substitution_data: { + recipient_type: 'Original' + } + }, + { + address: { + email: 'cc.recipient@example.com', + name: 'Carbon Copy Recipient', + header_to: '"Original Recipient" ' + }, + substitution_data: { + recipient_type: 'CC' + } + } + ], + content: { + from: { + name: 'Node CC Test', + email: 'from@example.com' + }, + headers: { + 'CC': '"Carbon Copy Recipient" ' + }, + subject: 'Example email using cc', + text: 'An example email using cc with SparkPost to the {{recipient_type}} recipient.', + html: '

An example email using cc with SparkPost to the {{recipient_type}} recipient.

' + } +}) + .then(data => { + console.log('Congrats! You sent an email with cc using SparkPost!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.webhooks.create({ name: "Test webhook", target: "http://client.test.com/test-webhook", @@ -850,6 +1584,28 @@ client.webhooks.create({ } }); +// Promise +client.webhooks.create({ + name: 'Test Webhook', + target: 'http://client.test.com/test-webhook', + auth_token: 'AUTH_TOKEN', + events: [ + 'delivery', + 'injection', + 'open', + 'click' + ] +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.webhooks.delete("TEST_WEBHOOK_UUID", function(err, res) { if (err) { console.log(err); @@ -859,20 +1615,45 @@ client.webhooks.delete("TEST_WEBHOOK_UUID", function(err, res) { } }); -client.webhooks.describe({ - id: "TEST_WEBHOOK_UUID", - timezone: "America/New_York" -}, function(err, res) { +// Promise +client.webhooks.delete('TEST_WEBHOOK_UUID') + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); + +// Callback +client.webhooks.get('TEST_WEBHOOK_UUID', { + timezone: 'America/New_York' +}, function(err, data) { if (err) { + console.log('Whoops! Something went wrong'); console.log(err); } else { - console.log(res.body); - console.log("Congrats you can use our SDK!"); + console.log('Congrats you can use our client library!'); + console.log(data); } }); -client.webhooks.getBatchStatus({ - id: "TEST_WEBHOOK_UUID", +// Promise +client.webhooks.get('TEST_WEBHOOK_UUID', { + timezone: 'America/New_York' +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); + +// Callback +client.webhooks.getBatchStatus('TEST_WEBHOOK_UUID', { limit: 1000 }, function(err, res) { if (err) { @@ -883,7 +1664,20 @@ client.webhooks.getBatchStatus({ } }); +// Promise +client.webhooks.getBatchStatus('TEST_WEBHOOK_UUID', { + limit: 1000 +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); +// Callback client.webhooks.getDocumentation(function(err, res) { if (err) { console.log(err); @@ -893,6 +1687,18 @@ client.webhooks.getDocumentation(function(err, res) { } }); +// Promise +client.webhooks.getDocumentation() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback client.webhooks.getSamples({ events: "bounce" }, function(err, res) { @@ -904,7 +1710,21 @@ client.webhooks.getSamples({ } }); -client.webhooks.all(function(err, res) { +// Promise +client.webhooks.getSamples({ + events: 'bounce' +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.webhooks.list(function(err, res) { if (err) { console.log(err); } else { @@ -913,8 +1733,19 @@ client.webhooks.all(function(err, res) { } }); -client.webhooks.update({ - id: "TEST_WEBHOOK_UUID", +// Promise +client.webhooks.list() + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.webhooks.update('TEST_WEBHOOK_UUID', { name: "Renamed Test webhook", events: [ "policy_rejection", @@ -929,8 +1760,25 @@ client.webhooks.update({ } }); -client.webhooks.validate({ - id: "TEST_WEBHOOK_UUID", +// Promise +client.webhooks.update('TEST_WEBHOOK_UUID', { + name: 'Renamed Test Webhook', + events: [ + 'policy_rejection', + 'delay' + ] +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); +}); + +// Callback +client.webhooks.validate('TEST_WEBHOOK_UUID', { message: { msys: {} } @@ -942,3 +1790,18 @@ client.webhooks.validate({ console.log("Congrats you can use our SDK!"); } }); + +// Promise +client.webhooks.validate('TEST_WEBHOOK_UUID', { + message: { + msys: {} + } +}) + .then(data => { + console.log('Congrats you can use our client library!'); + console.log(data); + }) + .catch(err => { + console.log('Whoops! Something went wrong'); + console.log(err); + }); diff --git a/sparkpost/tsconfig.json b/sparkpost/tsconfig.json index 0ef33f26af..e40a56608b 100644 --- a/sparkpost/tsconfig.json +++ b/sparkpost/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +19,4 @@ "index.d.ts", "sparkpost-tests.ts" ] -} \ No newline at end of file +} diff --git a/sparkpost/tslint.json b/sparkpost/tslint.json new file mode 100644 index 0000000000..e77aa7b0ee --- /dev/null +++ b/sparkpost/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "../tslint.json", + "rules": { + "only-arrow-functions-2": [ + false + ] + } +} diff --git a/sparkpost/v1/index.d.ts b/sparkpost/v1/index.d.ts new file mode 100644 index 0000000000..b12f3712ab --- /dev/null +++ b/sparkpost/v1/index.d.ts @@ -0,0 +1,1119 @@ +// Type definitions for sparkpost v1.3 +// Project: https://github.com/SparkPost/node-sparkpost +// Definitions by: Joshua DeVinney +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as Request from "request"; +import * as Http from "http"; + +declare class SparkPost { + /** Specifying an inbound domain enables you to customize the address to which inbound messages are sent. */ + inboundDomains: { + /** + * List all your inbound domains. + * @param callback The request callback with Domain results array + */ + all(callback: SparkPost.ResultsCallback): void; + /** + * Retrieve an inbound domain by specifying its domain name in the URI path. + * @param domain Domain name + * @param callback The request callback with Domain results + */ + find(domain: string, callback: SparkPost.ResultsCallback): void; + /** + * Create an inbound domain by providing an inbound domains object as the POST request body. + * @param domain Domain name + * @param callback The request callback + */ + create(domain: string, callback: SparkPost.Callback): void; + /** + * Delete an inbound domain by specifying its domain name in the URI path. + * @param domain Domain name + * @param callback The request callback + */ + delete(domain: string, callback: SparkPost.Callback): void; + }; + /** The Message Events API provides the means to search the raw events generated by SparkPost. */ + messageEvents: { + /** + * Retrieves list of message events according to given params + * @param parameters Query parameters + * @param callback The request callback with MessageEvent results array + */ + search(parameters: SparkPost.MessageEventParameters, callback: SparkPost.ResultsCallback): void; + }; + /** A recipient list is a collection of recipients that can be used in a transmission. */ + recipientLists: { + /** + * List a summary of all recipient lists. The recipients for each list are not included in the results. + * To retrieve recipient details, use the RETRIEVE API for a specified recipient list. + * @param callback The request callback with RecipientList results array + */ + all(callback: SparkPost.ResultsCallback): void; + /** + * Retrieve details about a specified recipient list by specifying its id in the URI path. + * To retrieve the recipients contained in a list, the show_recipients parameter must be set to true. + * @param options The find options + * @param callback The request callback with RecipientList results + */ + find(options: { id: string, show_recipients?: false }, callback: SparkPost.Callback): void; + /** + * Retrieve details about a specified recipient list by specifying its id in the URI path. + * To retrieve the recipients contained in a list, the show_recipients parameter must be set to true. + * @param options The find options + * @param callback The request callback with RecipientList results (with recipients) + */ + find(options: { id: string, show_recipients: true }, callback: SparkPost.Callback): void; + /** + * Create a recipient list by providing a recipient list object as the POST request body. + * At a minimum, the “recipients” array is required, which must contain a valid “address”. + * If the recipient list “id” is not provided in the POST request body, one will be generated and returned in the results body. + * Use the num_rcpt_errors parameter to limit the number of recipient errors returned. + * @param options The create options + * @param callback The request callback with metadata results + */ + create(options: SparkPost.CreateRecipientList, callback: SparkPost.ResultsCallback): void; + /** + * Update an existing recipient list by specifying its ID in the URI path and use a recipient list object as the PUT request body. + * Use the num_rcpt_errors parameter to limit the number of recipient errors returned. + * @param options The update options + * @param callback The request callback with metadata results + */ + update(options: SparkPost.UpdateRecipientList, callback: SparkPost.ResultsCallback): void; + /** + * Permanently delete the specified recipient list. + * @param id The list id + * @param callback The request callback + */ + delete(id: string, callback: SparkPost.Callback): void; + }; + /** Relay Webhooks are a way to instruct SparkPost to accept inbound email on your behalf and forward it to you over HTTP for your own consumption. */ + relayWebhooks: { + /** + * List all your relay webhooks. + * @param callback The request callback with RelayWebhook results array + */ + all(callback: SparkPost.ResultsCallback): void; + /** + * Delete a relay webhook by specifying the webhook ID in the URI path. + * @param relayWebhookId The webhook id + * @param callback The request callback with RelayWebhook results + */ + find(relayWebhookId: string, callback: SparkPost.ResultsCallback): void; + /** + * Create a relay webhook by providing a relay webhooks object as the POST request body. + * @param options The create options + * @param callback The request callback with webhook id results + */ + create(options: SparkPost.RelayWebhook, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Update a relay webhook by specifying the webhook ID in the URI path. + * @param options The update options + * @param callback The request callback with webhook id results + */ + update(options: SparkPost.UpdateRelayWebhook & { relayWebhookId: string }, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Delete a relay webhook by specifying the webhook ID in the URI path. + * @param relayWebhookId The webhook id + * @param callback The request callback + */ + delete(relayWebhookId: string, callback: SparkPost.Callback): void; + }; + sendingDomains: { + /** + * List an overview of all sending domains in the system. + * @param callback The request callback with SendingDomain results array + */ + all(callback: SparkPost.ResultsCallback): void; + /** + * Retrieve a sending domain by specifying its domain name in the URI path. The response includes details about its DKIM key configuration. + * @param domain The domain + * @param callback The request callback with SendingDomain results + */ + find(domain: string, callback: SparkPost.ResultsCallback): void; + /** + * Create a sending domain by providing a sending domain object as the POST request body. + * @param options The create options + * @param callback The request callback with basic info results + */ + create(options: SparkPost.CreateSendingDomain, callback: SparkPost.ResultsCallback<{ message: string, domain: string }>): void; + /** + * Update the attributes of an existing sending domain by specifying its domain name in the URI path and use a sending domain object as the PUT request body. + * @param options The update options + * @param callback The request callback with basic info results + */ + update(options: SparkPost.UpdateSendingDomain, callback: SparkPost.ResultsCallback<{ message: string, domain: string }>): void; + /** + * Delete an existing sending domain. + * @param domain The domain + * @param callback The request callback + */ + delete(domain: string, callback: SparkPost.Callback): void; + /** + * Verify a Sending Domain + * @param options The verify options + * @param callback The request callback with verify results + */ + verify(options: SparkPost.VerifyOptions, callback: SparkPost.ResultsCallback): void; + }; + subaccounts: { + /** + * Endpoint for retrieving a list of your subaccounts. + * This endpoint only returns information about the subaccounts themselves, not the data associated with the subaccount. + * @param callback The request callback with subaccount information results array + */ + all(callback: SparkPost.ResultsCallback): void; + /** + * + * @param subaccountId The webhook id + * @param callback The request callback with subaccount information results + */ + find(subaccountId: string | number, callback: SparkPost.ResultsCallback): void; + /** + * Provisions a new subaccount and an initial subaccount API key. + * @param options The create options + * @param callback The request callback with basic subaccount information results + */ + create(options: SparkPost.CreateSubaccount, callback: SparkPost.ResultsCallback): void; + /** + * Update an existing subaccount’s information. + * @param options The create options + * @param callback The request callback with webhook id results + */ + update(options: SparkPost.UpdateSubaccount, callback: SparkPost.ResultsCallback<{ message: string }>): void; + }; + suppressionList: { + /** + * Perform a filtered search for entries in your suppression list. + * @param parameters Object of search parameters + * @param callback The request callback with RelayWebhook results + */ + search(parameters: SparkPost.SupressionSearch, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve the suppression status for a specific recipient by specifying the recipient’s email address in the URI path. + * @param email Email address to check + * @param callback The request callback with webhook id results + */ + checkStatus(email: string, callback: SparkPost.ResultsCallback): void; + /** + * Delete a recipient from the list by specifying the recipient’s email address in the URI path. + * @param email Email address to check + * @param callback The request callback + */ + removeStatus(email: string, callback: SparkPost.Callback): void; + /** + * Bulk insert or update entries in the customer-specific exclusion list. + * @param parameters The suppression entry list + * @param callback The request callback + */ + upsert(parameters: SparkPost.CreateSupressionListEntry | SparkPost.CreateSupressionListEntry[], callback: SparkPost.ResultsCallback<{ message: string }>): void; + }; + templates: { + /** + * List a summary of all templates. + * @param callback The request callback with TemplateMeta results array + */ + all(callback: SparkPost.ResultsCallback): void; + /** + * Retrieve details about a specified template by its id + * @param options The id and draft status information + * @param callback The request callback with Template results + */ + find(options: { id: string, draft?: boolean }, callback: SparkPost.ResultsCallback): void; + /** + * Create a new template + * @param options The create options + * @param callback The request callback with template id results + */ + create(options: { template: SparkPost.CreateTemplate }, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Update an existing template + * @param options The create options + * @param callback The request callback with template id results + */ + update(options: { + id: string, + template: SparkPost.UpdateTemplate, + update_published?: boolean; + }, callback: SparkPost.ResultsCallback<{ id: string }>): void; + /** + * Delete an existing template + * @param id The template id + * @param callback The request callback + */ + delete(id: string, callback: SparkPost.Callback): void; + /** + * Preview the most recent version of an existing template by id + * @param options The preview options + * @param callback The request callback with webhook id results + */ + preview(options: { id: string, data: any, draft?: boolean }, callback: SparkPost.ResultsCallback): void; + }; + transmissions: { + /** + * List an overview of all transmissions in the account + * @param callback The request callback with Transmission results array + */ + all(callback: SparkPost.ResultsCallback): void; + /** + * List an overview of all transmissions in the account, with added filters + * @param options The search options { campaign_id?, template_id? } + * @param callback The request callback with Transmission results array + */ + all(options: { campaign_id?: string, template_id?: string }, callback: SparkPost.ResultsCallback): void; + /** + * Retrieve the details about a transmission by its ID + * @param transmissionID The transmission id + * @param callback The request callback with Transmission results + */ + find(transmissionID: string, callback: SparkPost.ResultsCallback): void; + /** + * Sends a message by creating a new transmission + * @param options The create options + * @param callback The request callback with metadata and id results + */ + send(options: { transmissionBody: SparkPost.CreateTransmission, num_rcpt_errors?: number }, callback: SparkPost.ResultsCallback<{ + total_rejected_recipients: number; + total_accepted_recipients: number; + id: string; + }>): void; + }; + webhooks: { + /** + * List currently existing webhooks. + * @param callback The request callback with RelayWebhook results array + */ + all(callback: SparkPost.ResultsCallback>): void; + /** + * List currently existing webhooks. + * @param options Object containing optional timezone + * @param callback The request callback with RelayWebhook results array + */ + all(options: { timezone?: string }, callback: SparkPost.ResultsCallback>): void; + /** + * Retrieve details about a specified webhook by its id + * @param options Object containing id and optional timezone + * @param callback The request callback with RelayWebhook results + */ + describe(options: { id: string, timezone?: string }, callback: SparkPost.ResultsCallback): void; + /** + * Create a new webhook + * @param options The create options + * @param callback The request callback with webhook id results + */ + create(options: SparkPost.Webhook, callback: SparkPost.ResultsCallback): void; + /** + * Update an existing webhook + * @param options The update options + * @param callback The request callback with webhook id results + */ + update(options: SparkPost.UpdateWebhook, callback: SparkPost.ResultsCallback): void; + /** + * Delete an existing webhook + * @param id The webhook id + * @param callback The request callback + */ + delete(id: string, callback: SparkPost.Callback): void; + /** + * Sends an example message event batch from the Webhook API to the target URL + * @param options The webhook id and message + * @param callback The request callback with validation results + */ + validate(options: { id: string, message: any }, callback: SparkPost.ResultsCallback<{ + msg: string; + response: { + status: number; + headers: any; + body: string; + } + }>): void; + /** + * Sends an example message event batch from the Webhook API to the target URL + * @param options The webhook id and optional limit + * @param callback The request callback with status results + */ + getBatchStatus(options: { id: string, limit?: number }, callback: SparkPost.ResultsCallback<{ + batch_id: string; + ts: string; + attempts: number; + response_code: number; + }[]>): void; + /** + * Lists descriptions of the events, event types, and event fields that could be included in a Webhooks post to your target URL. + * @param callback The request callback containing documentation results + */ + getDocumentation(callback: SparkPost.ResultsCallback): void; + /** + * List an example of the event data that will be posted by a Webhook for the specified events. + * @param callback The request callback containing examples + */ + getSamples(callback: SparkPost.Callback): void; + /** + * List an example of the event data that will be posted by a Webhook for the specified events. + * @param options The optional event name + * @param callback The request callback containing examples + */ + getSamples(options: { events?: string }, callback: SparkPost.Callback): void; + }; + + /** + * The official Node.js binding for your favorite SparkPost APIs! + * @param apiKey A passed in apiKey will take precedence over an environment variable + * @param options Additional options + */ + constructor(apiKey?: string, options?: SparkPost.ConstructorOptions); + + request(options: Request.Options, callback: SparkPost.Callback): void; + get(options: Request.Options, callback: SparkPost.Callback): void; + post(options: Request.Options, callback: SparkPost.Callback): void; + put(options: Request.Options, callback: SparkPost.Callback): void; + delete(options: Request.Options, callback: SparkPost.Callback): void; +} + +declare namespace SparkPost { + + export interface ErrorWithDescription { + message: string; + code: string; + description: string; + } + export interface ErrorWithParam { + message: string; + param: string; + value: string | null; + } + export interface SparkPostError extends Error { + name: "SparkPostError"; + errors: ErrorWithDescription[] | ErrorWithParam[]; + statusCode: number; + } + + export interface ConstructorOptions { + origin?: string; + endpoint?: string; + apiVersion?: string; + headers?: any; + } + + export interface Response extends Http.IncomingMessage { + body: T; + } + export interface Callback { + (err: Error | SparkPostError | null, res: Response): void; + } + export type ResultsCallback = Callback<{ results: T }>; + + export interface Domain { + domain: string; + } + + export interface MessageEvent { + /** Type of event this record describes */ + type: string; + /** Classification code for a given message (see [Bounce Classification Codes](https://support.sparkpost.com/customer/portal/articles/1929896)) */ + bounce_class: string; + /** Campaign of which this message was a part */ + campaign_id: string; + /** SparkPost-customer identifier through which this message was sent */ + customer_id: string; + /** Protocol by which SparkPost delivered this message */ + delv_method: string; + /** Token of the device / application targeted by this PUSH notification message. Applies only when delv_method is gcm or apn. */ + device_token: string; + /** Error code by which the remote server described a failed delivery attempt */ + error_code: string; + /** IP address of the host to which SparkPost delivered this message; in engagement events, the IP address of the host where the HTTP request originated */ + ip_address: string; + /** SparkPost-cluster-wide unique identifier for this message */ + message_id: string; + /** Sender address used on this message"s SMTP envelope */ + msg_from: string; + /** Message"s size in bytes */ + msg_size: string; + /** Number of failed attempts before this message was successfully delivered; when the first attempt succeeds, zero */ + num_retries: string; + /** Metadata describing the message recipient */ + rcpt_meta: any; + /** Tags applied to the message which generated this event */ + rcpt_tags: string[]; + /** Recipient address used on this message"s SMTP envelope */ + rcpt_to: string; + /** Indicates that a recipient address appeared in the Cc or Bcc header or the archive JSON array */ + rcpt_type: string; + /** Unmodified, exact response returned by the remote server due to a failed delivery attempt */ + raw_reason: string; + /** Canonicalized text of the response returned by the remote server due to a failed delivery attempt */ + reason: string; + /** Domain receiving this message */ + routing_domain: string; + /** Subject line from the email header */ + subject: string; + /** Slug of the template used to construct this message */ + template_id: string; + /** Version of the template used to construct this message */ + template_version: string; + /** Event date and time formatted as: YYYY-MM-DDTHH:MM:SS.SSS±hh:mm */ + timestamp: string; + /** Transmission which originated this message */ + transmission_id: string; + } + + export interface MessageEventParameters { + /** delimited list of bounce classification codes to search. (See Bounce Classification Codes.) */ + bounce_classes?: Array | string | number; + /** delimited list of campaign ID’s to search (i.e. the campaign id used during creation of a transmission). */ + campaign_ids?: string[] | string; + /** Specifies the delimiter for query parameter lists */ + delimiter?: string; + /** delimited list of event types to search. Defaults to all event types. */ + events?: string[] | string; + /** delimited list of friendly from emails to search. */ + friendly_froms?: string[] | string; + /** Datetime in format of YYYY-MM-DDTHH:MM. */ + from?: string; + /** delimited list of message ID’s to search. */ + message_ids?: string[] | string; + /** The results page number to return. Used with per_page for paging through results. */ + page?: number; + /** Number of results to return per page. Must be between 1 and 10,000 (inclusive). */ + per_page?: number; + /** Bounce/failure/rejection reason that will be matched using a wildcard (e.g., %reason%). */ + reason?: string[] | string; + /** delimited list of recipients to search. */ + recipients?: string[] | string; + /** delimited list of subaccount ID’s to search. */ + subaccounts?: number[] | number; + /** delimited list of template ID’s to search. */ + template_ids?: string[] | string; + /** Standard timezone identification string. */ + timezone?: string; + /** Datetime in format of YYYY-MM-DDTHH:MM. */ + to?: string; + /** delimited list of transmission ID’s to search (i.e. id generated during creation of a transmission). */ + transmission_ids?: string[] | string; + } + + export interface RecipientListMetadata { + total_rejected_recipients: number; + total_accepted_recipients: number; + id: string; + name: string; + } + + export interface RecipientList { + /** Short, unique, recipient list identifier */ + id: string; + /** Short, pretty/readable recipient list display name, not required to be unique */ + name: string; + /** Detailed description of the recipient list */ + description: string; + /** Recipient list attribute object */ + attributes: any; + /** Number of accepted recipients */ + total_accepted_recipients: number; + } + export interface RecipientListWithRecipients extends RecipientList { + /** Array of recipient objects */ + recipients: Recipient[]; + } + + export interface CreateRecipientList { + /** Short, unique, recipient list identifier */ + id?: string; + /** Short, pretty/readable recipient list display name, not required to be unique */ + name?: string; + /** Detailed description of the recipient list */ + description?: string; + /** Recipient list attribute object */ + attributes?: any; + /** limit the number of recipient errors returned. */ + num_rcpt_errors?: number; + /** Array of recipient objects */ + recipients: Recipient[]; + } + export interface UpdateRecipientList { + /** Short, unique, recipient list identifier */ + id?: string; + /** Short, pretty/readable recipient list display name, not required to be unique */ + name?: string; + /** Detailed description of the recipient list */ + description?: string; + /** Recipient list attribute object */ + attributes?: any; + /** limit the number of recipient errors returned. */ + num_rcpt_errors?: number; + /** Array of recipient objects */ + recipients?: Recipient[]; + } + + export interface BaseRecipient { + /** SparkPost Enterprise API only. Email to use for envelope FROM. */ + return_path?: string; + /** Array of text labels associated with a recipient. */ + tags?: string[]; + /** Key/value pairs associated with a recipient. */ + metadata?: any; + /** Key/value pairs associated with a recipient that are provided to the substitution engine. */ + substitution_data?: any; + } + export interface RecipientWithAddress { + /** Address information for a recipient At a minimum, address or multichannel_addresses is required. */ + address: Address | string; + } + export interface RecipientWithMultichannelAddresses { + /** + * Address information for a recipient. + * At a minimum, address or multichannel_addresses is required. + * If both address and multichannel_addresses are specified only multichannel_addresses will be used. + * + * @type {(Address | string)} + * @memberOf RecipientWithMultichannelAddresses + */ + address?: Address | string; + /** + * Array of Multichannel Address objects for a recipient. + * At a minimum, address or multichannel_addresses is required. + * If both address and multichannel_addresses are specified only multichannel_addresses will be used. + * + * @type {MultichannelAddress[]} + * @memberOf RecipientWithMultichannelAddresses + */ + multichannel_addresses: MultichannelAddress[]; + } + export type Recipient = (RecipientWithAddress | RecipientWithMultichannelAddresses) & BaseRecipient; + + export interface Address { + /** Valid email address */ + email: string; + /** User-friendly name for the email address */ + name?: string; + /** Email address to display in the “To” header instead of address.email (for CC and BCC) */ + header_to?: string; + } + + export interface MultichannelAddress { + /** The communication channel used to reach recipient. Valid values are “email”, “gcm”, “apns”. */ + channel: string; + /** Valid email address. Required if channel is “email”. */ + email: string; + /** User-friendly name for the email address. Used when channel is “email” */ + name: string; + /** Email address to display in the “To” header instead of address.email (for BCC). Used when channel is “email” */ + header_to: string; + /** SparkPost Enterprise API only. Required if channel is “gcm” or “apns” */ + token: string; + /** SparkPost Enterprise API only. Required if channel is “gcm” or “apns” */ + app_id: string; + } + + export interface RelayWebhook { + /** User-friendly name no example: Inbound Customer Replies */ + name?: string; + /** URL of the target to which to POST relay batches */ + target: string; + /** Authentication token to present in the X-MessageSystems-Webhook-Token header of POST requests to target */ + auth_token?: string; + /** Restrict which inbound messages will be relayed to the target */ + match: Match; + } + + export interface UpdateRelayWebhook { + /** User-friendly name no example: Inbound Customer Replies */ + name?: string; + /** URL of the target to which to POST relay batches */ + target?: string; + /** Authentication token to present in the X-MessageSystems-Webhook-Token header of POST requests to target */ + auth_token?: string; + /** Restrict which inbound messages will be relayed to the target */ + match?: Match; + } + + export interface Match { + /** Inbound messaging protocol associated with this webhook. Defaults to “SMTP” */ + protocol?: string; + /** Inbound domain associated with this webhook. Required when protocol is “SMTP”. */ + domain?: string; + /** ESME address binding associated with this webhook yes, when protocol is “SMPP”. SparkPost Enterprise API only. */ + esme_address?: string; + } + + export interface SendingDomain { + /** Name of the sending domain. */ + domain: string; + /** Associated tracking domain. */ + tracking_domain: string; + /** JSON object containing status details, including whether this domain’s ownership has been verified. */ + status: Status; + /** JSON object in which DKIM key configuration is defined. */ + dkim?: DKIM; + /** Whether to generate a DKIM keypair on creation. */ + generate_dkim?: boolean; + /** Size, in bits, of the DKIM private key to be generated. This option only applies if generate_dkim is ‘true’. */ + dkim_key_length?: number; + /** Setting to true allows this domain to be used by subaccounts. Defaults to false, only available to domains belonging to a master account. */ + shared_with_subaccounts: boolean; + } + + export interface CreateSendingDomain { + /** Name of the sending domain. */ + domain: string; + /** Associated tracking domain. */ + tracking_domain?: string; + /** JSON object containing status details, including whether this domain’s ownership has been verified. */ + status?: Status; + /** JSON object in which DKIM key configuration is defined. */ + dkim?: DKIM; + /** Whether to generate a DKIM keypair on creation. */ + generate_dkim?: boolean; + /** Size, in bits, of the DKIM private key to be generated. This option only applies if generate_dkim is ‘true’. */ + dkim_key_length?: number; + /** Setting to true allows this domain to be used by subaccounts. Defaults to false, only available to domains belonging to a master account. */ + shared_with_subaccounts?: boolean; + } + + export interface UpdateSendingDomain { + /** Name of the sending domain. */ + domain: string; + /** Associated tracking domain. */ + tracking_domain?: string; + /** JSON object in which DKIM key configuration is defined. */ + dkim?: DKIM; + /** Whether to generate a DKIM keypair on creation. */ + generate_dkim?: boolean; + /** Size, in bits, of the DKIM private key to be generated. This option only applies if generate_dkim is ‘true’. */ + dkim_key_length?: number; + /** Setting to true allows this domain to be used by subaccounts. Defaults to false, only available to domains belonging to a master account. */ + shared_with_subaccounts?: boolean; + } + + export interface DKIM { + /** Signing Domain Identifier (SDID). SparkPost Enterprise API only. */ + signing_domain?: string; + /** DKIM private key. */ + private?: string; + /** DKIM public key. */ + public: string; + /** DomainKey selector. */ + selector: string; + /** Header fields to be included in the DKIM signature. This field is currently ignored. */ + headers?: string; + } + + export interface Status { + /** Whether domain ownership has been verified */ + ownership_verified: boolean; + /** Verification status of SPF configuration */ + spf_status: "valid" | "invalid" | "unverified" | "pending"; + /** Compliance status */ + compliance_status: "valid" | "pending" | "blocked"; + /** Verification status of DKIM configuration */ + dkim_status: "valid" | "invalid" | "unverified" | "pending"; + /** Verification status of abuse@ mailbox */ + abuse_at_status: "valid" | "invalid" | "unverified" | "pending"; + /** Verification status of postmaster@ mailbox */ + postmaster_at_status: "valid" | "invalid" | "unverified" | "pending"; + } + + export interface VerifyOptions { + domain: string; + verifyDKIM?: boolean; + verifySPF?: boolean; + } + + export interface VerifyResults extends Status { + dns?: { + dkim_record: string; + spf_record: string; + }; + } + + export interface CreateSubaccount { + /** user-friendly name */ + name: string; + /** user-friendly identifier for subaccount API key */ + keyLabel: string; + /** list of grants to give the subaccount API key */ + keyGrants: string[]; + /** list of IPs the subaccount may be used from */ + keyValidIps?: string[]; + /** id of the default IP pool assigned to subaccount"s transmissions */ + ipPool?: string; + } + + export interface CreateSubaccountResponse { + subaccount_id: number; + key: string; + label: string; + short_key: string; + } + + export interface UpdateSubaccount { + /** the id of the subaccount you want to update */ + subaccountId: string | number; + /** user-friendly name */ + name: string; + /** status of the subaccount */ + status: string; + /** id of the default IP pool assigned to subaccount"s transmissions */ + ipPool?: string; + } + + export interface SubaccountInformation { + /** ID of subaccount */ + id: number; + /** User friendly identifier for a specific subaccount */ + name: string; + /** Status of the account */ + status: "active" | "suspended" | "terminated"; + /** The ID of the default IP Pool assigned to this subaccount’s transmissions */ + ip_pool?: string; + compliance_status: string; + } + + export interface CreateSupressionListEntry { + recipient: string; + /** Whether the recipient requested to not receive any transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + transactional?: boolean; + /** Whether the recipient requested to not receive any non-transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + non_transactional?: boolean; + /** Short explanation of the suppression */ + description?: string; + } + + export interface SupressionListEntry { + recipient: string; + /** Whether the recipient requested to not receive any transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + transactional?: boolean; + /** Whether the recipient requested to not receive any non-transactional messages. At a minimum, transactional or non_transactional is required upon creation of the entry. */ + non_transactional?: boolean; + /** Coming soon */ + type?: "transactional" | "non_transactional"; + /** Source responsible for inserting the list entry. Valid values include: Spam Complaint, List Unsubscribe, Bounce Rule, Unsubscribe Link, Manually Added, Compliance. */ + source?: string; + /** Short explanation of the suppression */ + description?: string; + created: string; + updated: string; + } + + export interface SupressionSearch { + /** Datetime the entries were last updated, in the format of YYYY-MM-DDTHH:mm:ssZ */ + to?: string; + /** Datetime the entries were last updated, in the format YYYY-MM-DDTHH:mm:ssZ */ + from?: string; + /** Types of entries to include in the search, i.e. entries with “transactional” and/or “non_transactional” keys set to true */ + types?: string; + /** Sources of the entries to include in the search, i.e. entries that were added by this source */ + sources?: string; + /** Maximum number of results to return. Must be between 1 and 100000. Default value is 100000. */ + limit?: number; + } + + export interface TemplateContent { + /** HTML content for the email’s text/html MIME part */ + html: string; + /** Text content for the email’s text/plain MIME part */ + text: string; + /** Email subject line. */ + subject: string; + /** + * Address “from” : "deals@company.com" or JSON object composed of the “name” and “email” fields + * “from” : { “name” : “My Company”, “email” : "deals@company.com" } used to compose the email’s “From” header. + * + * @type {(Address | string)} + * @memberOf CreateTemplateContent + */ + from: Address | string; + /** Email address used to compose the email’s “Reply-To” header. */ + reply_to?: string; + /** JSON dictionary containing headers other than “Subject”, “From”, “To”, and “Reply-To”. */ + headers?: any; + } + + export interface CreateTemplateContent { + /** HTML content for the email’s text/html MIME part */ + html?: string; + /** Text content for the email’s text/plain MIME part */ + text?: string; + /** Email subject line. */ + subject: string; + /** + * Address “from” : "deals@company.com" or JSON object composed of the “name” and “email” fields + * “from” : { “name” : “My Company”, “email” : "deals@company.com" } used to compose the email’s “From” header. + * + * @type {(Address | string)} + * @memberOf CreateTemplateContent + */ + from: Address | string; + /** Email address used to compose the email’s “Reply-To” header. */ + reply_to?: string; + /** JSON dictionary containing headers other than “Subject”, “From”, “To”, and “Reply-To”. */ + headers?: any; + } + + export interface TemplateMeta { + /** Unique template ID */ + id: string; + /** Template name */ + name: string; + /** Published state of the template (true = published, false = draft) */ + published: boolean; + /** Template description */ + description: string; + } + + export interface Template { + /** + * Short, unique, alphanumeric ID used to reference the template. + * At a minimum, id or name is required upon creation. It is auto generated if not provided. + * After a template has been created, this property cannot be changed. Maximum length - 64 bytes + * + * @type {string} + * @memberOf CreateTemplate + */ + id: string; + /** Content that will be used to construct a message yes For a full description, see the Content Attributes. Maximum length - 20 MBs */ + content: TemplateContent | { email_rfc822: string }; + /** Whether the template is published or is a draft version no - defaults to false A template cannot be changed from published to draft. */ + published: boolean; + /** Editable display name At a minimum, id or name is required upon creation. The name does not have to be unique. Maximum length - 1024 bytes */ + name: string; + /** Detailed description of the template no Maximum length - 1024 bytes */ + description: string; + /** JSON object in which template options are defined no For a full description, see the Options Attributes. */ + options: TemplateOptions; + /** The “last_update_time” is the time the template was last updated, for both draft and published versions */ + last_update_time: string; + /** The “last_use” time represents the last time any version of this template was used (draft or published). */ + last_use?: string; + } + + export interface CreateTemplate { + /** + * Short, unique, alphanumeric ID used to reference the template. + * At a minimum, id or name is required upon creation. It is auto generated if not provided. + * After a template has been created, this property cannot be changed. Maximum length - 64 bytes + * + * @type {string} + * @memberOf CreateTemplate + */ + id?: string; + /** Content that will be used to construct a message yes For a full description, see the Content Attributes. Maximum length - 20 MBs */ + content: CreateTemplateContent | { email_rfc822: string }; + /** Whether the template is published or is a draft version no - defaults to false A template cannot be changed from published to draft. */ + published?: boolean; + /** Editable display name At a minimum, id or name is required upon creation. The name does not have to be unique. Maximum length - 1024 bytes */ + name?: string; + /** Detailed description of the template no Maximum length - 1024 bytes */ + description?: string; + /** JSON object in which template options are defined no For a full description, see the Options Attributes. */ + options?: CreateTemplateOptions; + } + + export interface UpdateTemplate { + /** Content that will be used to construct a message yes For a full description, see the Content Attributes. Maximum length - 20 MBs */ + content?: CreateTemplateContent | { email_rfc822: string }; + /** Whether the template is published or is a draft version no - defaults to false A template cannot be changed from published to draft. */ + published?: boolean; + /** Editable display name At a minimum, id or name is required upon creation. The name does not have to be unique. Maximum length - 1024 bytes */ + name?: string; + /** Detailed description of the template no Maximum length - 1024 bytes */ + description?: string; + /** JSON object in which template options are defined no For a full description, see the Options Attributes. */ + options?: CreateTemplateOptions; + } + + export interface TemplateOptions { + /** Enable or disable open tracking */ + open_tracking: boolean; + /** Enable or disable click tracking */ + click_tracking: boolean; + /** Distinguish between transactional and non-transactional messages for unsubscribe and suppression purposes */ + transactional: boolean; + } + + export interface CreateTemplateOptions { + /** Enable or disable open tracking */ + open_tracking?: boolean; + /** Enable or disable click tracking */ + click_tracking?: boolean; + /** Distinguish between transactional and non-transactional messages for unsubscribe and suppression purposes */ + transactional?: boolean; + } + + export interface CreateTransmission { + /** JSON object in which transmission options are defined */ + options?: TransmissionOptions; + /** Inline recipient objects or object containing stored recipient list ID */ + recipients?: Recipient[] | { list_id: string }; + /** Name of the campaign */ + campaign_id?: string; + /** Description of the transmission */ + description?: string; + /** Transmission level metadata containing key/value pairs */ + metadata?: any; + /** Key/value pairs that are provided to the substitution engine */ + substitution_data?: any; + /** SparkPost Enterprise API only: email to use for envelope FROM */ + return_path?: string; + /** Content that will be used to construct a message */ + content: InlineContent | { template_id: string, use_draft_template?: boolean } | { email_rfc822: string }; + } + + export interface TransmissionSummary { + /** ID of the transmission */ + id: string; + /** State of the transmission */ + state: "submitted" | "Generating" | "Success" | "Canceled"; + /** Description of the transmission */ + description: string; + /** Name of the campaign */ + campaign_id: string; + /** Content that will be used to construct a message */ + content: { template_id: string }; + } + + export interface Transmission { + /** ID of the transmission */ + id: string; + /** State of the transmission */ + state: "submitted" | "Generating" | "Success" | "Canceled"; + /** JSON object in which transmission options are defined */ + options: TransmissionOptions; + /** Name of the campaign */ + campaign_id: string; + /** Description of the transmission */ + description: string; + /** Transmission level metadata containing key/value pairs */ + metadata: any; + /** Key/value pairs that are provided to the substitution engine */ + substitution_data: any; + /** Content that will be used to construct a message */ + content: InlineContent | { template_id: string, use_draft_template?: boolean } | { email_rfc822: string }; + /** Computed total number of messages generated */ + num_generated: number; + /** Computed total number of failed messages */ + num_failed_generation: number; + /** Number of recipients that failed input validation */ + num_invalid_recipients: number; + rcpt_list_chunk_size: number; + rcpt_list_total_chunks: number; + } + + export interface TransmissionOptions { + /** Delay generation of messages until this datetime. */ + start_time?: string; + /** Whether open tracking is enabled for this transmission */ + open_tracking?: boolean; + /** Whether click tracking is enabled for this transmission */ + click_tracking?: boolean; + /** Whether message is transactional or non-transactional for unsubscribe and suppression purposes */ + transactional?: boolean; + /** Whether or not to use the sandbox sending domain */ + sandbox?: boolean; + /** SparkPost Enterprise API only: Whether or not to ignore customer suppression rules, for this transmission only. Only applicable if your configuration supports this parameter. */ + skip_suppression?: boolean; + /** The ID of a dedicated IP pool associated with your account ( Note: SparkPost only ). */ + ip_pool?: string; + /** Whether or not to perform CSS inlining in HTML content */ + inline_css?: boolean; + } + + export interface InlineContent { + /** HTML content for the email’s text/html MIME part At a minimum, html, text, or push is required. */ + html?: string; + /** Text content for the email’s text/plain MIME part At a minimum, html, text, or push is required. */ + text?: string; + /** Content of push notifications At a minimum, html, text, or push is required. SparkPost Enterprise API only. */ + push?: PushData; + /** Email subject line required for email transmissions Expected in the UTF-8 charset without RFC2047 encoding. Substitution syntax is supported. */ + subject?: string; + /** "deals@company.com" or JSON object composed of the “name” and “email” fields “from” : { “name” : “My Company”, “email” : "deals@company.com" } used to compose the email’s “From” header */ + from?: string | { email: string, name: string }; + /** Email address used to compose the email’s “Reply-To” header */ + reply_to?: string; + /** JSON dictionary containing headers other than “Subject”, “From”, “To”, and “Reply-To” */ + headers?: any; + /** JSON array of attachments. */ + attachments?: Attachment[]; + /** JSON array of inline images. */ + inline_images?: Attachment[]; + } + + export interface PushData { + /** payload for APNs messages */ + apns?: any; + /** payload for GCM messages */ + gcm?: any; + } + + export interface Attachment { + /** + * The MIME type of the attachment; e.g., “text/plain”, “image/jpeg”, “audio/mp3”, “video/mp4”, “application/msword”, “application/pdf”, etc., + * including the “charset” parameter (text/html; charset=“UTF-8”) if needed. + * The value will apply “as-is” to the “Content-Type” header of the generated MIME part for the attachment. + * + * @type {string} + * @memberOf Attachment + */ + type: string; + /** The filename of the attachment (for example, “document.pdf”). This is inserted into the filename parameter of the Content-Disposition header. */ + name: string; + /** + * The content of the attachment as a Base64 encoded string. + * The string should not contain \r\n line breaks. + * The SparkPost systems will add line breaks as necessary to ensure the Base64 encoded lines contain no more than 76 characters each. + * + * @type {string} + * @memberOf Attachment + */ + data: string; + } + + export interface Webhook { + /** User-friendly name for webhook */ + name: string; + /** URL of the target to which to POST event batches */ + target: string; + /** Array of event types this webhook will receive */ + events: string[]; + /** Type of authentication to be used during POST requests to target */ + auth_type?: string; + /** Object containing details needed to request authorization credentials, as necessary */ + auth_request_details?: any; + /** Object containing credentials needed to make authorized POST requests to target */ + auth_credentials?: any; + /** Authentication token to present in the X-MessageSystems-Webhook-Token header of POST requests to target */ + auth_token?: string; + } + + export interface UpdateWebhook { + id: string; + /** User-friendly name for webhook */ + name?: string; + /** URL of the target to which to POST event batches */ + target?: string; + /** Array of event types this webhook will receive */ + events?: string[]; + /** Type of authentication to be used during POST requests to target */ + auth_type?: string; + /** Object containing details needed to request authorization credentials, as necessary */ + auth_request_details?: any; + /** Object containing credentials needed to make authorized POST requests to target */ + auth_credentials?: any; + /** Authentication token to present in the X-MessageSystems-Webhook-Token header of POST requests to target */ + auth_token?: string; + } + + export interface WebhookLinks { + links: { + href: string; + rel: string; + method: string[]; + }[]; + } +} + +export = SparkPost; diff --git a/sparkpost/v1/sparkpost-tests.ts b/sparkpost/v1/sparkpost-tests.ts new file mode 100644 index 0000000000..0b8a41ab0a --- /dev/null +++ b/sparkpost/v1/sparkpost-tests.ts @@ -0,0 +1,944 @@ +import * as SparkPost from "sparkpost"; + +let key = "YOURAPIKEY"; +let client = new SparkPost(key); + +client.get({ + uri: "metrics/domains" +}, function(err, data) { + if (err) { + console.log(err); + return; + } + + console.log(data.body); +}); + +client.inboundDomains.create("example1.com", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.inboundDomains.delete("example1.com", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.inboundDomains.find("example1.com", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.inboundDomains.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.messageEvents.search({}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.messageEvents.search({ + events: "click", + campaign_ids: "monday_mailshot" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.messageEvents.search({ + from: "2016-01-01T00:00", + to: "2016-01-02T23:59", + page: 1, + per_page: 5, + events: ["bounce", "out_of_band"], + bounce_classes: [10] +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.recipientLists.create({ + id: "UNIQUE_TEST_ID", + name: "Test Recipient List", + recipients: [ + { + address: { + email: "test1@test.com" + } + }, { + address: { + email: "test2@test.com" + } + }, { + address: { + email: "test3@test.com" + } + } + ] +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.recipientLists.delete("UNIQUE_TEST_ID", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.recipientLists.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.recipientLists.find({ + id: "UNIQUE_TEST_ID" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.recipientLists.find({ + id: "UNIQUE_TEST_ID", + show_recipients: true +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.recipientLists.update({ + id: "EXISTING_TEST_ID", + name: "Test Recipient List", + recipients: [ + { + address: { + email: "test1@test.com" + } + }, { + address: { + email: "test2@test.com" + } + }, { + address: { + email: "test3@test.com" + } + } + ] +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.relayWebhooks.create({ + name: "Test Relay Webhook", + target: "http://client.test.com/test-webhook", + match: { + domain: "inbound.example.com" + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.relayWebhooks.delete("123456789", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.relayWebhooks.find("123456789", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.relayWebhooks.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.relayWebhooks.update({ + relayWebhookId: "123456789", + target: "http://client.test.com/test-webhook" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.sendingDomains.create({ + domain: "example1.com", + dkim: { + "private": "MIICXgIBAAKBgQC+W6scd3XWwvC//Y1g==", + "public": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==", + selector: "brisbane", + headers: "from:to:subject:date" + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + + +client.sendingDomains.delete("example1.com", function(err, data) { + if (err) { + console.log(err); + } else { + console.log(data); + console.log("Congrats you can use our client library!"); + } +}); + +client.sendingDomains.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.sendingDomains.find("example1.com", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.sendingDomains.update({ + domain: "example1.com", + dkim: { + "private": "MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx//Y1g==", + "public": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==", + selector: "hello_selector", + headers: "from:to:subject:date" + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.sendingDomains.verify({ + domain: "example1.com" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.sendingDomains.verify({ + domain: "example1.com", + verifySPF: false +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.sendingDomains.verify({ + domain: "example1.com", + verifyDKIM: false +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.subaccounts.create({ + name: "Test Subaccount", + keyLabel: "Test Subaccount key", + keyGrants: [ + "smtp/inject", + "transmissions/modify" + ] +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res); + console.log("Congrats you can use our client library!"); + } +}); + +client.subaccounts.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.subaccounts.find(123, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.subaccounts.update({ + subaccountId: 123, + name: "Test Subaccount", + status: "suspended" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.suppressionList.checkStatus("test@test.com", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.suppressionList.removeStatus("test@test.com", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.suppressionList.search({ + from: "2015-05-07T00:00:00+0000", + to: "2015-05-07T23:59:59+0000", + limit: 5 +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.suppressionList.upsert([ + { + recipient: "test1@test.com", + transactional: false, + non_transactional: true, + description: "Test description 1" + }, + { + recipient: "test2@test.com", + transactional: true, + non_transactional: true, + description: "Test description 2" + }, + { + recipient: "test3@test.com", + transactional: true, + non_transactional: false, + description: "Test description 3" + } +], function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our client library!"); + } +}); + +client.templates.create({ + template: { + id: "TEST_ID", + name: "Test Template", + content: { + from: "test@test.com", + subject: "Test email template!", + html: "This is a test email template!" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.templates.delete("TEST_ID", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + + +client.templates.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.templates.find({ + id: "TEST_ID", + draft: true +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.templates.find({ + id: "TEST_ID" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.templates.preview({ + id: "TEST_ID", + data: {} +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.templates.update({ + id: "TEST_ID", + template: { + content: { + from: "test@test.com", + subject: "Updated Published Test email template!", + html: "This is a published test email template! Updated!" + } + }, + update_published: true +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.templates.update({ + id: "TEST_ID", + template: { + content: { + from: "test@test.com", + subject: "Updated Test email template!", + html: "This is a test email template! Updated!" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.find("YOUR-TRANSMISSION-KEY", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.all({ + campaign_id: "my_campaign" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.all({ + template_id: "my_template" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.send({ + transmissionBody: { + recipients: [{ address: { email: "john.doe@example.com" } }], + content: { + from: "From Envelope ", + subject: "Example Email for MIME Parts", + html: "

Hello World!

", + text: "Hello World!" + }, + options: { + open_tracking: true, + click_tracking: true + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.send({ + transmissionBody: { + recipients: [{address: {email: "john.doe@example.com"}}], + content: { + email_rfc822: "Content-Type: text/plain\nFrom: From Envelope \nSubject: Example Email\n\nHello World" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.send({ + transmissionBody: { + options: { + open_tracking: true, + click_tracking: true + }, + campaign_id: "christmas_campaign", + return_path: "bounces-christmas-campaign@flintstone.com", + metadata: { + user_type: "students" + }, + substitution_data: { + sender: "Big Store Team" + }, + recipients: [ + { + return_path: "123@bounces.flintstone.com", + address: { + email: "wilma@flintstone.com", + name: "Wilma Flintstone" + }, + tags: [ + "greeting", + "prehistoric", + "fred", + "flintstone" + ], + metadata: { + place: "Bedrock" + }, + substitution_data: { + customer_type: "Platinum" + } + } + ], + content: { + from: { + name: "Fred Flintstone", + email: "fred@flintstone.com" + }, + subject: "Big Christmas savings!", + reply_to: "Christmas Sales ", + headers: { + "X-Customer-Campaign-ID": "christmas_campaign" + }, + text: "Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n Hurry, this offer is only to {{customer_type}}\n {{sender}}", + html: "

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.send({ + transmissionBody: { + recipients: [ + { + address: { + email: "original.recipient@example.com", + name: "Original Recipient" + }, + substitution_data: { + recipient_type: "Original" + } + }, + { + address: { + email: "bcc.recipient@example.com", + header_to: "\"Original Recipient\" " + }, + substitution_data: { + recipient_type: "BCC" + } + } + ], + content: { + from: { + name: "Node BCC Test", + email: "from@example.com" + }, + subject: "Example email using bcc", + text: "An example email using bcc with SparkPost to the {{recipient_type}} recipient.", + html: "

An example email using bcc with SparkPost to the {{recipient_type}} recipient.

" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats! You sent an email with bcc using SparkPost!"); + } +}); + +client.transmissions.send({ + transmissionBody: { + recipients: [ + { + address: { + email: "original.recipient@example.com", + name: "Original Recipient" + }, + substitution_data: { + recipient_type: "Original" + } + }, + { + address: { + email: "cc.recipient@example.com", + name: "Carbon Copy Recipient", + header_to: "\"Original Recipient\" " + }, + substitution_data: { + recipient_type: "CC" + } + } + ], + content: { + from: { + name: "Node CC Test", + email: "from@example.com" + }, + headers: { + "CC": "\"Carbon Copy Recipient\" " + }, + subject: "Example email using cc", + text: "An example email using cc with SparkPost to the {{recipient_type}} recipient.", + html: "

An example email using cc with SparkPost to the {{recipient_type}} recipient.

" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats! You sent an email with cc using SparkPost!"); + } +}); + +client.transmissions.send({ + transmissionBody: { + recipients: { + list_id: "example-list" + }, + content: { + from: "From Envelope ", + subject: "Example Email for Stored List and Inline Content", + html: "

Hello World

", + text: "Hello World!" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.send({ + transmissionBody: { + recipients: { + list_id: "example-list" + }, + content: { + from: "From Envelope ", + subject: "Example Email for Stored List and Template", + template_id: "my-template" + } + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.transmissions.send({ + num_rcpt_errors: 3, + transmissionBody: { + campaign_id: "ricks-campaign", + content: { + template_id: "ricks-template" + }, + recipients: [{ address: { email: "rick.sanchez@rickandmorty100years.com", name: "Rick Sanchez" } }] + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("What up my glib globs! SparkPost!"); + } +}); + +client.webhooks.create({ + name: "Test webhook", + target: "http://client.test.com/test-webhook", + auth_token: "AUTH_TOKEN", + events: [ + "delivery", + "injection", + "open", + "click" + ] +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.webhooks.delete("TEST_WEBHOOK_UUID", function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.webhooks.describe({ + id: "TEST_WEBHOOK_UUID", + timezone: "America/New_York" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.webhooks.getBatchStatus({ + id: "TEST_WEBHOOK_UUID", + limit: 1000 +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + + +client.webhooks.getDocumentation(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.webhooks.getSamples({ + events: "bounce" +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.webhooks.all(function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.webhooks.update({ + id: "TEST_WEBHOOK_UUID", + name: "Renamed Test webhook", + events: [ + "policy_rejection", + "delay" + ] +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); + +client.webhooks.validate({ + id: "TEST_WEBHOOK_UUID", + message: { + msys: {} + } +}, function(err, res) { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } +}); diff --git a/sparkpost/v1/tsconfig.json b/sparkpost/v1/tsconfig.json new file mode 100644 index 0000000000..54f30b3435 --- /dev/null +++ b/sparkpost/v1/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "sparkpost": ["sparkpost/v1"], + "sparkpost/*": ["sparkpost/v1/*"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sparkpost-tests.ts" + ] +} diff --git a/speakeasy/index.d.ts b/speakeasy/index.d.ts index 15ec90c09a..4e281f996f 100644 --- a/speakeasy/index.d.ts +++ b/speakeasy/index.d.ts @@ -49,6 +49,7 @@ interface TotpOptions { counter?: number; epoch?: number; secret?: string; + digits?: number; digest?: () => string; algorithm?: string; } diff --git a/speakingurl/index.d.ts b/speakingurl/index.d.ts index 289c1eb033..83e38fd7b8 100644 --- a/speakingurl/index.d.ts +++ b/speakingurl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for speakingurl 10.0 +// Type definitions for speakingurl 13.0 // Project: http://pid.github.io/speakingurl/ // Definitions by: Zlatko Andonovski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,7 +7,7 @@ interface Dictionary { [x: string]: T; } -interface Options { +interface SpeakingURLOptions { separator?: string; lang?: string|boolean; symbols?: boolean; @@ -20,10 +20,10 @@ interface Options { custom?: string[]|Dictionary; } -declare function getSlug(input: string, options?: Options|string): string; +declare function getSlug(input: string, options?: SpeakingURLOptions|string): string; declare namespace getSlug { - export function createSlug(options: Options): (input: string) => string; + export function createSlug(options: SpeakingURLOptions): (input: string) => string; } -export = getSlug; \ No newline at end of file +export = getSlug; diff --git a/stamplay-js-sdk/index.d.ts b/stamplay-js-sdk/index.d.ts index 53f57ad86c..81f20d8c95 100644 --- a/stamplay-js-sdk/index.d.ts +++ b/stamplay-js-sdk/index.d.ts @@ -1,35 +1,27 @@ -// Type definitions for stamplay-js-sdk 1.2.9 +// Type definitions for stamplay-js-sdk 1.2 // Project: https://github.com/Stamplay/stamplay-js-sdk // Definitions by: Riderman de Sousa Barbosa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - declare namespace Stamplay { + export function init(appId: string): void; + export function User(): StamplayObject; + export function Cobject(object: string): StamplayObject; - 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 Model { + signup({}): Promise; + new(): Model; // This is suspicious, but tests show model instances being constructable... + get(property: string): any; + set(property: string, value: any): void; + unset(property: string) : void; + fetch(id: any) : Promise; + destroy(): Promise; + save({}?): Promise; + upVote(): Promise; } - export interface IStamplayObject { - Model : IStamplayModel - Collection : any - - } - - export interface StamplayStatic { - init(appId : string) : void; - User() : IStamplayObject - Cobject(object : string) : IStamplayObject + export interface StamplayObject { + Model: Model; + Collection : any; } } - -declare var Stamplay: Stamplay.StamplayStatic; diff --git a/stamplay-js-sdk/stamplay-js-sdk-tests.ts b/stamplay-js-sdk/stamplay-js-sdk-tests.ts index d9a4247e03..9dddc1b242 100644 --- a/stamplay-js-sdk/stamplay-js-sdk-tests.ts +++ b/stamplay-js-sdk/stamplay-js-sdk-tests.ts @@ -11,26 +11,24 @@ var registrationData = { password: 'mySecret' }; -user.signup(registrationData).then(function(){ - user.set('phoneNumber', '020 123 4567' ); - return user.save(); - }).then(function(){ - var number = user.get('phoneNumber'); - console.log(number); // number value is 020 123 4567 - }); +user.signup(registrationData).then(() => { + user.set('phoneNumber', '020 123 4567' ); + return user.save(); +}).then(() => { + var number = user.get('phoneNumber'); + console.log(number); // number value is 020 123 4567 +}); // Action var colFoo = Stamplay.Cobject('foo'); var fooMod = new colFoo.Model(); -fooMod.fetch(5).then( - function(){ - return fooMod.upVote() - } -).then( - function(){ +fooMod.fetch(5) + .then(() => fooMod.upVote()) + .then( + () => { //success callback - }, function( err : any ){ + }, (err: any) => { //error callback } ) diff --git a/stamplay-js-sdk/tslint.json b/stamplay-js-sdk/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/stamplay-js-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/status-bar/tsconfig.json b/status-bar/tsconfig.json index 874ffb81d1..9fe41d5d67 100644 --- a/status-bar/tsconfig.json +++ b/status-bar/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/text-buffer/index.d.ts b/text-buffer/index.d.ts index 60207c7e80..a3d652bd28 100644 --- a/text-buffer/index.d.ts +++ b/text-buffer/index.d.ts @@ -5,7 +5,6 @@ /// /// -/// declare namespace TextBuffer { @@ -240,7 +239,7 @@ declare namespace TextBuffer { positionForCharacterIndex(offset:number):IPoint; getMaxCharacterIndex():number; loadSync():ITextBuffer; - load():Q.IPromise; + load():Promise; finishLoading():ITextBuffer; handleTextChange(event:any):any; destroy():any; @@ -253,7 +252,7 @@ declare namespace TextBuffer { hasMultipleEditors():boolean; reload():any; updateCachedDiskContentsSync():string; - updateCachedDiskContents():Q.IPromise; + updateCachedDiskContents():Promise; getBaseName():string; getPath():string; getUri():string; diff --git a/text-buffer/tsconfig.json b/text-buffer/tsconfig.json index 860c31d7f7..ebee922349 100644 --- a/text-buffer/tsconfig.json +++ b/text-buffer/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true 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/transducers-js-tests.ts b/transducers-js/transducers-js-tests.ts index f40575fe72..d11825838f 100644 --- a/transducers-js/transducers-js-tests.ts +++ b/transducers-js/transducers-js-tests.ts @@ -1,7 +1,6 @@ // tests taken from https://github.com/cognitect-labs/transducers-js import * as t from 'transducers-js'; -import * as _ from "lodash"; var map = t.map, filter = t.filter, @@ -14,7 +13,7 @@ function inc(n: number) { return n + 1; }; function isEven(n: number) { return n % 2 === 0; }; var xf = comp(map(inc), filter(isEven)); -console.log(into([], xf, [0, 1, 2, 3, 4])); // [2, 4] +into([], xf, [0, 1, 2, 3, 4]); // [2, 4] // integration @@ -24,27 +23,6 @@ var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], toFn = t.toFn; arr.reduce(toFn(xf, apush), []); // native -_(arr).reduce(toFn(xf, apush), []); // underscore or lodash - -// immutable-js - -import * as Immutable from 'immutable'; - -function sum(a: number, b: number): number { return a + b; }; -var transduce = t.transduce; - -var largeVector = Immutable.List(); - -for (var i = 0; i < 1000000; i++) { - largeVector = largeVector.push(i); -} - -// built in Immutable-js functionality -largeVector.map(inc).filter(isEven).reduce(sum); - -// faster with transducers -var xf = comp(map(inc), filter(isEven)); -transduce(xf, sum, 0, largeVector); // source examples diff --git a/transducers-js/tsconfig.json b/transducers-js/tsconfig.json index 02a9f8b69d..3a49663656 100644 --- a/transducers-js/tsconfig.json +++ b/transducers-js/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/tslint.json b/tslint.json index 6b04ae7f36..7847d36674 100644 --- a/tslint.json +++ b/tslint.json @@ -1 +1 @@ -{ "extends": "./node_modules/types-publisher/tslint-definitions.json" } \ No newline at end of file +{ "extends": "./node_modules/types-publisher/tslint-definitions.json" } diff --git a/twilio/index.d.ts b/twilio/index.d.ts index d186831e93..358f45ca01 100644 --- a/twilio/index.d.ts +++ b/twilio/index.d.ts @@ -3,9 +3,8 @@ // Definitions by: nickiannone , Ashley Brener // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// -/// + import Express = require("express"); import Http = require("http"); import Q = require("q"); diff --git a/twilio/tsconfig.json b/twilio/tsconfig.json index 997e9d8770..805d02ab2f 100644 --- a/twilio/tsconfig.json +++ b/twilio/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/typeahead/index.d.ts b/typeahead/index.d.ts index 95100bbbba..d6ed81a921 100644 --- a/typeahead/index.d.ts +++ b/typeahead/index.d.ts @@ -1015,7 +1015,7 @@ declare namespace Bloodhound { * @param response Prefetch response. * @returns Transform response. */ - transform?: (response: T[]) => T[]; + transform?: (response: T) => T; } /** @@ -1069,7 +1069,13 @@ declare namespace Bloodhound { * @param response Prefetch response. * @returns Transform response. */ - transform?: (response: T[]) => T[]; + transform?: (response: T) => T; + + /** + * DEPRECATED: transform the remote response before the Bloodhound instance operates on it. + * */ + filter?: (response: T) => T; + } /** @@ -1200,6 +1206,11 @@ declare class Bloodhound { * clearRemoteCache offers a way to programmatically clear said cache. */ public clearRemoteCache(): Bloodhound; + + /* + * DEPRECATED: wraps the suggestion engine in an adapter that is compatible with the typeahead jQuery plugin + */ + public ttAdapter(): any; } declare module "bloodhound" { diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 61d48b6aa9..d298508e11 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -374,7 +374,7 @@ function test_bloodhout() { } function test_bloodhout_prefetch_options_transform() { - var options: Bloodhound.PrefetchOptions = { + var options: Bloodhound.PrefetchOptions = { url: 'url', transform: (response: string[]) => { return new Array(); } }; @@ -383,7 +383,7 @@ function test_bloodhout() { function test_bloodhout_prefetch_options_all() { var ajaxSettings: JQueryAjaxSettings = { url: 'url' }; - var options: Bloodhound.PrefetchOptions = { + var options: Bloodhound.PrefetchOptions = { url: 'url', cache: true, ttl: 86400000, @@ -433,7 +433,7 @@ function test_bloodhout() { } function test_bloodhout_remote_options_transform() { - var options: Bloodhound.RemoteOptions = { + var options: Bloodhound.RemoteOptions = { url: 'url', transform: (response: string[]) => { return new Array(); } }; @@ -442,7 +442,7 @@ function test_bloodhout() { function test_bloodhout_remote_options_all() { var ajaxSettings: JQueryAjaxSettings = { url: 'url' }; - var options: Bloodhound.RemoteOptions = { + var options: Bloodhound.RemoteOptions = { url: 'url', prepare: (query: string, settings: JQueryAjaxSettings) => { return ajaxSettings; }, wildcard: '%QUERY', diff --git a/victory/index.d.ts b/victory/index.d.ts index 70d1ecb6f1..d1d241354d 100644 --- a/victory/index.d.ts +++ b/victory/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Victory 0.9.0 // Project: https://github.com/FormidableLabs/victory -// Definitions by: Alexey Svetliakov +// Definitions by: Alexey Svetliakov , snerks // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -299,6 +299,11 @@ declare module "victory" { before?: (datum: any) => AnimationStyle; after?: (datum: any) => AnimationStyle; }; + /** + * The easing prop specifies an easing function name to use for tweening. + * @default "quadInOut" + */ + easing?: AnimationEasing; } /** diff --git a/victory/victory-tests.tsx b/victory/victory-tests.tsx index 7947f5f0ec..601780ffaf 100644 --- a/victory/victory-tests.tsx +++ b/victory/victory-tests.tsx @@ -601,4 +601,8 @@ test = ( } }} /> -); \ No newline at end of file +); + +test = ( + +); diff --git a/vinyl-buffer/tsconfig.json b/vinyl-buffer/tsconfig.json index 1208954da6..93296b534b 100644 --- a/vinyl-buffer/tsconfig.json +++ b/vinyl-buffer/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/vinyl-paths/tsconfig.json b/vinyl-paths/tsconfig.json index 4aa2ca1faa..126374df8c 100644 --- a/vinyl-paths/tsconfig.json +++ b/vinyl-paths/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/vinyl-source-stream/tsconfig.json b/vinyl-source-stream/tsconfig.json index 580c625e75..ef3c4de3b7 100644 --- a/vinyl-source-stream/tsconfig.json +++ b/vinyl-source-stream/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/vso-node-api/index.d.ts b/vso-node-api/index.d.ts index 92b18209c1..51569f75a9 100644 --- a/vso-node-api/index.d.ts +++ b/vso-node-api/index.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// declare module 'vso-node-api/Serialization' { + import Q = require("q"); /** * Metadata for deserializing an enum field on a contract/type */ diff --git a/vso-node-api/tsconfig.json b/vso-node-api/tsconfig.json index 17db4a2513..feaeda0a61 100644 --- a/vso-node-api/tsconfig.json +++ b/vso-node-api/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/webdriverio/index.d.ts b/webdriverio/index.d.ts index f091159263..e74b4712a5 100644 --- a/webdriverio/index.d.ts +++ b/webdriverio/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// declare namespace WebdriverIO { export type Method = 'POST' | 'GET' | 'DELETE'; @@ -506,7 +505,11 @@ declare namespace WebdriverIO { onRejected?: (error: any) => P | Client

): Client

; - inspect(): Q.PromiseState; + inspect(): { + state: "fulfilled" | "rejected" | "pending"; + value?: T; + reason?: any; + }; } export interface Client { @@ -1815,14 +1818,14 @@ declare namespace WebdriverIO { ): Client

; waitUntil( - condition: () => boolean | Q.IPromise | Client> & RawResult, + condition: () => boolean | Promise | Client> & RawResult, timeout?: number, timeoutMsg?: string, interval?: number ): Client & any; waitUntil

( - condition: () => boolean | Q.IPromise | Client> & RawResult, + condition: () => boolean | Promise | Client> & RawResult, timeout?: number, timeoutMsg?: string, interval?: number diff --git a/wiredep/tsconfig.json b/wiredep/tsconfig.json index 3794e2a3b2..69ee121ef9 100644 --- a/wiredep/tsconfig.json +++ b/wiredep/tsconfig.json @@ -11,6 +11,9 @@ "typeRoots": [ "../" ], + "paths": { + "q": [ "q/v0" ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/x2js/index.d.ts b/x2js/index.d.ts deleted file mode 100644 index 56ff735b38..0000000000 --- a/x2js/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Type definitions for x2js -// Project: https://code.google.com/p/x2js/ -// Definitions by: Horiuchi_H -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface IX2JS { - new (config?: IX2JSOption): IX2JS; - - getVersion(): string; - - xml2json(dom: Node): T; - json2xml(json: T): Node; - xml_str2json(xml: string): T; - json2xml_str(json: T): string; - parseXmlString(xml: string): Node; - - asArray(prop: any): any[]; - asDateTime(key: string): string; - asXmlDateTime(date: Date): string; - asXmlDateTime(date: number): string; -} - -interface IX2JSOption { - escapeMode?: boolean; - attributePrefix?: string; - arrayAccessForm?: string; - emptyNodeForm?: string; - enableToStringFunc?: boolean; - arrayAccessFormPaths?: any[]; - skipEmptyTextNodesForObj?: boolean; - stripWhitespaces?: boolean; - datetimeAccessFormPaths?: any[]; -} - -declare var X2JS: IX2JS; - diff --git a/x2js/x2js-tests.ts b/x2js/x2js-tests.ts deleted file mode 100644 index fcea1fe966..0000000000 --- a/x2js/x2js-tests.ts +++ /dev/null @@ -1,298 +0,0 @@ -// Create x2js instance with default config -var x2js = new X2JS(); - -// JSON to DOM -var xmlDoc = x2js.json2xml( - { - MyRoot: { - MyChild: 'my_child_value', - MyAnotherChild: 10, - MyArray: [ 'test', 'test2' ], - MyArrayRecords: [ - { - ttt: 'vvvv' - }, - { - ttt: 'vvvv2' - } - ] - } - } -); - - -// JSON to XML string -var xmlDocStr = x2js.json2xml_str( - { - MyRoot: { - MyChild: 'my_child_value', - MyAnotherChild: 10, - MyArray: [ 'test', 'test2' ], - MyArrayRecords: [ - { - ttt: 'vvvv' - }, - { - ttt: 'vvvv2' - } - ] - } - } -); - -console.log(xmlDocStr); - -// JSON arrays to string -var xmlDocStr = x2js.json2xml_str( - { - MyRoot: { - namedItemArray: { - item: [ - { first: 'success1' } , - { first: 'success2' } - ] - }, - namedArray: [ - { first: 'success1' } , - { first: 'success2' } - ], - justArray: [ 'just success1', 'just success2' ], - arrayWithAttrs: [ - { - _test: 'successAttr', - __text: 'success', - temp: 'successTemp' - }, - { - _test: 'successAttr2', - __text: 'success2', - temp: 'successTemp2' - } - ] - } - } -); - -console.log(xmlDocStr); - -// XML string to JSON -var xmlText = "Successddsfgdsdgfdgfd"; -var jsonObj = x2js.xml_str2json(xmlText); -console.log(jsonObj.MyOperation.test); - -// Array access form examples -console.log(x2js.asArray(jsonObj.MyOperation.test)[0]); -// Or old style (1.0.+): -var x2jsOld = new X2JS({arrayAccessForm: "property"}); -jsonObj = x2jsOld.xml_str2json(xmlText); -console.log("Old is " + jsonObj.MyOperation.test_asArray[0]); - -// XML/DOM to JSON -var xmlText = " - Success - TestText ddsfg TestText2 dsdgfdgfd" -xmlDoc = x2js.parseXmlString(xmlText); - -var jsonObj = x2js.xml2json(xmlDoc); -console.log(jsonObj.MyOperation.test); - -// Parsing XML attrs -var xmlText = "SUCCESS TXTSuccessddsfgdsdgfdgfd"; -var jsonObj = x2js.xml_str2json(xmlText); -console.log(jsonObj.MyOperation._myAttr); -console.log(jsonObj.MyOperation.test2._myAttr); -console.log(jsonObj.MyOperation.txtAttrChild._sAttr); -console.log(jsonObj.MyOperation.txtAttrChild.__text); -console.log(jsonObj.MyOperation.txtAttrChild.toString()); - -// JSON to XML attrs -var xmlDocStr = x2js.json2xml_str( - { - TestAttrRoot: { - _myAttr: 'myAttrValue', - MyChild: 'my_child_value', - MyAnotherChild: 10, - MyTextAttrChild: { - _myTextAttr: 'myTextAttrValue', - __text: 'HelloText' - } - } - } -); - -console.log(xmlDocStr); - -//Change prefix for attributes -var x2jsChangedAttrs = new X2JS({ - // XML attributes. Default is "_" - attributePrefix: "$" -}); -jsonObj = x2jsChangedAttrs.xml_str2json(xmlText); -console.log(jsonObj.MyOperation.$myAttr); -console.log(jsonObj.MyOperation.test2.$myAttr); -console.log(jsonObj.MyOperation.txtAttrChild.$sAttr); - -xmlDocStr = x2jsChangedAttrs.json2xml_str({ - TestAttrRoot: { - _myAttr: 'myAttrValue', - MyChild: 'my_child_value', - MyAnotherChild: 10, - MyTextAttrChild: { - $myTextAttr: 'myTextAttrValue', - __text: 'HelloText' - } - } - } -); - -console.log(xmlDocStr); - - -// Parse XML with namespaces -var xmlText = "SuccessddsfgdsdgfdgfdtestArrSize"; -var jsonObj = x2js.xml_str2json(xmlText); -console.log(jsonObj.MyOperation.test); -if (jsonObj.MyOperation.test2.item.length > 2) - console.log("Error! Incorrect array len!"); - -var testObjC = { - 'm:TestAttrRoot': { - '_tns:m': 'http://www.example.org', - '_tns:cms': 'http://www.example.org', - MyChild: 'my_child_value', - 'cms:MyAnotherChild': 'vdfd' - } -} - -// Parse JSON object with namespaces -var xmlDocStr = x2js.json2xml_str( - testObjC -); - -console.log(xmlDocStr); - -// Parse JSON object constructed with another NS-style -var testObjNew = { - TestAttrRoot: { - __prefix: 'm', - '_tns:m': 'http://www.example.org', - '_tns:cms': 'http://www.example.org', - MyChild: 'my_child_value', - MyAnotherChild: { - __prefix: 'cms', - __text: 'vdfd' - } - } -} - -// Parse JSON object with namespaces -var xmlDocStr = x2js.json2xml_str( - testObjNew -); - -console.log(xmlDocStr); - -// Parse XML with header -var xmlText = "\n" + - "XML HEADER SUCCESS!"; - -var jsonObj = x2js.xml_str2json(xmlText); -console.log(jsonObj.test); - -// Parse XML with CDATA -var xmlText = "simple success]]> "; - -var jsonObj = x2js.xml_str2json(xmlText); -console.log(jsonObj.test.data.toString()); -console.log(jsonObj.test.data.__cdata); -console.log(jsonObj.test.simple); - - -// Parse JSON object with CDATA -var xmlDocStr = x2js.json2xml_str( - jsonObj -); -console.log(xmlDocStr); - -// Parse JSON with emtpy attributes -var xmlDocStr = x2js.json2xml_str( - { - MyRoot: { - MyNullChild: null, - MyNullChild2: undefined, - MyAnotherChild: 10, - MyEmptyChild: { - _attr: "test" - }, - MyEmptyChild2: { - _attr: "test", - __text: "Empty Nodes Test" - } - } - } -); - -console.log(xmlDocStr); - -// Escaping XML characters -xmlDocStr = x2js.json2xml_str( - { - MyRoot: { - MyEscapeXmlChild: " & \" ' / ", - MyEscapeXmlChild2: { - _attr: "success", - __text: " & \" ' / " - }, - MyEscapeXmlChildNonString: false - } - } -); - -console.log(xmlDocStr); - -jsonObj = x2js.xml_str2json(xmlDocStr); -console.log(jsonObj.MyRoot.MyEscapeXmlChild); -console.log(jsonObj.MyRoot.MyEscapeXmlChild2.toString()); - -console.log(x2js.getVersion()); - -// Array access path demos -x2js = new X2JS({ - arrayAccessFormPaths: [ - "MyArrays.test4.item", - /.*\.test3\.item/ - ] -}); - -xmlText = "" + - "successsecond" + - "success" + - "success" + - "success" + - ""; - - -jsonObj = x2js.xml_str2json(xmlText); -console.log(jsonObj.MyArrays.test3.item[0]); -console.log(jsonObj.MyArrays.test4.item[0]); -console.log(jsonObj.MyArrays.test5.item); - -// Working with datetimes -x2js = new X2JS({ - datetimeAccessFormPaths: [ - "MyDts.testds", - /.*\.testdt.*/ - ] -}); - -xmlText = "" + - "2002-10-10T12:00:00+04:00" + - "2002-10-10T12:00:00Z" + - "2002-10-10T12:00:00" + - "2002-10-10T12:00:00Z" + - ""; -jsonObj = x2js.xml_str2json(xmlText); - -console.log(jsonObj.MyDts.testds); -console.log(jsonObj.MyDts.testdt1); -console.log(jsonObj.MyDts.testdt2); -console.log(x2js.asDateTime(jsonObj.MyDts.testdc)); - diff --git a/xmldom/index.d.ts b/xmldom/index.d.ts old mode 100644 new mode 100755 index dfbe34599c..8c252389cc --- a/xmldom/index.d.ts +++ b/xmldom/index.d.ts @@ -7,6 +7,11 @@ declare namespace xmldom { var DOMParser: DOMParserStatic; var XMLSerializer: XMLSerializerStatic; + var DOMImplementation: DOMImplementationStatic; + + interface DOMImplementationStatic { + new(): DOMImplementation; + } interface DOMParserStatic { new (): DOMParser; diff --git a/xmpp-jid/index.d.ts b/xmpp-jid/index.d.ts deleted file mode 100644 index 678e306abc..0000000000 --- a/xmpp-jid/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for @xmpp/jid 0.0 -// Project: github.com/node-xmpp/node-xmpp/ -// Definitions by: PJakcson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 -import {JID} from './lib/JID'; - -export declare function createJID(local: string, domain: string, resource: string): JID; - -export {JID} from './lib/JID'; - -export declare function equal(a: JID, b: JID): boolean; -export declare function is(a: any): boolean; diff --git a/xmpp-jid/lib/JID.d.ts b/xmpp-jid/lib/JID.d.ts deleted file mode 100644 index a1d2558b30..0000000000 --- a/xmpp-jid/lib/JID.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Created by marcneumann on 17.02.17. - */ - -export declare class JID { - local: string; - domain: string; - resource: string; - - constructor(local: string, domain?: string, resource?: string); - - parseJID(jid: string): void; - - toString(unescape?: any): string; - - /** - * Convenience method to distinguish users - **/ - bare(): JID; - - /** - * Comparison function - **/ - equals(other: JID): boolean; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-localpart - **/ - setLocal(local: string, escape?: any): void; - - getLocal(unescape?: any): string; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-domain - */ - setDomain(value: string): void; - - getDomain(): string; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-resourcepart - */ - setResource(value: string): void; - - getResource(): string; -} diff --git a/xmpp-jid/xmpp-jid-tests.ts b/xmpp-jid/xmpp-jid-tests.ts deleted file mode 100644 index 2514d5fb8a..0000000000 --- a/xmpp-jid/xmpp-jid-tests.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {JID} from './index'; - -/* - * All return an instance of JID.JID, the new operator is optional. - */ -let addr = new JID('alice@wonderland.net/rabbithole'); // OK -addr = new JID('alice', 'wonderland.net', 'rabbithole'); // BEST; see section on escaping below - -/* - * local - */ -addr.local = 'alice'; -addr.local; // alice -// same as -addr.setLocal('alice'); -addr.getLocal(); // alice - -/* - * domain - */ -addr.domain = 'wonderland.net'; -addr.domain; // wonderland.net -// same as -addr.setDomain('wonderland.net'); -addr.getDomain(); // wonderland.net - -/* - * resource - */ -addr.resource = 'rabbithole'; -addr.resource; // rabbithole -// same as -addr.setResource('rabbithole'); -addr.getResource(); // rabbithole - -addr.toString(); // alice@wonderland.net/rabbithole -addr.bare(); // returns a JID without resource - -const some_jid = new JID('is', 'a', 'test'); -addr.equals(some_jid); // returns true if the two JIDs are equal, false otherwise diff --git a/youtube/index.d.ts b/youtube/index.d.ts index ca5d99550a..a45ec6a8c8 100644 --- a/youtube/index.d.ts +++ b/youtube/index.d.ts @@ -1,166 +1,935 @@ // Type definitions for YouTube // Project: https://developers.google.com/youtube/ -// Definitions by: Daz Wilkin , Ian Obermiller +// Definitions by: Daz Wilkin , +// Ian Obermiller , +// Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -declare namespace YT { - interface EventArgs { - target: Player; - data: any; - } - - interface EventHandler { - (event: EventArgs): void; - } - - export interface Events { - onReady?: EventHandler; - onPlayback?: EventHandler; - onStateChange?: EventHandler; - onError?: EventHandler; - } - - export enum ListType { - search, - user_uploads, - playlist, +/** + * @see https://developers.google.com/youtube/iframe_api_reference + * @see https://developers.google.com/YouTube/player_parameters + */ +declare namespace YT +{ + /** + * State of a video player. + */ + export enum PlayerState + { + UNSTARTED = -1, + ENDED = 0, + PLAYING = 1, + PAUSED = 2, + BUFFERING = 3, + CUED = 5 } - export interface PlayerVars { - autohide?: number; - autoplay?: number; - cc_load_policy?: any; - color?: string; - controls?: number; - disablekb?: number; - enablejsapi?: number; + /** + * Known causes for player errors. + */ + export const enum PlayerError + { + /** + * The request contained an invalid parameter value. + */ + InvalidParam = 2, + + /** + * The requested content cannot be played in an HTML5 player. + */ + Html5Error = 5, + + /** + * The video requested was not found. + */ + VideoNotFound = 100, + + /** + * The owner of the requested video does not allow it to be played in embedded players. + */ + EmbeddingNotAllowed = 101, + + /** + * This error is the same as 101. It's just a 101 error in disguise! + */ + EmbeddingNotAllowed2 = 150 + } + + /** + * Whether to auto-hide video controls. + */ + export const enum AutoHide + { + /** + * Controls are visible throughout the video + */ + AlwaysVisible = 0, + + /** + * Progress bar and player controls slide out of view after a couple of seconds. + */ + HideAllControls = 1, + + /** + * Progress bar fades out while the player controls remain visible. + */ + HideProgressBar = 2 + } + + /** + * Whether to autoplay the video. + */ + export const enum AutoPlay + { + /** + * Video does not autoplay. + */ + NoAutoPlay = 0, + + /** + * Video will autoplay when loaded. + */ + AutoPlay = 1 + } + + /** + * Whether to use user-preferred or forced caption loading. + */ + export const enum ClosedCaptionsLoadPolicy + { + /** + * Defaults to the user's preferences. + */ + UserDefault = 0, + + /** + * For closed captions to be shown. + */ + ForceOn = 1 + } + + /** + * Allowed progress bar colors. + */ + export type ProgressBarColor = "red" | "white"; + + /** + * How video controls are shown. + */ + export const enum Controls + { + /** + * Player controls do not display. + */ + Hide = 0, + + /** + * Player controls display. + */ + ShowLoadPlayer = 1, + + /** + * Player controls display after a delay. + */ + ShowDelayLoadPlayer = 2 + } + + /** + * Whether to allow keyboard controls. + */ + export const enum KeyboardControls + { + /** + * Keyboard controls are enabled. + */ + Enable = 0, + + /** + * Keyboard controls are disabled. + */ + Disable = 1 + } + + /** + * Whether the JavaScript API should be enabled. + */ + export const enum JsApi + { + /** + * JavaScript API will be disabled. + */ + Disable = 0, + + /** + * JavaScript API will be enabled. + */ + Enable = 1 + } + + /** + * Whether to display the full-screen button. + */ + export const enum FullscreenButton + { + /** + * The full screen button is hidden. + */ + Hide = 0, + + /** + * The full screen button is visible. + */ + Show = 1 + } + + /** + * Whether to show video annotations. + */ + export const enum IvLoadPolicy + { + /** + * Video annotations will be shown. + */ + Show = 1, + + /** + * Video annotations will not be shown. + */ + Hide = 3 + } + + /** + * Which type of content loads in the player. + */ + export type ListType = ListTypePlayer | ListTypeSearch | ListTypeUserUploads; + + /** + * The requested video should be shown in the player. + */ + export type ListTypePlayer = "player"; + + /** + * A search area should be shown in the player. + */ + export type ListTypeSearch = "search"; + + /** + * The user's uploads should load in the player. + */ + export type ListTypeUserUploads = "user_uploads"; + + /** + * Whether a single video should be looped. + */ + export const enum Loop + { + /** + * Video or playlist will be played only once. + */ + SinglePlay = 0, + + /** + * Video or playlist will be played over and over again. + */ + Loop = 1 + } + + /** + * Comma separated list of video IDs to play after the URL path's video. + */ + export const enum ModestBranding + { + /** + * Player will contain full YouTube branding. + */ + Full = 0, + + /** + * YouTube logo will not display in the control bar. + */ + Modest = 1 + } + + /** + * Whether to show related videos after the video finishes. + */ + export const enum RelatedVideos + { + /** + * Hide related videos after playback is complete. + */ + Hide = 0, + + /** + * Show related videos after playback is complete. + */ + Show = 1 + } + + /** + * Whether to show video information before playing. + */ + export const enum ShowInfo + { + /** + * Hide video title and uploader before video starts playing. + */ + Hide = 0, + + /** + * Show video title and uploader before video starts playing. + */ + Show = 1 + } + + /** + * Base interface for events triggered by a player. + */ + export interface PlayerEvent + { + /** + * Video player corresponding to the event. + */ + target: Player; + } + + /** + * Event for player state change. + */ + export interface OnStateChangeEvent extends PlayerEvent + { + /** + * New player state. + */ + data: PlayerState; + } + + /** + * Event for playback quality change. + */ + export interface OnPlaybackQualityChangeEvent extends PlayerEvent + { + /** + * New playback quality. + */ + data: string; + } + + /** + * Event for playback rate change. + */ + export interface OnPlaybackRateChangeEvent extends PlayerEvent + { + /** + * New playback rate. + */ + data: number; + } + + /** + * Event for a player error. + */ + export interface OnErrorEvent extends PlayerEvent + { + /** + * Which type of error occurred. + */ + data: PlayerError; + } + + /** + * Handles a player event. + * + * @param event The triggering event. + */ + export interface PlayerEventHandler + { + (event: TEvent): void; + } + + /** + * YouTube player options. + */ + export interface PlayerOptions + { + /** + * Player width. + */ + width?: number; + + /** + * Player height + */ + height?: number; + + /** + * ID of the video to load. + */ + videoId: string; + + /** + * Player parameters. + */ + playerVars?: PlayerVars; + + /** + * Handlers for events fired by the player. + */ + events?: Events; + } + + /** + * Allowed suggested player video qualities. + */ + export type SuggestedVideoQuality = ( + VideoQualityDefault + | VideoQualitySmall + | VideoQualityMedium + | VideoQualityLarge + | VideoQualityHD720 + | VideoQualityHD1080 + | VideoQualityHighRes); + + /** + * Default video quality chosen by YouTube. + */ + export type VideoQualityDefault = "default"; + + /** + * Player height is 240px, and player dimensions are at least 320px by 240px for 4:3 aspect ratio. + */ + export type VideoQualitySmall = "small"; + + /** + * Player height is 360px, and player dimensions are 640px by 360px (for 16:9 aspect ratio) or 480px by 360px (for 4:3 aspect ratio). + */ + export type VideoQualityMedium = "medium"; + + /** + * Player height is 480px, and player dimensions are 853px by 480px (for 16:9 aspect ratio) or 640px by 480px (for 4:3 aspect ratio). + */ + export type VideoQualityLarge = "large"; + + /** + * Player height is 720px, and player dimensions are 1280px by 720px (for 16:9 aspect ratio) or 960px by 720px (for 4:3 aspect ratio). + */ + export type VideoQualityHD720 = "hd720"; + + /** + * Player height is 1080px, and player dimensions are 1920px by 1080px (for 16:9 aspect ratio) or 1440px by 1080px (for 4:3 aspect ratio). + */ + export type VideoQualityHD1080 = "hd1080"; + + /** + * Player height is greater than 1080px, which means that the player's aspect ratio is greater than 1920px by 1080px. + */ + export type VideoQualityHighRes = "highres"; + + /** + * Player parameters. + */ + export interface PlayerVars + { + /** + * Whether to autohide video controls (by default, HideProgressBar). + */ + autohide?: AutoHide; + + /** + * Whether to autoplay the video (by default, NoAutoPlay). + */ + autoplay?: AutoPlay; + + /** + * Whether to use user-preferred or forced caption loading (by default, UserDefault). + */ + cc_load_policy?: ClosedCaptionsLoadPolicy; + + /** + * Player progress bar color + */ + color?: ProgressBarColor; + + /** + * How video controls are shown (by default, ShowLoadPlayer). + */ + controls?: Controls; + + /** + * Whether to allow keyboard controls (by default, Enable). + */ + disablekb?: KeyboardControls; + + /** + * Whether the JavaScript API should be enabled (by default, Disable). + */ + enablejsapi?: JsApi; + + /** + * Time, in seconds from the beginning of the video, when to stop playing. + */ end?: number; - fs?: number; - iv_load_policy?: number; + + /** + * Whether to display the full-screen button (by default, Show). + */ + fs?: FullscreenButton; + + /** + * Player language as an ISO 639-1 two-letter language code or fully-specified locale. + */ + hl?: string; + + /** + * Whether to show video annotations (by default, Show). + */ + iv_load_policy?: IvLoadPolicy; + + /** + * Identifies content that will load. + * If listType is search, this is the search query. + * If listType is user_uploads, this is the YouTube user. + * If listType is playlist, this is the playlist ID, prepended by 'PL'. + */ list?: string; + + /** + * Which type of content loads in the player. + */ listType?: ListType; - loop?: number; - modestbranding?: number; + + /** + * Whether a single video should be looped (by default, SinglePlay). + */ + loop?: Loop; + + /** + * Whether to hide some YouTube branding (by default, Full). + */ + modestbranding?: ModestBranding; + + /** + * Origin domain for additional security if using the JavaScript API. + */ origin?: string; - playerpiid?: string; - playlist?: string[]; - playsinline?: number; - rel?: number; - showinfo?: number; + + /** + * Comma separated list of video IDs to play after the URL path's video. + */ + playlist?: string; + + /** + * Whether to show related videos after the video finishes (by default, Show). + */ + rel?: RelatedVideos; + + /** + * Whether to show video information before playing (by default, Show). + */ + showinfo?: ShowInfo; + + /** + * Time, in seconds from the beginning of the video, when to start playing. + */ start?: number; - theme?: string; - } + } - export interface PlayerOptions { - width?: string | number; - height?: string | number; - videoId?: string; - playerVars?: PlayerVars; - events?: Events; - } + /** + * Handlers for events fired by the player. + */ + export interface Events + { + /** + * Event fired when a player has finished loading and is ready to begin receiving API calls. + */ + onReady?: PlayerEventHandler; - interface VideoByIdParams { - videoId: string; - startSeconds?: number; - endSeconds?: number; - suggestedQuality?: string; - } + /** + * Event fired when the player's state changes. + */ + onStateChange?: PlayerEventHandler; - interface VideoByUrlParams { - mediaContentUrl: string; - startSeconds?: number; - endSeconds?: number; - suggestedQuality?: string; - } + /** + * Event fired when the playback quality of the player changes. + */ + onPlaybackQualityChange?: PlayerEventHandler; - export interface VideoData - { - video_id: string; - author: string; - title: string; - } + /** + * Event fired when the playback rate of the player changes. + */ + onPlaybackRateChange?: PlayerEventHandler; - export class Player { - // Constructor - constructor(id: string, playerOptions: PlayerOptions); - constructor(element: HTMLElement, playerOptions: PlayerOptions); + /** + * Event fired when an error in the player occurs + */ + onError?: PlayerEventHandler; - // Queueing functions - loadVideoById(videoId: string, startSeconds?: number, suggestedQuality?: string): void; - loadVideoById(VideoByIdParams: Object): void; - cueVideoById(videoId: string, startSeconds?: number, suggestedQuality?: string): void; - cueVideoById(VideoByIdParams: Object): void; + /** + * Event fired to indicate thath the player has loaded, or unloaded, a module + * with exposed API methods. This currently only occurs for closed captioning. + */ + onApiChange?: PlayerEventHandler; + } - loadVideoByUrl(mediaContentUrl: string, startSeconds?: number, suggestedQuality?: string): void; - loadVideoByUrl(VideoByUrlParams: Object): void; - cueVideoByUrl(mediaContentUrl: string, startSeconds?: number, suggestedQuality?: string): void; - cueVideoByUrl(VideoByUrlParams: Object): void; + /** + * Settings to load, play, or queue a video or playlist. + */ + export interface VideoOrPlaylistSettings { + /** + * Time, in seconds from the beginning of the (first) video, when to start playing. + */ + startSeconds?: number; - // Properties - size: any; + /** + * Time, in seconds from the end of the (first) video, when to end playing. + */ + endSeconds?: number; - // Playing - playVideo(): void; - pauseVideo(): void; - stopVideo(): void; - seekTo(seconds:number, allowSeekAhead:boolean): void; - clearVideo(): void; + /** + * Suggested video player quality. + */ + suggestedQuality?: SuggestedVideoQuality + } - // Playlist - nextVideo(): void; - previousVideo(): void; - playVideoAt(index: number): void; + /** + * Settings to play or queue a video by ID. + */ + export interface VideoByIdSettings extends VideoOrPlaylistSettings { + /** + * Video ID. + */ + videoId: string; + } - // Volume - mute(): void; - unMute(): void; - isMuted(): boolean; - setVolume(volume: number): void; - getVolume(): number; + /** + * Settings to play or queue a video by media content URL. + */ + export interface VideoByMediaContentUrlSettings extends VideoOrPlaylistSettings { + /** + * Fully qualified player URL. + */ + mediaContentUrl: string; + } - // Sizing - setSize(width: number, height: number): any; + /** + * Settings to load or queue a playlist. + */ + export interface IPlaylistSettings extends VideoOrPlaylistSettings { + /** + * Identifier for the listType videos list. + */ + list: string; - // Playback - getPlaybackRate(): number; - setPlaybackRate(suggestedRate:number): void; - getAvailablePlaybackRates(): number[]; + /** + * Which type of content loads in the player. + */ + listType?: ListType; - // Behavior - setLoop(loopPlaylists: boolean): void; - setShuffle(shufflePlaylist: boolean): void; + /** + * Start index of the playlist, if not 0. + */ + index?: number; + } - // Status - getVideoLoadedFraction(): number; - getPlayerState(): number; - getCurrentTime(): number; - getVideoStartBytes(): number; - getVideoBytesLoaded(): number; - getVideoBytesTotal(): number; + /** + * Creates and controls a YouTube player in an