Merge remote-tracking branch 'upstream/master'

Conflicts:
	README.md
This commit is contained in:
Patrick Magee
2014-05-16 23:08:49 +01:00
300 changed files with 312960 additions and 30521 deletions
+1 -1
View File
@@ -1 +1 @@
Please see the [contribution guide](https://github.com/borisyankov/DefinitelyTyped/wiki/How-to-contribute) for information on how to contribute to this project.
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.
+321
View File
@@ -0,0 +1,321 @@
# Contributors
This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url.
All definitions files include a header with the author and editors, so at some point this list will be auto-generated.
* [accounting.js](http://josscrowcroft.github.io/accounting.js/) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [Ace Cloud9 Editor](http://ace.ajax.org/) (by [Diullei Gomes](https://github.com/Diullei))
* [Add To Home Screen](http://cubiq.org/add-to-home-screen) (by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw))
* [AmCharts](http://www.amcharts.com/) (by [Covobonomo](https://github.com/covobonomo/))
* [AngularAgility](https://github.com/AngularAgility/AngularAgility) (by [Roland Zwaga](https://github.com/rolandzwaga)
* [AngularFire](https://www.firebase.com/docs/angular/reference.html) (by [Dénes Harmath](https://github.com/thSoft))
* [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes))
* [angularLocalStorage](https://github.com/agrublev/angularLocalStorage) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib))
* [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong))
* [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib))
* [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted))
* [AppFramework](http://app-framework-software.intel.com/) (by [Kyo Ago](https://github.com/kyo-ago))
* [Arbiter](http://arbiterjs.com/) (by [Arash Shakery](https://github.com/arash16))
* [asciify](https://github.com/olizilla/asciify) (by [Alan](http://alan.norbauer.com))
* [assert](https://github.com/Jxck/assert) (by [vvakame](https://github.com/vvakame))
* [async](https://github.com/caolan/async) (by [Boris Yankov](https://github.com/borisyankov))
* [Atom](https://atom.io/) (by [vvakame](https://github.com/vvakame))
* [aws-sdk-js](https://github.com/aws/aws-sdk-js) (by [midknight41](https://github.com/midknight41))
* [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Backbone Relational](http://backbonerelational.org/) (by [Eirik Hoem](https://github.com/eirikhm))
* [BigInteger](https://github.com/peterolson/BigInteger.js) (by [Ingo Bürk](https://github.com/Airblader))
* [BigScreen](http://brad.is/coding/BigScreen/) (by [Douglas Eichelberger](https://github.com/dduugg))
* [Bluebird](https://github.com/petkaantonov/bluebird) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/))
* [Bootstrap](http://twitter.github.com/bootstrap/) (by [Boris Yankov](https://github.com/borisyankov))
* [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) (by [Blake Niemyjski](https://github.com/niemyjski))
* [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) (by [Boris Yankov](https://github.com/borisyankov))
* [Box2DWeb](http://code.google.com/p/box2dweb/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Breeze](http://www.breezejs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Browser Harness](https://github.com/scriby/browser-harness) (by [Chris Scribner](https://github.com/scriby))
* [CasperJS](http://casperjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
* [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle))
* [Chosen](http://harvesthq.github.com/chosen/) (by [Boris Yankov](https://github.com/borisyankov))
* [Chrome](http://developer.chrome.com/extensions/) (by [Matthew Kimber](https://github.com/matthewkimber) and [otiai10](https://github.com/otiai10))
* [Chrome App](http://developer.chrome.com/apps/) (by [Adam Lay](https://github.com/AdamLay))
* [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik))
* [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans))
* [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon))
* [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem))
* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/))
* [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat))
* [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli))
* [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts)
* [d3.js](http://d3js.org/) (from TypeScript samples)
* [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) (by [Maksim Kozhukh](http://github.com/mkozhukh))
* [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) (by [Maksim Kozhukh](http://github.com/mkozhukh))
* [diff](https://github.com/kpdecker/jsdiff) (by [vvakame](http://github.com/vvakame))
* [Dock Spawn](http://dockspawn.com) (by [Drew Noakes](https://drewnoakes.com))
* [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) (by [Jon Egerton](https://github.com/jonegerton))
* [domo](http://domo-js.com/) (by [Steve Fenton](https://github.com/Steve-Fenton))
* [doT](https://github.com/olado/doT) (by [ZombieHunter](https://github.com/ZombieHunter))
* [dust](http://linkedin.github.com/dustjs) (by [Marcelo Dezem](https://github.com/mdezem))
* [EaselJS](http://www.createjs.com/#!/EaselJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [EasyStar](http://easystarjs.com/) (by [Magnus Gustafsson](https://github.com/Borundin))
* [Elm](http://elm-lang.org) (by [Dénes Harmath](https://github.com/thSoft))
* [ember.js](http://emberjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [emissary](https://github.com/atom/emissary) (by [vvakame](https://github.com/vvakame))
* [EpicEditor](http://epiceditor.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/))
* [Esprima](http://esprima.org/) (by [Teppei Sato](https://github.com/teppeis))
* [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis))
* [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame))
* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Ext JS](http://www.sencha.com/products/extjs/) (by [Brian Kotek](https://github.com/brian428))
* [Fabric.js](http://fabricjs.com/) (by [Oliver Klemencic](https://github.com/oklemencic/))
* [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov))
* [File API: Directories and System](http://www.w3.org/TR/file-system-api/) (by [Kon](http://phyzkit.net/))
* [File API: Writer](http://www.w3.org/TR/file-writer-api/) (by [Kon](http://phyzkit.net/))
* [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) (by [Boris Yankov](https://github.com/borisyankov))
* [Firebase](https://www.firebase.com/docs/javascript/firebase) (by [Vincent Bortone](https://github.com/vbortone))
* [Firefox](https://developer.mozilla.org/en-US/docs/Web/API) (by [vvakame](https://github.com/vvakame))
* [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei))
* [Flight by Twitter](http://flightjs.github.com/flight/) (by [Jonathan Hedrén](https://github.com/jonathanhedren))
* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros))
* [fs-extra](https://github.com/jprichardson/node-fs-extra) (by [midknight41](https://github.com/midknight41))
* [FullCalendar](http://arshaw.com/fullcalendar/) (by [Neil Stalker](https://github.com/nestalk))
* [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/))
* [Giraffe](https://github.com/barc/backbone.giraffe) (by [Matt McCray](https://github.com/darthapo))
* [glDatePicker](http://glad.github.com/glDatePicker/) (by [Dániel Tar](https://github.com/qcz))
* [Glob](https://github.com/isaacs/node-glob) (by [vvakame](https://github.com/vvakame))
* [GoJS](http://gojs.net/) (by [Barbara Duckworth](https://github.com/barbara42))
* [Greasemonkey](http://www.greasespot.net/) (by [Kota Saito](https://github.com/kotas))
* [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt))
* [gridfs-stream](https://github.com/aheckmann/gridfs-stream) (by [Lior Mualem](https://github.com/liorm))
* [Grunt JS](http://gruntjs.com/) (by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) and [San Chen](https://github.com/bigsan))
* [Google API Client](https://code.google.com/p/google-api-javascript-client/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google App Engine Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) (by [vvakame](https://github.com/vvakame))
* [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper))
* [GoogleMaps InfoBubble](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/) (by [Johan Nilsson](https://github.com/dashue))
* [Google Geolocation](https://code.google.com/p/geo-location-javascript/) (by [Vincent Bortone](https://github.com/vbortone))
* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [Hashtable](http://www.timdown.co.uk/jshashtable/) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [HelloJS](http://adodson.com/hello.js) (by [Pavel Zika](https://github.com/PavelPZ))
* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog))
* [Highland](http://highlandjs.org/) (by [Bart van der Schoor](https://github.com/Bartvds/))
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee))
* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov))
* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn))
* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac))
* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter))
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov))
* [Imagemagick](http://github.com/rsms/node-imagemagick) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov) and [Christiaan Rakowski](https://github.com/csrakowski))
* [IxJS (Interactive extensions)](https://github.com/Reactive-Extensions/IxJS) (by [Igor Oleinikov](https://github.com/Igorbek))
* [jake](https://github.com/mde/jake) (by [Kon](http://phyzkit.net/))
* [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov))
* [Jasmine-jQuery](https://github.com/velesin/jasmine-jquery) (by [Gregor Stamac](https://github.com/gstamac))
* [jDataView](https://github.com/jDataView/jDataView) (by [Ingvar Stepanyan](https://github.com/RReverser))
* [JointJS](http://www.jointjs.com/) (by [Aidan Reel](http://github.com/areel))
* [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) (by [Dániel Tar](https://github.com/qcz))
* [jQuery](http://jquery.com/) (from TypeScript samples)
* [jQuery Mobile](http://jquerymobile.com) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery UI](http://jqueryui.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery.Address](https://github.com/asual/jquery-address) (by [Martin Duparc](https://github.com/martinduparc/))
* [jQuery.areYouSure](https://github.com/codedance/jquery.AreYouSure) (by [Jon Egerton](https://github.com/jonegerton))
* [jQuery.autosize](http://www.jacklmoore.com/autosize/) (by [Jack Moore](http://www.jacklmoore.com/))
* [jQuery.BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (by [Adam R. Smith](https://github.com/sunetos))
* [jQuery.CLEditor](http://premiumsoftware.net/CLEditor) (by [Jeffery Grajkowski](https://github.com/pushplay))
* [jQuery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging/) (by [Diullei Gomes](https://github.com/diullei/))
* [jQuery.Colorbox](http://www.jacklmoore.com/colorbox/) (by [Gidon Junge](https://github.com/gjunge))
* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/))
* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode))
* [jQuery.Cycle](http://jquery.malsup.com/cycle/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) (by [Donny Nadolny](https://github.com/dnadolny))
* [jQuery.dataTables](http://www.datatables.net) (by [Armin Sander](https://github.com/pragmatrix))
* [jQuery.datetimepicker](http://trentrichardson.com/examples/timepicker/) (by [Doug McDonald](https://github.com/dougajmcdonald))
* [jQuery.dynatree](http://code.google.com/p/dynatree/) (by [François de Campredon](https://github.com/fdecampredon))
* [jQuery.Finger](http://ngryman.sh/jquery.finger/) (by [Max Ackley](https://github.com/maxackley))
* [jQuery.Flot](http://www.flotcharts.org/) (by [Matt Burland](https://github.com/burlandm))
* [jQuery.form](http://malsup.com/jquery/form/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Globalize](https://github.com/jquery/globalize) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery.gridster](http://gridster.net) (by [Josh Baldwin](https://github.com/jbaldwin/gridster.d.ts))
* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/))
* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone))
* [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee))
* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb))
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
* [jQuery.pnotify](http://sciactive.github.io/pnotify/ (by [David Sichau](https://github.com/DavidSichau/))
* [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/))
* [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/))
* [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski))
* [jQuery.tile](https://github.com/urin/jquery.tile.js) (by [Shunsuke Ohtani](https://github.com/zaneli))
* [jQuery.timeago](http://timeago.yarp.com/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Timepicker](http://fgelinas.com/code/timepicker/) (by [Anwar Javed](https://github.com/anwarjaved))
* [jQuery.Timer](http://jchavannes.com/jquery-timer/demo) (by [Joshua Strobl](https://github.com/JoshStrobl))
* [jQuery.TinyCarousel](http://baijs.nl/tinycarousel/) (by [Christiaan Rakowski](https://github.com/csrakowski))
* [jQuery.TinyScrollbar](http://baijs.nl/tinyscrollbar/) (by [Christiaan Rakowski](https://github.com/csrakowski))
* [jQuery.tooltipster](https://github.com/iamceege/tooltipster) (by [Patrick Magee](https://github.com/pjmagee))
* [jQuery.total-storage](https://github.com/Upstatement/jquery-total-storage) (by [Jeremy Brooks](https://github.com/JeremyCBrooks/))
* [jQuery.Transit](http://ricostacruz.com/jquery.transit/) (by [MrBigDog2U](https://github.com/MrBigDog2U))
* [jQuery.Validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved))
* [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
* [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds))
* [js-url](https://github.com/websanova/js-url) (by [MIZUNE Pine](https://github.com/pine613))
* [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/))
* [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz))
* [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk))
* [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/))
* [JSON-Pointer](https://www.npmjs.org/package/json-pointer) (by [Bart van der Schoor](https://github.com/Bartvds))
* [JsRender](http://www.jsviews.com/#jsrender) (by [Kensuke MATSUZAKI](https://github.com/zakki))
* [jStorage](http://www.jstorage.info/) (by [Danil Flores](https://github.com/dflor003/))
* [jsTree](http://www.jstree.com/) (by [Adam Pluciński](https://github.com/adaskothebeast))
* [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/))
* [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/))
* [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat))
* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit))
* [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Knockout.DeferredUpdates](https://github.com/mbest/knockout-deferred-updates) (by [Sebastián Galiano](https://github.com/sgaliano))
* [Knockout.ES5](https://github.com/SteveSanderson/knockout-es5) (by [Sebastián Galiano](https://github.com/sgaliano))
* [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC))
* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov))
* [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel))
* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek))
* [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig))
* [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising))
* [ko.editables](http://romanych.github.com/ko.editables/) (by [Oisin Grehan](https://github.com/oising))
* [KoLite](https://github.com/CodeSeven/kolite) (by [Boris Yankov](https://github.com/borisyankov))
* [Lazy.js](http://danieltao.com/lazy.js/) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Leaflet](https://github.com/Leaflet/Leaflet) (by [Vladimir](https://github.com/rgripper))
* [Libxmljs](https://github.com/polotek/libxmljs) (by [François de Campredon](https://github.com/fdecampredon))
* [ladda](https://github.com/hakimel/Ladda) (by [Danil Flores](https://github.com/dflor003))
* [Levelup](https://github.com/rvagg/node-levelup) (by [Bret Little](https://github.com/blittle))
* [linq.js](http://linqjs.codeplex.com/) (by [Marcin Najder](https://github.com/marcinnajder))
* [Livestamp.js](https://github.com/mattbradley/livestampjs) (by [Vincent Bortone](https://github.com/vbortone))
* [localForage](https://github.com/mozilla/localForage) (by [david pichsenmeister](https://github.com/3x14159265))
* [Lodash](http://lodash.com/) (by [Brian Zengel](https://github.com/bczengel))
* [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle))
* [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r))
* [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr))
* [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg))
* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave))
* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk))
* [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame))
* [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds))
* [mixto](https://github.com/atom/mixto) (by [vvakame](https://github.com/vvakame))
* [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/))
* [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield))
* [MongoDB](http://mongodb.github.io/node-mongodb-native/) (from TypeScript samples, updated by [Niklas Mollenhauer](https://github.com/nikeee))
* [mongoose](http://mongoosejs.com/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [Mousetrap](http://craig.is/killing/mice) (by [Dániel Tar](https://github.com/qcz))
* [msgpack.js](https://github.com/uupaa/msgpack.js) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
* [Mustache.js](https://github.com/janl/mustache.js) (by [Boris Yankov](https://github.com/borisyankov))
* [nconf](https://github.com/flatiron/nconf) (by [Jeff Goddard](https://github.com/jedigo))
* [noble](https://github.com/sandeepmistry/noble) (by [Seon-Wook Park](https://github.com/swook))
* [nock](https://github.com/pgte/nock) (by [bonnici](https://github.com/bonnici))
* [Node.js](http://nodejs.org/) (from TypeScript samples)
* [node_redis](https://github.com/mranney/node_redis) (by [Boris Yankov](https://github.com/borisyankov))
* [node-ffi](https://github.com/rbranson/node-ffi) (by [Paul Loyd](https://github.com/loyd))
* [node-git](https://github.com/christkv/node-git) (by [vvakame](https://github.com/vvakame))
* [nodeunit](https://github.com/caolan/nodeunit) (by [Jeff Goddard](https://github.com/jedigo))
* [node_zeromq](https://github.com/JustinTulloss/zeromq.node) (by [Dave McKeown](https://github.com/davemckeown))
* [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov))
* [node-uuid](https://github.com/broofa/node-uuid) (by [Jeff May](https://github.com/jeffmay))
* [notify.js](https://github.com/alexgibson/notify.js) (by [soundTricker](https://github.com/soundTricker))
* [NProgress](https://github.com/rstacruz/nprogress) (by [Judah Gabriel Himango](https://github.com/judahgabriel))
* [Numeral.js](https://github.com/adamwdraper/Numeral-js) (by [Vincent Bortone](https://github.com/vbortone/))
* [ocLazyLoad](https://github.com/ocombe/ocLazyLoad) (by [Roland Zwaga](https://github.com/rolandzwaga/))
* [OpenLayers](https://github.com/openlayers/openlayers) (by [Ilya Bolkhovsky](https://github.com/bolhovsky/))
* [Optimist](https://github.com/substack/node-optimist) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [Passport](http://passportjs.org/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [pathwatcher](http://atom.github.io/node-pathwatcher/) (by [vvakame](https://github.com/vvakame))
* [Parallel.js](https://github.com/adambom/parallel.js) (by [Josh Baldwin](https://github.com/jbaldwin))
* [Parsimmon](https://github.com/jayferd/parsimmon) (by [Bart van der Schoor](https://github.com/Bartvds))
* [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin))
* [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame))
* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto))
* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
* [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov))
* [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments))
* [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH))
* [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/))
* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [Q](https://github.com/kriskowal/q) (by Barrie Nemetchek, Andrew Gaspar)
* [Q-io](https://github.com/kriskowal/q-io) (by [Bart van der Schoor](https://github.com/Bartvds))
* [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei))
* [Raven.js](https://github.com/getsentry/raven-js) (by [Santi Albo](https://github.com/santialbo))
* [Rickshaw](http://code.shutterstock.com/rickshaw/) (by [Blake Niemyjski](https://github.com/niemyjski))
* [Riot.js](https://github.com/moot/riotjs) (by [vvakame](https://github.com/vvakame))
* [Restify](https://github.com/mcavage/node-restify) (by [Bret Little](https://github.com/blittle))
* [Redis](https://github.com/mranney/node_redis) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [Request](https://github.com/mikeal/request) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [Royalslider](http://dimsemenov.com/plugins/royal-slider/) (by [Christiaan Rakowski](https://github.com/csrakowski))
* [Rx.js](http://rx.codeplex.com/) (by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek), [Carl de Billy](http://carl.debilly.net/), [zoetrope](https://github.com/zoetrope))
* [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall))
* [Restangular](https://github.com/mgonto/restangular/) (by [Boris Yankov](https://github.com/borisyankov))
* [require.js](http://requirejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Sammy.js](http://sammyjs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Select2](http://ivaynberg.github.com/select2/) (by [Boris Yankov](https://github.com/borisyankov))
* [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong))
* [Semver](https://github.com/isaacs/node-semver) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428))
* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com))
* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov))
* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame))
* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u))
* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin))
* [smoothie](https://github.com/joewalnes/smoothie) (by [Mike H. Hawley](https://github.com/mikehhawley) and [Drew Noakes](https://drewnoakes.com))
* [socket.io](http://socket.io) (by [William Orr](https://github.com/worr))
* [socket.io-client](http://socket.io) (by [Maido Kaara](https://github.com/v3rm0n))
* [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev))
* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [status-bar](https://github.com/atom/status-bar) (by [vvakame](https://github.com/vvakame))
* [stripe](https://stripe.com/) (by [Eric J. Smith](https://github.com/ejsmith/))
* [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone))
* [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Swiper](http://www.idangero.us/sliders/swiper) (by [Sebastián Galiano](https://github.com/sgaliano))
* [SwipeView](http://cubiq.org/swipeview) (by [Boris Yankov](https://github.com/borisyankov))
* [Swiz](https://github.com/racker/node-swiz) (by [Jeff Goddard](https://github.com/jedigo))
* [TV4](https://github.com/geraintluff/tv4) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Tags Manager](http://welldonethings.com/tags/manager) (by [Vincent Bortone](https://github.com/vbortone))
* [Teechart](http://www.steema.com) (by [Steema](http://www.steema.com))
* [text-buffer](https://github.com/atom/text-buffer) (by [vvakame](https://github.com/vvakame))
* [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/))
* [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov))
* [trunk8](https://github.com/rviscomi/trunk8) (by [Blake Niemyjski](https://github.com/niemyjski))
* [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [tween.js](https://github.com/sole/tween.js/) (by [Adam R. Smith](https://github.com/sunetos))
* [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) (by [Blake Niemyjski](https://github.com/niemyjski))
* [Twitter Typeahead](http://twitter.github.io/typeahead.js) (by [Ivaylo Gochkov](https://github.com/igochkov))
* [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) (by [John Vrbanac](https://github.com/jmvrbanac))
* [Underscore.js](http://underscorejs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Underscore.js (Typed)](http://underscorejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Underscore-ko.js](https://github.com/kamranayub/UnderscoreKO) (by [Maurits Elbers](https://github.com/MagicMau))
* [universal-analytics](https://github.com/peaksandpies/universal-analytics) (by [Bart van der Schoor](https://github.com/Bartvds))
* [update-notifier](https://github.com/yeoman/update-notifier) (by [vvakame](https://github.com/vvakame))
* [uri-templates](https://github.com/geraintluff/uri-templates) (by [Bart van der Schoor](https://github.com/Bartvds))
* [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade))
* [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient))
* [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov))
* [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/))
* [WebRTC](http://dev.w3.org/2011/webrtc/editor/webrtc.html) (by [Ken Smith](https://github.com/smithkl42))
* [websocket](https://github.com/Worlize/WebSocket-Node) (by [Paul Loyd](https://github.com/loyd))
* [WinJS](http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx) (from TypeScript samples)
* [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples)
* [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd))
* [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds))
* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/))
* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy))
* [YouTube Data API](https://developers.google.com/youtube/v3/) (by [Frank M](https://github.com/sgtfrankieboy/))
* [Zepto.js](http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin))
* [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov))
* [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith](https://github.com/ejsmith))
Executable → Regular
+28 -294
View File
@@ -1,307 +1,41 @@
DefinitelyTyped [![Build Status](https://travis-ci.org/borisyankov/DefinitelyTyped.png?branch=master)](https://travis-ci.org/borisyankov/DefinitelyTyped)
===============
# DefinitelyTyped [![Build Status](https://travis-ci.org/borisyankov/DefinitelyTyped.png?branch=master)](https://travis-ci.org/borisyankov/DefinitelyTyped)
The repository for *high quality* TypeScript type definitions.
> The repository for *high quality* TypeScript type definitions.
For more information see the [definitelytyped.org](http://definitelytyped.org) website.
## Usage
Usage
-----
Include a line like this:
```
```typescript
/// <reference path="jquery.d.ts" />
```
[TypeScript Directory: tools, libraries, projects and learning resources](https://github.com/DefinitelyTyped/typescript-directory)
## Contributions
Contributor Guidelines
----------------------
DefinitelyTyped only works because of contributions by users like you!
See the section: [How to contribute](https://github.com/borisyankov/DefinitelyTyped/wiki/How-to-contribute)
Please see the [contribution guide](http://definitelytyped.org/guides/contributing.html) on how to contribute to DefinitelyTyped.
Other means to get the definitions
----------------------------------
## How to get the definitions
* Directly from the Github repos
* [NuGet packages](http://nuget.org/packages?q=DefinitelyTyped)
* [TypeScript Definition package manager](https://github.com/DefinitelyTyped/tsd)
* [TypeScript Definition manager](https://github.com/DefinitelyTyped/tsd)
List of Definitions
-------------------
* [accounting.js](http://josscrowcroft.github.io/accounting.js/) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [Ace Cloud9 Editor](http://ace.ajax.org/) (by [Diullei Gomes](https://github.com/Diullei))
* [Add To Home Screen] (http://cubiq.org/add-to-home-screen) (by [James Wilkins] (http://www.codeplex.com/site/users/view/jamesnw))
* [AmCharts](http://www.amcharts.com/) (by [Covobonomo](https://github.com/covobonomo/))
* [AngularFire](https://www.firebase.com/docs/angular/reference.html) (by [Dénes Harmath](https://github.com/thSoft))
* [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes))
* [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib))
* [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong))
* [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib))
* [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted))
* [AppFramework](http://app-framework-software.intel.com/) (by [Kyo Ago](https://github.com/kyo-ago))
* [Arbiter](http://arbiterjs.com/) (by [Arash Shakery](https://github.com/arash16))
* [asciify](https://github.com/olizilla/asciify) (by [Alan](http://alan.norbauer.com))
* [assert](https://github.com/Jxck/assert) (by [vvakame](https://github.com/vvakame))
* [async](https://github.com/caolan/async) (by [Boris Yankov](https://github.com/borisyankov))
* [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Backbone Relational](http://backbonerelational.org/) (by [Eirik Hoem](https://github.com/eirikhm))
* [BigScreen](http://brad.is/coding/BigScreen/) (by [Douglas Eichelberger](https://github.com/dduugg))
* [Bluebird](https://github.com/petkaantonov/bluebird) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/))
* [Bootstrap](http://twitter.github.com/bootstrap/) (by [Boris Yankov](https://github.com/borisyankov))
* [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) (by [Blake Niemyjski](https://github.com/niemyjski))
* [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) (by [Boris Yankov](https://github.com/borisyankov))
* [Box2DWeb](http://code.google.com/p/box2dweb/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Breeze](http://www.breezejs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Browser Harness](https://github.com/scriby/browser-harness) (by [Chris Scribner](https://github.com/scriby))
* [CasperJS](http://casperjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
* [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle))
* [Chosen](http://harvesthq.github.com/chosen/) (by [Boris Yankov](https://github.com/borisyankov))
* [Chrome](http://developer.chrome.com/extensions/) (by [Matthew Kimber](https://github.com/matthewkimber) and [otiai10](https://github.com/otiai10))
* [Chrome App](http://developer.chrome.com/apps/) (by [Adam Lay](https://github.com/AdamLay))
* [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik))
* [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon))
* [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem))
* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat))
* [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli))
* [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts)
* [d3.js](http://d3js.org/) (from TypeScript samples)
* [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) (by [Maksim Kozhukh](http://github.com/mkozhukh))
* [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) (by [Maksim Kozhukh](http://github.com/mkozhukh))
* [Dock Spawn](http://dockspawn.com) (by [Drew Noakes](https://drewnoakes.com))
* [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) (by [Jon Egerton](https://github.com/jonegerton))
* [domo](http://domo-js.com/) (by [Steve Fenton](https://github.com/Steve-Fenton))
* [doT](https://github.com/olado/doT) (by [ZombieHunter](https://github.com/ZombieHunter))
* [dust](http://linkedin.github.com/dustjs) (by [Marcelo Dezem](https://github.com/mdezem))
* [EaselJS](http://www.createjs.com/#!/EaselJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [EasyStar](http://easystarjs.com/) (by [Magnus Gustafsson](https://github.com/Borundin))
* [ember.js](http://emberjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [EpicEditor](http://epiceditor.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/))
* [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis))
* [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame))
* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Ext JS](http://www.sencha.com/products/extjs/) (by [Brian Kotek](https://github.com/brian428))
* [Fabric.js](http://fabricjs.com/) (by [Oliver Klemencic](https://github.com/oklemencic/))
* [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov))
* [File API: Directories and System](http://www.w3.org/TR/file-system-api/) (by [Kon](http://phyzkit.net/))
* [File API: Writer](http://www.w3.org/TR/file-writer-api/) (by [Kon](http://phyzkit.net/))
* [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) (by [Boris Yankov](https://github.com/borisyankov))
* [Firebase](https://www.firebase.com/docs/javascript/firebase) (by [Vincent Bortone](https://github.com/vbortone))
* [Firefox](https://developer.mozilla.org/en-US/docs/Web/API) (by [vvakame](https://github.com/vvakame))
* [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei))
* [Flight by Twitter](http://flightjs.github.com/flight/) (by [Jonathan Hedrén](https://github.com/jonathanhedren))
* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros))
* [FullCalendar](http://arshaw.com/fullcalendar/) (by [Neil Stalker](https://github.com/nestalk))
* [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/))
* [Giraffe](https://github.com/barc/backbone.giraffe) (by [Matt McCray](https://github.com/darthapo))
* [glDatePicker](http://glad.github.com/glDatePicker/) (by [Dániel Tar](https://github.com/qcz))
* [GoJS](http://gojs.net/) (by [Barbara Duckworth](https://github.com/barbara42))
* [Greasemonkey](http://www.greasespot.net/) (by [Kota Saito](https://github.com/kotas))
* [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt))
* [Grunt JS](http://gruntjs.com/) (by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) and [San Chen](https://github.com/bigsan))
* [Google API Client](https://code.google.com/p/google-api-javascript-client/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google App Engine Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) (by [vvakame](https://github.com/vvakame))
* [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper))
* [GoogleMaps InfoBubble](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/) (by [Johan Nilsson](https://github.com/dashue))
* [Google Geolocation](https://code.google.com/p/geo-location-javascript/) (by [Vincent Bortone](https://github.com/vbortone))
* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [Hashtable](http://www.timdown.co.uk/jshashtable/) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog))
* [Highland](http://highlandjs.org/) (by [Bart van der Schoor](https://github.com/Bartvds/))
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee))
* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov))
* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn))
* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac))
* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter))
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov))
* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov) and [Christiaan Rakowski](https://github.com/csrakowski))
* [IxJS (Interactive extensions)](https://github.com/Reactive-Extensions/IxJS) (by [Igor Oleinikov](https://github.com/Igorbek))
* [jake](https://github.com/mde/jake) (by [Kon](http://phyzkit.net/))
* [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov))
* [Jasmine-jQuery](https://github.com/velesin/jasmine-jquery) (by [Gregor Stamac](https://github.com/gstamac))
* [JointJS](http://www.jointjs.com/) (by [Aidan Reel](http://github.com/areel))
* [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) (by [Dániel Tar](https://github.com/qcz))
* [jQuery](http://jquery.com/) (from TypeScript samples)
* [jQuery Mobile](http://jquerymobile.com) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery UI](http://jqueryui.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery.Address](https://github.com/asual/jquery-address) (by [Martin Duparc](https://github.com/martinduparc/))
* [jQuery.areYouSure](https://github.com/codedance/jquery.AreYouSure) (by [Jon Egerton](https://github.com/jonegerton))
* [jQuery.autosize](http://www.jacklmoore.com/autosize/) (by [Jack Moore](http://www.jacklmoore.com/))
* [jQuery.BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (by [Adam R. Smith](https://github.com/sunetos))
* [jQuery.CLEditor](http://premiumsoftware.net/CLEditor) (by [Jeffery Grajkowski](https://github.com/pushplay))
* [jQuery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging/) (by [Diullei Gomes](https://github.com/diullei/))
* [jQuery.Colorbox](http://www.jacklmoore.com/colorbox/) (by [Gidon Junge](https://github.com/gjunge))
* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/))
* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode))
* [jQuery.Cycle](http://jquery.malsup.com/cycle/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) (by [Donny Nadolny](https://github.com/dnadolny))
* [jQuery.dataTables](http://www.datatables.net) (by [Armin Sander](https://github.com/pragmatrix))
* [jQuery.datetimepicker](http://trentrichardson.com/examples/timepicker/) (by [Doug McDonald](https://github.com/dougajmcdonald))
* [jQuery.dynatree](http://code.google.com/p/dynatree/) (by [François de Campredon](https://github.com/fdecampredon))
* [jQuery.Flot](http://www.flotcharts.org/) (by [Matt Burland](https://github.com/burlandm))
* [jQuery.form](http://malsup.com/jquery/form/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Globalize](https://github.com/jquery/globalize) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery.gridster](http://gridster.net) (by [Josh Baldwin](https://github.com/jbaldwin/gridster.d.ts))
* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/))
* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone))
* [jQuery.jSignature] (https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee))
* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb))
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
* [jQuery.pnotify](http://sciactive.github.io/pnotify/ (by [David Sichau](https://github.com/DavidSichau/))
* [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/))
* [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/))
* [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski))
* [jQuery.timeago](http://timeago.yarp.com/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Timepicker](http://fgelinas.com/code/timepicker/) (by [Anwar Javed](https://github.com/anwarjaved))
* [jQuery.Timer](http://jchavannes.com/jquery-timer/demo) (by [Joshua Strobl](https://github.com/JoshStrobl))
* [jQuery.TinyCarousel](http://baijs.nl/tinycarousel/) (by [Christiaan Rakowski](https://github.com/csrakowski))
* [jQuery.TinyScrollbar](http://baijs.nl/tinyscrollbar/) (by [Christiaan Rakowski](https://github.com/csrakowski))
* [jQuery.tooltipster] (https://github.com/iamceege/tooltipster) (by [Patrick Magee](https://github.com/pjmagee))
* [jQuery.Transit](http://ricostacruz.com/jquery.transit/) (by [MrBigDog2U](https://github.com/MrBigDog2U))
* [jQuery.Validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved))
* [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
* [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds))
* [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/))
* [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz))
* [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk))
* [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/))
* [JSON-Pointer](https://www.npmjs.org/package/json-pointer) (by [Bart van der Schoor](https://github.com/Bartvds))
* [JsRender](http://www.jsviews.com/#jsrender) (by [Kensuke MATSUZAKI](https://github.com/zakki))
* [jStorage](http://www.jstorage.info/) (by [Danil Flores](https://github.com/dflor003/))
* [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/))
* [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/))
* [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat))
* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit))
* [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Knockout.DeferredUpdates](https://github.com/mbest/knockout-deferred-updates) (by [Sebastián Galiano](https://github.com/sgaliano))
* [Knockout.ES5](https://github.com/SteveSanderson/knockout-es5) (by [Sebastián Galiano](https://github.com/sgaliano))
* [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC))
* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov))
* [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel))
* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek))
* [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig))
* [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising))
* [ko.editables](http://romanych.github.com/ko.editables/) (by [Oisin Grehan](https://github.com/oising))
* [KoLite](https://github.com/CodeSeven/kolite) (by [Boris Yankov](https://github.com/borisyankov))
* [Lazy.js](http://danieltao.com/lazy.js/) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Leaflet](https://github.com/Leaflet/Leaflet) (by [Vladimir](https://github.com/rgripper))
* [Libxmljs](https://github.com/polotek/libxmljs) (by [François de Campredon](https://github.com/fdecampredon))
* [ladda](https://github.com/hakimel/Ladda) (by [Danil Flores](https://github.com/dflor003))
* [Levelup](https://github.com/rvagg/node-levelup) (by [Bret Little](https://github.com/blittle))
* [linq.js](http://linqjs.codeplex.com/) (by [Marcin Najder](https://github.com/marcinnajder))
* [Livestamp.js](https://github.com/mattbradley/livestampjs) (by [Vincent Bortone](https://github.com/vbortone))
* [localForage](https://github.com/mozilla/localForage) (by [david pichsenmeister](https://github.com/3x14159265))
* [Lodash](http://lodash.com/) (by [Brian Zengel](https://github.com/bczengel))
* [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle))
* [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr))
* [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg))
* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave))
* [Microsoft Ajax] (http://msdn.microsoft.com/en-us/library/bb397536(v=vs.100).aspx) (by [Patrick Magee] (https://github.com/pjmagee))
* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk))
* [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/))
* [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield))
* [MongoDB](http://mongodb.github.io/node-mongodb-native/) (from TypeScript samples, updated by [Niklas Mollenhauer](https://github.com/nikeee))
* [Mousetrap](http://craig.is/killing/mice) (by [Dániel Tar](https://github.com/qcz))
* [msgpack.js](https://github.com/uupaa/msgpack.js) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
* [Mustache.js](https://github.com/janl/mustache.js) (by [Boris Yankov](https://github.com/borisyankov))
* [Node.js](http://nodejs.org/) (from TypeScript samples)
* [node_redis](https://github.com/mranney/node_redis) (by [Boris Yankov](https://github.com/borisyankov))
* [node-ffi](https://github.com/rbranson/node-ffi) (by [Paul Loyd](https://github.com/loyd))
* [node-git](https://github.com/christkv/node-git) (by [vvakame](https://github.com/vvakame))
* [node_zeromq](https://github.com/JustinTulloss/zeromq.node) (by [Dave McKeown](https://github.com/davemckeown))
* [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov))
* [NProgress](https://github.com/rstacruz/nprogress) (by [Judah Gabriel Himango](https://github.com/judahgabriel))
* [Numeral.js](https://github.com/adamwdraper/Numeral-js) (by [Vincent Bortone](https://github.com/vbortone/))
* [OpenLayers](https://github.com/openlayers/openlayers) (by [Ilya Bolkhovsky](https://github.com/bolhovsky/))
* [Passport](http://passportjs.org/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [Parallel.js](https://github.com/adambom/parallel.js) (by [Josh Baldwin](https://github.com/jbaldwin))
* [Parsimmon](https://github.com/jayferd/parsimmon) (by [Bart van der Schoor](https://github.com/Bartvds))
* [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin))
* [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame))
* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto))
* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
* [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov))
* [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments))
* [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH))
* [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/))
* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [Q](https://github.com/kriskowal/q) (by Barrie Nemetchek, Andrew Gaspar)
* [Q-io](https://github.com/kriskowal/q-io) (by [Bart van der Schoor](https://github.com/Bartvds))
* [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei))
* [Raven.js](https://github.com/getsentry/raven-js) (by [Santi Albo](https://github.com/santialbo))
* [Rickshaw](http://code.shutterstock.com/rickshaw/) (by [Blake Niemyjski](https://github.com/niemyjski))
* [Riot.js](https://github.com/moot/riotjs) (by [vvakame](https://github.com/vvakame))
* [Restify](https://github.com/mcavage/node-restify) (by [Bret Little](https://github.com/blittle))
* [Royalslider](http://dimsemenov.com/plugins/royal-slider/) (by [Christiaan Rakowski](https://github.com/csrakowski))
* [Rx.js](http://rx.codeplex.com/) (by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek), [Carl de Billy](http://carl.debilly.net/), [zoetrope](https://github.com/zoetrope))
* [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall))
* [Restangular](https://github.com/mgonto/restangular/) (by [Boris Yankov](https://github.com/borisyankov))
* [require.js](http://requirejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Sammy.js](http://sammyjs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Select2](http://ivaynberg.github.com/select2/) (by [Boris Yankov](https://github.com/borisyankov))
* [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong))
* [Semver](https://github.com/isaacs/node-semver) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428))
* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com))
* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov))
* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame))
* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u))
* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin))
* [smoothie](https://github.com/joewalnes/smoothie) (by [Mike H. Hawley](https://github.com/mikehhawley) and [Drew Noakes](https://drewnoakes.com))
* [socket.io](http://socket.io) (by [William Orr](https://github.com/worr))
* [socket.io-client](http://socket.io) (by [Maido Kaara](https://github.com/v3rm0n))
* [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev))
* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [stripe](https://stripe.com/) (by [Eric J. Smith](https://github.com/ejsmith/))
* [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone))
* [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Swiper](http://www.idangero.us/sliders/swiper) (by [Sebastián Galiano](https://github.com/sgaliano))
* [SwipeView](http://cubiq.org/swipeview) (by [Boris Yankov](https://github.com/borisyankov))
* [TV4](https://github.com/geraintluff/tv4) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Tags Manager](http://welldonethings.com/tags/manager) (by [Vincent Bortone](https://github.com/vbortone))
* [Teechart](http://www.steema.com) (by [Steema](http://www.steema.com))
* [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/))
* [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov))
* [trunk8](https://github.com/rviscomi/trunk8) (by [Blake Niemyjski](https://github.com/niemyjski))
* [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [tween.js](https://github.com/sole/tween.js/) (by [Adam R. Smith](https://github.com/sunetos))
* [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) (by [Blake Niemyjski](https://github.com/niemyjski))
* [Twitter Typeahead](http://twitter.github.io/typeahead.js) (by [Ivaylo Gochkov](https://github.com/igochkov))
* [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) (by [John Vrbanac](https://github.com/jmvrbanac))
* [Underscore.js](http://underscorejs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Underscore.js (Typed)](http://underscorejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Underscore-ko.js](https://github.com/kamranayub/UnderscoreKO) (by [Maurits Elbers](https://github.com/MagicMau))
* [universal-analytics](https://github.com/peaksandpies/universal-analytics) (by [Bart van der Schoor](https://github.com/Bartvds))
* [update-notifier](https://github.com/yeoman/update-notifier) (by [vvakame](https://github.com/vvakame))
* [uri-templates](https://github.com/geraintluff/uri-templates) (by [Bart van der Schoor](https://github.com/Bartvds))
* [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade))
* [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient))
* [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov))
* [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/))
* [WebRTC](http://dev.w3.org/2011/webrtc/editor/webrtc.html) (by [Ken Smith](https://github.com/smithkl42))
* [websocket](https://github.com/Worlize/WebSocket-Node) (by [Paul Loyd](https://github.com/loyd))
* [WinJS](http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx) (from TypeScript samples)
* [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples)
* [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd))
* [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds))
* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/))
* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy))
* [YouTube Data API](https://developers.google.com/youtube/v3/) (by [Frank M](https://github.com/sgtfrankieboy/))
* [Zepto.js](http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin))
* [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov))
* [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith](https://github.com/ejsmith))
## List of definitions
Requested Definitions
---------------------
Here is an updated list of [definitions people have requested](https://github.com/borisyankov/DefinitelyTyped/issues?labels=Definition%3ARequest)
* See [CONTRIBUTORS.md](CONTRIBUTORS.md)
## Requested definitions
Here is an updated list of [definitions people have requested](https://github.com/borisyankov/DefinitelyTyped/issues?labels=Definition%3ARequest).
## Licence
This project is licensed under the MIT license.
Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file.
[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('./tsc.js')
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('./tsc.js')
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+78
View File
@@ -0,0 +1,78 @@
/// <reference path="angular-agility.d.ts" />
/// <reference path='../angularjs/angular.d.ts' />
var validIconStrategy:aa.IValidIconStrategy = <aa.IValidIconStrategy>{};
validIconStrategy.validIcon = "";
validIconStrategy.invalidIcon = "";
validIconStrategy.getContainer(<ng.IAugmentedJQueryStatic>{});
var provider:aa.IFormExtensionsProvider = <aa.IFormExtensionsProvider>{};
provider.defaultLabelStrategy = "";
provider.defaultFieldGroupStrategy = "";
provider.defaultValMsgPlacementStrategy = "";
provider.validIconStrategy = validIconStrategy;
provider.defaultSpinnerClickStrategy = "";
provider.defaultNotifyTarget = "";
provider.defaultOnNavigateAwayStrategy = "";
provider.validationMessages['testName'] = 'testMessages';
provider.valMsgForTemplate = "";
provider.confirmResetStrategy = ():boolean=>{ return false; };
provider.globalSettings['testSetting'] = 'test';
provider.labelStrategies['testLabelStratgey'] = (element:ng.IAugmentedJQueryStatic, labelText:string, isRequired:boolean):void=>{};
provider.fieldGroupStrategies['testFieldGroupStratgey'] = (element:ng.IAugmentedJQueryStatic):void=>{};
provider.valMsgPlacementStrategies['testValMsgPlacementStrategy'] = (formFieldElement:ng.IAugmentedJQueryStatic, formName:string, formFieldName:string):void=>{};
provider.spinnerClickStrategies['testSpinnerClickStratgey'] = (element:ng.IAugmentedJQueryStatic):void=>{};
provider.onNavigateAwayStrategies['testOnNavigateAwayStrategy'] = (rootFormScope:ng.IScope, rootForm:ng.IAugmentedJQueryStatic, $injector:ng.auto.IInjectorService)=>{};
var defaults:aa.INotifyDefaults = <aa.INotifyDefaults>{};
defaults.success = (message:string, options:any, notifier:any):any=>{};
defaults.info = (message:string, options:any, notifier:any):any=>{};
defaults.warning = (message:string, options:any, notifier:any):any=>{};
defaults.danger = (message:string, options:any, notifier:any):any=>{};
defaults.error = (message:string, options:any, notifier:any):any=>{};
var configWithoutTemplate:aa.INotifyConfig = {
name: "",
options: <aa.INotifyOptions> {},
namedDefaults: <aa.INotifyDefaults> {}
}
var configWithTemplate:aa.INotifyConfig = {
name: "",
template: "",
templateName: "",
options: <aa.INotifyOptions> {},
namedDefaults: <aa.INotifyDefaults> {}
}
var notifyOptionsWithoutCssClasses:aa.INotifyOptions = {
messageType: "",
allowHtml: true,
message: ""
}
var notifyOptionsWithCssClasses:aa.INotifyOptions = {
cssClasses: "",
messageType: "",
allowHtml: true,
message: ""
}
var notifyConfigProvider:aa.INotifyConfigProvider = <aa.INotifyConfigProvider> {};
notifyConfigProvider.notifyConfigs = {};
notifyConfigProvider.defaultTargetContainerName = "";
notifyConfigProvider.defaultNotifyConfig = "";
notifyConfigProvider.addOrUpdateNotifyConfig("", configWithTemplate);
notifyConfigProvider.optionsTransformer(notifyOptionsWithCssClasses, <ng.ISCEService>{});
var fullExternalConfig:aa.IExternalFormValidationConfig = {
validations: "",
ignore: "",
globals: "",
resolve: "",
resolveFn: (modelValue:string):string=>{ return "" }
}
var minimalExternalConfig:aa.IExternalFormValidationConfig = {
validations: ""
}
+106
View File
@@ -0,0 +1,106 @@
// Type definitions for AngularAgility
// Project: https://github.com/AngularAgility/AngularAgility
// Definitions by: Roland Zwaga <https://github.com/rolandzwaga>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
declare module aa {
export interface ILabelStrategies {
[strategyName: string]: (element:ng.IAugmentedJQueryStatic, labelText:string, isRequired:boolean)=>void;
}
export interface IFieldGroupStrategies {
[strategyName: string]: (element:ng.IAugmentedJQueryStatic)=>void;
}
export interface IValMsgPlacementStrategies {
[strategyName: string]: (formFieldElement:ng.IAugmentedJQueryStatic, formName:string, formFieldName:string)=>void;
}
export interface IValidIconStrategy {
validIcon:string;
invalidIcon:string;
getContainer(element:ng.IAugmentedJQueryStatic):void;
}
export interface ISpinnerClickStrategies {
[strategyName: string]: (element:ng.IAugmentedJQueryStatic)=>void;
}
export interface IOnNavigateAwayStrategies {
[strategyName: string]: (rootFormScope:ng.IScope, rootForm:ng.IAugmentedJQueryStatic, $injector:ng.auto.IInjectorService)=>void;
}
export interface IValidationMessages {
[validationKey: string]: string;
}
export interface IGlobalSettings {
[settingName: string]: any;
}
export interface IFormExtensionsProvider extends ng.auto.IProvider {
defaultLabelStrategy:string;
defaultFieldGroupStrategy:string;
defaultValMsgPlacementStrategy:string;
validIconStrategy:IValidIconStrategy;
defaultSpinnerClickStrategy:string;
defaultNotifyTarget:string;
defaultOnNavigateAwayStrategy:string;
validationMessages:IValidationMessages;
valMsgForTemplate:string;
confirmResetStrategy:()=>boolean;
globalSettings:IGlobalSettings;
labelStrategies:ILabelStrategies;
fieldGroupStrategies:IFieldGroupStrategies;
valMsgPlacementStrategies:IValMsgPlacementStrategies;
spinnerClickStrategies:ISpinnerClickStrategies;
onNavigateAwayStrategies:IOnNavigateAwayStrategies;
}
export interface INotifyPredicate {
(message:string, options:any, notifier:any):any;
}
export interface INotifyDefaults {
success: INotifyPredicate;
info: INotifyPredicate;
warning: INotifyPredicate;
danger: INotifyPredicate;
error: INotifyPredicate;
}
export interface INotifyConfig {
name:string;
template?:string;
templateName?:string;
options:INotifyOptions;
namedDefaults:INotifyDefaults;
}
export interface INotifyOptions {
cssClasses?:string;
messageType:string;
allowHtml:boolean;
message:string;
}
export interface INotifyConfigProvider extends ng.auto.IProvider {
notifyConfigs:any;
defaultTargetContainerName:string;
defaultNotifyConfig:string;
addOrUpdateNotifyConfig(name:string, opts:INotifyConfig):void;
optionsTransformer(options:INotifyOptions, $sce:ng.ISCEService):void;
}
export interface IExternalFormValidationConfig {
validations:any;
ignore?:any;
globals?:any;
resolve?:any;
resolveFn?:(modelValue:string)=>string;
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ declare module ng.translate {
}
interface ITranslateService {
(key: string, ...params: string[]): string;
(key: string, ...params: string[]): ng.IPromise<string>;
fallbackLanguage(): string;
preferredLanguage(): string;
proposedLanguage(): string;
@@ -0,0 +1,27 @@
///<reference path="../angularjs/angular.d.ts" />
///<reference path="./angularLocalStorage.d.ts" />
interface TestScope extends ng.IScope {
viewType: string;
}
module ng.LocalStorageTests {
export class TestController {
constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) {
storage.bind($scope, 'varName');
storage.bind($scope,'varName', { defaultValue: 'randomValue123', storeName: 'customStoreKey' });
$scope.viewType = 'ANYTHING';
storage.unbind($scope, 'viewType');
storage.set('key', 'value');
storage.get('key');
storage.remove('key');
storage.clearAll();
}
}
}
var app = angular.module('angularLocalStorageTests', ['angularLocalStorage']);
app.controller('testCtrl', ['$scope', 'storage', ($scope: TestScope, storage: ng.localStorage.ILocalStorageService) => new ng.LocalStorageTests.TestController($scope, storage)]);
+22
View File
@@ -0,0 +1,22 @@
// Type definitions for AngularLocalStorage 0.1.7
// Project: https://github.com/agrublev/angularLocalStorage
// Definitions by: Horiuchi_H <https://github.com/horiuchi/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts"/>
declare module ng.localStorage {
interface ILocalStorageService {
set(key: string, value: any): any;
get(key: string): any;
remove(key: string): boolean;
clearAll(): void;
bind($scope: ng.IScope, key: string, opts?: {
defaultValue?: any;
storeName?: string;
}): any;
unbind($scope: ng.IScope, key: string, storeName?: string): void;
}
}
+52 -1
View File
@@ -19,7 +19,7 @@ actionDescriptor.params = { key: 'value' };
///////////////////////////////////////
var resourceClass: IMyResourceClass;
var resource: IMyResource;
var resourceArray: IMyResource[];
var resourceArray: ng.resource.IResourceArray<IMyResource>;
resource = resourceClass.delete();
resource = resourceClass.delete({ key: 'value' });
@@ -29,6 +29,7 @@ resource = resourceClass.delete(function () { }, function () { });
resource = resourceClass.delete({ key: 'value' }, { key: 'value' });
resource = resourceClass.delete({ key: 'value' }, { key: 'value' }, function () { });
resource = resourceClass.delete({ key: 'value' }, { key: 'value' }, function () { }, function () { });
resource.$promise.then(function(data: IMyResource) {});
resource = resourceClass.get();
resource = resourceClass.get({ key: 'value' });
@@ -47,6 +48,8 @@ resourceArray = resourceClass.query(function () { }, function () { });
resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' });
resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { });
resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { }, function () { });
resourceArray.push(resource);
resourceArray.$promise.then(function(data: ng.resource.IResourceArray<IMyResource>) {});
resource = resourceClass.remove();
resource = resourceClass.remove({ key: 'value' });
@@ -66,6 +69,50 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' });
resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { });
resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { }, function () { });
///////////////////////////////////////
// IResource
///////////////////////////////////////
var promise : ng.IPromise<IMyResource>;
var arrayPromise : ng.IPromise<IMyResource[]>;
promise = resource.$delete();
promise = resource.$delete({ key: 'value' });
promise = resource.$delete({ key: 'value' }, function () { });
promise = resource.$delete(function () { });
promise = resource.$delete(function () { }, function () { });
promise = resource.$delete({ key: 'value' }, function () { }, function () { });
promise.then(function(data: IMyResource) {});
promise = resource.$get();
promise = resource.$get({ key: 'value' });
promise = resource.$get({ key: 'value' }, function () { });
promise = resource.$get(function () { });
promise = resource.$get(function () { }, function () { });
promise = resource.$get({ key: 'value' }, function () { }, function () { });
arrayPromise = resourceArray[0].$query();
arrayPromise = resourceArray[0].$query({ key: 'value' });
arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { });
arrayPromise = resourceArray[0].$query(function () { });
arrayPromise = resourceArray[0].$query(function () { }, function () { });
arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { }, function () { });
arrayPromise.then(function(data: ng.resource.IResourceArray<IMyResource>) {});
promise = resource.$remove();
promise = resource.$remove({ key: 'value' });
promise = resource.$remove({ key: 'value' }, function () { });
promise = resource.$remove(function () { });
promise = resource.$remove(function () { }, function () { });
promise = resource.$remove({ key: 'value' }, function () { }, function () { });
promise = resource.$save();
promise = resource.$save({ key: 'value' });
promise = resource.$save({ key: 'value' }, function () { });
promise = resource.$save(function () { });
promise = resource.$save(function () { }, function () { });
promise = resource.$save({ key: 'value' }, function () { }, function () { });
///////////////////////////////////////
// IResourceService
///////////////////////////////////////
@@ -85,3 +132,7 @@ resourceClass = resourceServiceFactoryFunction<IMyResourceClass>(resourceService
resourceServiceFactoryFunction = function (resourceService: ng.resource.IResourceService) { return <any>resourceClass; };
mod = mod.factory('factory name', resourceServiceFactoryFunction);
///////////////////////////////////////
// IResource
///////////////////////////////////////
+61 -44
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.2 (ngResource module)
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Michael Jess <http://github.com/miffels> (minor enhancements)
// Definitions: https://github.com/daptiv/DefinitelyTyped
/// <reference path="angular.d.ts" />
@@ -50,67 +50,84 @@ declare module ng.resource {
// PATCH (in other words, methods with body). Otherwise, it's going
// to be considered as parameters to the request.
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L461-L465
//
// Only those methods with an HTTP body do have 'data' as first parameter:
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L463
// More specifically, those methods are POST, PUT and PATCH:
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L432
//
// Also, static calls always return the IResource (or IResourceArray) retrieved
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L549
interface IResourceClass<T> {
new(dataOrParams? : any) : T;
get(): T;
get(dataOrParams: any): T;
get(dataOrParams: any, success: Function): T;
get(params: Object): T;
get(success: Function, error?: Function): T;
get(params: any, data: any, success?: Function, error?: Function): T;
get(params: Object, success: Function, error?: Function): T;
get(params: Object, data: Object, success?: Function, error?: Function): T;
query(): IResourceArray<T>;
query(params: Object): IResourceArray<T>;
query(success: Function, error?: Function): IResourceArray<T>;
query(params: Object, success: Function, error?: Function): IResourceArray<T>;
query(params: Object, data: Object, success?: Function, error?: Function): IResourceArray<T>;
save(): T;
save(dataOrParams: any): T;
save(dataOrParams: any, success: Function): T;
save(data: Object): T;
save(success: Function, error?: Function): T;
save(params: any, data: any, success?: Function, error?: Function): T;
query(): T[];
query(dataOrParams: any): T[];
query(dataOrParams: any, success: Function): T[];
query(success: Function, error?: Function): T[];
query(params: any, data: any, success?: Function, error?: Function): T[];
save(data: Object, success: Function, error?: Function): T;
save(params: Object, data: Object, success?: Function, error?: Function): T;
remove(): T;
remove(dataOrParams: any): T;
remove(dataOrParams: any, success: Function): T;
remove(params: Object): T;
remove(success: Function, error?: Function): T;
remove(params: any, data: any, success?: Function, error?: Function): T;
remove(params: Object, success: Function, error?: Function): T;
remove(params: Object, data: Object, success?: Function, error?: Function): T;
delete(): T;
delete(dataOrParams: any): T;
delete(dataOrParams: any, success: Function): T;
delete(params: Object): T;
delete(success: Function, error?: Function): T;
delete(params: any, data: any, success?: Function, error?: Function): T;
delete(params: Object, success: Function, error?: Function): T;
delete(params: Object, data: Object, success?: Function, error?: Function): T;
}
// Instance calls always return the the promise of the request which retrieved the object
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L546
interface IResource<T> {
$get(): T;
$get(dataOrParams: any): T;
$get(dataOrParams: any, success: Function): T;
$get(success: Function, error?: Function): T;
$get(params: any, data: any, success?: Function, error?: Function): T;
$save(): T;
$save(dataOrParams: any): T;
$save(dataOrParams: any, success: Function): T;
$save(success: Function, error?: Function): T;
$save(params: any, data: any, success?: Function, error?: Function): T;
$query(): T[];
$query(dataOrParams: any): T[];
$query(dataOrParams: any, success: Function): T[];
$query(success: Function, error?: Function): T[];
$query(params: any, data: any, success?: Function, error?: Function): T[];
$remove(): T;
$remove(dataOrParams: any): T;
$remove(dataOrParams: any, success: Function): T;
$remove(success: Function, error?: Function): T;
$remove(params: any, data: any, success?: Function, error?: Function): T;
$delete(): T;
$delete(dataOrParams: any): T;
$delete(dataOrParams: any, success: Function): T;
$delete(success: Function, error?: Function): T;
$delete(params: any, data: any, success?: Function, error?: Function): T;
$get(): ng.IPromise<T>;
$get(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
$get(success: Function, error?: Function): ng.IPromise<T>;
$query(): ng.IPromise<IResourceArray<T>>;
$query(params?: Object, success?: Function, error?: Function): ng.IPromise<IResourceArray<T>>;
$query(success: Function, error?: Function): ng.IPromise<IResourceArray<T>>;
$save(): ng.IPromise<T>;
$save(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
$save(success: Function, error?: Function): ng.IPromise<T>;
$remove(): ng.IPromise<T>;
$remove(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
$remove(success: Function, error?: Function): ng.IPromise<T>;
$delete(): ng.IPromise<T>;
$delete(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
$delete(success: Function, error?: Function): ng.IPromise<T>;
/** the promise of the original server interaction that created this instance. **/
$promise : ng.IPromise<T>;
$resolved : boolean;
}
/**
* Really just a regular Array object with $promise and $resolve attached to it
*/
interface IResourceArray<T> extends Array<T> {
/** the promise of the original server interaction that created this collection. **/
$promise : ng.IPromise<IResourceArray<T>>;
$resolved : boolean;
}
/** when creating a resource factory via IModule.factory */
interface IResourceServiceFactoryFunction<T> {
($resource: ng.resource.IResourceService): IResourceClass<T>;
+8 -2
View File
@@ -10,7 +10,7 @@ declare var angular: ng.IAngularStatic;
// Support for painless dependency injection
interface Function {
$inject:string[];
$inject?: string[];
}
///////////////////////////////////////////////////////////////////////////////
@@ -238,7 +238,7 @@ declare module ng {
$parent: IScope;
$id: number;
$id: string;
// Hidden members
$$isolateBindings: any;
@@ -351,6 +351,7 @@ declare module ng {
///////////////////////////////////////////////////////////////////////////
// LogService
// see http://docs.angularjs.org/api/ng.$log
// see http://docs.angularjs.org/api/ng.$logProvider
///////////////////////////////////////////////////////////////////////////
interface ILogService {
debug: ILogCall;
@@ -360,6 +361,11 @@ declare module ng {
warn: ILogCall;
}
interface ILogProvider {
debugEnabled(enabled: boolean): ILogProvider;
debugEnabled(): boolean;
}
// We define this as separete interface so we can reopen it later for
// the ngMock module.
interface ILogCall {
+77
View File
@@ -0,0 +1,77 @@
/// <reference path="../node/node.d.ts" />
/// <reference path="./atom.d.ts" />
/// <reference path="../pathwatcher/pathwatcher.d.ts" />
import path = require("path");
import _atom = require("atom");
import pathwatcher = require("pathwatcher");
var File = pathwatcher.File;
class SampleView extends _atom.ScrollView {
editorId:string;
file:PathWatcher.IFile;
editor:AtomCore.IEditor;
static deserialize(state:any):SampleView {
return new SampleView(state);
}
static content():any {
return this.div({class: 'sample native-key-bindings', tabindex: -1});
}
constructor(params:{editorId?:string; filePath?:string;} = {}) {
super();
this.editorId = params.editorId;
if (this.editorId) {
this.resolveEditor(this.editorId);
} else {
this.file = new File(params.filePath);
}
}
get jq():JQuery {
// dirty hack
return <any>this;
}
serialize() {
return {
deserializer: 'SampleView',
editorId: this.editorId
};
}
destroy() {
this.unsubscribe();
}
resolveEditor(editorId:string) {
var resolve = ()=> {
if (this.editor) {
this.jq.trigger("title-changed");
} else {
var view = this.jq.parents('.pane').view();
if (view) {
view.destroyItem(this);
}
}
};
if (atom.workspace) {
resolve();
} else {
atom.packages.once("activated", ()=> {
resolve();
});
}
}
}
atom.deserializers.add(SampleView);
export = SampleView;
+1
View File
@@ -0,0 +1 @@
--noImplicitAny --module commonjs --target es5
+1637
View File
File diff suppressed because it is too large Load Diff
+25
View File
@@ -0,0 +1,25 @@
/// <reference path="atpl.d.ts" />
import atpl = require('atpl');
var bool: boolean;
var str: string;
var err: Error;
var items: any;
var options: Object;
var callback: Function;
atpl.compile(str, options);
atpl.__express(str, options, callback);
atpl.registerExtension(items);
atpl.registerTags(items);
atpl.registerFunctions(items);
atpl.registerFilters(items);
atpl.registerTests(items);
atpl.registerTags(null);
atpl.renderFile(str, str, options, bool, (e, res?) => {
err = err;
str = res;
});
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for atpl
// Project: https://github.com/soywiz/atpl.js
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/atpl.d.ts
declare module "atpl" {
export function compile(templateString: string, options: any): (context:any) => string;
export function __express(filename: string, options: any, callback: Function): any;
export function registerExtension(items: any): void;
export function registerTags(items: any): void;
export function registerFunctions(items: any): void;
export function registerFilters(items: any): void;
export function registerTests(items: any): void;
export function renderFileSync(viewsPath: string, filename: string, parameters: any, cache: boolean ): string;
export function renderFile(viewsPath: string, filename: string, parameters: any, cache: boolean, done: (err: Error, result?: string) => void): void;
}
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="aws-sdk.d.ts" />
import awsSdk = require('aws-sdk');
var str: string;
var creds: awsSdk.Credentials;
creds = new awsSdk.Credentials(str, str);
creds = new awsSdk.Credentials(str, str, str);
str = creds.accessKeyId;
// more
+909
View File
@@ -0,0 +1,909 @@
// Type definitions for aws-sdk
// Project: https://github.com/aws/aws-sdk-js
// Definitions by: midknight41 <https://github.com/midknight41>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/aws-sdk.d.ts
/// <reference path="../node/node.d.ts" />
declare module "aws-sdk" {
export var config: ClientConfig;
export function Config(json: any): void;
export class Credentials {
constructor(accessKeyId: string, secretAccessKey: string, sessionToken?: string);
accessKeyId: string;
}
export interface ClientConfig {
credentials: Credentials;
region: string;
}
export class SQS {
constructor(options?: any);
public client: Sqs.Client;
}
export class SES {
constructor(options?: any);
public client: Ses.Client;
}
export class SNS {
constructor(options?: any);
public client: Sns.Client;
}
export class SimpleWorkflow {
constructor(options?: any);
public client: Swf.Client;
}
export class S3 {
constructor(options?: any);
public client: s3.Client;
}
export module Sqs {
export interface Client {
config: ClientConfig;
sendMessage(params: SendMessageRequest, callback: (err: any, data: SendMessageResult) => void): void;
sendMessageBatch(params: SendMessageBatchRequest, callback: (err: any, data: SendMessageBatchResult) => void): void;
receiveMessage(params: ReceiveMessageRequest, callback: (err: any, data: ReceiveMessageResult) => void): void;
deleteMessage(params: DeleteMessageRequest, callback: (err: any, data: any) => void): void;
deleteMessageBatch(params: DeleteMessageBatchRequest, callback: (err: any, data: DeleteMessageBatchResult) => void): void;
createQueue(params: CreateQueueRequest, callback: (err: any, data: CreateQueueResult) => void): void;
deleteQueue(params: DeleteQueueRequest, callback: (err: any, data: any) => void): void;
}
export interface SendMessageRequest {
QueueUrl?: string;
MessageBody?: string;
DelaySeconds?: number;
}
export interface ReceiveMessageRequest {
QueueUrl?: string;
MaxNumberOfMessages?: number;
VisibilityTimeout?: number;
AttributeNames?: string[];
}
export interface DeleteMessageBatchRequest {
QueueUrl?: string;
Entries?: DeleteMessageBatchRequestEntry[];
}
export interface DeleteMessageBatchRequestEntry {
Id: string;
ReceiptHandle: string;
}
export interface DeleteMessageRequest {
QueueUrl?: string;
ReceiptHandle?: string;
}
export class Attribute {
Name: string;
Value: string;
}
export interface SendMessageBatchRequest {
QueueUrl?: string;
Entries?: SendMessageBatchRequestEntry[];
}
export class SendMessageBatchRequestEntry {
Id: string;
MessageBody: string;
DelaySeconds: number;
}
export interface CreateQueueRequest {
QueueName?: string;
DefaultVisibilityTimeout?: number;
DelaySeconds?: number;
Attributes?: Attribute[];
}
export interface DeleteQueueRequest {
QueueUrl?: string;
}
export class SendMessageResult {
MessageId: string;
MD5OfMessageBody: string;
}
export class ReceiveMessageResult {
Messages: Message[];
}
export class Message {
MessageId: string;
ReceiptHandle: string;
MD5OfBody: string;
Body: string;
Attributes: Attribute[];
}
export class DeleteMessageBatchResult {
Successful: DeleteMessageBatchResultEntry[];
Failed: BatchResultErrorEntry[];
}
export class DeleteMessageBatchResultEntry {
Id: string;
}
export class BatchResultErrorEntry {
Id: string;
Code: string;
Message: string;
SenderFault: string;
}
export class SendMessageBatchResult {
Successful: SendMessageBatchResultEntry[];
Failed: BatchResultErrorEntry[];
}
export class SendMessageBatchResultEntry {
Id: string;
MessageId: string;
MD5OfMessageBody: string;
}
export class CreateQueueResult {
QueueUrl: string;
}
}
export module Ses {
export interface Client {
config: ClientConfig;
sendEmail(params: any, callback: (err: any, data: SendEmailResult) => void): void;
}
export interface SendEmailRequest {
Source: string;
Destination: Destination;
Message: Message;
ReplyToAddresses: string[];
ReturnPath: string;
}
export class Destination {
ToAddresses: string[];
CcAddresses: string[];
BccAddresses: string[];
}
export class Message {
Subject: Content;
Body: Body;
}
export class Content {
Data: string;
Charset: string;
}
export class Body {
Text: Content;
Html: Content;
}
export class SendEmailResult {
MessageId: string;
}
}
export module Swf {
export class Client {
//constructor(options?: any);
public config: ClientConfig;
countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
countPendingActivityTasks(params: any, callback: (err: any, data: any) => void): void;
countPendingDecisionTasks(params: any, callback: (err: any, data: any) => void): void;
deprecateActivityType(params: any, callback: (err: any, data: any) => void): void;
deprecateDomain(params: any, callback: (err: any, data: any) => void): void;
deprecateWorkflowType(params: any, callback: (err: any, data: any) => void): void;
describeActivityType(params: any, callback: (err: any, data: any) => void): void;
describeDomain(params: any, callback: (err: any, data: any) => void): void;
describeWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
describeWorkflowType(params: any, callback: (err: any, data: any) => void): void;
getWorkflowExecutionHistory(params: any, callback: (err: any, data: any) => void): void;
listActivityTypes(params: any, callback: (err: any, data: any) => void): void;
listClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
listDomains(params: any, callback: (err: any, data: any) => void): void;
listOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void;
listWorkflowTypes(params: any, callback: (err: any, data: any) => void): void;
pollForActivityTask(params: any, callback: (err: any, data: ActivityTask) => void): void;
pollForDecisionTask(params: any, callback: (err: any, data: DecisionTask) => void): void;
recordActivityTaskHeartbeat(params: any, callback: (err: any, data: any) => void): void;
registerActivityType(params: any, callback: (err: any, data: any) => void): void;
registerDomain(params: any, callback: (err: any, data: any) => void): void;
registerWorkflowType(params: any, callback: (err: any, data: any) => void): void;
requestCancelWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
respondActivityTaskCanceled(params: RespondActivityTaskCanceledRequest, callback: (err: any, data: any) => void): void;
respondActivityTaskCompleted(params: RespondActivityTaskCompletedRequest, callback: (err: any, data: any) => void): void;
respondActivityTaskFailed(params: RespondActivityTaskFailedRequest, callback: (err: any, data: any) => void): void;
respondDecisionTaskCompleted(params: RespondDecisionTaskCompletedRequest, callback: (err: any, data: any) => void): void;
signalWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
startWorkflowExecution(params: any, callback: (err: any, data: StartWorkflowExecutionResult) => void): void;
terminateWorkflowExecution(params: any, callback: (err: any, data: any) => void): void;
}
export interface PollForActivityTaskRequest {
domain?: string;
taskList?: TaskList;
identity?: string;
}
export interface TaskList {
name?: string;
}
export interface PollForDecisionTaskRequest {
domain?: string;
taskList?: TaskList;
identity?: string;
nextPageToken?: string;
maximumPageSize?: number;
reverseOrder?: Boolean;
}
export interface StartWorkflowExecutionRequest {
domain?: string;
workflowId?: string;
workflowType?: WorkflowType;
taskList?: TaskList;
input?: string;
executionStartToCloseTimeout?: string;
tagList?: string[];
taskStartToCloseTimeout?: string;
childPolicy?: string;
}
export interface WorkflowType {
name?: string;
version?: string;
}
export interface RespondDecisionTaskCompletedRequest {
taskToken?: string;
decisions?: Decision[];
executionContext?: string;
}
export interface Decision {
decisionType?: string;
scheduleActivityTaskDecisionAttributes?: ScheduleActivityTaskDecisionAttributes;
requestCancelActivityTaskDecisionAttributes?: RequestCancelActivityTaskDecisionAttributes;
completeWorkflowExecutionDecisionAttributes?: CompleteWorkflowExecutionDecisionAttributes;
failWorkflowExecutionDecisionAttributes?: FailWorkflowExecutionDecisionAttributes;
cancelWorkflowExecutionDecisionAttributes?: CancelWorkflowExecutionDecisionAttributes;
continueAsNewWorkflowExecutionDecisionAttributes?: ContinueAsNewWorkflowExecutionDecisionAttributes;
recordMarkerDecisionAttributes?: RecordMarkerDecisionAttributes;
startTimerDecisionAttributes?: StartTimerDecisionAttributes;
cancelTimerDecisionAttributes?: CancelTimerDecisionAttributes;
signalExternalWorkflowExecutionDecisionAttributes?: SignalExternalWorkflowExecutionDecisionAttributes;
requestCancelExternalWorkflowExecutionDecisionAttributes?: RequestCancelExternalWorkflowExecutionDecisionAttributes;
startChildWorkflowExecutionDecisionAttributes?: StartChildWorkflowExecutionDecisionAttributes;
}
export interface ScheduleActivityTaskDecisionAttributes {
activityType?: ActivityType;
activityId?: string;
control?: string;
input?: string;
scheduleToCloseTimeout?: string;
taskList?: TaskList;
scheduleToStartTimeout?: string;
startToCloseTimeout?: string;
heartbeatTimeout?: string;
}
export interface ActivityType {
name?: string;
version?: string;
}
export interface RequestCancelActivityTaskDecisionAttributes {
activityId?: string;
}
export interface CompleteWorkflowExecutionDecisionAttributes {
result?: string;
}
export interface FailWorkflowExecutionDecisionAttributes {
reason?: string;
details?: string;
}
export interface CancelWorkflowExecutionDecisionAttributes {
details?: string;
}
export interface ContinueAsNewWorkflowExecutionDecisionAttributes {
input?: string;
executionStartToCloseTimeout?: string;
taskList?: TaskList;
taskStartToCloseTimeout?: string;
childPolicy?: string;
tagList?: string[];
workflowTypeVersion?: string;
}
export interface RecordMarkerDecisionAttributes {
markerName?: string;
details?: string;
}
export interface StartTimerDecisionAttributes {
timerId?: string;
control?: string;
startToFireTimeout?: string;
}
export interface CancelTimerDecisionAttributes {
timerId?: string;
}
export interface SignalExternalWorkflowExecutionDecisionAttributes {
workflowId?: string;
runId?: string;
signalName?: string;
input?: string;
control?: string;
}
export interface RequestCancelExternalWorkflowExecutionDecisionAttributes {
workflowId?: string;
runId?: string;
control?: string;
}
export interface StartChildWorkflowExecutionDecisionAttributes {
workflowType?: WorkflowType;
workflowId?: string;
control?: string;
input?: string;
executionStartToCloseTimeout?: string;
taskList?: TaskList;
taskStartToCloseTimeout?: string;
childPolicy?: string;
tagList?: string[];
}
export interface RespondActivityTaskCompletedRequest {
taskToken?: string;
result?: string;
}
export interface RespondActivityTaskFailedRequest {
taskToken?: string;
reason?: string;
details?: string;
}
export interface RespondActivityTaskCanceledRequest {
taskToken?: string;
details?: string;
}
export interface DecisionTask {
taskToken?: string;
startedEventId?: number;
workflowExecution?: WorkflowExecution;
workflowType?: WorkflowType;
events?: HistoryEvent[];
nextPageToken?: string;
previousStartedEventId?: number;
}
export interface WorkflowExecution {
workflowId?: string;
runId?: string;
}
export interface HistoryEvent {
eventTimestamp?: any;
eventType?: string;
eventId?: number;
workflowExecutionStartedEventAttributes?: WorkflowExecutionStartedEventAttributes;
workflowExecutionCompletedEventAttributes?: WorkflowExecutionCompletedEventAttributes;
completeWorkflowExecutionFailedEventAttributes?: CompleteWorkflowExecutionFailedEventAttributes;
workflowExecutionFailedEventAttributes?: WorkflowExecutionFailedEventAttributes;
failWorkflowExecutionFailedEventAttributes?: FailWorkflowExecutionFailedEventAttributes;
workflowExecutionTimedOutEventAttributes?: WorkflowExecutionTimedOutEventAttributes;
workflowExecutionCanceledEventAttributes?: WorkflowExecutionCanceledEventAttributes;
cancelWorkflowExecutionFailedEventAttributes?: CancelWorkflowExecutionFailedEventAttributes;
workflowExecutionContinuedAsNewEventAttributes?: WorkflowExecutionContinuedAsNewEventAttributes;
continueAsNewWorkflowExecutionFailedEventAttributes?: ContinueAsNewWorkflowExecutionFailedEventAttributes;
workflowExecutionTerminatedEventAttributes?: WorkflowExecutionTerminatedEventAttributes;
workflowExecutionCancelRequestedEventAttributes?: WorkflowExecutionCancelRequestedEventAttributes;
decisionTaskScheduledEventAttributes?: DecisionTaskScheduledEventAttributes;
decisionTaskStartedEventAttributes?: DecisionTaskStartedEventAttributes;
decisionTaskCompletedEventAttributes?: DecisionTaskCompletedEventAttributes;
decisionTaskTimedOutEventAttributes?: DecisionTaskTimedOutEventAttributes;
activityTaskScheduledEventAttributes?: ActivityTaskScheduledEventAttributes;
activityTaskStartedEventAttributes?: ActivityTaskStartedEventAttributes;
activityTaskCompletedEventAttributes?: ActivityTaskCompletedEventAttributes;
activityTaskFailedEventAttributes?: ActivityTaskFailedEventAttributes;
activityTaskTimedOutEventAttributes?: ActivityTaskTimedOutEventAttributes;
activityTaskCanceledEventAttributes?: ActivityTaskCanceledEventAttributes;
activityTaskCancelRequestedEventAttributes?: ActivityTaskCancelRequestedEventAttributes;
workflowExecutionSignaledEventAttributes?: WorkflowExecutionSignaledEventAttributes;
markerRecordedEventAttributes?: MarkerRecordedEventAttributes;
timerStartedEventAttributes?: TimerStartedEventAttributes;
timerFiredEventAttributes?: TimerFiredEventAttributes;
timerCanceledEventAttributes?: TimerCanceledEventAttributes;
startChildWorkflowExecutionInitiatedEventAttributes?: StartChildWorkflowExecutionInitiatedEventAttributes;
childWorkflowExecutionStartedEventAttributes?: ChildWorkflowExecutionStartedEventAttributes;
childWorkflowExecutionCompletedEventAttributes?: ChildWorkflowExecutionCompletedEventAttributes;
childWorkflowExecutionFailedEventAttributes?: ChildWorkflowExecutionFailedEventAttributes;
childWorkflowExecutionTimedOutEventAttributes?: ChildWorkflowExecutionTimedOutEventAttributes;
childWorkflowExecutionCanceledEventAttributes?: ChildWorkflowExecutionCanceledEventAttributes;
childWorkflowExecutionTerminatedEventAttributes?: ChildWorkflowExecutionTerminatedEventAttributes;
signalExternalWorkflowExecutionInitiatedEventAttributes?: SignalExternalWorkflowExecutionInitiatedEventAttributes;
externalWorkflowExecutionSignaledEventAttributes?: ExternalWorkflowExecutionSignaledEventAttributes;
signalExternalWorkflowExecutionFailedEventAttributes?: SignalExternalWorkflowExecutionFailedEventAttributes;
externalWorkflowExecutionCancelRequestedEventAttributes?: ExternalWorkflowExecutionCancelRequestedEventAttributes;
requestCancelExternalWorkflowExecutionInitiatedEventAttributes?: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes;
requestCancelExternalWorkflowExecutionFailedEventAttributes?: RequestCancelExternalWorkflowExecutionFailedEventAttributes;
scheduleActivityTaskFailedEventAttributes?: ScheduleActivityTaskFailedEventAttributes;
requestCancelActivityTaskFailedEventAttributes?: RequestCancelActivityTaskFailedEventAttributes;
startTimerFailedEventAttributes?: StartTimerFailedEventAttributes;
cancelTimerFailedEventAttributes?: CancelTimerFailedEventAttributes;
startChildWorkflowExecutionFailedEventAttributes?: StartChildWorkflowExecutionFailedEventAttributes;
}
export interface WorkflowExecutionStartedEventAttributes {
input?: string;
executionStartToCloseTimeout?: string;
taskStartToCloseTimeout?: string;
childPolicy?: string;
taskList?: TaskList;
workflowType?: WorkflowType;
tagList?: string[];
continuedExecutionRunId?: string;
parentWorkflowExecution?: WorkflowExecution;
parentInitiatedEventId?: number;
}
export interface WorkflowExecutionCompletedEventAttributes {
result?: string;
decisionTaskCompletedEventId?: number;
}
export interface CompleteWorkflowExecutionFailedEventAttributes {
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface WorkflowExecutionFailedEventAttributes {
reason?: string;
details?: string;
decisionTaskCompletedEventId?: number;
}
export interface FailWorkflowExecutionFailedEventAttributes {
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface WorkflowExecutionTimedOutEventAttributes {
timeoutType?: string;
childPolicy?: string;
}
export interface WorkflowExecutionCanceledEventAttributes {
details?: string;
decisionTaskCompletedEventId?: number;
}
export interface CancelWorkflowExecutionFailedEventAttributes {
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface WorkflowExecutionContinuedAsNewEventAttributes {
input?: string;
decisionTaskCompletedEventId?: number;
newExecutionRunId?: string;
executionStartToCloseTimeout?: string;
taskList?: TaskList;
taskStartToCloseTimeout?: string;
childPolicy?: string;
tagList?: string[];
workflowType?: WorkflowType;
}
export interface ContinueAsNewWorkflowExecutionFailedEventAttributes {
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface WorkflowExecutionTerminatedEventAttributes {
reason?: string;
details?: string;
childPolicy?: string;
cause?: string;
}
export interface WorkflowExecutionCancelRequestedEventAttributes {
externalWorkflowExecution?: WorkflowExecution;
externalInitiatedEventId?: number;
cause?: string;
}
export interface DecisionTaskScheduledEventAttributes {
taskList?: TaskList;
startToCloseTimeout?: string;
}
export interface DecisionTaskStartedEventAttributes {
identity?: string;
scheduledEventId?: number;
}
export interface DecisionTaskCompletedEventAttributes {
executionContext?: string;
scheduledEventId?: number;
startedEventId?: number;
}
export interface DecisionTaskTimedOutEventAttributes {
timeoutType?: string;
scheduledEventId?: number;
startedEventId?: number;
}
export interface ActivityTaskScheduledEventAttributes {
activityType?: ActivityType;
activityId?: string;
input?: string;
control?: string;
scheduleToStartTimeout?: string;
scheduleToCloseTimeout?: string;
startToCloseTimeout?: string;
taskList?: TaskList;
decisionTaskCompletedEventId?: number;
heartbeatTimeout?: string;
}
export interface ActivityTaskStartedEventAttributes {
identity?: string;
scheduledEventId?: number;
}
export interface ActivityTaskCompletedEventAttributes {
result?: string;
scheduledEventId?: number;
startedEventId?: number;
}
export interface ActivityTaskFailedEventAttributes {
reason?: string;
details?: string;
scheduledEventId?: number;
startedEventId?: number;
}
export interface ActivityTaskTimedOutEventAttributes {
timeoutType?: string;
scheduledEventId?: number;
startedEventId?: number;
details?: string;
}
export interface ActivityTaskCanceledEventAttributes {
details?: string;
scheduledEventId?: number;
startedEventId?: number;
latestCancelRequestedEventId?: number;
}
export interface ActivityTaskCancelRequestedEventAttributes {
decisionTaskCompletedEventId?: number;
activityId?: string;
}
export interface WorkflowExecutionSignaledEventAttributes {
signalName?: string;
input?: string;
externalWorkflowExecution?: WorkflowExecution;
externalInitiatedEventId?: number;
}
export interface MarkerRecordedEventAttributes {
markerName?: string;
details?: string;
decisionTaskCompletedEventId?: number;
}
export interface TimerStartedEventAttributes {
timerId?: string;
control?: string;
startToFireTimeout?: string;
decisionTaskCompletedEventId?: number;
}
export interface TimerFiredEventAttributes {
timerId?: string;
startedEventId?: number;
}
export interface TimerCanceledEventAttributes {
timerId?: string;
startedEventId?: number;
decisionTaskCompletedEventId?: number;
}
export interface StartChildWorkflowExecutionInitiatedEventAttributes {
workflowId?: string;
workflowType?: WorkflowType;
control?: string;
input?: string;
executionStartToCloseTimeout?: string;
taskList?: TaskList;
decisionTaskCompletedEventId?: number;
childPolicy?: string;
taskStartToCloseTimeout?: string;
tagList?: string[];
}
export interface ChildWorkflowExecutionStartedEventAttributes {
workflowExecution?: WorkflowExecution;
workflowType?: WorkflowType;
initiatedEventId?: number;
}
export interface ChildWorkflowExecutionCompletedEventAttributes {
workflowExecution?: WorkflowExecution;
workflowType?: WorkflowType;
result?: string;
initiatedEventId?: number;
startedEventId?: number;
}
export interface ChildWorkflowExecutionFailedEventAttributes {
workflowExecution?: WorkflowExecution;
workflowType?: WorkflowType;
reason?: string;
details?: string;
initiatedEventId?: number;
startedEventId?: number;
}
export interface ChildWorkflowExecutionTimedOutEventAttributes {
workflowExecution?: WorkflowExecution;
workflowType?: WorkflowType;
timeoutType?: string;
initiatedEventId?: number;
startedEventId?: number;
}
export interface ChildWorkflowExecutionCanceledEventAttributes {
workflowExecution?: WorkflowExecution;
workflowType?: WorkflowType;
details?: string;
initiatedEventId?: number;
startedEventId?: number;
}
export interface ChildWorkflowExecutionTerminatedEventAttributes {
workflowExecution?: WorkflowExecution;
workflowType?: WorkflowType;
initiatedEventId?: number;
startedEventId?: number;
}
export interface SignalExternalWorkflowExecutionInitiatedEventAttributes {
workflowId?: string;
runId?: string;
signalName?: string;
input?: string;
decisionTaskCompletedEventId?: number;
control?: string;
}
export interface ExternalWorkflowExecutionSignaledEventAttributes {
workflowExecution?: WorkflowExecution;
initiatedEventId?: number;
}
export interface SignalExternalWorkflowExecutionFailedEventAttributes {
workflowId?: string;
runId?: string;
cause?: string;
initiatedEventId?: number;
decisionTaskCompletedEventId?: number;
control?: string;
}
export interface ExternalWorkflowExecutionCancelRequestedEventAttributes {
workflowExecution?: WorkflowExecution;
initiatedEventId?: number;
}
export interface RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {
workflowId?: string;
runId?: string;
decisionTaskCompletedEventId?: number;
control?: string;
}
export interface RequestCancelExternalWorkflowExecutionFailedEventAttributes {
workflowId?: string;
runId?: string;
cause?: string;
initiatedEventId?: number;
decisionTaskCompletedEventId?: number;
control?: string;
}
export interface ScheduleActivityTaskFailedEventAttributes {
activityType?: ActivityType;
activityId?: string;
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface RequestCancelActivityTaskFailedEventAttributes {
activityId?: string;
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface StartTimerFailedEventAttributes {
timerId?: string;
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface CancelTimerFailedEventAttributes {
timerId?: string;
cause?: string;
decisionTaskCompletedEventId?: number;
}
export interface StartChildWorkflowExecutionFailedEventAttributes {
workflowType?: WorkflowType;
cause?: string;
workflowId?: string;
initiatedEventId?: number;
decisionTaskCompletedEventId?: number;
control?: string;
}
export interface ActivityTask {
taskToken?: string;
activityId?: string;
startedEventId?: number;
workflowExecution?: WorkflowExecution;
activityType?: ActivityType;
input?: string;
}
export interface PollForActivityTaskResult {
activityTask?: ActivityTask;
}
export interface PollForDecisionTaskResult {
decisionTask?: DecisionTask;
}
export interface StartWorkflowExecutionResult {
run?: Run;
}
export interface Run {
runId?: string;
}
}
export module Sns {
export interface Client {
config: ClientConfig;
publicTopic(params: PublishRequest, callback: (err: any, data: PublishResult) => void): void;
createTopic(params: CreateTopicRequest, callback: (err: any, data: CreateTopicResult) => void): void;
deleteTopic(params: DeleteTopicRequest, callback: (err: any, data: any) => void): void;
}
export interface PublishRequest {
TopicArn?: string;
Message?: string;
MessageStructure?: string;
Subject?: string;
}
export interface PublishResult {
MessageId?: string;
}
export interface CreateTopicRequest {
Name?: string;
}
export interface CreateTopicResult {
TopicArn?: string;
}
export interface DeleteTopicRequest {
TopicArn?: string;
}
}
export module s3 {
export interface Client {
config: ClientConfig;
putObject(params: PutObjectRequest, callback: (err: any, data: any) => void): void;
getObject(params: GetObjectRequest, callback: (err: any, data: any) => void): void;
}
export interface PutObjectRequest {
ACL?: string;
Body?: any;
Bucket: string;
CacheControl?: string;
ContentDisposition?: string;
ContentEncoding?: string;
ContentLanguage?: string;
ContentLength?: string;
ContentMD5?: string;
ContentType?: string;
Expires?: any;
GrantFullControl?: string;
GrantRead?: string;
GrantReadACP?: string;
GrantWriteACP?: string;
Key: string;
Metadata?: string[];
ServerSideEncryption?: string;
StorageClass?: string;
WebsiteRedirectLocation?: string;
}
export interface GetObjectRequest {
Bucket: string;
IfMatch?: string;
IfModifiedSince?: any;
IfNoneMatch?: string;
IfUnmodifiedSince?: any;
Key: string;
Range?: string;
ResponseCacheControl?: string;
ResponseContentDisposition?: string;
ResponseContentEncoding?: string;
ResponseContentLanguage?: string;
ResponseContentType?: string;
ResponseExpires?: any;
VersionId?: string;
}
}
}
+14 -11
View File
@@ -5,12 +5,15 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../backbone/backbone.d.ts" />
declare module Backbone {
export class RelationalModel extends Model {
static extend(properties:any, classProperties?:any):any; // do not use, prefer TypeScript's extend functionality
class RelationalModel extends Model {
/**
* Do not use, prefer TypeScript's extend functionality.
**/
//private static extend(properties:any, classProperties?:any):any;
relations:any;
subModelTypes:any;
subModelTypeAttribute:any;
@@ -58,7 +61,7 @@ declare module Backbone {
setRelated(related:Model):void;
setRelated(related:Collection):void;
setRelated(related:Collection<Model>):void;
getReverseRelations(model:RelationalModel):Relation;
@@ -78,15 +81,15 @@ declare module Backbone {
setKeyContents(keyContents:number[]):void;
setKeyContents(keyContents:Collection):void;
setKeyContents(keyContents:Collection<Model>):void;
onChange(model:Model, attr:any, options:any):void;
handleAddition(model:Model, coll:Collection, options:any):void;
handleAddition(model:Model, coll:Collection<Model>, options:any):void;
handleRemoval(model:Model, coll:Collection, options:any):void;
handleRemoval(model:Model, coll:Collection<Model>, options:any):void;
handleReset(coll:Collection, options:any):void;
handleReset(coll:Collection<Model>, options:any):void;
tryAddRelated(model:Model, coll:any, options:any):void;
@@ -135,9 +138,9 @@ declare module Backbone {
processOrphanRelations():void;
retroFitRelation(relation:RelationalModel, create:boolean):Collection;
retroFitRelation(relation:RelationalModel, create:boolean):Collection<Model>;
getCollection(type:RelationalModel, create:boolean):Collection;
getCollection(type:RelationalModel, create:boolean):Collection<Model>;
getObjectByName(name:string):any;
@@ -158,7 +161,7 @@ declare module Backbone {
update(model:RelationalModel):void;
unregister(model:RelationalModel, collection:Collection, options:any):void;
unregister(model:RelationalModel, collection:Collection<Model>, options:any):void;
reset():void;
+96 -61
View File
@@ -4,7 +4,7 @@
function test_events() {
var object = new Backbone.Events();
object.on("alert", (msg) => alert("Triggered " + msg));
object.on("alert", (eventName: string) => alert("Triggered " + eventName));
object.trigger("alert", "an event");
@@ -18,48 +18,74 @@ function test_events() {
object.off();
}
class SettingDefaults extends Backbone.Model {
// 'defaults' could be set in one of the following ways:
defaults() {
return {
name: "Joe"
}
}
constructor(attributes?: any, options?: any) {
this.defaults = <any>{
name: "Joe"
}
// super has to come last
super(attributes, options);
}
// or set it like this
initialize() {
this.defaults = <any>{
name: "Joe"
}
}
// same patterns could be used for setting 'Router.routes' and 'View.events'
}
class Sidebar extends Backbone.Model {
promptColor() {
var cssColor = prompt("Please enter a CSS color:");
this.set({ color: cssColor });
}
}
class Note extends Backbone.Model {
initialize() { }
author() { }
coordinates() { }
allowedToEdit(account: any) {
return true;
}
}
class PrivateNote extends Note {
allowedToEdit(account: any) {
return account.owns(this);
}
set(attributes: any, options?: any): Backbone.Model {
return Backbone.Model.prototype.set.call(this, attributes, options);
}
}
function test_models() {
var Sidebar = Backbone.Model.extend({
promptColor: function () {
var cssColor = prompt("Please enter a CSS color:");
this.set({ color: cssColor });
}
});
var sidebar = new Sidebar();
sidebar.on('change:color', (model, color) => $('#sidebar').css({ background: color }));
sidebar.on('change:color', (model: {}, color: string) => $('#sidebar').css({ background: color }));
sidebar.set({ color: 'white' });
sidebar.promptColor();
////////
var Note = Backbone.Model.extend({
initialize: () => { },
author: () => { },
coordinates: () => { },
allowedToEdit: (account) => {
return true;
}
});
var PrivateNote = Note.extend({
allowedToEdit: function (account) {
return account.owns(this);
}
});
//////////
var note = Backbone.Model.extend({
set: function (attributes, options) {
Backbone.Model.prototype.set.call(this, attributes, options);
}
});
var note = new PrivateNote();
note.get("title")
note.get("title");
note.set({ title: "March 20", content: "In his eyes she eclipses..." });
@@ -69,7 +95,7 @@ function test_models() {
class Employee extends Backbone.Model {
reports: EmployeeCollection;
constructor (options? ) {
constructor(attributes?: any, options?: any) {
super(options);
this.reports = new EmployeeCollection();
this.reports.url = '../api/employees/' + this.id + '/reports';
@@ -80,29 +106,38 @@ class Employee extends Backbone.Model {
}
}
class EmployeeCollection extends Backbone.Collection {
findByName(key) { }
class EmployeeCollection extends Backbone.Collection<Employee> {
findByName(key: any) { }
}
class Book extends Backbone.Model {
title: string;
author: string;
}
class Library extends Backbone.Collection<Book> {
model: typeof Book;
}
class Books extends Backbone.Collection<Book> { }
function test_collection() {
var Book: Backbone.Model;
var Library = Backbone.Collection.extend({
model: Book
var books = new Library();
books.each(book => {
book.get("title");
});
var Books: Backbone.Collection;
Books.each(function (book) {
});
var titles = Books.map(function (book) {
var titles = books.map(book => {
return book.get("title");
});
var publishedBooks = Books.filter(function (book) {
var publishedBooks = books.filter(book => {
return book.get("published") === true;
});
var alphabetical = Books.sortBy(function (book) {
var alphabetical = books.sortBy((book: Book): number => {
return null;
});
}
@@ -121,26 +156,26 @@ module v1Changes {
function test_listenTo() {
var model = new Employee;
var view = new Backbone.View;
var view = new Backbone.View<Employee>();
view.listenTo(model, 'invalid', () => { });
}
function test_listenToOnce() {
var model = new Employee;
var view = new Backbone.View;
var view = new Backbone.View<Employee>();
view.listenToOnce(model, 'invalid', () => { });
}
function test_stopListening() {
var model = new Employee;
var view = new Backbone.View;
var view = new Backbone.View<Employee>();
view.stopListening(model, 'invalid', () => { });
view.stopListening(model, 'invalid');
view.stopListening(model);
}
}
module modelandcollection {
module ModelAndCollection {
function test_url() {
Employee.prototype.url = () => '/employees';
EmployeeCollection.prototype.url = () => '/employees';
@@ -168,7 +203,7 @@ module v1Changes {
}
}
module model {
module Model {
function test_validationError() {
var model = new Employee;
if (model.validationError) {
@@ -195,17 +230,17 @@ module v1Changes {
model.destroy({
wait: true,
success: (m?, response?, options?) => { },
error: (m?, jqxhr?: JQueryXHR, options?) => { }
error: (m?, jqxhr?, options?) => { }
});
model.destroy({
success: (m?, response?, options?) => { },
error: (m?, jqxhr?: JQueryXHR) => { }
error: (m?, jqxhr?) => { }
});
model.destroy({
success: () => { },
error: (m?, jqxhr?: JQueryXHR) => { }
error: (m?, jqxhr?) => { }
});
}
@@ -220,7 +255,7 @@ module v1Changes {
wait: true,
validate: false,
success: (m?, response?, options?) => { },
error: (m?, jqxhr?: JQueryXHR, options?) => { }
error: (m?, jqxhr?, options?) => { }
});
model.save({
@@ -229,7 +264,7 @@ module v1Changes {
},
{
success: () => { },
error: (m?, jqxhr?: JQueryXHR) => { }
error: (m?, jqxhr?) => { }
});
}
@@ -240,7 +275,7 @@ module v1Changes {
}
}
module collection {
module Collection {
function test_fetch() {
var collection = new EmployeeCollection;
collection.fetch({ reset: true });
@@ -256,7 +291,7 @@ module v1Changes {
}
}
module router {
module Router {
function test_navigate() {
var router = new Backbone.Router;
@@ -264,4 +299,4 @@ module v1Changes {
router.navigate('/employees', true);
}
}
}
}
-1
View File
@@ -1 +0,0 @@
""
+133 -110
View File
@@ -6,6 +6,7 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../underscore/underscore.d.ts" />
declare module Backbone {
@@ -67,7 +68,7 @@ declare module Backbone {
}
class Events {
on(eventName: any, callback?: Function, context?: any): any;
on(eventName: string, callback?: Function, context?: any): any;
off(eventName?: string, callback?: Function, context?: any): any;
trigger(eventName: string, ...args: any[]): any;
bind(eventName: string, callback: Function, context?: any): any;
@@ -86,17 +87,22 @@ declare module Backbone {
sync(...arg: any[]): JQueryXHR;
}
interface OptionalDefaults {
defaults?(): any;
}
class Model extends ModelBase {
class Model extends ModelBase implements OptionalDefaults {
static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality
/**
* Do not use, prefer TypeScript's extend functionality.
**/
private static extend(properties: any, classProperties?: any): any;
attributes: any;
changed: any[];
cid: string;
/**
* Default attributes for the model. It can be an object hash or a method returning an object hash.
* For assigning an object hash, do it like this: this.defaults = <any>{ attribute: value, ... };
* That works only if you set it in the constructor or the initialize method.
**/
defaults(): any;
id: any;
idAttribute: string;
validationError: any;
@@ -127,7 +133,7 @@ declare module Backbone {
unset(attribute: string, options?: Silenceable): Model;
validate(attributes: any, options?: any): any;
_validate(attrs: any, options: any): boolean;
private _validate(attrs: any, options: any): boolean;
// mixins from underscore
@@ -141,114 +147,125 @@ declare module Backbone {
omit(...keys: string[]): any;
}
class Collection extends ModelBase {
class Collection<TModel extends Model> extends ModelBase {
static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality
/**
* Do not use, prefer TypeScript's extend functionality.
**/
private static extend(properties: any, classProperties?: any): any;
model: any;
models: any;
collection: Model;
// TODO: this really has to be typeof TModel
//model: typeof TModel;
model: { new(): TModel; }; // workaround
models: TModel[];
collection: TModel;
length: number;
constructor(models?: any, options?: any);
constructor(models?: TModel[], options?: any);
fetch(options?: CollectionFetchOptions): JQueryXHR;
comparator(element: Model): any;
comparator(compare: Model, to?: Model): any;
comparator(element: TModel): number;
comparator(compare: TModel, to?: TModel): number;
add(model: Model, options?: AddOptions): Collection;
add(model: any, options?: AddOptions): Collection;
add(models: Model[], options?: AddOptions): Collection;
add(models: any[], options?: AddOptions): Collection;
at(index: number): Model;
get(id: any): Model;
create(attributes: any, options?: ModelSaveOptions): Model;
add(model: TModel, options?: AddOptions): Collection<TModel>;
add(models: TModel[], options?: AddOptions): Collection<TModel>;
at(index: number): TModel;
get(id: string): TModel;
create(attributes: any, options?: ModelSaveOptions): TModel;
pluck(attribute: string): any[];
push(model: Model, options?: AddOptions): Model;
pop(options?: Silenceable): Model;
remove(model: Model, options?: Silenceable): Model;
remove(models: Model[], options?: Silenceable): Model[];
reset(models?: Model[], options?: Silenceable): Model[];
reset(models?: any[], options?: Silenceable): Model[];
shift(options?: Silenceable): Model;
sort(options?: Silenceable): Collection;
unshift(model: Model, options?: AddOptions): Model;
where(properies: any): Model[];
findWhere(properties: any): Model;
push(model: TModel, options?: AddOptions): TModel;
pop(options?: Silenceable): TModel;
remove(model: TModel, options?: Silenceable): TModel;
remove(models: TModel[], options?: Silenceable): TModel[];
reset(models?: TModel[], options?: Silenceable): TModel[];
set(models?: TModel[], options?: Silenceable): TModel[];
shift(options?: Silenceable): TModel;
sort(options?: Silenceable): Collection<TModel>;
unshift(model: TModel, options?: AddOptions): TModel;
where(properies: any): TModel[];
findWhere(properties: any): TModel;
_prepareModel(attrs?: any, options?: any): any;
_removeReference(model: Model): void;
_onModelEvent(event: string, model: Model, collection: Collection, options: any): void;
private _prepareModel(attrs?: any, options?: any): any;
private _removeReference(model: TModel): void;
private _onModelEvent(event: string, model: TModel, collection: Collection<TModel>, options: any): void;
// mixins from underscore
all(iterator: (element: Model, index: number) => boolean, context?: any): boolean;
any(iterator: (element: Model, index: number) => boolean, context?: any): boolean;
collect(iterator: (element: Model, index: number, context?: any) => any[], context?: any): any[];
all(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
any(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
collect(iterator: (element: TModel, index: number, context?: any) => any[], context?: any): any[];
chain(): any;
compact(): Model[];
compact(): TModel[];
contains(value: any): boolean;
countBy(iterator: (element: Model, index: number) => any): any[];
countBy(attribute: string): any[];
countBy(iterator: (element: TModel, index: number) => any): _.Dictionary<number>;
countBy(attribute: string): _.Dictionary<number>;
detect(iterator: (item: any) => boolean, context?: any): any; // ???
difference(...model: Model[]): Model[];
drop(): Model;
drop(n: number): Model[];
each(iterator: (element: Model, index: number, list?: any) => void , context?: any): any;
every(iterator: (element: Model, index: number) => boolean, context?: any): boolean;
filter(iterator: (element: Model, index: number) => boolean, context?: any): Model[];
find(iterator: (element: Model, index: number) => boolean, context?: any): Model;
first(): Model;
first(n: number): Model[];
flatten(shallow?: boolean): Model[];
foldl(iterator: (memo: any, element: Model, index: number) => any, initialMemo: any, context?: any): any;
forEach(iterator: (element: Model, index: number, list?: any) => void , context?: any): any;
difference(...model: TModel[]): TModel[];
drop(): TModel;
drop(n: number): TModel[];
each(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any;
every(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
filter(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[];
find(iterator: (element: TModel, index: number) => boolean, context?: any): TModel;
first(): TModel;
first(n: number): TModel[];
flatten(shallow?: boolean): TModel[];
foldl(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
forEach(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any;
groupBy(iterator: (element: TModel, index: number) => string, context?: any): _.Dictionary<TModel[]>;
groupBy(attribute: string, context?: any): _.Dictionary<TModel[]>;
include(value: any): boolean;
indexOf(element: Model, isSorted?: boolean): number;
initial(): Model;
initial(n: number): Model[];
inject(iterator: (memo: any, element: Model, index: number) => any, initialMemo: any, context?: any): any;
intersection(...model: Model[]): Model[];
indexOf(element: TModel, isSorted?: boolean): number;
initial(): TModel;
initial(n: number): TModel[];
inject(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
intersection(...model: TModel[]): TModel[];
isEmpty(object: any): boolean;
invoke(methodName: string, arguments?: any[]): any;
last(): Model;
last(n: number): Model[];
lastIndexOf(element: Model, fromIndex?: number): number;
map(iterator: (element: Model, index: number, context?: any) => any[], context?: any): any[];
max(iterator?: (element: Model, index: number) => any, context?: any): Model;
min(iterator?: (element: Model, index: number) => any, context?: any): Model;
last(): TModel;
last(n: number): TModel[];
lastIndexOf(element: TModel, fromIndex?: number): number;
map(iterator: (element: TModel, index: number, context?: any) => any[], context?: any): any[];
max(iterator?: (element: TModel, index: number) => any, context?: any): TModel;
min(iterator?: (element: TModel, index: number) => any, context?: any): TModel;
object(...values: any[]): any[];
reduce(iterator: (memo: any, element: Model, index: number) => any, initialMemo: any, context?: any): any;
reduce(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
select(iterator: any, context?: any): any[];
size(): number;
shuffle(): any[];
some(iterator: (element: Model, index: number) => boolean, context?: any): boolean;
sortBy(iterator: (element: Model, index: number) => number, context?: any): Model[];
sortBy(attribute: string, context?: any): Model[];
sortedIndex(element: Model, iterator?: (element: Model, index: number) => number): number;
some(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
sortBy(iterator: (element: TModel, index: number) => number, context?: any): TModel[];
sortBy(attribute: string, context?: any): TModel[];
sortedIndex(element: TModel, iterator?: (element: TModel, index: number) => number): number;
range(stop: number, step?: number): any;
range(start: number, stop: number, step?: number): any;
reduceRight(iterator: (memo: any, element: Model, index: number) => any, initialMemo: any, context?: any): any[];
reject(iterator: (element: Model, index: number) => boolean, context?: any): Model[];
rest(): Model;
rest(n: number): Model[];
tail(): Model;
tail(n: number): Model[];
reduceRight(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any[];
reject(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[];
rest(): TModel;
rest(n: number): TModel[];
tail(): TModel;
tail(n: number): TModel[];
toArray(): any[];
union(...model: Model[]): Model[];
uniq(isSorted?: boolean, iterator?: (element: Model, index: number) => boolean): Model[];
without(...values: any[]): Model[];
zip(...model: Model[]): Model[];
union(...model: TModel[]): TModel[];
uniq(isSorted?: boolean, iterator?: (element: TModel, index: number) => boolean): TModel[];
without(...values: any[]): TModel[];
zip(...model: TModel[]): TModel[];
}
interface OptionalRoutes {
routes?(): any;
}
class Router extends Events {
class Router extends Events implements OptionalRoutes {
/**
* Do not use, prefer TypeScript's extend functionality.
**/
private static extend(properties: any, classProperties?: any): any;
static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality
/**
* Routes hash or a method returning the routes hash that maps URLs with parameters to methods on your Router.
* For assigning routes as object hash, do it like this: this.routes = <any>{ "route": callback, ... };
* That works only if you set it in the constructor or the initialize method.
**/
routes(): any;
constructor(options?: RouterOptions);
initialize(options?: RouterOptions): void;
@@ -256,9 +273,9 @@ declare module Backbone {
navigate(fragment: string, options?: NavigateOptions): Router;
navigate(fragment: string, trigger?: boolean): Router;
_bindRoutes(): void;
_routeToRegExp(route: string): RegExp;
_extractParameters(route: RegExp, fragment: string): string[];
private _bindRoutes(): void;
private _routeToRegExp(route: string): RegExp;
private _extractParameters(route: RegExp, fragment: string): string[];
}
var history: History;
@@ -278,13 +295,14 @@ declare module Backbone {
loadUrl(fragmentOverride: string): boolean;
navigate(fragment: string, options?: any): boolean;
started: boolean;
options: any;
_updateHash(location: Location, fragment: string, replace: boolean): void;
private _updateHash(location: Location, fragment: string, replace: boolean): void;
}
interface ViewOptions {
model?: Backbone.Model;
collection?: Backbone.Collection;
interface ViewOptions<TModel extends Model> {
model?: TModel;
collection?: Backbone.Collection<TModel>;
el?: any;
id?: string;
className?: string;
@@ -292,35 +310,41 @@ declare module Backbone {
attributes?: any[];
}
interface OptionalEvents {
events?(): any;
}
class View<TModel extends Model> extends Events {
class View extends Events implements OptionalEvents {
/**
* Do not use, prefer TypeScript's extend functionality.
**/
private static extend(properties: any, classProperties?: any): any;
static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality
constructor(options?: ViewOptions<TModel>);
constructor(options?: ViewOptions);
/**
* Events hash or a method returning the events hash that maps events/selectors to methods on your View.
* For assigning events as object hash, do it like this: this.events = <any>{ "event:selector": callback, ... };
* That works only if you set it in the constructor or the initialize method.
**/
events(): any;
$(selector: string): JQuery;
model: Model;
collection: Collection;
make(tagName: string, attrs?: any, opts?: any): View;
setElement(element: HTMLElement, delegate?: boolean): View;
setElement(element: JQuery, delegate?: boolean): View;
model: TModel;
collection: Collection<TModel>;
//template: (json, options?) => string;
make(tagName: string, attrs?: any, opts?: any): View<TModel>;
setElement(element: HTMLElement, delegate?: boolean): View<TModel>;
setElement(element: JQuery, delegate?: boolean): View<TModel>;
id: string;
cid: string;
className: string;
tagName: string;
options: any;
el: any;
$el: JQuery;
setElement(element: any): View;
setElement(element: any): View<TModel>;
attributes: any;
$(selector: any): JQuery;
render(): View;
remove(): View;
render(): View<TModel>;
remove(): View<TModel>;
make(tagName: any, attributes?: any, content?: any): any;
delegateEvents(events?: any): any;
undelegateEvents(): any;
@@ -330,14 +354,13 @@ declare module Backbone {
// SYNC
function sync(method: string, model: Model, options?: JQueryAjaxSettings): any;
function ajax(options?: JQueryAjaxSettings): JQueryXHR;
var emulateHTTP: boolean;
var emulateJSONBackbone: boolean;
// Utility
function noConflict(): typeof Backbone;
function setDomLibrary(jQueryNew: any): any;
var $: JQueryStatic;
}
declare module "backbone" {
+3 -3
View File
@@ -23,7 +23,7 @@ class TestModel extends Backbone.Model {
}
class TestCollection extends Backbone.Collection {
class TestCollection extends Backbone.Collection<TestModel> {
constructor(models?: any, options?: any) {
this.model = TestModel;
@@ -41,11 +41,11 @@ class TestCollection extends Backbone.Collection {
}
}
class TestView extends Backbone.View {
class TestView extends Backbone.View<TestModel> {
gridView: Backgrid.Grid;
testCollection: TestCollection;
constructor(viewOptions?: Backbone.ViewOptions) {
constructor(viewOptions?: Backbone.ViewOptions<TestModel>) {
this.testCollection = new TestCollection();
this.gridView = new Backgrid.Grid({
columns: [new Backgrid.Column({name: "FirstName", cell: "string", label: "First Name"}),
+10 -10
View File
@@ -9,20 +9,20 @@ declare module Backgrid {
interface GridOptions {
columns: Column[];
collection: Backbone.Collection;
collection: Backbone.Collection<Backbone.Model>;
header: Header;
body: Body;
row: Row;
footer: Footer;
}
class Header extends Backbone.View {
class Header extends Backbone.View<Backbone.Model> {
}
class Footer extends Backbone.View {
class Footer extends Backbone.View<Backbone.Model> {
}
class Row extends Backbone.View {
class Row extends Backbone.View<Backbone.Model> {
}
class Command {
@@ -50,19 +50,19 @@ declare module Backgrid {
initialize(options?: any);
}
class Body extends Backbone.View {
class Body extends Backbone.View<Backbone.Model> {
tagName: string;
initialize(options?: any);
insertRow(model: Backbone.Model, collection: Backbone.Collection, options: any);
insertRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
moveToNextCell(model: Backbone.Model, cell: Column, command: Command);
refresh(): Body;
remove(): Body;
removeRow(model: Backbone.Model, collection: Backbone.Collection, options: any);
removeRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
render(): Body;
}
class Grid extends Backbone.View {
class Grid extends Backbone.View<Backbone.Model> {
body: Backgrid.Body;
className: string;
footer: any;
@@ -72,10 +72,10 @@ declare module Backgrid {
initialize(options: any);
getSelectedModels(): Backbone.Model[];
insertColumn(...options: any[]): Grid;
insertRow(model: Backbone.Model, collection: Backbone.Collection, options: any);
insertRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
remove():Grid;
removeColumn(...options: any[]): Grid;
removeRow(model: Backbone.Model, collection: Backbone.Collection, options: any);
removeRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
render():Grid;
}
+114
View File
@@ -0,0 +1,114 @@
/// <reference path="big-integer.d.ts" />
// constructor tests
var noArgument = bigInt(),
numberArgument = bigInt( 93 ),
stringArgument = bigInt( "75643564363473453456342378564387956906736546456235345" ),
bigIntArgument = bigInt( noArgument );
// method tests
var x = bigInt(),
isBigInteger: BigInteger,
isNumber: number,
isBoolean: boolean,
isString: string,
isDivmod: {
quotient: BigInteger;
remainder: BigInteger;
};
isBigInteger = x.abs();
isBigInteger = x.add( 0 );
isBigInteger = x.add( x );
isBigInteger = x.add( "100" );
isBigInteger = x.compare( 0 );
isBigInteger = x.compare( x );
isBigInteger = x.compare( "100" );
isBigInteger = x.compareAbs( 0 );
isBigInteger = x.compareAbs( x );
isBigInteger = x.compareAbs( "100" );
isBigInteger = x.divide( 0 );
isBigInteger = x.divide( x );
isBigInteger = x.divide( "100" );
isDivmod = x.divmod( 0 );
isDivmod = x.divmod( x );
isDivmod = x.divmod( "100" );
isBoolean = x.equals( 0 );
isBoolean = x.equals( x );
isBoolean = x.equals( "100" );
isBoolean = x.greater( 0 );
isBoolean = x.greater( x );
isBoolean = x.greater( "100" );
isBoolean = x.greaterOrEquals( 0 );
isBoolean = x.greaterOrEquals( x );
isBoolean = x.greaterOrEquals( "100" );
isBoolean = x.isEven();
isBoolean = x.isNegative();
isBoolean = x.isOdd();
isBoolean = x.isPositive();
isBoolean = x.lesser( 0 );
isBoolean = x.lesser( x );
isBoolean = x.lesser( "100" );
isBoolean = x.lesserOrEquals( 0 );
isBoolean = x.lesserOrEquals( x );
isBoolean = x.lesserOrEquals( "100" );
isBigInteger = x.minus( 0 );
isBigInteger = x.minus( x );
isBigInteger = x.minus( "100" );
isBigInteger = x.mod( 0 );
isBigInteger = x.mod( x );
isBigInteger = x.mod( "100" );
isBigInteger = x.multiply( 0 );
isBigInteger = x.multiply( x );
isBigInteger = x.multiply( "100" );
isBigInteger = x.next();
isBoolean = x.notEquals( 0 );
isBoolean = x.notEquals( x );
isBoolean = x.notEquals( "100" );
isBigInteger = x.over( 0 );
isBigInteger = x.over( x );
isBigInteger = x.over( "100" );
isBigInteger = x.plus( 0 );
isBigInteger = x.plus( x );
isBigInteger = x.plus( "100" );
isBigInteger = x.pow( 0 );
isBigInteger = x.pow( x );
isBigInteger = x.pow( "100" );
isBigInteger = x.prev();
isBigInteger = x.subtract( 0 );
isBigInteger = x.subtract( x );
isBigInteger = x.subtract( "100" );
isBigInteger = x.times( 0 );
isBigInteger = x.times( x );
isBigInteger = x.times( "100" );
isNumber = x.toJSNumber();
isString = x.toString();
isNumber = x.valueOf();
+202
View File
@@ -0,0 +1,202 @@
// Type definitions for BigInteger.js
// Project: https://github.com/peterolson/BigInteger.js
// Definitions by: Ingo Bürk <https://github.com/Airblader>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface BigInteger {
/** Returns the absolute value of a bigInt. */
abs(): BigInteger;
/** Performs addition */
add( number: number ): BigInteger;
/** Performs addition */
add( number: BigInteger ): BigInteger;
/** Performs addition */
add( number: string ): BigInteger;
/** Alias for the add method. */
plus( number: number ): BigInteger;
/** Alias for the add method. */
plus( number: BigInteger ): BigInteger;
/** Alias for the add method. */
plus( number: string ): BigInteger;
/** Alias for the subtract method. */
minus( number: number ): BigInteger;
/** Alias for the subtract method. */
minus( number: BigInteger ): BigInteger;
/** Alias for the subtract method. */
minus( number: string ): BigInteger;
/** Performs subtraction. */
subtract( number: number ): BigInteger;
/** Performs subtraction. */
subtract( number: BigInteger ): BigInteger;
/** Performs subtraction. */
subtract( number: string ): BigInteger;
/** Performs multiplication. */
multiply( number: number ): BigInteger;
/** Performs multiplication. */
multiply( number: BigInteger ): BigInteger;
/** Performs multiplication. */
multiply( number: string ): BigInteger;
/** Alias for the multiply method. */
times( number: number ): BigInteger;
/** Alias for the multiply method. */
times( number: BigInteger ): BigInteger;
/** Alias for the multiply method. */
times( number: string ): BigInteger;
/** Performs integer division, disregarding the remainder. */
divide( number: number ): BigInteger;
/** Performs integer division, disregarding the remainder. */
divide( number: BigInteger ): BigInteger;
/** Performs integer division, disregarding the remainder. */
divide( number: string ): BigInteger;
/** Alias for the divide method. */
over( number: number ): BigInteger;
/** Alias for the divide method. */
over( number: BigInteger ): BigInteger;
/** Alias for the divide method. */
over( number: string ): BigInteger;
/** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */
pow( number: number ): BigInteger;
/** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */
pow( number: BigInteger ): BigInteger;
/** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */
pow( number: string ): BigInteger;
/** Adds one to the number. */
next(): BigInteger;
/** Subtracts one from the number. */
prev(): BigInteger;
/** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */
mod( number: number ): BigInteger;
/** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */
mod( number: BigInteger ): BigInteger;
/** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */
mod( number: string ): BigInteger;
/** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */
divmod( number: number ): { quotient: BigInteger; remainder: BigInteger };
/** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */
divmod( number: BigInteger ): { quotient: BigInteger; remainder: BigInteger };
/** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */
divmod( number: string ): { quotient: BigInteger; remainder: BigInteger };
/** Checks if the first number is greater than the second. */
greater( number: number ): boolean;
/** Checks if the first number is greater than the second. */
greater( number: BigInteger ): boolean;
/** Checks if the first number is greater than the second. */
greater( number: string ): boolean;
/** Checks if the first number is greater than or equal to the second. */
greaterOrEquals( number: number ): boolean;
/** Checks if the first number is greater than or equal to the second. */
greaterOrEquals( number: BigInteger ): boolean;
/** Checks if the first number is greater than or equal to the second. */
greaterOrEquals( number: string ): boolean;
/** Checks if the first number is lesser than the second. */
lesser( number: number ): boolean;
/** Checks if the first number is lesser than the second. */
lesser( number: BigInteger ): boolean;
/** Checks if the first number is lesser than the second. */
lesser( number: string ): boolean;
/** Checks if the first number is less than or equal to the second. */
lesserOrEquals( number: number ): boolean;
/** Checks if the first number is less than or equal to the second. */
lesserOrEquals( number: BigInteger ): boolean;
/** Checks if the first number is less than or equal to the second. */
lesserOrEquals( number: string ): boolean;
/** Returns true if the number is even, false otherwise. */
isEven(): boolean;
/** Returns true if the number is odd, false otherwise. */
isOdd(): boolean;
/** Return true if the number is positive, false otherwise. Returns true for 0 and false for -0. */
isPositive(): boolean;
/** Returns true if the number is negative, false otherwise. Returns false for 0 and true for -0. */
isNegative(): boolean;
/**
* Performs a comparison between two numbers. If the numbers are equal, it returns 0.
* If the first number is greater, it returns 1. If the first number is lesser, it returns -1.
*/
compare( number: number ): BigInteger;
/**
* Performs a comparison between two numbers. If the numbers are equal, it returns 0.
* If the first number is greater, it returns 1. If the first number is lesser, it returns -1.
*/
compare( number: BigInteger ): BigInteger;
/**
* Performs a comparison between two numbers. If the numbers are equal, it returns 0.
* If the first number is greater, it returns 1. If the first number is lesser, it returns -1.
*/
compare( number: string ): BigInteger;
/** Performs a comparison between the absolute value of two numbers. */
compareAbs( number: number ): BigInteger;
/** Performs a comparison between the absolute value of two numbers. */
compareAbs( number: BigInteger ): BigInteger;
/** Performs a comparison between the absolute value of two numbers. */
compareAbs( number: string ): BigInteger;
/** Checks if two numbers are equal. */
equals( number: number ): boolean;
/** Checks if two numbers are equal. */
equals( number: BigInteger ): boolean;
/** Checks if two numbers are equal. */
equals( number: string ): boolean;
/** Checks if two numbers are not equal. */
notEquals( number: number ): boolean;
/** Checks if two numbers are not equal. */
notEquals( number: BigInteger ): boolean;
/** Checks if two numbers are not equal. */
notEquals( number: string ): boolean;
/** Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. */
toJSNumber(): number;
/** Converts a bigInt to a string. */
toString(): string;
/** Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion. */
valueOf(): number;
}
interface BigIntegerStatic {
/** Equivalent to bigInt(1) */
one: BigInteger;
/** Equivalent to bigInt(0) */
zero: BigInteger;
/** Equivalent to bigInt(-1) */
minusOne: BigInteger;
/** Equivalent to bigInt(0) */
(): BigInteger;
/** Parse a Javascript number into a bigInt */
( number: number ): BigInteger;
/** Parse a string into a bigInt */
( string: string ): BigInteger;
/** no-op */
( bigInt: BigInteger ): BigInteger;
}
declare var bigInt: BigIntegerStatic;
declare module "big-integer" {
export = bigInt;
}
+2 -2
View File
@@ -382,7 +382,7 @@ declare module breeze {
executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Q.Promise<QueryResult>;
executeQueryLocally(query: EntityQuery): Entity[];
exportEntities(entities?: Entity[]): string;
exportEntities(entities?: Entity[], includeMetadata?: boolean): string;
fetchEntityByKey(typeName: string, keyValue: any, checkLocalCacheFirst?: boolean): Q.Promise<EntityByKeyResult>;
fetchEntityByKey(typeName: string, keyValues: any[], checkLocalCacheFirst?: boolean): Q.Promise<EntityByKeyResult>;
fetchEntityByKey(entityKey: EntityKey, checkLocalCacheFirst?: boolean): Q.Promise<EntityByKeyResult>;
@@ -877,7 +877,7 @@ declare module breeze.config {
var dataService: string;
var functionRegistry: Object;
export function getAdapter(interfaceName: string, adapterName: string): Object;
export function getAdapterInstance(interfaceName: string, adapterName: string): Object;
export function getAdapterInstance(interfaceName: string, adapterName?: string): Object;
export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault: boolean): void;
export function initializeAdapterInstances(config: Object): void;
var interfaceInitialized: Event;
+17 -16
View File
@@ -6,27 +6,28 @@
/// <reference path="../node/node.d.ts" />
declare module "browser-harness" {
import _events = require('events');
interface HarnessEvents extends NodeEventEmitter {
once(event: string, listener: (driver: Driver) => void): NodeEventEmitter;
once(event: 'ready', listener: (driver: Driver) => void): NodeEventEmitter;
interface HarnessEvents extends _events.EventEmitter {
once(event: string, listener: (driver: Driver) => void): _events.EventEmitter;
once(event: 'ready', listener: (driver: Driver) => void): _events.EventEmitter;
on(event: string, listener: (driver: Driver) => void): NodeEventEmitter;
on(event: 'ready', listener: (driver: Driver) => void): NodeEventEmitter;
on(event: string, listener: (driver: Driver) => void): _events.EventEmitter;
on(event: 'ready', listener: (driver: Driver) => void): _events.EventEmitter;
}
interface DriverEvents extends NodeEventEmitter {
once(event: string, listener: (text: string) => void): NodeEventEmitter;
once(event: 'console.log', listener: (text: string) => void): NodeEventEmitter;
once(event: 'console.warn', listener: (text: string) => void): NodeEventEmitter;
once(event: 'console.error', listener: (text: string) => void): NodeEventEmitter;
once(event: 'window.onerror', listener: (text: string) => void): NodeEventEmitter;
interface DriverEvents extends _events.EventEmitter {
once(event: string, listener: (text: string) => void): _events.EventEmitter;
once(event: 'console.log', listener: (text: string) => void): _events.EventEmitter;
once(event: 'console.warn', listener: (text: string) => void): _events.EventEmitter;
once(event: 'console.error', listener: (text: string) => void): _events.EventEmitter;
once(event: 'window.onerror', listener: (text: string) => void): _events.EventEmitter;
on(event: string, listener: (text: string) => void): NodeEventEmitter;
on(event: 'console.log', listener: (text: string) => void): NodeEventEmitter;
on(event: 'console.warn', listener: (text: string) => void): NodeEventEmitter;
on(event: 'console.error', listener: (text: string) => void): NodeEventEmitter;
on(event: 'window.onerror', listener: (text: string) => void): NodeEventEmitter;
on(event: string, listener: (text: string) => void): _events.EventEmitter;
on(event: 'console.log', listener: (text: string) => void): _events.EventEmitter;
on(event: 'console.warn', listener: (text: string) => void): _events.EventEmitter;
on(event: 'console.error', listener: (text: string) => void): _events.EventEmitter;
on(event: 'window.onerror', listener: (text: string) => void): _events.EventEmitter;
}
export interface Driver {
+2 -2
View File
@@ -5,7 +5,7 @@
/// <reference path="../node/node.d.ts" />
interface BrowserifyObject extends NodeEventEmitter {
interface BrowserifyObject extends NodeJS.EventEmitter {
add(file: string): BrowserifyObject;
require(file: string, opts?: {
expose: string;
@@ -16,7 +16,7 @@ interface BrowserifyObject extends NodeEventEmitter {
debug?: boolean;
standalone?: string;
insertGlobalVars?: any;
}, cb?: (err: any, src: any) => void): ReadableStream;
}, cb?: (err: any, src: any) => void): NodeJS.ReadableStream;
external(file: string): BrowserifyObject;
ignore(file: string): BrowserifyObject;
+1 -1
View File
@@ -3,6 +3,6 @@
import bufferEqual = require('buffer-equal');
var bool: boolean;
var buf: NodeBuffer;
var buf: Buffer;
bool = bufferEqual(buf, buf);
+1 -1
View File
@@ -6,6 +6,6 @@
/// <reference path="../node/node.d.ts" />
declare module 'buffer-equal' {
function bufferEqual(actual:NodeBuffer, expected:NodeBuffer): boolean;
function bufferEqual(actual:Buffer, expected:Buffer): boolean;
export = bufferEqual;
}
+25
View File
@@ -20,12 +20,14 @@ interface Casper extends EventEmitter {
constructor (options: CasperOptions): Casper;
options: CasperOptions;
// Properties
__utils__: ClientUtils;
// Methods
back(): Casper;
base64encode(url: string, method?: string, data?: any): string;
bypass(nb: number): any;
click(selector: string): boolean;
clickLabel(label: string, tag?: string): boolean;
capture(targetFilePath: string, clipRect: ClipRect): Casper;
@@ -49,11 +51,15 @@ interface Casper extends EventEmitter {
forward(): Casper;
log(message: string, level?: string, space?: string): Casper;
fill(selector: string, values: any, submit?: boolean): void;
fillSelectors(selector: string, values: any, submit?: boolean): void;
fillXPath(selector: string, values: any, submit?: boolean): void;
getCurrentUrl(): string;
getElementAttribute(selector: string, attribute: string): string;
getElementsAttribute(selector: string, attribute: string): string;
getElementBounds(selector: string): ElementBounds;
getElementsBounds(selector: string): ElementBounds[];
getElementInfo(selector: string): ElementInfo;
getElementsInfo(selector: string): ElementInfo;
getFormValues(selector: string): any;
getGlobal(name: string): any;
getHTML(selector?: string, outer?: boolean): string;
@@ -66,24 +72,33 @@ interface Casper extends EventEmitter {
resourceExists(test: Function): boolean;
resourceExists(test: string): boolean;
run(onComplete: Function, time?: number): Casper;
scrollTo(x: number, y: number): Casper;
scrollToBottom(): Casper;
sendKeys(selector: string, keys: string, options?: any): Casper;
setHttpAuth(username: string, password: string): Casper;
start(url?: string, then?: (response: HttpResponse) => void): Casper;
status(asString: boolean): any;
then(fn: (self?: Casper) => void): Casper;
thenBypass(nb: number): Casper;
thenBypassIf(condition: any, nb: number): Casper;
thenBypassUnless(condition: any, nb: number): Casper;
thenClick(selector: string): Casper;
thenEvaluate(fn: () => any, ...args: any[]): Casper;
thenOpen(location: string, then?: (response: HttpResponse) => void): Casper;
thenOpen(location: string, options?: OpenSettings, then?: (response: HttpResponse) => void): Casper;
thenOpenAndEvaluate(location: string, then?: Function, ...args: any[]): Casper;
toString(): string;
unwait(): Casper;
userAgent(agent: string): string;
viewport(width: number, height: number): Casper;
visible(selector: string): boolean;
wait(timeout: number, then?: Function): Casper;
waitFor(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper;
waitForAlert(then: Function, onTimeout?: Function, timeout?: number): Casper;
waitForPopup(urlPattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper;
waitForPopup(urlPattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper;
waitForUrl(url: string, then?: Function, onTimeout?: Function, timeout?: number): Casper;
waitForUrl(url: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper;
waitForSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper;
waitWhileSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper;
waitForResource(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper;
@@ -157,10 +172,12 @@ interface CasperOptions {
pageSettings?: any;
remoteScripts?: any[];
safeLogs?: boolean;
silentErrors?: boolean;
stepTimeout?: number;
timeout?: number;
verbose?: boolean;
viewportSize?: any;
retryTimeout?: number;
waitTimeout?: number;
}
@@ -200,6 +217,9 @@ interface Tester {
assertExists(selector: string, message?: string): any;
assertFalsy(subject: any, message?: string): any;
assertField(inputName: string, expected: string, message?: string): any;
assertFieldName(inputName: string, expected: string, message?: string, options?: any): any;
assertFieldCSS(cssSelector: string, expected: string, message?: string): any;
assertFieldXPath(xpathSelector: string, expected: string, message?: string): any;
assertHttpStatus(status: number, message?: string): any;
assertMatch(subject: any, pattern: RegExp, message?: string): any;
assertNot(subject: any, message?: string): any;
@@ -216,6 +236,7 @@ interface Tester {
assertTitleMatch(pattern: RegExp, message?: string): any;
assertTruthy(subject: any, message?: string): any;
assertType(input: any, type: string, message?: string): any;
assertInstanceOf(input: any, ctor: Function, message?: string): any;
assertUrlMatch(pattern: string, message?: string): any;
assertUrlMatch(pattern: RegExp, message?: string): any;
assertVisible(selector: string, message?: string): any;
@@ -237,6 +258,10 @@ interface Tester {
info(message: string): any;
pass(message: string): any;
renderResults(exit: boolean, status: number, save: string): any;
setup(fn: Function): any;
skip(nb: number, message: string): any;
tearDown(fn: Function): any;
}
interface Cases {
+47
View File
@@ -0,0 +1,47 @@
/// <reference path="../chai/chai.d.ts" />
/// <reference path="../chai/chai-assert.d.ts" />
/// <reference path="chai-datetime.d.ts" />
var expect = chai.expect;
function test_equalTime(){
var date: Date = new Date(2014, 1, 1);
expect(date).to.be.equalTime(date);
date.should.be.equalTime(date);
assert.equalTime(date, date);
}
function test_beforeTime(){
var date: Date = new Date(2014, 1, 1);
expect(date).to.be.beforeTime(date);
date.should.be.beforeTime(date);
assert.beforeTime(date, date);
}
function test_afterTime(){
var date: Date = new Date(2014, 1, 1);
expect(date).to.be.afterTime(date);
date.should.be.afterTime(date);
assert.afterTime(date, date);
}
function test_equalDate(){
var date: Date = new Date(2014, 1, 1);
expect(date).to.equalDate(date);
date.should.equalDate(date);
assert.equalDate(date, date);
}
function test_beforeDate(){
var date: Date = new Date(2014, 1, 1);
expect(date).to.beforeDate(date);
date.should.beforeDate(date);
assert.beforeDate(date, date);
}
function test_afterDate(){
var date: Date = new Date(2014, 1, 1);
expect(date).to.afterDate(date);
date.should.afterDate(date);
assert.afterDate(date, date);
}
+39
View File
@@ -0,0 +1,39 @@
// Type definitions for chai-datetime
// Project: https://github.com/gaslight/chai-datetime.git
// Definitions by: Cliff Burger <https://github.com/cliffburger/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../chai/chai.d.ts" />
declare module chai {
interface Expect {
afterDate(date: Date): boolean;
beforeDate(date: Date): boolean;
equalDate(date: Date): boolean;
afterTime(date: Date): boolean;
beforeTime(date: Date): boolean;
equalTime(date: Date): boolean;
}
interface Assert {
equalTime(val: Date, exp: Date, msg?: string): boolean;
notEqualTime(val: Date, exp: Date, msg?: string): boolean;
beforeTime(val: Date, exp: Date, msg?: string): boolean;
notBeforeTime(val: Date, exp: Date, msg?: string): boolean;
afterTime(val: Date, exp: Date, msg?: string): boolean;
notAfterTime(val: Date, exp: Date, msg?: string): boolean;
equalDate(val: Date, exp: Date, msg?: string): boolean;
notEqualDate(val: Date, exp: Date, msg?: string): boolean;
beforeDate(val: Date, exp: Date, msg?: string): boolean;
notBeforeDate(val: Date, exp: Date, msg?: string): boolean;
afterDate(val: Date, exp: Date, msg?: string): boolean;
notAfterDate(val: Date, exp: Date, msg?: string): boolean;
}
}
interface Date {
should: chai.Expect;
}
-1
View File
@@ -1 +0,0 @@
""
+16 -16
View File
@@ -9,28 +9,28 @@ declare module chai {
function expect(target: any, message?: string): Expect;
// Provides a way to extend the internals of Chai
function use(fn: (chai: any, utils: any) => void);
function use(fn: (chai: any, utils: any) => void): any;
interface ExpectStatic {
(target: any): Expect;
}
interface Assertions {
attr(name, value?);
css(name, value?);
data(name, value?);
class(className);
id(id);
html(html);
text(text);
value(value);
visible;
hidden;
selected;
checked;
disabled;
empty;
exist;
attr(name: string, value?: string): any;
css(name: string, value?: string): any;
data(name: string, value?: string): any;
class(className: string): any;
id(id: string): any;
html(html: string): any;
text(text: string): any;
value(value: string): any;
visible: any;
hidden: any;
selected: any;
checked: any;
disabled: any;
empty: any;
exist: any;
}
interface Expect extends LanguageChains, NumericComparison, TypeComparison, Assertions {
-1
View File
@@ -1 +0,0 @@
""
+6
View File
@@ -1824,6 +1824,10 @@ declare module chrome.tabs {
addListener(callback: (activeInfo: TabActiveInfo) => void): void;
}
interface TabReplacedEvent extends chrome.events.Event {
addListener(callback: (addedTabId: number, removedTabId: number) => void): void;
}
export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void;
export function executeScript(tabId: number, details: InjectDetails, callback?: (result: any[]) => void): void;
export function get(tabId: number, callback: (tab: Tab) => void): void;
@@ -1831,6 +1835,7 @@ declare module chrome.tabs {
export function create(createProperties: CreateProperties, callback?: (tab: Tab) => void): void;
export function move(tabId: number, moveProperties: MoveProperties, callback?: (tab: Tab) => void): void;
export function move(tabIds: number[], moveProperties: MoveProperties, callback?: (tabs: Tab[]) => void): void;
export function update(updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
export function update(tabId: number, updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
export function remove(tabId: number, callback?: Function): void;
export function remove(tabIds: number[], callback?: Function): void;
@@ -1856,6 +1861,7 @@ declare module chrome.tabs {
var onDetached: TabDetachedEvent;
var onCreated: TabCreatedEvent;
var onActivated: TabActivatedEvent;
var onReplaced: TabReplacedEvent;
}
////////////////////
+9
View File
@@ -0,0 +1,9 @@
import clone = require("clone");
var original = {
key: "value"
};
var copy = clone(original);
copy = clone(original, false);
copy = clone(original, true);
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for clone 0.1.11
// Project: https://github.com/pvorb/node-clone
// Definitions by: Kieran Simpson <https://github.com/kierans/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* See clone JS source for API docs
*/
declare module "clone" {
/**
* @param parent
* @param circular If not given, defaults to true in JS lib.
*/
function clone(parent: Object, circular?: boolean): Object
export = clone
}
+4
View File
@@ -3,6 +3,10 @@
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "colors" {
export function setTheme(theme:any):any;
}
interface String {
bold:string;
italic:string;
+27
View File
@@ -0,0 +1,27 @@
/// <reference path="consolidate.d.ts" />
import consolidate = require('consolidate');
var path: string = null;
var options: any = null;
var fn: any = null;
consolidate.clearCache();
consolidate.jade(path, options, fn);
consolidate.dust(path, options, fn);
consolidate.swig(path, options, fn);
consolidate.liquor(path, options, fn);
consolidate.ejs(path, options, fn);
consolidate.eco(path, options, fn);
consolidate.jazz(path, options, fn);
consolidate.jqtpl(path, options, fn);
consolidate.haml(path, options, fn);
consolidate.whiskers(path, options, fn);
//consolidate.'haml-coffee':Function;
consolidate.hogan(path, options, fn);
consolidate.handlebars(path, options, fn);
consolidate.underscore(path, options, fn);
consolidate.qejs(path, options, fn);
consolidate.walrus(path, options, fn);
consolidate.mustache(path, options, fn);
consolidate.dot(path, options, fn);
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for consolidate
// Project: https://github.com/visionmedia/consolidate.js
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts
/// <reference path="../node/node.d.ts" />
declare module "consolidate" {
export function clearCache(): void;
export var jade: (path: String, options: any, fn: any) => void;
export var dust: (path: String, options: any, fn: any) => void;
export var swig: (path: String, options: any, fn: any) => void;
export var liquor: (path: String, options: any, fn: any) => void;
export var ejs: (path: String, options: any, fn: any) => void;
export var eco: (path: String, options: any, fn: any) => void;
export var jazz: (path: String, options: any, fn: any) => void;
export var jqtpl: (path: String, options: any, fn: any) => void;
export var haml: (path: String, options: any, fn: any) => void;
export var whiskers: (path: String, options: any, fn: any) => void;
//export var 'haml-coffee':Function;
export var hogan: (path: String, options: any, fn: any) => void;
export var handlebars: (path: String, options: any, fn: any) => void;
export var underscore: (path: String, options: any, fn: any) => void;
export var qejs: (path: String, options: any, fn: any) => void;
export var walrus: (path: String, options: any, fn: any) => void;
export var mustache: (path: String, options: any, fn: any) => void;
export var dot: (path: String, options: any, fn: any) => void;
}
+229
View File
@@ -0,0 +1,229 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
/// <reference path="cordova.d.ts"/>
// Apache Cordova core
//----------------------------------------------------------------------
console.log('cordova.version: ' + cordova.version + ', cordova.platformId: ' + cordova.platformId);
cordova.exec(null, null, "NativeClassName", "MethodName");
cordova.define('mymodule', (require, exports, module) => { });
var myModule = cordova.require('mymodule');
var argsCheck: ArgsCheck = <ArgsCheck>cordova.require('cordova/argcheck');
argsCheck.checkArgs('ssA', 'cordova.exec', [() => { }, () => { }, 'window', 'openDatabase']);
// Battery status plugin
//----------------------------------------------------------------------
window.addEventListener('batterystatus',
(ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); });
window.addEventListener('batterycritical',
()=> { alert('Battery is critical low!'); });
// Camera plugin
//----------------------------------------------------------------------
navigator.camera.getPicture(
(data: string) => { alert('Got photo!'); },
(message: string)=> { alert('Failed!: ' + message); },
{
allowEdit: true,
cameraDirection: Camera.Direction.BACK,
destinationType: Camera.DestinationType.FILE_URI,
encodingType: Camera.EncodingType.JPEG,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
quality: 80
});
// Contacts plugin
//----------------------------------------------------------------------
var contact: Contact = navigator.contacts.create({
nickname: 'John Smith',
displayName: 'John Smith',
phoneNumbers: [{ pref: true, type: "work", value: "+185642556856" }]
});
navigator.contacts.find(["phoneNumbers"],
(contacts: Contact[])=> { alert('Find ' + contacts.length + ' contacts'); },
(error: ContactError) => { alert('Error: ' + error.message); },
{
filter: "+1",
multiple: true
}
);
// Device API
//----------------------------------------------------------------------
console.log(JSON.stringify(device));
// DeviceMotion plugin
//----------------------------------------------------------------------
navigator.accelerometer.getCurrentAcceleration(
(acc: Acceleration) => { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); },
() => { alert('Error!'); });
var acchandle: WatchHandle = navigator.accelerometer.watchAcceleration(
(acc: Acceleration)=> { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); },
() => { alert('Error!'); },
{ frequency: 10 });
navigator.accelerometer.clearWatch(acchandle);
// DeviceOrientation plugin
//----------------------------------------------------------------------
navigator.compass.getCurrentHeading(
(heading: CompassHeading)=> { console.log('Got heading to ' + heading.magneticHeading); },
(error: CompassError)=> { alert('Error! ' + error.code); },
{ frequency: 10 });
var accelhandle = navigator.compass.watchHeading(
(heading: CompassHeading) => { console.log('Got heading to ' + heading.magneticHeading); },
(error: CompassError) => { alert('Error! ' + error.code); },
{ frequency: 10 });
navigator.compass.clearWatch(accelhandle);
// Dialogs plugin
//----------------------------------------------------------------------
navigator.notification.alert('Alert!', () => { alert('You\'re alerted'); }, 'Alert', 'Ok');
navigator.notification.confirm('Are you ok?', (choice: number) => { alert('Your choice is ' + choice); });
// FileSystem plugin
//----------------------------------------------------------------------
function fsaccessor(fs: FileSystem) {
console.log('FS root is: ' + fs.root.name);
var fsreader: DirectoryReader = fs.root.createReader();
fsreader.readEntries(
(entries: Entry[]) => { console.log(fs.root.name + ' has ' + entries.length + ' child elements'); },
(err: Error)=> { alert('Error: ' + err.message); });
}
window.requestFileSystem(
window.TEMPORARY,
1024 * 1024 * 5,
fsaccessor,
(err: Error) => { alert('Error: ' + err.message); });
// FileTransfer plugin
//----------------------------------------------------------------------
var file = new FileTransfer();
file.download('http://some.server.com/download.php',
'cdvfile://localhost/persistent/path/to/downloads/',
(file: FileEntry)=> { console.log('File Downloaded to ' + file.fullPath); },
(err: FileTransferError)=> { alert('Error ' + err.code); },
{ headers: null },
true);
// InAppBrowser plugin
//----------------------------------------------------------------------
// signature of window.open() added by InAppBrowser plugin
// is similar to native window.open signature, so the compiler can's
// select proper overload, but we cast result to InAppBrowser manually.
var iab = <InAppBrowser>window.open('google.com', '_self');
iab.addEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Start opening ' + ev.url); });
iab.show();
// Globalization plugin
//----------------------------------------------------------------------
navigator.globalization.dateToString(new Date(),
(date) => { console.log(JSON.stringify(date)); },
(error) => { alert(error.message); },
{ formatLength: "short", selector: "date" });
navigator.globalization.getDateNames(
(names) => {
names.value.forEach((name) => { console.log(name); });
},
(error) => { alert(error.message); },
{ item: "months", type: "wide" });
// Media and Media Capture
//----------------------------------------------------------------------
var media = new Media('',
() => { console.log('Media opened'); },
(err: MediaError) => { alert('Error: ' + err.code); });
media.play();
media.setVolume(10);
console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes));
navigator.device.capture.captureAudio(
(captures: MediaFile[])=> { console.log(captures.length + ' captured'); },
(err: CaptureError)=> { alert('Error ' + err.message); },
{
limit: 3,
duration: 10
});
// Push Notifications
//----------------------------------------------------------------------
var pushNotification = window.plugins.pushNotification;
pushNotification.register(
(regId: string) => { console.log('Successfully registered'); },
(err: any) => { alert('Error!'); },
{
channelName: "your_channel_name",
ecb: "onNotification"
});
function onNotification(e: any) {
navigator.notification.alert(e.text2, () => { }, e.text1);
}
window.plugins.pushNotification.unregister(() => { }, () => { });
// Network Plugin
//----------------------------------------------------------------------
console.log('Connection type is: ' + navigator.connectionSpeed);
var connType = navigator.connection.type;
if (connType == Connection.WIFI) {
console.log('Congratulations, you\'re with fast Internet!');
}
document.addEventListener('offline', () => { alert('You\'re offline!'); });
// SplashScreen plugin
//----------------------------------------------------------------------
navigator.splashscreen.show();
navigator.splashscreen.hide();
// WebSQL plugin
//----------------------------------------------------------------------
var db = window.openDatabase('Test', '0.1', 'test', 1024 * 1024 * 5);
db.transaction(
(tx: SqlTransaction) => {
tx.executeSql('CREATE TABLE Sample IF NOT EXIST...');
tx.executeSql('INSERT INTO Sample VALUES...');
},
(err: SqlError) => {
if (err.code = SqlError.SYNTAX_ERR) {
alert('Error ' + err.message);
}
},
() => { console.log('Transaction completed successfully'); }
);
// Vibration plugin
//----------------------------------------------------------------------
navigator.notification.vibrate(100);
+60
View File
@@ -0,0 +1,60 @@
// Type definitions for Apache Cordova.
// Project: http://cordova.apache.org
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
/// <reference path="plugins/BatteryStatus.d.ts"/>
/// <reference path="plugins/Camera.d.ts"/>
/// <reference path="plugins/Contacts.d.ts"/>
/// <reference path="plugins/Device.d.ts"/>
/// <reference path="plugins/DeviceMotion.d.ts"/>
/// <reference path="plugins/DeviceOrientation.d.ts"/>
/// <reference path="plugins/Dialogs.d.ts"/>
/// <reference path="plugins/FileSystem.d.ts"/>
/// <reference path="plugins/FileTransfer.d.ts"/>
/// <reference path="plugins/Globalization.d.ts"/>
/// <reference path="plugins/InAppBrowser.d.ts"/>
/// <reference path="plugins/Media.d.ts"/>
/// <reference path="plugins/MediaCapture.d.ts"/>
/// <reference path="plugins/NetworkInformation.d.ts"/>
/// <reference path="plugins/Push.d.ts"/>
/// <reference path="plugins/Splashscreen.d.ts"/>
/// <reference path="plugins/Vibration.d.ts"/>
/// <reference path="plugins/WebSQL.d.ts"/>
interface Cordova {
/** Invokes native functionality by specifying corresponding service name, action and optional parameters.
* @param success A success callback function.
* @param fail An error callback function.
* @param service The service name to call on the native side (corresponds to a native class).
* @param action The action name to call on the native side (generally corresponds to the native class method).
* @param args An array of arguments to pass into the native environment.
*/
exec(success: () => any, fail: () => any, service: string, action: string, args?: string[]): void;
/** Gets the operating system name. */
platformId: string;
/** Gets Cordova framework version */
version: string;
/** Defines custom logic as a Cordova module. Other modules can later access it using module name provided. */
define(moduleName: string, factory: (require: any, exports: any, module: any) => any): void;
/** Access a Cordova module by name. */
require(moduleName: string): any;
}
// cordova/argscheck module
interface ArgsCheck {
checkArgs(argsSpec: string, functionName: string, args: any[], callee?: any): void;
getValue(value?: any, defaultValue?: any): any;
enableChecks: boolean;
}
// cordova/urlutil module
interface UrlUtil {
makeAbsolute(url: string): string
}
/** Apache Cordova instance */
declare var cordova: Cordova;
+125
View File
@@ -0,0 +1,125 @@
// Type definitions for Apache Cordova BatteryStatus plugin.
// Project: https://github.com/apache/cordova-plugin-battery-status
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Window {
onbatterystatus: (type: BatteryStatusEvent) => void;
onbatterycritical: (type: BatteryStatusEvent) => void;
onbatterylow: (type: BatteryStatusEvent) => void;
/**
* Adds a listener for an event from the BatteryStatus plugin.
* @param type the event to listen for
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param listener the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
addEventListener(type: "batterystatus", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void;
/**
* Adds a listener for an event from the BatteryStatus plugin.
* @param type the event to listen for
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param listener the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
addEventListener(type: "batterycritical", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void;
/**
* Adds a listener for an event from the BatteryStatus plugin.
* @param type the event to listen for
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param listener the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
addEventListener(type: "batterylow", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void;
/**
* Adds a listener for an event from the BatteryStatus plugin.
* @param type the event to listen for
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param listener the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
addEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void;
/**
* Removes a listener for an event from the BatteryStatus plugin.
* @param type The event to stop listening for.
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param callback the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
removeEventListener(type: "batterystatus", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void;
/**
* Removes a listener for an event from the BatteryStatus plugin.
* @param type The event to stop listening for.
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param callback the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
removeEventListener(type: "batterycritical", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void;
/**
* Removes a listener for an event from the BatteryStatus plugin.
* @param type The event to stop listening for.
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param callback the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
removeEventListener(type: "batterylow", listener: (ev: BatteryStatusEvent) => any, useCapture?: boolean): void;
/**
* Removes a listener for an event from the BatteryStatus plugin.
* @param type The event to stop listening for.
* batterystatus: event fires when the percentage of battery charge
* changes by at least 1 percent, or if the device is plugged in or unplugged.
* batterycritical: event fires when the percentage of battery charge has reached
* the critical battery threshold. The value is device-specific.
* batterylow: event fires when the percentage of battery charge has
* reached the low battery threshold, device-specific value.
* @param callback the function that executes when the event fires. The function is
* passed an BatteryStatusEvent object as a parameter.
*/
removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void;
}
/** Object, that passed into battery event listener */
interface BatteryStatusEvent extends Event {
/* The percentage of battery charge (0-100). */
level: number;
/* A boolean that indicates whether the device is plugged in. */
isPlugged: boolean;
}
+167
View File
@@ -0,0 +1,167 @@
// Type definitions for Apache Cordova Camera plugin.
// Project: https://github.com/apache/cordova-plugin-camera
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/**
* This plugin provides an API for taking pictures and for choosing images from the system's image library.
*/
camera: Camera;
}
/**
* This plugin provides an API for taking pictures and for choosing images from the system's image library.
*/
interface Camera {
/**
* Removes intermediate photos taken by the camera from temporary storage.
* @param onSuccess Success callback, that called when cleanup succeeds.
* @param onError Error callback, that get an error message.
*/
cleanup(
onSuccess: () => void,
onError: (message: string) => void): void;
/**
* Takes a photo using the camera, or retrieves a photo from the device's image gallery.
* @param cameraSuccess Success callback, that get the image
* as a base64-encoded String, or as the URI for the image file.
* @param cameraError Error callback, that get an error message.
* @param cameraOptions Optional parameters to customize the camera settings.
*/
getPicture(
cameraSuccess: (data: string) => void,
cameraError: (message: string) => void,
cameraOptions?: CameraOptions): void;
// Next will work only on iOS
//getPicture(
// cameraSuccess: (data: string) => void,
// cameraError: (message: string) => void,
// cameraOptions?: CameraOptions): CameraPopoverHandle;
}
interface CameraOptions {
/** Picture quality in range o-100 */
quality?: number;
/**
* Choose the format of the return value.
* Defined in navigator.camera.DestinationType
* DATA_URL : 0, Return image as base64-encoded string
* FILE_URI : 1, Return image file URI
* NATIVE_URI : 2 Return image native URI
* (e.g., assets-library:// on iOS or content:// on Android)
*/
destinationType?: number;
/**
* Set the source of the picture. Defined in navigator.camera.PictureSourceType
* PHOTOLIBRARY : 0,
* CAMERA : 1,
* SAVEDPHOTOALBUM : 2
*/
sourceType?: number;
/** Allow simple editing of image before selection. */
allowEdit?: boolean;
/**
* Choose the returned image file's encoding. Defined in navigator.camera.EncodingType
* JPEG : 0 Return JPEG encoded image
* PNG : 1 Return PNG encoded image
*/
encodingType?: number;
/**
* Width in pixels to scale image. Must be used with targetHeight.
* Aspect ratio remains constant.
*/
targetWidth?: number;
/**
* Height in pixels to scale image. Must be used with targetWidth.
* Aspect ratio remains constant.
*/
targetHeight?: number;
/**
* Set the type of media to select from. Only works when PictureSourceType
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType
* PICTURE: 0 allow selection of still pictures only. DEFAULT.
* Will return format specified via DestinationType
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
* ALLMEDIA : 2 allow selection from all media types
*/
mediaType?: number;
/** Rotate the image to correct for the orientation of the device during capture. */
correctOrientation?: boolean;
/** Save the image to the photo album on the device after capture. */
saveToPhotoAlbum?: boolean;
/** Choose the camera to use (front- or back-facing). Defined in navigator.camera.Direction */
cameraDirection?: number;
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
popoverOptions?: CameraPopoverOptions;
}
/**
* A handle to the popover dialog created by navigator.camera.getPicture. Used on iOS only.
*/
interface CameraPopoverHandle {
/**
* Set the position of the popover.
* @param popoverOptions the CameraPopoverOptions that specify the new position.
*/
setPosition(popoverOptions: CameraPopoverOptions): void;
}
/**
* iOS-only parameters that specify the anchor element location and arrow direction
* of the popover when selecting images from an iPad's library or album.
*/
interface CameraPopoverOptions {
x: number;
y: number;
width: number;
height: number;
/**
* Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection
* Matches iOS UIPopoverArrowDirection constants.
* ARROW_UP : 1,
* ARROW_DOWN : 2,
* ARROW_LEFT : 4,
* ARROW_RIGHT : 8,
* ARROW_ANY : 15
*/
arrowDir : number;
}
declare var Camera: {
// Camera constants, defined in Camera plugin
DestinationType: {
DATA_URL: number;
FILE_URI: number;
NATIVE_URI: number
}
Direction: {
BACK: number;
FRONT: number;
}
EncodingType: {
JPEG: number;
PNG: number;
}
MediaType: {
PICTURE: number;
VIDEO: number;
ALLMEDIA: number;
}
PictureSourceType: {
PHOTOLIBRARY: number;
CAMERA: number;
SAVEDPHOTOALBUM: number;
}
// Used only on iOS
PopoverArrowDirection: {
ARROW_UP: number;
ARROW_DOWN: number;
ARROW_LEFT: number;
ARROW_RIGHT: number;
ARROW_ANY: number;
}
};
+262
View File
@@ -0,0 +1,262 @@
// Type definitions for Apache Cordova Contacts plugin.
// Project: https://github.com/apache/cordova-plugin-contacts
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/** Provides access to the device contacts database. */
contacts: Contacts;
}
interface Contacts {
/**
* The navigator.contacts.create method is synchronous, and returns a new Contact object.
* This method does not retain the Contact object in the device contacts database,
* for which you need to invoke the Contact.save method.
* @param properties Object with contact fields
*/
create(properties?: ContactProperties): Contact;
/**
* The navigator.contacts.find method executes asynchronously, querying the device contacts database
* and returning an array of Contact objects. The resulting objects are passed to the onSuccess
* callback function specified by the onSuccess parameter.
* @param fields The fields parameter specifies the fields to be used as a search qualifier,
* and only those results are passed to the onSuccess callback function. A zero-length fields parameter
* is invalid and results in ContactError.INVALID_ARGUMENT_ERROR. A contactFields value of "*" returns all contact fields.
* @param onSuccess Success callback function invoked with the array of Contact objects returned from the database
* @param onError Error callback function, invoked when an error occurs.
* @param options Search options to filter navigator.contacts.
*/
find(fields: string[],
onSuccess: (contacts: Contact[]) => void,
onError: (error: ContactError) => void,
options?: ContactFindOptions): void;
}
interface ContactProperties {
/** A globally unique identifier. */
id?: string;
/** The name of this Contact, suitable for display to end users. */
displayName?: string;
/** An object containing all components of a persons name. */
name?: ContactName;
/** A casual name by which to address the contact. */
nickname?: string;
/** An array of all the contact's phone numbers. */
phoneNumbers?: ContactField[];
/** An array of all the contact's email addresses. */
emails?: ContactField[];
/** An array of all the contact's addresses. */
addresses?: ContactAddress[];
/** An array of all the contact's IM addresses. */
ims?: ContactField[];
/** An array of all the contact's organizations. */
organizations?: ContactOrganization[];
/** The birthday of the contact. */
birthday?: Date;
/** A note about the contact. */
note?: string;
/** An array of the contact's photos. */
photos?: ContactField[];
/** An array of all the user-defined categories associated with the contact. */
categories?: ContactField[];
/** An array of web pages associated with the contact. */
urls?: ContactField[];
}
/**
* The Contact object represents a user's contact. Contacts can be created, stored, or removed
* from the device contacts database. Contacts can also be retrieved (individually or in bulk)
* from the database by invoking the navigator.contacts.find method.
*/
interface Contact extends ContactProperties {
/**
* Returns a new Contact object that is a deep copy of the calling object, with the id property set to null
*/
clone(): Contact;
/**
* Removes the contact from the device contacts database, otherwise executes an error callback with a ContactError object.
* @param onSuccess Success callback function invoked on success operation.
* @param onError Error callback function, invoked when an error occurs.
*/
remove(
onSuccess: () => void,
onError: (error: Error) => void): void;
/**
* Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same id already exists.
* @param onSuccess Success callback function invoked on success operation with che Contact object.
* @param onError Error callback function, invoked when an error occurs.
*/
save(
onSuccess: (contact: Contact) => void,
onError: (error: Error) => void): void;
}
declare var Contact: {
/** Constructor of Contact object */
new(id?: string,
displayName?: string,
name?: ContactName,
nickname?: string,
phoneNumbers?: ContactField[],
emails?: ContactField[],
addresses?: ContactAddress[],
ims?: ContactField[],
organizations?: ContactOrganization[],
birthday?: Date,
note?: string,
photos?: ContactField[],
categories?: ContactField,
urls?: ContactField[]): Contact
};
/** The ContactError object is returned to the user through the contactError callback function when an error occurs. */
interface ContactError {
/** Error code */
code: number;
/** Error message */
message: string;
}
declare var ContactError: {
new(code: number): ContactError;
UNKNOWN_ERROR: number;
INVALID_ARGUMENT_ERROR: number;
TIMEOUT_ERROR: number;
PENDING_OPERATION_ERROR: number;
IO_ERROR: number;
NOT_SUPPORTED_ERROR: number;
PERMISSION_DENIED_ERROR: number
};
/** Contains different kinds of information about a Contact object's name. */
interface ContactName {
/** The complete name of the contact. */
formatted?: string;
/** The contact's family name. */
familyName?: string;
/** The contact's given name. */
givenName?: string;
/** The contact's middle name. */
middleName?: string;
/** The contact's prefix (example Mr. or Dr.) */
honorificPrefix?: string;
/** The contact's suffix (example Esq.). */
honorificSuffix?: string;
}
declare var ContactName: {
/** Constructor for ContactName object */
new(formatted?: string,
familyName?: string,
givenName?: string,
middleName?: string,
honorificPrefix?: string,
honorificSuffix?: string): ContactName
};
/**
* The ContactField object is a reusable component that represents contact fields generically.
* Each ContactField object contains a value, type, and pref property. A Contact object stores
* several properties in ContactField[] arrays, such as phone numbers and email addresses.
*
* In most instances, there are no pre-determined values for a ContactField object's type attribute.
* For example, a phone number can specify type values of home, work, mobile, iPhone,
* or any other value that is supported by a particular device platform's contact database.
* However, for the Contact photos field, the type field indicates the format of the returned image:
* url when the value attribute contains a URL to the photo image, or base64 when the value
* contains a base64-encoded image string.
*/
interface ContactField {
/** A string that indicates what type of field this is, home for example. */
type: string;
/** The value of the field, such as a phone number or email address. */
value: string;
/** Set to true if this ContactField contains the user's preferred value. */
pref: boolean;
}
declare var ContactField: {
/** Constructor for ContactField object */
new(type?: string,
value?: string,
pref?: boolean): ContactField
};
/**
* The ContactAddress object stores the properties of a single address of a contact.
* A Contact object may include more than one address in a ContactAddress[] array.
*/
interface ContactAddress {
/** Set to true if this ContactAddress contains the user's preferred value. */
pref?: boolean;
/** A string indicating what type of field this is, home for example. */
type?: string;
/** The full address formatted for display. */
formatted?: string;
/** The full street address. */
streetAddress?: string;
/** The city or locality. */
locality?: string;
/** The state or region. */
region?: string;
/** The zip code or postal code. */
postalCode?: string;
/** The country name. */
country?: string;
}
declare var ContactAddress: {
/** Constructor of ContactAddress object */
new(pref?: boolean,
type?: string,
formatted?: string,
streetAddress?: string,
locality?: string,
region?: string,
postalCode?: string,
country?: string): ContactAddress
};
/**
* The ContactOrganization object stores a contact's organization properties. A Contact object stores
* one or more ContactOrganization objects in an array.
*/
interface ContactOrganization {
/** Set to true if this ContactOrganization contains the user's preferred value. */
pref?: boolean;
/** A string that indicates what type of field this is, home for example. */
type?: string;
/** The name of the organization. */
name?: string;
/** The department the contract works for. */
department?: string;
/** The contact's title at the organization. */
title?: string;
}
declare var ContactOrganization: {
/** Constructor for ContactOrganization object */
new(pref?: boolean,
type?: string,
name?: string,
department?: string,
title?: string): ContactOrganization
};
/** Search options to filter navigator.contacts. */
interface ContactFindOptions {
/** The search string used to find navigator.contacts. */
filter?: string;
/** Determines if the find operation returns multiple navigator.contacts. */
multiple?: boolean;
}
declare var ContactFindOptions: {
/** Constructor for ContactFindOptions object */
new(filter?: string,
multiple?: boolean): ContactFindOptions
};
+31
View File
@@ -0,0 +1,31 @@
// Type definitions for Apache Cordova Device plugin.
// Project: https://github.com/apache/cordova-plugin-device
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
/**
* This plugin defines a global device object, which describes the device's hardware and software.
* Although the object is in the global scope, it is not available until after the deviceready event.
*/
interface Device {
/** Get the version of Cordova running on the device. */
cordova: string;
/**
* The device.model returns the name of the device's model or product. The value is set
* by the device manufacturer and may be different across versions of the same product.
*/
model: string;
/** device.name is deprecated as of version 2.3.0. Use device.model instead. */
name: string;
/** Get the device's operating system name. */
platform: string;
/** Get the device's Universally Unique Identifier (UUID). */
uuid: string;
/** Get the operating system version. */
version: string;
}
declare var device: Device;
+77
View File
@@ -0,0 +1,77 @@
// Type definitions for Apache Cordova Device Motion plugin.
// Project: https://github.com/apache/cordova-plugin-device-motion
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/**
* This plugin provides access to the device's accelerometer. The accelerometer is a motion sensor
* that detects the change (delta) in movement relative to the current device orientation,
* in three dimensions along the x, y, and z axis.
*/
accelerometer: Accelerometer;
}
/**
* This plugin provides access to the device's accelerometer. The accelerometer is a motion sensor
* that detects the change (delta) in movement relative to the current device orientation,
* in three dimensions along the x, y, and z axis.
*/
interface Accelerometer {
/**
* Stop watching the Acceleration referenced by the watchID parameter.
* @param watchID The ID returned by navigator.accelerometer.watchAcceleration.
*/
clearWatch(watchID: WatchHandle): void;
/**
* Get the current acceleration along the x, y, and z axes.
* These acceleration values are returned to the accelerometerSuccess callback function.
* @param accelerometerSuccess Success callback that gets the Acceleration object.
* @param accelerometerError Success callback
*/
getCurrentAcceleration(
accelerometerSuccess: (acceleration: Acceleration) => void,
accelerometerError: () => void): void;
/**
* Retrieves the device's current Acceleration at a regular interval, executing the
* accelerometerSuccess callback function each time. Specify the interval in milliseconds
* via the acceleratorOptions object's frequency parameter.
* The returned watch ID references the accelerometer's watch interval, and can be used
* with navigator.accelerometer.clearWatch to stop watching the accelerometer.
* @param accelerometerSuccess Callback, that called at every time interval and passes an Acceleration object.
* @param accelerometerError Error callback.
* @param accelerometerOptions Object with options for watchAcceleration
*/
watchAcceleration(
accelerometerSuccess: (acceleration: Acceleration) => void,
accelerometerError: () => void,
accelerometerOptions?: AccelerometerOptions): WatchHandle;
}
/**
* Contains Accelerometer data captured at a specific point in time. Acceleration values include
* the effect of gravity (9.81 m/s^2), so that when a device lies flat and facing up, x, y, and z
* values returned should be 0, 0, and 9.81.
*/
interface Acceleration {
/** Amount of acceleration on the x-axis. (in m/s^2) */
x: number;
/** Amount of acceleration on the y-axis. (in m/s^2) */
y: number;
/** Amount of acceleration on the z-axis. (in m/s^2) */
z: number;
/** Creation timestamp in milliseconds. */
timestamp: number;
}
/** Object with options for watchAcceleration */
interface AccelerometerOptions {
/** How often to retrieve the Acceleration in milliseconds. (Default: 10000) */
frequency?: number;
}
/** Abstract type for watch IDs used by Accelerometer. Values of these type are actually `number` at runtime.*/
interface WatchHandle { }
+86
View File
@@ -0,0 +1,86 @@
// Type definitions for Apache Cordova Device Orientation plugin.
// Project: https://github.com/apache/cordova-plugin-device-orientation
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/**
* This plugin provides access to the device's compass. The compass is a sensor that detects
* the direction or heading that the device is pointed, typically from the top of the device.
* It measures the heading in degrees from 0 to 359.99, where 0 is north.
*/
compass: Compass;
}
/**
* This plugin provides access to the device's compass. The compass is a sensor that detects
* the direction or heading that the device is pointed, typically from the top of the device.
* It measures the heading in degrees from 0 to 359.99, where 0 is north.
*/
interface Compass {
/**
* Get the current compass heading. The compass heading is returned via a CompassHeading
* object using the onSuccess callback function.
* @param onSuccess Success callback that passes CompassHeading object.
* @param onError Error callback that passes CompassError object.
*/
getCurrentHeading(
onSuccess: (heading: CompassHeading) => void,
onError: (error: CompassError) => void,
options?: CompassOptions): void;
/**
* Gets the device's current heading at a regular interval. Each time the heading is retrieved,
* the headingSuccess callback function is executed. The returned watch ID references the compass
* watch interval. The watch ID can be used with navigator.compass.clearWatch to stop watching
* the navigator.compass.
* @param onSuccess Success callback that passes CompassHeading object.
* @param onError Error callback that passes CompassError object.
* @param options CompassOptions object
*/
watchHeading(
onSuccess: (heading: CompassHeading) => void,
onError: (error: CompassError) => void,
options?: CompassOptions): number;
/**
* Stop watching the compass referenced by the watch ID parameter.
* @param id The ID returned by navigator.compass.watchHeading.
*/
clearWatch(id: number): void;
}
/** A CompassHeading object is returned to the compassSuccess callback function. */
interface CompassHeading {
/** The heading in degrees from 0-359.99 at a single moment in time. */
magneticHeading: number;
/** The heading relative to the geographic North Pole in degrees 0-359.99 at a single moment in time. A negative value indicates that the true heading can't be determined. */
trueHeading: number;
/** The deviation in degrees between the reported heading and the true heading. */
headingAccuracy: number;
/** The time at which this heading was determined. */
timestamp: number;
}
interface CompassOptions {
filter?: number;
frequency?: number;
}
/** A CompassError object is returned to the onError callback function when an error occurs. */
interface CompassError {
/**
* One of the predefined error codes
* CompassError.COMPASS_INTERNAL_ERR
* CompassError.COMPASS_NOT_SUPPORTED
*/
code: number;
}
declare var CompassError: {
/** Constructor for CompassError object */
new(code: number): CompassError;
COMPASS_INTERNAL_ERR: number;
COMPASS_NOT_SUPPORTED: number
}
+66
View File
@@ -0,0 +1,66 @@
// Type definitions for Apache Cordova Dialogs plugin.
// Project: https://github.com/apache/cordova-plugin-dialogs
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/** This plugin provides access to some native dialog UI elements. */
notification: Notification
}
/** This plugin provides access to some native dialog UI elements. */
interface Notification {
/**
* Shows a custom alert or dialog box. Most Cordova implementations use a native dialog box for this feature,
* but some platforms use the browser's alert function, which is typically less customizable.
* @param message Dialog message.
* @param alertCallback Callback to invoke when alert dialog is dismissed.
* @param title Dialog title, defaults to 'Alert'.
* @param buttonName Button name, defaults to OK.
*/
alert(message: string,
alertCallback: () => void,
title?: string,
buttonName?: string): void;
/**
* The device plays a beep sound.
* @param times The number of times to repeat the beep.
*/
beep(times: number): void;
/**
* Displays a customizable confirmation dialog box.
* @param message Dialog message.
* @param confirmCallback Callback to invoke with index of button pressed (1, 2, or 3)
* or when the dialog is dismissed without a button press (0).
* @param title Dialog title, defaults to Confirm.
* @param buttonLabels Array of strings specifying button labels, defaults to [OK,Cancel].
*/
confirm(message: string,
confirmCallback: (choice: number) => void,
title?: string,
buttonLabels?: string[]): void;
/**
* Displays a native dialog box that is more customizable than the browser's prompt function.
* @param message Dialog message.
* @param promptCallback Callback to invoke when a button is pressed.
* @param title Dialog title, defaults to "Prompt".
* @param buttonLabels Array of strings specifying button labels, defaults to ["OK","Cancel"].
* @param defaultText Default textbox input value, default: "".
*/
prompt(message: string,
promptCallback: (result: NotificationPromptResult) => void,
title?: string,
buttonLabels?: string[],
defaultText?: string): void;
}
/** Object, passed to promptCallback */
interface NotificationPromptResult {
/** The index of the pressed button. Note that the index uses one-based indexing, so the value is 1, 2, 3, etc. */
buttonIndex: number;
/** The text entered in the prompt dialog box. */
input1: string;
}
+282
View File
@@ -0,0 +1,282 @@
// Type definitions for Apache Cordova File System plugin.
// Project: https://github.com/apache/cordova-plugin-file
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Window {
/**
* Requests a filesystem in which to store application data.
* @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
* @param size This is an indicator of how much storage space, in bytes, the application expects to need.
* @param successCallback The callback that is called when the user agent provides a filesystem.
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
*/
requestFileSystem(
type: number,
size: number,
successCallback: (fileSystem: FileSystem) => void,
errorCallback?: (fileError: Error) => void): void;
TEMPORARY: number;
PERSISTENT: number;
}
/** This interface represents a file system. */
interface FileSystem {
/* The name of the file system, unique across the list of exposed file systems. */
name: string;
/** The root directory of the file system. */
root: DirectoryEntry;
}
/**
* An abstract interface representing entries in a file system,
* each of which may be a File or DirectoryEntry.
*/
interface Entry {
/** Entry is a file. */
isFile: boolean;
/** Entry is a directory. */
isDirectory: boolean;
/** The name of the entry, excluding the path leading to it. */
name: string;
/** The full absolute path from the root to the entry. */
fullPath: string;
/** The file system on which the entry resides. */
fileSystem: FileSystem;
nativeURL: string;
/**
* Look up metadata about this entry.
* @param successCallback A callback that is called with the time of the last modification.
* @param errorCallback A callback that is called when errors happen.
*/
getMetadata(
successCallback: (metadata: Metadata) => void,
errorCallback?: (error: Error) => void): void;
/**
* Move an entry to a different location on the file system. It is an error to try to:
* move a directory inside itself or to any child at any depth;move an entry into its parent if a name different from its current one isn't provided;
* move a file to a path occupied by a directory;
* move a directory to a path occupied by a file;
* move any element to a path occupied by a directory which is not empty.
* A move of a file on top of an existing file must attempt to delete and replace that file.
* A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
* @param parent The directory to which to move the entry.
* @param newName The new name of the entry. Defaults to the Entry's current name if unspecified.
* @param successCallback A callback that is called with the Entry for the new location.
* @param errorCallback A callback that is called when errors happen.
*/
moveTo(parent: DirectoryEntry,
newName?: string,
successCallback?: (entry: Entry) => void ,
errorCallback?: (error: Error) => void ): void;
/**
* Copy an entry to a different location on the file system. It is an error to try to:
* copy a directory inside itself or to any child at any depth;
* copy an entry into its parent if a name different from its current one isn't provided;
* copy a file to a path occupied by a directory;
* copy a directory to a path occupied by a file;
* copy any element to a path occupied by a directory which is not empty.
* A copy of a file on top of an existing file must attempt to delete and replace that file.
* A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
* Directory copies are always recursive--that is, they copy all contents of the directory.
* @param parent The directory to which to move the entry.
* @param newName The new name of the entry. Defaults to the Entry's current name if unspecified.
* @param successCallback A callback that is called with the Entry for the new object.
* @param errorCallback A callback that is called when errors happen.
*/
copyTo(parent: DirectoryEntry,
newName?: string,
successCallback?: (entry: Entry) => void ,
errorCallback?: (error: Error) => void ): void;
toURL(): string;
/**
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
* @param successCallback A callback that is called on success.
* @param errorCallback A callback that is called when errors happen.
*/
remove(successCallback: () => void ,
errorCallback?: (error: Error) => void ): void;
/**
* Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
* @param successCallback A callback that is called with the time of the last modification.
* @param errorCallback A callback that is called when errors happen.
*/
getParent(successCallback: (entry: Entry) => void ,
errorCallback?: (error: Error) => void ): void;
}
/** This interface supplies information about the state of a file or directory. */
interface Metadata {
/** This is the time at which the file or directory was last modified. */
modificationTime: Date;
/** The size of the file, in bytes. This must return 0 for directories. */
size: number;
}
/** This interface represents a directory on a file system. */
interface DirectoryEntry extends Entry {
/**
* Creates a new DirectoryReader to read Entries from this Directory.
*/
createReader(): DirectoryReader;
/**
* Creates or looks up a file.
* @param path Either an absolute path or a relative path from this DirectoryEntry
* to the file to be looked up or created.
* It is an error to attempt to create a file whose immediate parent does not yet exist.
* @param options If create and exclusive are both true, and the path already exists, getFile must fail.
* If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.
* If create is not true and the path doesn't exist, getFile must fail.
* If create is not true and the path exists, but is a directory, getFile must fail.
* Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.
* @param successCallback A callback that is called to return the File selected or created.
* @param errorCallback A callback that is called when errors happen.
*/
getFile(path: string, options?: Flags,
successCallback?: (entry: FileEntry) => void,
errorCallback?: (error: Error) => void): void;
/**
* Creates or looks up a directory.
* @param path Either an absolute path or a relative path from this DirectoryEntry
* to the directory to be looked up or created.
* It is an error to attempt to create a directory whose immediate parent does not yet exist.
* @param options If create and exclusive are both true and the path already exists, getDirectory must fail.
* If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.
* If create is not true and the path doesn't exist, getDirectory must fail.
* If create is not true and the path exists, but is a file, getDirectory must fail.
* Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.
* @param successCallback A callback that is called to return the Directory selected or created.
* @param errorCallback A callback that is called when errors happen.
*/
getDirectory(path: string, options?: Flags,
successCallback?: (entry: DirectoryEntry) => void,
errorCallback?: (error: Error) => void): void;
/**
* Deletes a directory and all of its contents, if any. In the event of an error (e.g. trying
* to delete a directory that contains a file that cannot be removed), some of the contents
* of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
* @param successCallback A callback that is called on success.
* @param errorCallback A callback that is called when errors happen.
*/
removeRecursively(successCallback: () => void,
errorCallback?: (error: Error) => void): void;
}
/**
* This dictionary is used to supply arguments to methods
* that look up or create files or directories.
*/
interface Flags {
/** Used to indicate that the user wants to create a file or directory if it was not previously there. */
create?: boolean;
/** By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists. */
exclusive?: boolean;
}
/**
* This interface lets a user list files and directories in a directory. If there are
* no additions to or deletions from a directory between the first and last call to
* readEntries, and no errors occur, then:
* A series of calls to readEntries must return each entry in the directory exactly once.
* Once all entries have been returned, the next call to readEntries must produce an empty array.
* If not all entries have been returned, the array produced by readEntries must not be empty.
* The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].
*/
interface DirectoryReader {
/**
* Read the next block of entries from this directory.
* @param successCallback Called once per successful call to readEntries to deliver the next
* previously-unreported set of Entries in the associated Directory.
* If all Entries have already been returned from previous invocations
* of readEntries, successCallback must be called with a zero-length array as an argument.
* @param errorCallback A callback indicating that there was an error reading from the Directory.
*/
readEntries(successCallback: (entries: Entry[]) => void, errorCallback?: (error: Error) => void): void;
}
/** This interface represents a file on a file system. */
interface FileEntry extends Entry {
/**
* Creates a new FileWriter associated with the file that this FileEntry represents.
* @param successCallback A callback that is called with the new FileWriter.
* @param errorCallback A callback that is called when errors happen.
*/
createWriter(successCallback: (
writer: FileWriter) => void,
errorCallback?: (error: Error) => void): void;
/**
* Returns a File that represents the current state of the file that this FileEntry represents.
* @param successCallback A callback that is called with the File.
* @param errorCallback A callback that is called when errors happen.
*/
file(successCallback: (file: File) => void,
errorCallback?: (error: Error) => void): void;
}
/**
* This interface provides methods to monitor the asynchronous writing of blobs
* to disk using progress events and event handler attributes.
*/
interface FileSaver extends EventTarget {
/** Terminate file operation */
abort(): void;
/**
* The FileSaver object can be in one of 3 states. The readyState attribute, on getting,
* must return the current state, which must be one of the following values:
* INIT
* WRITING
* DONE
*/
readyState: number;
/** Handler for writestart events. */
onwritestart: (event: ProgressEvent) => void;
/** Handler for progress events. */
onprogress: (event: ProgressEvent) => void;
/** Handler for write events. */
onwrite: (event: ProgressEvent) => void;
/** Handler for abort events. */
onabort: (event: ProgressEvent) => void;
/** Handler for error events. */
onerror: (event: ProgressEvent) => void;
/** Handler for writeend events. */
onwriteend: (event: ProgressEvent) => void;
/** The last error that occurred on the FileSaver. */
error: Error;
}
/**
* This interface expands on the FileSaver interface to allow for multiple write
* actions, rather than just saving a single Blob.
*/
interface FileWriter extends FileSaver {
/**
* The byte offset at which the next write to the file will occur. This always less or equal than length.
* A newly-created FileWriter will have position set to 0.
*/
position: number;
/**
* The length of the file. If the user does not have read access to the file,
* this will be the highest byte offset at which the user has written.
*/
length: number;
/**
* Write the supplied data to the file at position.
* @param {Blob} data The blob to write.
*/
write(data: Blob): void;
/**
* The file position at which the next write will occur.
* @param offset If nonnegative, an absolute byte offset into the file.
* If negative, an offset back from the end of the file.
*/
seek(offset: number): void;
/**
* Changes the length of the file to that specified. If shortening the file, data beyond the new length
* will be discarded. If extending the file, the existing data will be zero-padded up to the new length.
* @param size The size to which the length of the file is to be adjusted, measured in bytes.
*/
truncate(size: number): void;
}
+129
View File
@@ -0,0 +1,129 @@
// Type definitions for Apache Cordova FileTransfer plugin.
// Project: https://github.com/apache/cordova-plugin-file-transfer
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
/// <reference path="FileSystem.d.ts"/>
/**
* The FileTransfer object provides a way to upload files using an HTTP multi-part POST request,
* and to download files as well.
*/
interface FileTransfer {
/** Called with a ProgressEvent whenever a new chunk of data is transferred. */
onprogress: Function;
/**
* Sends a file to a server.
* @param fileURL Filesystem URL representing the file on the device. For backwards compatibility,
* this can also be the full path of the file on the device.
* @param server URL of the server to receive the file, as encoded by encodeURI().
* @param successCallback A callback that is passed a FileUploadResult object.
* @param errorCallback A callback that executes if an error occurs retrieving the FileUploadResult.
* Invoked with a FileTransferError object.
* @param options Optional parameters.
* @param trustAllHosts Optional parameter, defaults to false. If set to true, it accepts all security certificates.
* This is useful since Android rejects self-signed security certificates.
* Not recommended for production use. Supported on Android and iOS.
*/
upload(
fileURL: string,
server: string,
successCallback: (result: FileUploadResult) => void,
errorCallback: (error: FileTransferError) => void,
options?: FileUploadOptions,
trustAllHosts?: boolean): void;
/**
* downloads a file from server.
* @param source URL of the server to download the file, as encoded by encodeURI().
* @param target Filesystem url representing the file on the device. For backwards compatibility,
* this can also be the full path of the file on the device.
* @param successCallback A callback that is passed a FileEntry object. (Function)
* @param errorCallback A callback that executes if an error occurs when retrieving the fileEntry.
* Invoked with a FileTransferError object.
* @param options Optional parameters.
* @param trustAllHosts Optional parameter, defaults to false. If set to true, it accepts all security certificates.
* This is useful since Android rejects self-signed security certificates.
* Not recommended for production use. Supported on Android and iOS.
*/
download(
source: string,
target: string,
successCallback: (fileEntry: FileEntry) => void,
errorCallback: (error: FileTransferError) => void,
options?: FileDownloadOptions,
trustAllHosts?: boolean): void;
/**
* Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object
* which has an error code of FileTransferError.ABORT_ERR.
*/
abort(): void;
}
declare var FileTransfer: {
new (): FileTransfer;
};
/** A FileUploadResult object is passed to the success callback of the FileTransfer object's upload() method. */
interface FileUploadResult {
/** The number of bytes sent to the server as part of the upload. */
bytesSent: number;
/** The HTTP response code returned by the server. */
responseCode: number;
/** The HTTP response returned by the server. */
response: string;
/** The HTTP response headers by the server. Currently supported on iOS only.*/
headers: any;
}
/** Optional parameters for upload method. */
interface FileUploadOptions {
/** The name of the form element. Defaults to file. */
fileKey?: string;
/** The file name to use when saving the file on the server. Defaults to image.jpg. */
fileName?: string;
/** The mime type of the data to upload. Defaults to image/jpeg. */
mimeType?: string;
/** A set of optional key/value pairs to pass in the HTTP request. */
params?: Object;
/** Whether to upload the data in chunked streaming mode. Defaults to true. */
chunkedMode?: boolean;
/** A map of header name/header values. Use an array to specify more than one value. */
headers?: Object[];
}
/** Optional parameters for download method. */
interface FileDownloadOptions {
/** A map of header name/header values. Use an array to specify more than one value. */
headers?: Object[];
}
/** A FileTransferError object is passed to an error callback when an error occurs. */
interface FileTransferError {
/**
* One of the predefined error codes listed below.
* FileTransferError.FILE_NOT_FOUND_ERR
* FileTransferError.INVALID_URL_ERR
* FileTransferError.CONNECTION_ERR
* FileTransferError.ABORT_ERR
*/
code: number;
/** URL to the source. */
source: string;
/** URL to the target. */
target: string;
/** HTTP status code. This attribute is only available when a response code is received from the HTTP connection. */
http_status: number;
body: any;
}
declare var FileTransferError: {
/** Constructor for FileTransferError object */
new (code?: number, source?: string, target?: string, status?: number, body?: any): FileTransferError;
FILE_NOT_FOUND_ERR: number;
INVALID_URL_ERR: number;
CONNECTION_ERR: number;
ABORT_ERR: number;
}
+255
View File
@@ -0,0 +1,255 @@
// Type definitions for Apache Cordova Globalization plugin.
// Project: https://github.com/apache/cordova-plugin-globalization
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/** This plugin obtains information and performs operations specific to the user's locale and timezone. */
globalization: Globalization
}
/** This plugin obtains information and performs operations specific to the user's locale and timezone. */
interface Globalization {
/**
* Get the string identifier for the client's current language.
* @param onSuccess Called on success getting the language with a properties object,
* that should have a value property with a String value.
* @param onError Called on error getting the language with a GlobalizationError object.
* The error's expected code is GlobalizationError.UNKNOWN_ERROR.
*/
getPreferredLanguage(
onSuccess: (language: { value: string; }) => void,
onError: (error: GlobalizationError) => void): void;
/**
* Get the string identifier for the client's current locale setting.
* @param onSuccess Called on success getting the locale identifier with a properties object,
* that should have a value property with a String value.
* @param onError Called on error getting the locale identifier with a GlobalizationError object.
* The error's expected code is GlobalizationError.UNKNOWN\_ERROR.
*/
getLocaleName(
onSuccess: (locale: { value: string; }) => void,
onError: (error: GlobalizationError) => void): void;
/**
* Returns a date formatted as a string according to the client's locale and timezone.
* @param date Date to format.
* @param onSuccess Called on success with a properties object,
* that should have a value property with a String value.
* @param onError Called on error with a GlobalizationError object.
* The error's expected code is GlobalizationError.FORMATTING_ERROR.
* @param options Optional format parameters. Default {formatLength:'short', selector:'date and time'}
*/
dateToString(
date: Date,
onSuccess: (date: { value: string; }) => void,
onError: (error: GlobalizationError) => void,
options?: { type?: string; item?: string; }): void;
/**
* Parses a date formatted as a string, according to the client's user preferences
* and calendar using the time zone of the client, and returns the corresponding date object.
* @param dateString String to parse
* @param onSuccess Called on success with GlobalizationDate object
* @param onError Called on error getting the language with a GlobalizationError object.
* The error's expected code is GlobalizationError.PARSING_ERROR.
* @param options Optional parse parameters. Default {formatLength:'short', selector:'date and time'}
*/
stringToDate(
dateString: string,
onSuccess: (date: GlobalizationDate) => void,
onError: (error: GlobalizationError) => void,
options?: { type?: string; item?: string; }): void;
/**
* Returns a pattern string to format and parse dates according to the client's user preferences.
* @param onSuccess Called on success getting pattern with a GlobalizationDatePattern object
* @param onError Called on error getting pattern with a GlobalizationError object.
* The error's expected code is GlobalizationError.PATTERN_ERROR.
* @param options Optional format parameters. Default {formatLength:'short', selector:'date and time'}
*/
getDatePattern(
onSuccess: (datePattern: GlobalizationDatePattern) => void,
onError: (error: GlobalizationError) => void,
options?: { type?: string; item?: string; }): void;
/**
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
* @param onSuccess Called on success getting names with a properties object,
* that should have a value property with a String[] value.
* @param onError Called on error getting the language with a GlobalizationError object.
* The error's expected code is GlobalizationError.UNKNOWN_ERROR.
* @param options Optional parameters. Default: {type:'wide', item:'months'}
*/
getDateNames(
onSuccess: (names: { value: string[]; }) => void,
onError: (error: GlobalizationError) => void,
options?: { type?: string; item?: string; }): void;
/**
* Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
* @param {Date} date Date to check
* @param onSuccess Called on success with a properties object,
* that should have a dst property with a boolean value.
* @param onError Called on error with a GlobalizationError object.
* The error's expected code is GlobalizationError.UNKNOWN_ERROR.
*/
isDaylightSavingsTime(
date: Date,
onSuccess: (result: { dst: boolean; }) => void,
onError: (error: GlobalizationError) => void): void;
/**
* Returns the first day of the week according to the client's user preferences and calendar.
* @param onSuccess Called on success with a day object,
* that should have a value property with a number value.
* @param onError Called on error with a GlobalizationError object.
* The error's expected code is GlobalizationError.UNKNOWN_ERROR.
*/
getFirstDayOfWeek(
onSuccess: (day: { value: number; }) => void,
onError: (error: GlobalizationError) => void): void;
/**
* Returns a number formatted as a string according to the client's user preferences.
* @param value Number to format
* @param onSuccess Called on success with a result object,
* that should have a value property with a String value.
* @param onError Called on error with a GlobalizationError object.
* The error's expected code is GlobalizationError.FORMATTING_ERROR.
* @param format Optional format parameters. Default: {type:'decimal'}
*/
nubmerToString(
value: number,
onSuccess: (result: { value: string; }) => void,
onError: (error: GlobalizationError) => void,
format?: { type?: string; }): void;
/**
* Parses a number formatted as a string according to the client's user preferences and returns the corresponding number.
* @param value String to parse
* @param onSuccess Called on success with a result object,
* that should have a value property with a number value.
* @param onError Called on error with a GlobalizationError object.
* The error's expected code is GlobalizationError.FORMATTING_ERROR.
* @param format Optional format parameters. Default: {type:'decimal'}
*/
stringToNumber(
value: string,
onSuccess: (result: { value: number; }) => void,
onError: (error: GlobalizationError) => void,
format?: { type?: string; }): void;
/**
* Returns a pattern string to format and parse numbers according to the client's user preferences.
* @param onSuccess Called on success getting pattern with a GlobalizationNumberPattern object
* @param onError Called on error getting the language with a GlobalizationError object.
* The error's expected code is GlobalizationError.PATTERN_ERROR.
* @param options Optional format parameters. Default {type:'decimal'}.
*/
getNumberPattern(
onSuccess: (result: GlobalizationNumberPattern) => void,
onError: (error: GlobalizationError) => void,
format?: { type?: string; }): void;
/**
* Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
* @param currencyCode Should be a String of one of the ISO 4217 currency codes, for example 'USD'.
* @param onSuccess Called on success getting pattern with a GlobalizatioCurrencyPattern object
* @param onError Called on error getting pattern with a GlobalizationError object.
* The error's expected code is GlobalizationError.FORMATTING_ERROR.
* @param options Optional format parameters. Default {type:'decimal'}.
*/
getCurrencyPattern(
currencyCode: string,
onSuccess: (result: GlobalizationCurrencyPattern) => void,
onError: (error: GlobalizationError) => void): void;
}
/** Date returned by stringToDate */
interface GlobalizationDate {
/* The four digit year. */
year: number;
/* The month from (0-11). */
month: number;
/* The day from (1-31). */
day: number;
/* The hour from (0-23). */
hour: number;
/* The minute from (0-59). */
minute: number;
/* The second from (0-59). */
second: number;
/* The milliseconds (from 0-999), not available on all platforms. */
millisecond: number;
}
/** Pattern to format and parse dates according to the client's user preferences.*/
interface GlobalizationDatePattern {
/* The date and time pattern to format and parse dates. The patterns follow Unicode Technical Standard #35. */
pattern: string;
/* The abbreviated name of the time zone on the client. */
timezone: string;
/* The current difference in seconds between the client's time zone and coordinated universal time. */
utc_offset: number;
/* The current daylight saving time offset in seconds between the client's non-daylight saving's time zone and the client's daylight saving's time zone. */
dst_offset: number;
}
interface GlobalizationDateNameOptions {
type?: string;
item?: string;
}
/** Pattern to format and parse numbers according to the client's user preferences. */
interface GlobalizationNumberPattern {
/* The number pattern to format and parse numbers. The patterns follow Unicode Technical Standard #35. */
pattern: string;
/* The symbol to use when formatting and parsing, such as a percent or currency symbol. */
symbol: string;
/* The number of fractional digits to use when parsing and formatting numbers. */
fraction: number;
/* The rounding increment to use when parsing and formatting. */
rounding: number;
/* The symbol to use for positive numbers when parsing and formatting. */
positive: string;
/* The symbol to use for negative numbers when parsing and formatting. */
negative: string;
/* The decimal symbol to use for parsing and formatting. */
decimal: string;
/* The grouping symbol to use for parsing and formatting. */
grouping: string;
}
/**
* Pattern to format and parse currency values according
* to the client's user preferences and ISO 4217 currency code.
*/
interface GlobalizationCurrencyPattern {
/** The currency pattern to format and parse currency values. The patterns follow Unicode Technical Standard #35. */
pattern: string;
/** The ISO 4217 currency code for the pattern. */
code: string;
/** The number of fractional digits to use when parsing and formatting currency. */
fraction: number;
/** The rounding increment to use when parsing and formatting. */
rounding: number;
/** The decimal symbol to use for parsing and formatting. */
decimal: string;
/** The grouping symbol to use for parsing and formatting. */
grouping: string;
}
/** An object representing a error from the Globalization API. */
interface GlobalizationError {
/** One of the following codes representing the error type:
* GlobalizationError.UNKNOWN_ERROR: 0
* GlobalizationError.FORMATTING_ERROR: 1
* GlobalizationError.PARSING_ERROR: 2
* GlobalizationError.PATTERN_ERROR: 3
*/
code: number;
/** A text message that includes the error's explanation and/or details */
message: string;
}
/** An object representing a error from the Globalization API. */
declare var GlobalizationError: {
UNKNOWN_ERROR: number;
FORMATTING_ERROR: number;
PARSING_ERROR: number;
PATTERN_ERROR: number;
}
+219
View File
@@ -0,0 +1,219 @@
// Type definitions for Apache Cordova InAppBrowser plugin.
// Project: https://github.com/apache/cordova-plugin-inappbrowser
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Window {
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
open(url: string, target?: "_self", options?: string): InAppBrowser;
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
open(url: string, target?: "_blank", options?: string): InAppBrowser;
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
open(url: string, target?: "_system", options?: string): InAppBrowser;
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
open(url: string, target?: string, options?: string, replace?: boolean): InAppBrowser;
}
/**
* The object returned from a call to window.open.
* NOTE: The InAppBrowser window behaves like a standard web browser, and can't access Cordova APIs.
*/
interface InAppBrowser extends Window {
onloadstart: (type: InAppBrowserEvent) => void;
onloadstop: (type: InAppBrowserEvent) => void;
onloaderror: (type: InAppBrowserEvent) => void;
onexit: (type: InAppBrowserEvent) => void;
// addEventListener overloads
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: string, callback: (event: InAppBrowserEvent) => void): void;
// removeEventListener overloads
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: string, callback: (event: InAppBrowserEvent) => void): void;
/** Closes the InAppBrowser window. */
close(): void;
/**
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
* if the InAppBrowser was already visible.
*/
show(): void;
/**
* Injects JavaScript code into the InAppBrowser window.
* @param script Details of the script to run, specifying either a file or code key.
* @param callback The function that executes after the JavaScript code is injected.
* If the injected script is of type code, the callback executes with
* a single parameter, which is the return value of the script, wrapped in an Array.
* For multi-line scripts, this is the return value of the last statement,
* or the last expression evaluated.
*/
executeScript(script: { code: string }, callback: (result: any) => void): void;
/**
* Injects JavaScript code into the InAppBrowser window.
* @param script Details of the script to run, specifying either a file or code key.
* @param callback The function that executes after the JavaScript code is injected.
* If the injected script is of type code, the callback executes with
* a single parameter, which is the return value of the script, wrapped in an Array.
* For multi-line scripts, this is the return value of the last statement,
* or the last expression evaluated.
*/
executeScript(script: { file: string }, callback: (result: any) => void): void;
/**
* Injects CSS into the InAppBrowser window.
* @param css Details of the script to run, specifying either a file or code key.
* @param callback The function that executes after the CSS is injected.
*/
insertCSS(css: { code: string }, callback: () => void): void;
/**
* Injects CSS into the InAppBrowser window.
* @param css Details of the script to run, specifying either a file or code key.
* @param callback The function that executes after the CSS is injected.
*/
insertCSS(css: { file: string }, callback: () => void): void;
}
interface InAppBrowserEvent extends Event {
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
type: string;
/** the URL that was loaded. */
url: string;
/** the error code, only in the case of loaderror. */
code: number;
/** the error message, only in the case of loaderror. */
message: string;
}
+73
View File
@@ -0,0 +1,73 @@
// Type definitions for Apache Cordova Media plugin.
// Project: https://github.com/apache/cordova-plugin-media
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
declare var Media: {
new (
src: string,
mediaSuccess: () => void,
mediaError?: (error: MediaError) => any,
mediaStatus?: (status: number) => void): Media;
//Media statuses
MEDIA_NONE: number;
MEDIA_STARTING: number;
MEDIA_RUNNING: number;
MEDIA_PAUSED: number;
MEDIA_STOPPED: number
};
/**
* This plugin provides the ability to record and play back audio files on a device.
* NOTE: The current implementation does not adhere to a W3C specification for media capture,
* and is provided for convenience only. A future implementation will adhere to the latest
* W3C specification and may deprecate the current APIs.
*/
interface Media {
/**
* Returns the current position within an audio file. Also updates the Media object's position parameter.
* @param mediaSuccess The callback that is passed the current position in seconds.
* @param mediaError The callback to execute if an error occurs.
*/
getCurrentPosition(
mediaSuccess: (position: number) => void,
mediaError?: (error: MediaError) => void): void;
/** Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1. */
getDuration(): number;
/** Starts or resumes playing an audio file. */
play(): void;
/** Pauses playing an audio file. */
pause(): void;
/**
* Releases the underlying operating system's audio resources. This is particularly important
* for Android, since there are a finite amount of OpenCore instances for media playback.
* Applications should call the release function for any Media resource that is no longer needed.
*/
release(): void;
/**
* Sets the current position within an audio file.
* @param position Position in milliseconds.
*/
seekTo(position: number): void;
/**
* Set the volume for an audio file.
* @param volume The volume to set for playback. The value must be within the range of 0.0 to 1.0.
*/
setVolume(volume: number): void;
/** Starts recording an audio file. */
startRecord(): void;
/** Stops recording an audio file. */
stopRecord(): void;
/** Stops playing an audio file. */
stop(): void;
/**
* The position within the audio playback, in seconds.
* Not automatically updated during play; call getCurrentPosition to update.
*/
position: number;
/** The duration of the media, in seconds. */
duration: number;
}
+167
View File
@@ -0,0 +1,167 @@
// Type definitions for Apache Cordova MediaCapture plugin.
// Project: https://github.com/apache/cordova-plugin-media-capture
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
device: Device;
}
interface Device {
capture: Capture;
}
/** This plugin provides access to the device's audio, image, and video capture capabilities. */
interface Capture {
/**
* Start the audio recorder application and return information about captured audio clip files.
* @param onSuccess Executes when the capture operation finishes with an array
* of MediaFile objects describing each captured audio clip file.
* @param onError Executes, if the user terminates the operation before an audio clip is captured,
* with a CaptureError object, featuring the CaptureError.CAPTURE_NO_MEDIA_FILES error code.
* @param options Encapsulates audio capture configuration options.
*/
captureAudio(
onSuccess: (mediaFiles: MediaFile[]) => void,
onError: (error: CaptureError) => void,
options?: AudioOptions): void ;
/**
* Start the camera application and return information about captured image files.
* @param onSuccess Executes when the capture operation finishes with an array
* of MediaFile objects describing each captured image clip file.
* @param onError Executes, if the user terminates the operation before an audio clip is captured,
* with a CaptureError object, featuring the CaptureError.CAPTURE_NO_MEDIA_FILES error code.
* @param options Encapsulates audio capture configuration options.
*/
captureImage(
onSuccess: (mediaFiles: MediaFile[]) => void,
onError: (error: CaptureError) => void,
options?: ImageOptions): void ;
/**
* Start the video recorder application and return information about captured video clip files.
* @param onSuccess Executes when the capture operation finishes with an array
* of MediaFile objects describing each captured video clip file.
* @param onError Executes, if the user terminates the operation before an audio clip is captured,
* with a CaptureError object, featuring the CaptureError.CAPTURE_NO_MEDIA_FILES error code.
* @param options Encapsulates audio capture configuration options.
*/
captureVideo(
onSuccess: (mediaFiles: MediaFile[]) => void,
onError: (error: CaptureError) => void,
options?: VideoOptions): void ;
/** The audio recording formats supported by the device. */
supportedAudioModes: ConfigurationData[];
/** The recording image sizes and formats supported by the device. */
supportedImageModes: ConfigurationData[];
/** The recording video resolutions and formats supported by the device. */
supportedVideoModes: ConfigurationData[];
}
/** Encapsulates properties of a media capture file. */
interface MediaFile {
/** The name of the file, without path information. */
name: string;
/** The full path of the file, including the name. */
fullPath: string;
/** The file's mime type */
type: string;
/** The date and time when the file was last modified. */
lastModifiedDate: Date;
/** The size of the file, in bytes. */
size: number;
/**
* Retrieves format information about the media capture file.
* @param successCallback Invoked with a MediaFileData object when successful.
* @param errorCallback Invoked if the attempt fails, this function.
*/
getFormatData(
successCallback: (data: MediaFileData) => void,
errorCallback?: () => void): void;
}
/** Encapsulates format information about a media file. */
interface MediaFileData {
/** The actual format of the audio and video content. */
codecs: string;
/** The average bitrate of the content. The value is zero for images. */
bitrate: number;
/** The height of the image or video in pixels. The value is zero for audio clips. */
height: number;
/** The width of the image or video in pixels. The value is zero for audio clips. */
width: number;
/** The length of the video or sound clip in seconds. The value is zero for images. */
duration: number;
}
/** Encapsulates the error code resulting from a failed media capture operation. */
interface CaptureError {
/**
* One of the pre-defined error codes listed below.
* CaptureError.CAPTURE_INTERNAL_ERR
* The camera or microphone failed to capture image or sound.
* CaptureError.CAPTURE_APPLICATION_BUSY
* The camera or audio capture application is currently serving another capture request.
* CaptureError.CAPTURE_INVALID_ARGUMENT
* Invalid use of the API (e.g., the value of limit is less than one).
* CaptureError.CAPTURE_NO_MEDIA_FILES
* The user exits the camera or audio capture application before capturing anything.
* CaptureError.CAPTURE_NOT_SUPPORTED
* The requested capture operation is not supported.
*/
code: number;
message: string;
}
declare var CaptureError: {
/** Constructor for CaptureError */
new (code: number, message: string): CaptureError;
CAPTURE_INTERNAL_ERR: number;
CAPTURE_APPLICATION_BUSY: number;
CAPTURE_INVALID_ARGUMENT: number;
CAPTURE_NO_MEDIA_FILES: number;
CAPTURE_NOT_SUPPORTED: number;
}
/** Encapsulates audio capture configuration options. */
interface AudioOptions {
/**
* The maximum number of audio clips the device's user can capture in a single
* capture operation. The value must be greater than or equal to 1.
*/
limit?: number;
/** The maximum duration of a audio clip, in seconds. */
duration?: number;
}
/** Encapsulates image capture configuration options. */
interface ImageOptions {
/**
* The maximum number of images the user can capture in a single capture operation.
* The value must be greater than or equal to 1 (defaults to 1).
*/
limit?: number;
}
/** Encapsulates video capture configuration options. */
interface VideoOptions {
/**
* The maximum number of video clips the device's user can capture in a single
* capture operation. The value must be greater than or equal to 1.
*/
limit?: number;
/** The maximum duration of a video clip, in seconds. */
duration?: number;
}
/** Encapsulates a set of media capture parameters that a device supports. */
interface ConfigurationData {
/** The ASCII-encoded lowercase string representing the media type. */
type: string;
/** The height of the image or video in pixels. The value is zero for sound clips. */
height: number;
/** The width of the image or video in pixels. The value is zero for sound clips. */
width: number;
}
+60
View File
@@ -0,0 +1,60 @@
// Type definitions for Apache Cordova Network Information plugin.
// Project: https://github.com/apache/cordova-plugin-network-information
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/**
* This plugin provides an implementation of an old version of the Network Information API.
* It provides information about the device's cellular and wifi connection, and whether the device has an internet connection.
*/
connection: Connection;
// see https://github.com/apache/cordova-plugin-network-information/blob/dev/doc/index.md#api-change
// for
network: {
/**
* This plugin provides an implementation of an old version of the Network Information API.
* It provides information about the device's cellular and wifi connection, and whether the device has an internet connection.
*/
connection: Connection
}
}
interface Document {
addEventListener(type: "online", connectionStateCallback: () => any, useCapture?: boolean): void;
addEventListener(type: "offline", connectionStateCallback: () => any, useCapture?: boolean): void;
}
/**
* The connection object, exposed via navigator.connection, provides information
* about the device's cellular and wifi connection.
*/
interface Connection {
/**
* This property offers a fast way to determine the device's network connection state, and type of connection.
* One of:
* Connection.UNKNOWN
* Connection.ETHERNET
* Connection.WIFI
* Connection.CELL_2G
* Connection.CELL_3G
* Connection.CELL_4G
* Connection.CELL
* Connection.NONE
*/
type: number
}
declare var Connection: {
UNKNOWN: number;
ETHERNET: number;
WIFI: number;
CELL_2G: number;
CELL_3G: number;
CELL_4G: number;
CELL: number;
NONE: number;
}
+68
View File
@@ -0,0 +1,68 @@
// Type definitions for Apache Cordova Push plugin.
// Project: https://github.com/phonegap-build/PushPlugin
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Window {
plugins: {
/**
* This plugin allows to receive push notifications. The Android implementation uses
* Google's GCM (Google Cloud Messaging) service,
* whereas the iOS version is based on Apple APNS Notifications
*/
pushNotification: PushNotification
}
}
/**
* This plugin allows to receive push notifications. The Android implementation uses
* Google's GCM (Google Cloud Messaging) service,
* whereas the iOS version is based on Apple APNS Notifications
*/
interface PushNotification {
/**
* Registers as push notification receiver.
* @param successCallback Called when a plugin method returns without error.
* @param errorCallback Called when the plugin returns an error.
* @param registrationOptions Options for registration process.
*/
register(
successCallback: (registrationId: string) => void,
errorCallback: (error: any) => void,
registrationOptions: RegistrationOptions): void;
/**
* Unregisters as push notification receiver.
* @param successCallback Called when a plugin method returns without error.
* @param errorCallback Called when the plugin returns an error.
*/
unregister(
successCallback: (result: any) => void,
errorCallback: (error: any) => void): void;
/**
* Sets the badge count visible when the app is not running. iOS only.
* @param successCallback Called when a plugin method returns without error.
* @param errorCallback Called when the plugin returns an error.
* @param badgeCount An integer indicating what number should show up in the badge. Passing 0 will clear the badge.
*/
setApplicationIconBadgeNumber(
successCallback: (result: any) => void,
errorCallback: (error: any) => void,
badgeCount: number): void;
}
/** Options for registration process. */
interface RegistrationOptions {
/** This is the Google project ID you need to obtain by registering your application for GCM. Android only */
senderID?: string;
/** WP8 only */
channelName?: string;
/** Callback, that is fired when notification arrived */
ecb?: string;
badge?: boolean;
sound?: boolean;
alert?: boolean
}
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for Apache Cordova Splashscreen plugin.
// Project: https://github.com/apache/cordova-plugin-splashscreen
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/** This plugin displays and hides a splash screen during application launch. */
splashscreen: {
/** Dismiss the splash screen. */
hide(): void;
/** Displays the splash screen. */
show(): void;
}
}
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for Apache Cordova Vibration plugin.
// Project: https://github.com/apache/cordova-plugin-vibration
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Notification {
/**
* Vibrates the device for the specified amount of time.
* @param time Milliseconds to vibrate the device. Ignored on iOS.
*/
vibrate(time: number): void
}
+103
View File
@@ -0,0 +1,103 @@
// Type definitions for Apache Cordova WebSQL plugin.
// Project: https://github.com/MSOpenTech/cordova-plugin-websql
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Window {
/**
* Creates (opens, if exist) database with supplied parameters.
* @param name Database name
* @param version Database version
* @param displayname Database display name
* @param size Size, in bytes
* @param creationCallback Callback, that executed on database creation. Accepts Database object.
*/
openDatabase(name: string,
version: string,
displayname: string,
size: number,
creationCallback?: (database: Database) => void): Database;
}
interface Database {
/**
* Starts new transaction.
* @param callback Function, that will be called when transaction starts.
* @param errorCallback Called, when Transaction fails.
* @param successCallback Called, when transaction committed.
*/
transaction(callback: (transaction: SqlTransaction) => void,
errorCallback?: (error: SqlError) => void,
successCallback?: () => void): void;
/**
* Starts new transaction.
* @param callback Function, that will be called when transaction starts.
* @param errorCallback Called, when Transaction fails.
* @param successCallback Called, when transaction committed.
*/
readTransaction(callback: (transaction: SqlTransaction) => void,
errorCallback?: (error: SqlError) => void,
successCallback?: () => void): void;
name: string;
version: string;
displayName: string;
size: number;
}
declare var Database: {
/** Constructor for Database object */
new(name: string,
version: string,
displayname: string,
size: number,
creationCallback: (database: Database)=> void): Database;
};
interface SqlTransaction {
/**
* Executes SQL statement via current transaction.
* @param sql SQL statement to execute.
* @param arguments SQL stetement arguments.
* @param successCallback Called in case of query has been successfully done.
* @param errorCallback Called, when query fails.
*/
executeSql(sql: string,
arguments?: any[],
successCallback?: (transaction: SqlTransaction, resultSet: SqlResultSet) => void,
errorCallback?: (transaction: SqlTransaction, error: SqlError) => void): void;
}
declare var SqlTransaction: {
new(): SqlTransaction;
};
interface SqlResultSet {
insertId: number;
rowsAffected: number;
rows: SqlResultSetRowList;
}
interface SqlResultSetRowList {
length: number;
item(index: number): Object;
}
interface SqlError {
code: number;
message: string;
}
declare var SqlError: {
// Error code constants from http://www.w3.org/TR/webdatabase/#sqlerror
UNKNOWN_ERR: number;
DATABASE_ERR: number;
VERSION_ERR: number;
TOO_LARGE_ERR: number;
QUOTA_ERR: number;
SYNTAX_ERR: number;
CONSTRAINT_ERR: number;
TIMEOUT_ERR: number;
};
+4 -4
View File
@@ -648,8 +648,8 @@ declare module 'couchbase' {
append(key: string, fragment: string, callback: KeyCallback): void;
append(key: string, fragment: string, options: AppendOptions, callback: KeyCallback): void;
append(key: string, fragment: NodeBuffer, callback: KeyCallback): void;
append(key: string, fragment: NodeBuffer, options: AppendOptions, callback: KeyCallback): void;
append(key: string, fragment: Buffer, callback: KeyCallback): void;
append(key: string, fragment: Buffer, options: AppendOptions, callback: KeyCallback): void;
appendMulti(kv: { [key: string]: AppendMultiOptionsForValue }, options: AppendMultiOptions, callback: MultiCallback): void;
decr(key: string, callback: KeyCallback): void;
@@ -683,8 +683,8 @@ declare module 'couchbase' {
prepend(key: string, fragment: string, callback: KeyCallback): void;
prepend(key: string, fragment: string, options: PrependOptions, callback: KeyCallback): void;
prepend(key: string, fragment: NodeBuffer, callback: KeyCallback): void;
prepend(key: string, fragment: NodeBuffer, options: PrependOptions, callback: KeyCallback): void;
prepend(key: string, fragment: Buffer, callback: KeyCallback): void;
prepend(key: string, fragment: Buffer, options: PrependOptions, callback: KeyCallback): void;
prependMulti(kv: { [key: string]: PrependMultiOptionsFoValue }, options: { [key: string]: PrependMultiOptions }, callback: MultiCallback): void;
remove(key: string, callback: KeyCallback): void;
+102
View File
@@ -0,0 +1,102 @@
// Type definitions for EaselJS 0.7.1, TweenJS 0.5.1, SoundJS 0.5.2, PreloadJS 0.4.1
// Project: http://www.createjs.com/#!/EaselJS
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>, Chris Smith <https://github.com/evilangelist>, Satoru Kimura <https://github.com/gyohk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/*
Copyright (c) 2012 Pedro Ferreira
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// Common class and methods for CreateJS.
// Library documentation : http://www.createjs.com/Docs/EaselJS/modules/EaselJS.html
// Library documentation : http://www.createjs.com/Docs/PreloadJS/modules/PreloadJS.html
// Library documentation : http://www.createjs.com/Docs/SoundJS/modules/SoundJS.html
// Library documentation : http://www.createjs.com/Docs/TweenJS/modules/TweenJS.html
declare module createjs {
export class Event {
constructor(type: string, bubbles: boolean, cancelable: boolean);
// properties
bubbles: boolean;
cancelable: boolean;
currentTarget: any; // It is 'Object' type officially, but 'any' is easier to use.
defaultPrevented: boolean;
eventPhase: number;
immediatePropagationStopped: boolean;
propagationStopped: boolean;
removed: boolean;
target: any; // It is 'Object' type officially, but 'any' is easier to use.
timeStamp: number;
type: string;
// other event payloads
data: any;
delta: number;
error: string;
id: string;
item: any;
loaded: number;
name: string;
next: string;
params: any;
paused: boolean;
progress: number;
rawResult: any;
result: any;
runTime: number;
src: string;
time: number;
total: number;
// methods
clone(): Event;
preventDefault(): void;
remove(): void;
stopImmediatePropagation(): void;
stopPropagation(): void;
toString(): string;
}
export class EventDispatcher {
constructor();
// methods
addEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
addEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
dispatchEvent(eventObj: Object, target?: Object): boolean;
dispatchEvent(eventObj: string, target?: Object): boolean;
dispatchEvent(eventObj: Event, target?: Object): boolean;
hasEventListener(type: string): boolean;
static initialize(target: Object): void;
off(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): void;
off(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
off(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
off(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
off(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
on(type: string, listener: (eventObj: Object) => boolean, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
on(type: string, listener: (eventObj: Object) => void, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
removeAllEventListeners(type?: string): void;
removeEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): void;
removeEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
removeEventListener(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
toString(): string;
willTrigger(type: string): boolean;
}
export function indexOf(array: any[], searchElement: Object): number;
export function proxy(method: (eventObj: Object) => boolean, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: (eventObj: Object) => void, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: { handleEvent: (eventObj: Object) => boolean; }, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: { handleEvent: (eventObj: Object) => void; }, scope: Object, ...arg: any[]): (eventObj: Object) => any;
}
+11 -89
View File
@@ -4,99 +4,21 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/*
Copyright (c) 2012 Pedro Ferreira
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// Common class and methods for CreateJS.
Copyright (c) 2012 Pedro Ferreira
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// Library documentation : http://www.createjs.com/Docs/EaselJS/modules/EaselJS.html
// Library documentation : http://www.createjs.com/Docs/PreloadJS/modules/PreloadJS.html
// Library documentation : http://www.createjs.com/Docs/SoundJS/modules/SoundJS.html
// Library documentation : http://www.createjs.com/Docs/TweenJS/modules/TweenJS.html
declare module createjs {
export class Event {
constructor(type: string, bubbles: boolean, cancelable: boolean);
/// <reference path="../createjs-lib/createjs-lib.d.ts" />
/// <reference path="../easeljs/easeljs.d.ts" />
/// <reference path="../tweenjs/tweenjs.d.ts" />
/// <reference path="../preloadjs/preloadjs.d.ts" />
/// <reference path="../soundjs/soundjs.d.ts" />
// properties
bubbles: boolean;
cancelable: boolean;
currentTarget: any; // It is 'Object' type officially, but 'any' is easier to use.
defaultPrevented: boolean;
eventPhase: number;
immediatePropagationStopped: boolean;
propagationStopped: boolean;
removed: boolean;
target: any; // It is 'Object' type officially, but 'any' is easier to use.
timeStamp: number;
type: string;
// other event payloads
data: any;
delta: number;
error: string;
id: string;
item: any;
loaded: number;
name: string;
next: string;
params: any;
paused: boolean;
progress: number;
rawResult: any;
result: any;
runTime: number;
src: string;
time: number;
total: number;
// methods
clone(): Event;
preventDefault(): void;
remove(): void;
stopImmediatePropagation(): void;
stopPropagation(): void;
toString(): string;
}
export class EventDispatcher {
constructor();
// methods
addEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
addEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
dispatchEvent(eventObj: Object, target?: Object): boolean;
dispatchEvent(eventObj: string, target?: Object): boolean;
dispatchEvent(eventObj: Event, target?: Object): boolean;
hasEventListener(type: string): boolean;
static initialize(target: Object): void;
off(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): void;
off(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
off(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
off(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
off(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
on(type: string, listener: (eventObj: Object) => boolean, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
on(type: string, listener: (eventObj: Object) => void, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
removeAllEventListeners(type?: string): void;
removeEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): void;
removeEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
removeEventListener(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
toString(): string;
willTrigger(type: string): boolean;
}
export function indexOf(array: any[], searchElement: Object): number;
export function proxy(method: (eventObj: Object) => boolean, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: (eventObj: Object) => void, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: { handleEvent: (eventObj: Object) => boolean; }, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: { handleEvent: (eventObj: Object) => void; }, scope: Object, ...arg: any[]): (eventObj: Object) => any;
}
+48 -53
View File
@@ -2286,62 +2286,57 @@ function attrObjTest () {
.attr({"xlink:href": function(d, i) { return d + "-" + i + ".png"; }});
}
// Test for setting styles as an object
// From https://github.com/mbostock/d3/blob/master/test/selection/style-test.js
function styleObjTest () {
d3.select('body')
.style({"background-color": "white", opacity: .42});
}
// Test for setting styles as an object
// From https://github.com/mbostock/d3/blob/master/test/selection/property-test.js
function propertyObjTest () {
d3.select('body')
.property({bgcolor: "purple", opacity: .41});
}
// Test for brushes
// This triggers a bug (shown below) in the 0.9.0 compiler, but works with
// 0.9.1 compiler.
function brushTest() {
var xScale = d3.scale.linear(),
yScale = d3.scale.linear();
// Stack trace:
// /usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:38215
// return (type === this.semanticInfoChain.anyTypeSymbol) || type.isError();
// ^
// TypeError: Cannot call method 'isError' of null
// at PullTypeResolver.isAnyOrEquivalent (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:38215:76)
// at PullTypeResolver.resolveNameExpression (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:39953:39)
// at PullTypeResolver.resolveAST (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:39758:37)
// at PullTypeResolver.computeIndexExpressionSymbol (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:40933:37)
// at PullTypeResolver.resolveIndexExpression (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:40925:45)
// at PullTypeResolver.resolveAST (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:39870:33)
// at PullTypeResolver.resolveOverloads (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:42917:43)
// at PullTypeResolver.computeCallExpressionSymbol (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:41373:34)
// at PullTypeResolver.resolveCallExpression (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:41175:29)
// at PullTypeChecker.typeCheckCallExpression (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:45111:58)
// at PullTypeChecker.typeCheckAST (/usr/local/share/npm/lib/node_modules/typescript/bin/tsc.js:43786:33)
var xMin = 0, xMax = 1,
yMin = 0, yMax = 1;
// function brushTest() {
// var xScale = d3.scale.linear(),
// yScale = d3.scale.linear();
//
// var xMin = 0, xMax = 1,
// yMin = 0, yMax = 1;
//
// // Setting only x scale.
// var brush1 = d3.svg.brush()
// .x(xScale)
// .on('brush', function () {
// var extent = brush1.extent();
// xMin = Math.max(extent[0], 0);
// xMax = Math.min(extent[1], 1);
// brush1.extent([xMin, xMax]);
// });
//
// // Setting both the x and y scale
// var brush2 = d3.svg.brush()
// .x(xScale)
// .y(yScale)
// .on('brush', function () {
// var extent = brush2.extent();
// var xExtent = extent[0],
// yExtent = extent[1];
//
// xMin = Math.max(xExtent[0], 0);
// xMax = Math.min(xExtent[1], 1);
//
// yMin = Math.max(yExtent[0], 0);
// yMax = Math.min(yExtent[1], 1);
//
// brush1.extent([[xMin, xMax], [yMin, yMax]]);
// });
// }
// Setting only x scale.
var brush1 = d3.svg.brush()
.x(xScale)
.on('brush', function () {
var extent = brush1.extent();
xMin = Math.max(extent[0], 0);
xMax = Math.min(extent[1], 1);
brush1.extent([xMin, xMax]);
});
// Setting both the x and y scale
var brush2 = d3.svg.brush()
.x(xScale)
.y(yScale)
.on('brush', function () {
var extent = brush2.extent();
var xExtent = extent[0],
yExtent = extent[1];
xMin = Math.max(xExtent[0], 0);
xMax = Math.min(xExtent[1], 1);
yMin = Math.max(yExtent[0], 0);
yMax = Math.min(yExtent[1], 1);
brush1.extent([[xMin, xMax], [yMin, yMax]]);
});
}
// Tests for area
Vendored
+5 -2
View File
@@ -54,6 +54,7 @@ declare module D3 {
y: number;
keyCode: number;
altKey: any;
type: string;
}
export interface Base extends Selectors {
@@ -709,7 +710,7 @@ declare module D3 {
(name: string): string;
(name: string, value: any): Selection;
(name: string, valueFunction: (data: any, index: number) => any): Selection;
(attrValueMap : any): Selection;
(attrValueMap : Object): Selection;
};
classed: {
@@ -722,12 +723,14 @@ declare module D3 {
(name: string): string;
(name: string, value: any, priority?: string): Selection;
(name: string, valueFunction: (data: any, index: number) => any, priority?: string): Selection;
(styleValueMap : Object): Selection;
};
property: {
(name: string): void;
(name: string, value: any): Selection;
(name: string, valueFunction: (data: any, index: number) => any): Selection;
(propertyValueMap : Object): Selection;
};
text: {
@@ -808,7 +811,7 @@ declare module D3 {
export interface EnterSelection {
append: (name: string) => Selection;
insert: (name: string, before: string) => Selection;
insert: (name: string, before?: string) => Selection;
select: (selector: string) => Selection;
empty: () => boolean;
node: () => Element;
@@ -1 +0,0 @@
""
+53
View File
@@ -0,0 +1,53 @@
/// <reference path="./diff.d.ts" />
import jsdiff = require('diff');
var one = 'beep boop';
var other = 'beep boob blah';
var diff = jsdiff.diffChars(one, other);
diff.forEach(function (part) {
var mark = part.added ? '+' :
part.removed ? '-' : ' ';
console.log(mark + " " + part.value);
});
// --------------------------
class LineDiffWithoutWhitespace extends jsdiff.Diff {
tokenize(value:string):any {
return value.split(/^/m);
}
equals(left:string, right:string):boolean {
return left.trim() === right.trim();
}
}
var obj = new LineDiffWithoutWhitespace(true);
var diff = obj.diff(one, other);
printDiff(diff);
function printDiff(diff:jsdiff.IDiffResult[]) {
function addLineHeader(decorator:string, str:string) {
return str.split("\n").map((line, index, array) => {
if (index === array.length - 1 && line === "") {
return line;
} else {
return decorator + line;
}
}).join("\n");
}
diff.forEach((part)=> {
if (part.added) {
console.log(addLineHeader("+", part.value));
} else if (part.removed) {
console.log(addLineHeader("-", part.value));
} else {
console.log(addLineHeader(" ", part.value));
}
});
}
+57
View File
@@ -0,0 +1,57 @@
// Type definitions for diff
// Project: https://github.com/kpdecker/jsdiff
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module JsDiff {
interface IDiffResult {
value: string;
added?: boolean;
removed?: boolean;
}
interface IBestPath {
newPos: number;
componenets: IDiffResult[];
}
class Diff {
ignoreWhitespace:boolean;
constructor(ignoreWhitespace?:boolean);
diff(oldString:string, newString:string):IDiffResult[];
pushComponent(components:IDiffResult[], value:string, added:boolean, removed:boolean):void;
extractCommon(basePath:IBestPath, newString:string, oldString:string, diagonalPath:number):number;
equals(left:string, right:string):boolean;
join(left:string, right:string):string;
tokenize(value:string):any; // return types are string or string[]
}
function diffChars(oldStr:string, newStr:string):IDiffResult[];
function diffWords(oldStr:string, newStr:string):IDiffResult[];
function diffWordsWithSpace(oldStr:string, newStr:string):IDiffResult[];
function diffLines(oldStr:string, newStr:string):IDiffResult[];
function diffCss(oldStr:string, newStr:string):IDiffResult[];
function createPatch(fileName:string, oldStr:string, newStr:string, oldHeader:string, newHeader:string):string;
function applyPatch(oldStr:string, uniDiff:string):string;
function convertChangesToXML(changes:IDiffResult[]):string;
function convertChangesToDMP(changes:IDiffResult[]):{0: number; 1:string;}[];
}
declare module "diff" {
export = JsDiff;
}
+5 -1
View File
@@ -3,4 +3,8 @@
// Definitions by: Christian Holm Nielsen
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function domready(callback: () => any) : void;
declare function domready(callback: () => any) : void;
declare module "domready" {
export = domready;
}
+2 -2
View File
@@ -12,10 +12,10 @@
// Library documentation : http://www.createjs.com/Docs/EaselJS/modules/EaselJS.html
/// <reference path="../createjs/createjs.d.ts" />
/// <reference path="../createjs-lib/createjs-lib.d.ts" />
/// <reference path="../tweenjs/tweenjs.d.ts" />
// rename the native MouseEvent, to avoid conflit with createjs's MouseEvent
// rename the native MouseEvent, to avoid conflict with createjs's MouseEvent
interface NativeMouseEvent extends MouseEvent {
}
+42
View File
@@ -0,0 +1,42 @@
/// <reference path="elm.d.ts" />
// Based on https://gist.github.com/evancz/8521339
interface Elm {
Shanghai: ElmModule<ShanghaiPorts>;
}
interface ShanghaiPorts {
coordinates: PortToElm<Array<number>>;
incomingShip: PortToElm<Ship>;
outgoingShip: PortToElm<string>;
totalCapacity: PortFromElm<number>;
}
interface Ship {
name: string;
capacity: number;
}
// initialize the Shanghai component which keeps track of
// shipping data in and out of the Port of Shanghai.
var shanghai = Elm.worker(Elm.Shanghai, {
coordinates: [0, 0],
incomingShip: { name: "", capacity: 0 },
outgoingShip: ""
});
function logger(x: any) { console.log(x) }
shanghai.ports.totalCapacity.subscribe(logger);
// send some ships to the port of Shanghai
shanghai.ports.incomingShip.send({
name: "Mary Mærsk",
capacity: 18270
});
shanghai.ports.incomingShip.send({
name: "Emma Mærsk",
capacity: 15500
});
// have those ships leave the port of Shanghai
shanghai.ports.outgoingShip.send("Mary Mærsk");
shanghai.ports.outgoingShip.send("Emma Mærsk");
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for Elm 0.12
// Project: http://elm-lang.org
// Definitions by: Dénes Harmath <https://github.com/thSoft>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var Elm: Elm;
interface Elm {
embed<P>(elmModule: ElmModule<P>, element: Node, initialValues?: Object): ElmComponent<P>;
fullscreen<P>(elmModule: ElmModule<P>, initialValues?: Object): ElmComponent<P>;
worker<P>(elmModule: ElmModule<P>, initialValues?: Object): ElmComponent<P>;
}
interface ElmModule<P> {
}
interface ElmComponent<P> {
ports: P;
}
interface PortToElm<V> {
send(value: V): void;
}
interface PortFromElm<V> {
subscribe(handler: (value: V) => void): void;
unsubscribe(handler: (value: V) => void): void;
}
+22
View File
@@ -0,0 +1,22 @@
/// <reference path="./emissary.d.ts" />
import emissary = require("emissary");
var Emitter = emissary.Emitter;
var emitter = new Emitter();
emitter.on('foo', ()=>{});
emitter.emit('a');
emitter.getSubscriptionCount('b');
emitter.on('b-subscription-added', (handler:any) =>{});
emitter.emit('b', 'b2');
emitter.off('foo', ()=>{});
emitter.signal('a');
var Subscriber = emissary.Subscriber;
var subscriber = new Subscriber();
subscriber.subscribe(emitter, 'event1', ()=>{});
subscriber.unsubscribe();
subscriber.unsubscribe(emitter);
+61
View File
@@ -0,0 +1,61 @@
// Type definitions for emissary
// Project: https://github.com/atom/emissary
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../mixto/mixto.d.ts" />
declare module Emissary {
interface IEmitterStatic extends Mixto.IMixinStatic {
new ():IEmitter;
}
interface IEmitter {
on(eventNames:string, handler:Function):any; // return value type are Signal
once(eventName:string, handler:Function):any; // return value type are Signal
signal(eventName:string):void;
behavior(eventName:string, initialValue:any):void;
emit(eventName:string, ...args:any[]):void;
off(eventNames:string, handler:Function):void;
pauseEvents(eventNames:string):void;
resumeEvents(eventNames:string):void;
incrementSubscriptionCount(eventName:string):number;
decrementSubscriptionCount(eventName:string):number;
getSubscriptionCount(eventName:string):number;
hasSubscriptions(eventName:string):boolean;
}
interface ISubscriberStatic extends Mixto.IMixinStatic {
new ():ISubscriber;
}
interface ISubscriber {
subscribeWith(eventEmitter:any, methodName:string, args:any):ISubscription;
addSubscription(subscription:any):ISubscription;
subscribe(eventEmitterOrSubscription:any, ...args:any[]):ISubscription;
subscribeToCommand(eventEmitter:any, ...args:any[]):ISubscription;
unsubscribe(object?:any):any;
}
interface ISubscriptionStatic {
new (emitter: any, eventNames:string, handler:Function):ISubscription;
}
interface ISubscription extends IEmitter {
cancelled:boolean;
off():any;
}
}
declare module "emissary" {
var Emitter:Emissary.IEmitterStatic;
var Subscriber:Emissary.ISubscriberStatic;
var Signal:Function; // TODO
var Behavior:Function; // TODO
var combine:Function; // TODO
}
+163
View File
@@ -0,0 +1,163 @@
/// <reference path="esprima.d.ts" />
import esprima = require('esprima');
import Syntax = esprima.Syntax;
var token: esprima.Token;
var options: esprima.Options;
var comment: Syntax.Comment;
var program: Syntax.Program;
var statement: Syntax.SomeStatement;
var blockStatement: Syntax.BlockStatement;
var expression: Syntax.SomeExpression;
var property: Syntax.Property;
var identifier: Syntax.Identifier;
var literal: Syntax.Literal;
var switchCase: Syntax.SwitchCase;
var catchClause: Syntax.CatchClause;
var variableDeclaratorOrExpression: Syntax.VariableDeclaratorOrExpression;
var literalOrIdentifier: Syntax.LiteralOrIdentifier;
var blockStatementOrExpression: Syntax.BlockStatementOrExpression;
var identifierOrExpression: Syntax.IdentifierOrExpression;
var any: any;
var string: string;
var boolean: boolean;
var number: number;
// esprima
string = esprima.version;
program = esprima.parse('code');
program = esprima.parse('code', {range: true});
token = esprima.tokenize('code')[0];
token = esprima.tokenize('code', {range: true})[0];
// Token
string = token.type;
string = token.value;
// Program
string = program.type;
statement = program.body[0];
comment = program.comments[0]
// Location
number = program.loc.start.line;
number = program.loc.start.column;
number = program.loc.end.line;
number = program.loc.end.column;
number = program.range[0];
// Comment
string = comment.value;
// Statement
// BlockStatement
string = statement.type;
statement = statement.body[0];
comment = statement.leadingComments[0]
comment = statement.trailingComments[0]
// ExpressionStatement
expression = statement.expression;
// IfStatement
expression = statement.test;
statement = statement.consequent;
statement = statement.alternate;
// LabeledStatement
identifier = statement.label;
statement = statement.body;
// WithStatement
expression = statement.object;
// SwitchStatement
expression = statement.discriminant;
switchCase = statement.cases[0];
boolean = statement.lexical;
// ReturnStatement
expression = statement.argument;
// TryStatement
blockStatement = statement.block;
catchClause = statement.handler;
catchClause = statement.guardedHandlers[0];
blockStatement = statement.finalizer;
// ForStatement
variableDeclaratorOrExpression = statement.init;
expression = statement.update;
// ForInStatement
variableDeclaratorOrExpression = statement.left;
expression = statement.right;
boolean = statement.each;
// Expression
// ArrayExpression
string = expression.type;
expression = expression.elements[0];
// ObjectExpression
property = expression.properties[0];
string = property.type;
literalOrIdentifier = property.key;
expression = property.value;
string = property.kind;
// FunctionExpression
identifier = expression.id;
identifier = expression.params[0];
expression = expression.defaults[0];
identifier = expression.rest;
blockStatementOrExpression = expression.body;
boolean = expression.generator;
boolean = expression.expression;
// SequenceExpression
expression = expression.expressions[0]
// UnaryExpression
string = expression.operator;
boolean = expression.prefix;
// BinaryExpression
expression = expression.left;
expression = expression.right;
// ConditionalExpression
expression = expression.test;
expression = expression.alternate;
expression = expression.consequent;
// ConditionalExpression
expression = expression.callee;
expression = expression.arguments[0];
// MemberExpression
expression = expression.object;
identifierOrExpression = expression.property;
boolean = expression.computed;
// Clauses
// SwitchCase
string = switchCase.type;
expression = switchCase.test;
statement = switchCase.consequent[0];
// CatchClause
string = catchClause.type;
identifier = catchClause.param;
expression = catchClause.guard;
blockStatement = catchClause.body;
// Misc
// Identifier
string = identifier.type;
string = identifier.name;
// Literal
string = literal.type;
any = literal.value;
+276
View File
@@ -0,0 +1,276 @@
// Type definitions for Esprima v1.2.0
// Project: http://esprima.org
// Definitions by: teppeis <https://github.com/teppeis/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module esprima {
var version: string;
function parse(code: string, options?: Options): Syntax.Program;
function tokenize(code: string, options?: Options): Array<Token>;
interface Token {
type: string
value: string
}
interface Options {
loc?: boolean
range?: boolean
raw?: boolean
tokens?: boolean
comment?: boolean
attachComment?: boolean
tolerant?: boolean
source?: boolean
}
module Syntax {
// Node
interface Node {
type: string
loc?: LineLocation
range?: number[]
leadingComments?: Comment[]
trailingComments?: Comment[]
}
interface LineLocation {
start: Position
end: Position
}
interface Position {
line: number
column: number
}
// Comment
interface Comment extends Node {
value: string
}
// Program
interface Program extends Node {
body: SomeStatement[]
comments?: Comment[]
}
// Function
interface Function extends Node {
id: Identifier // | null
params: Identifier[]
defaults: SomeExpression[]
rest: Identifier // | null
body: BlockStatementOrExpression
generator: boolean
expression: boolean
}
interface BlockStatementOrExpression extends Array<SomeStatement>, BlockStatement, SomeExpression {
body: BlockStatementOrExpression
}
// Statement
interface Statement extends Node {
}
interface EmptyStatement extends Statement {
}
interface BlockStatement extends Statement {
body: SomeStatement[]
}
interface ExpressionStatement extends Statement {
expression: SomeExpression
}
interface IfStatement extends Statement {
test: SomeExpression
consequent: SomeStatement
alternate: SomeStatement
}
interface LabeledStatement extends Statement {
label: Identifier
body: SomeStatement
}
interface BreakStatement extends Statement {
label: Identifier // | null
}
interface ContinueStatement extends Statement {
label: Identifier // | null
}
interface WithStatement extends Statement {
object: SomeExpression
body: SomeStatement
}
interface SwitchStatement extends Statement {
discriminant: SomeExpression
cases: SwitchCase[]
lexical: boolean
}
interface ReturnStatement extends Statement {
argument: SomeExpression // | null
}
interface ThrowStatement extends Statement {
argument: SomeExpression
}
interface TryStatement extends Statement {
block: BlockStatement
handler: CatchClause // | null
guardedHandlers: CatchClause[]
finalizer: BlockStatement // | null
}
interface WhileStatement extends Statement {
test: SomeExpression
body: SomeStatement
}
interface DoWhileStatement extends Statement {
body: SomeStatement
test: SomeExpression
}
interface ForStatement extends Statement {
init: VariableDeclaratorOrExpression // | null
test: SomeExpression // | null
update: SomeExpression // | null
body: SomeStatement
}
interface ForInStatement extends Statement {
left: VariableDeclaratorOrExpression
right: SomeExpression
body: SomeStatement
each: boolean
}
interface VariableDeclaratorOrExpression extends VariableDeclarator, SomeExpression {
}
interface DebuggerStatement extends Statement {
}
interface SomeStatement extends
EmptyStatement, ExpressionStatement, BlockStatement, IfStatement,
LabeledStatement, BreakStatement, ContinueStatement, WithStatement,
SwitchStatement, ReturnStatement, ThrowStatement, TryStatement,
WhileStatement, DoWhileStatement, ForStatement, ForInStatement, DebuggerStatement {
body: SomeStatementOrList
}
interface SomeStatementOrList extends Array<SomeStatement>, SomeStatement {
}
// Declration
interface Declration extends Statement {
}
interface FunctionDeclration extends Declration {
id: Identifier
params: Identifier[] // Pattern
defaults: SomeExpression[]
rest: Identifier
body: BlockStatementOrExpression
generator: boolean
expression: boolean
}
interface VariableDeclaration extends Declration {
declarations: VariableDeclarator[]
kind: string // "var" | "let" | "const"
}
interface VariableDeclarator extends Node {
id: Identifier // Pattern
init: SomeExpression
}
// Expression
interface Expression extends Node { // | Pattern
}
interface SomeExpression extends
ThisExpression, ArrayExpression, ObjectExpression, FunctionExpression,
ArrowFunctionExpression, SequenceExpression, UnaryExpression, BinaryExpression,
AssignmentExpression, UpdateExpression, LogicalExpression, ConditionalExpression,
NewExpression, CallExpression, MemberExpression {
}
interface ThisExpression extends Expression {
}
interface ArrayExpression extends Expression {
elements: SomeExpression[] // [ Expression | null ]
}
interface ObjectExpression extends Expression {
properties: Property[]
}
interface Property extends Node {
key: LiteralOrIdentifier // Literal | Identifier
value: SomeExpression
kind: string // "init" | "get" | "set"
}
interface LiteralOrIdentifier extends Literal, Identifier {
}
interface FunctionExpression extends Function, Expression {
}
interface ArrowFunctionExpression extends Function, Expression {
}
interface SequenceExpression extends Expression {
expressions: SomeExpression[]
}
interface UnaryExpression extends Expression {
operator: string // UnaryOperator
prefix: boolean
argument: SomeExpression
}
interface BinaryExpression extends Expression {
operator: string // BinaryOperator
left: SomeExpression
right: SomeExpression
}
interface AssignmentExpression extends Expression {
operator: string // AssignmentOperator
left: SomeExpression
right: SomeExpression
}
interface UpdateExpression extends Expression {
operator: string // UpdateOperator
argument: SomeExpression
prefix: boolean
}
interface LogicalExpression extends Expression {
operator: string // LogicalOperator
left: SomeExpression
right: SomeExpression
}
interface ConditionalExpression extends Expression {
test: SomeExpression
alternate: SomeExpression
consequent: SomeExpression
}
interface NewExpression extends Expression {
callee: SomeExpression
arguments: SomeExpression[]
}
interface CallExpression extends Expression {
callee: SomeExpression
arguments: SomeExpression[]
}
interface MemberExpression extends Expression {
object: SomeExpression
property: IdentifierOrExpression // Identifier | Expression
computed: boolean
}
interface IdentifierOrExpression extends Identifier, SomeExpression {
}
// Pattern
// interface Pattern extends Node {
// }
// Clauses
interface SwitchCase extends Node {
test: SomeExpression
consequent: SomeStatement[]
}
interface CatchClause extends Node {
param: Identifier // Pattern
guard: SomeExpression
body: BlockStatement
}
// Misc
interface Identifier extends Node, Expression { // | Pattern
name: string
}
interface Literal extends Node, Expression {
value: any // string | boolean | null | number | RegExp
}
}
}
declare module "esprima" {
export = esprima
}
+20 -3
View File
@@ -12,6 +12,17 @@
/// <reference path="../node/node.d.ts" />
declare module Express {
// These open interfaces may be extended in an application-specific manner via declaration merging.
// See for example passport.d.ts (https://github.com/borisyankov/DefinitelyTyped/blob/master/passport/passport.d.ts)
export interface Request { }
export interface Response { }
export interface Application { }
}
declare module "express" {
import http = require('http');
@@ -229,7 +240,7 @@ declare module "express" {
count: number;
}
interface Request {
interface Request extends http.ServerRequest, Express.Request {
session: Session;
@@ -545,7 +556,7 @@ declare module "express" {
(body: any): Response;
}
interface Response extends http.ServerResponse {
interface Response extends http.ServerResponse, Express.Response {
/**
* Set status `code`.
*
@@ -893,7 +904,7 @@ declare module "express" {
(req: Request, res: Response, next: Function): any;
}
interface Application extends IRouter<Application> {
interface Application extends IRouter<Application>, Express.Application {
/**
* Initialize the server.
*
@@ -967,6 +978,12 @@ declare module "express" {
* @param val
*/
set (setting: string, val: string): Application;
get(name: string): string;
get(name: string, ...handlers: RequestFunction[]): Application;
get(name: RegExp, ...handlers: RequestFunction[]): Application;
/**
* Return the app's absolute pathname
+29
View File
@@ -0,0 +1,29 @@
/// <reference path="fbsdk.d.ts" />
window.fbAsyncInit = function() {
FB.init(
{
appId : '{your-app-id}',
xfbml : true,
version : 'v2.0'
}
);
FB.ui(
{
method: 'share',
href: 'https://developers.facebook.com/docs/dialogs/'
},
function(response) {
console.log(response);
}
);
FB.api(
"/me",
"POST",
function (fbResponse){
console.log(fbResponse);
}
);
};
+135
View File
@@ -0,0 +1,135 @@
// Type definitions for Facebook Javascript SDK
// Project: https://developers.facebook.com/docs/javascript
// Definitions by: Joshua Strobl <https://github.com/JoshStrobl>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface FBInitParams{
appId ?: string;
authResponse ?: string;
cookie ?: boolean;
frictionlessRequests ?: boolean;
hideFlashCallback ?: Function;
logging ?: boolean;
status ?: boolean;
version ?: string;
xfbml ?: boolean;
}
interface FBUIParams{
method : string;
}
interface FBLoginOptions{
auth_type ?: string;
scopes ?: string;
return_scopes ?: boolean;
enable_profile_selector ?: boolean;
profile_selector_ids ?: string;
}
interface FBSDKEvents{
/* This method allows you to subscribe to a range of events, and define callback functions for when they fire. */
subscribe(event : string, callback : (fbResponseObject : Object) => any) : void;
/* This method allows you to un-subscribe a callback from any events previously subscribed to using .Event.subscribe(). */
unsubscribe(event : string, callback : (fbResponseObject : Object) => any) : void;
}
interface FBSDKXFBML{
/* This function parses and renders XFBML markup in a document on the fly. */
parse(ParseElement ?: Element) : void;
parse(ParseElement ?: HTMLElement) : void;
}
interface FBSDKCanvasPrefetcher{
/* Tells Facebook that the current page uses a specified resource. */
addStaticResource(res : string) : void;
/* Controls how statistics are collected on resources used by your application. */
setCollectionMode(option : string) : void;
}
interface FBSDKCanvasSize{
height ?: Number;
width ?: Number;
}
interface FBSDKCanvasDoneLoading{
time_delta_ms : Number;
}
interface FBSDKCanvas{
Prefetcher : FBSDKCanvasPrefetcher;
/* Hides the HTML element passed in via the elem param from view. */
hideFlashElement(element : Element) : void;
hideFlashElement(element : HTMLElement) : void;
/* Displays the HTML element passed in via the elem param, after it has been hidden via FB.Canvas.hideFlashElement. */
showFlashElement(element : Element) : void;
showFlashElement(element : HTMLElement) : void;
/* Tells Facebook to scroll to a specific location of your canvas page. */
scrollTo(x : Number, y : Number) : void;
/* Starts or stops a timer which will grow your iframe to fit the content every few milliseconds. */
setAutoGrow(stopTimer : boolean) : void;
setAutoGrow(diffInterval : Number) : void;
setAutoGrow(stopTimer : boolean, diffInterval : Number) : void
/* Tells Facebook to resize your iframe. */
setSize(canvasSizeOptions : FBSDKCanvasSize) : void;
/* Registers the callback for inline processing (i.e. without page reload) of user actions when they click on any link to the current app from Canvas */
setUrlHandler(handler ?: Function) : string;
/* Calls you back with an integer, in milliseconds, of the timing of the page load, beginning from the time when the first bytes arrive on
the client, and ending from the point at which you call this function.
*/
setDoneLoading(handler ?: Function) : FBSDKCanvasDoneLoading;
/* Call startTimer to resume the timer after a period of time for the page load that you didn't wish to measure, which you began by calling stopTimer. */
startTimer() : void;
/* Call stopTimer when you wish to stop timing the page load for a period of time */
stopTimer(handler ?: (fbResponseObject : Object) => any) : void;
}
interface FBSDK{
/* This method is used to initialize and setup the SDK. */
init(fbInitObject : FBInitParams) : void;
/* This method lets you make calls to the Graph API. */
api(path : string, method : string, callback : (fbResponseObject : Object) => any) : Object;
api(path : string, params : Object, callback : (fbResponseObject : Object) => any) : Object;
api(path : string, method : string, params : Object, callback : (fbResponseObject : Object) => any) : Object;
/* This method is used to trigger different forms of Facebook created UI dialogs. */
ui(params : FBUIParams, handler : (fbResponseObject : Object) => any) : void;
/* Allows you to determine if a user is logged in to Facebook and has authenticated your app */
getLoginStatus(handler : Function, force ?: Boolean) : void;
/* Calling FB.login prompts the user to authenticate your application using the Login Dialog. */
login(handler : (fbResponseObject : Object) => any, params ?: FBLoginOptions): void;
/* Log the user out of your site and Facebook */
logout(handler : (fbResponseObject : Object) => any) : void;
/* Synchronous accessor for the current authResponse. */
getAuthResponse() : Object;
Event : FBSDKEvents;
XFBML : FBSDKXFBML;
Canvas : FBSDKCanvas;
}
interface Window{
fbAsyncInit() : any;
}
declare module "FB" {
export = FB;
}
declare var FB : FBSDK;
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="fibers.d.ts" />
import fibers = require('fibers');
var fib: fibers.Fiber;
var x:any = null;
var func: () => void = null;
fib = fibers(func);
fib = fibers.current;
x = fibers.yield(x);
x = fib.run();
x = fib.run(x);
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for fibers
// Project: https://github.com/laverdet/node-fibers
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/fibers.d.ts
declare module "fibers" {
function fibers(callback: () => void): fibers.Fiber;
module fibers {
export var poolSize: number;
export var fibersCreated: number;
export var current: fibers.Fiber;
export function yield(value: any): any;
export interface Fiber {
run(step?: number): any;
}
}
export = fibers;
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="form-data.d.ts" />
import formData = require('form-data');
var value: any;
var fd = new formData.FormData();
var obj: Object = fd.getHeaders();
value = fd.pipe(value);
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for fibers
// Project: https://github.com/felixge/node-form-data
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/form-data.d.ts
declare module "form-data" {
export class FormData {
append(key: string, value: any): FormData;
getHeaders(): Object;
// TODO expand pipe
pipe(to: any): any;
}
}
+229
View File
@@ -0,0 +1,229 @@
/// <reference path="fs-extra.d.ts" />
/// <reference path="../node/node.d.ts" />
import fs = require('fs-extra');
import stream = require('stream');
var stats: fs.Stats;
var str: string;
var strArr: string[];
var bool: boolean;
var num: number;
var src: string;
var dest: string;
var file: string;
var filename: string;
var dir: string;
var path: string;
var data: any;
var object: Object;
var buffer: NodeBuffer;
var modeNum: number;
var modeStr: string;
var encoding: string;
var type: string;
var flags: string;
var srcpath: string;
var dstpath: string;
var oldPath: string;
var newPath: string;
var cache: string;
var offset: number;
var length: number;
var position: number;
var cacheBool: boolean;
var cacheStr: string;
var fd: number;
var len: number;
var uid: number;
var gid: number;
var atime: number;
var mtime: number;
var statsCallback: (err: Error, stats: fs.Stats) => void;
var errorCallback: (err: Error) => void;
var openOpts: fs.OpenOptions;
var watcher: fs.FSWatcher;
var readStreeam: stream.Readable;
var writeStream: stream.Writable;
fs.copy(src, dest, errorCallback);
fs.copy(src, dest, (src: string) => {
return false;
}, errorCallback);
fs.copySync(src, dest);
fs.copySync(src, dest, (src: string) => {
return false;
});
fs.createFile(file, errorCallback);
fs.createFileSync(file);
fs.mkdirs(dir, errorCallback);
fs.mkdirsSync(dir);
fs.mkdirp(dir, errorCallback);
fs.mkdirpSync(dir);
fs.outputFile(file, data, errorCallback);
fs.outputFileSync(file, data);
fs.outputJson(file, data, errorCallback);
fs.outputJSON(file, data, errorCallback);
fs.outputJsonSync(file, data);
fs.outputJSONSync(file, data);
fs.readJson(file, errorCallback);
fs.readJson(file, openOpts, errorCallback);
fs.readJSON(file, errorCallback);
fs.readJSON(file, openOpts, errorCallback);
fs.readJsonSync(file, openOpts);
fs.readJSONSync(file, openOpts);
fs.remove(dir, errorCallback);
fs.removeSync(dir);
fs.writeJson(file, object, errorCallback);
fs.writeJson(file, object, openOpts, errorCallback);
fs.writeJSON(file, object, errorCallback);
fs.writeJSON(file, object, openOpts, errorCallback);
fs.writeJsonSync(file, object, openOpts);
fs.writeJSONSync(file, object, openOpts);
fs.rename(oldPath, newPath, errorCallback);
fs.renameSync(oldPath, newPath);
fs.truncate(fd, len, errorCallback);
fs.truncateSync(fd, len);
fs.chown(path, uid, gid, errorCallback);
fs.chownSync(path, uid, gid);
fs.fchown(fd, uid, gid, errorCallback);
fs.fchownSync(fd, uid, gid);
fs.lchown(path, uid, gid, errorCallback);
fs.lchownSync(path, uid, gid);
fs.chmod(path, modeNum, errorCallback);
fs.chmod(path, modeStr, errorCallback);
fs.chmodSync(path, modeNum);
fs.chmodSync(path, modeStr);
fs.fchmod(fd, modeNum, errorCallback);
fs.fchmod(fd, modeStr, errorCallback);
fs.fchmodSync(fd, modeNum);
fs.fchmodSync(fd, modeStr);
fs.lchmod(path, modeStr, errorCallback);
fs.lchmod(path, modeNum, errorCallback);
fs.lchmodSync(path, modeNum);
fs.lchmodSync(path, modeStr);
fs.stat(path, statsCallback);
fs.lstat(path, statsCallback);
fs.fstat(fd, statsCallback);
stats = fs.statSync(path);
stats = fs.lstatSync(path);
stats = fs.fstatSync(fd);
fs.link(srcpath, dstpath, errorCallback);
fs.linkSync(srcpath, dstpath);
fs.symlink(srcpath, dstpath, type, errorCallback);
fs.symlinkSync(srcpath, dstpath, type);
fs.readlink(path, (err: Error, linkString: string) => {
});
fs.realpath(path, (err: Error, resolvedPath: string) => {
});
fs.realpath(path, cache, (err: Error, resolvedPath: string) => {
});
str = fs.realpathSync(path, cacheBool);
fs.unlink(path, errorCallback);
fs.unlinkSync(path);
fs.rmdir(path, errorCallback);
fs.rmdirSync(path);
fs.mkdir(path, modeNum, errorCallback);
fs.mkdir(path, modeStr, errorCallback);
fs.mkdirSync(path, modeNum);
fs.mkdirSync(path, modeStr);
fs.readdir(path, (err: Error, files: string[]) => {
});
strArr = fs.readdirSync(path);
fs.close(fd, errorCallback);
fs.closeSync(fd);
fs.open(path, flags, modeStr, (err: Error, fd: number) => [
]);
num = fs.openSync(path, flags, modeStr);
fs.utimes(path, atime, mtime, errorCallback);
fs.utimesSync(path, atime, mtime);
fs.futimes(fd, atime, mtime, errorCallback);
fs.futimesSync(fd, atime, mtime);
fs.fsync(fd, errorCallback);
fs.fsyncSync(fd);
fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: NodeBuffer) => {
});
num = fs.writeSync(fd, buffer, offset, length, position);
fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: NodeBuffer) => {
});
num = fs.readSync(fd, buffer, offset, length, position);
fs.readFile(filename, (err: Error, data: NodeBuffer) => {
});
fs.readFile(filename, encoding, (err: Error, data: string) => {
});
fs.readFile(filename, openOpts, (err: Error, data: string) => {
});
fs.readFile(filename, (err: Error, data: NodeBuffer) => {
});
buffer = fs.readFileSync(filename);
str = fs.readFileSync(filename, encoding);
str = fs.readFileSync(filename, openOpts);
fs.writeFile(filename, data, errorCallback);
fs.writeFile(filename, data, encoding, errorCallback);
fs.writeFile(filename, data, openOpts, errorCallback);
fs.writeFileSync(filename, data);
fs.writeFileSync(filename, data, encoding);
fs.writeFileSync(filename, data, openOpts);
fs.appendFile(filename, data, errorCallback);
fs.appendFile(filename, data, encoding, errorCallback);
fs.appendFile(filename, data, openOpts, errorCallback);
fs.appendFileSync(filename, data);
fs.appendFileSync(filename, data, encoding);
fs.appendFileSync(filename, data, openOpts);
fs.watchFile(filename, {
curr: stats,
prev: stats
});
fs.watchFile(filename, {
persistent: bool,
interval: num
}, {
curr: stats,
prev: stats
});
fs.unwatchFile(filename);
watcher = fs.watch(filename, { persistent: bool }, (event: string, filename: string) => {
});
fs.exists(path, (exists: boolean) => {
});
bool = fs.existsSync(path);
readStreeam = fs.createReadStream(path);
readStreeam = fs.createReadStream(path, {
flags: str,
encoding: str,
fd: num,
mode: num,
bufferSize: num
});
writeStream = fs.createWriteStream(path);
writeStream = fs.createWriteStream(path, {
flags: str,
encoding: str,
string: str
});
+187
View File
@@ -0,0 +1,187 @@
// Type definitions for aws-sdk
// Project: https://github.com/jprichardson/node-fs-extra
// Definitions by: midknight41 <https://github.com/midknight41>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts
///<reference path="../node/node.d.ts"/>
declare module "fs-extra" {
import stream = require("stream");
export interface Stats {
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
isCharacterDevice(): boolean;
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
dev: number;
ino: number;
mode: number;
nlink: number;
uid: number;
gid: number;
rdev: number;
size: number;
blksize: number;
blocks: number;
atime: Date;
mtime: Date;
ctime: Date;
}
export interface FSWatcher {
close(): void;
}
export class ReadStream extends stream.Readable { }
export class WriteStream extends stream.Writable { }
//extended methods
export function copy(src: string, dest: string, callback?: (err: Error) => void): void;
export function copy(src: string, dest: string, filter: (src: string) => boolean, callback?: (err: Error) => void): void;
export function copySync(src: string, dest: string): void;
export function copySync(src: string, dest: string, filter: (src: string) => boolean): void;
export function createFile(file: string, callback?: (err: Error) => void): void;
export function createFileSync(file: string): void;
export function mkdirs(dir: string, callback?: (err: Error) => void): void;
export function mkdirp(dir: string, callback?: (err: Error) => void): void;
export function mkdirsSync(dir: string): void;
export function mkdirpSync(dir: string): void;
export function outputFile(file: string, data: any, callback?: (err: Error) => void): void;
export function outputFileSync(file: string, data: any): void;
export function outputJson(file: string, data: any, callback?: (err: Error) => void): void;
export function outputJSON(file: string, data: any, callback?: (err: Error) => void): void;
export function outputJsonSync(file: string, data: any): void;
export function outputJSONSync(file: string, data: any): void;
export function readJson(file: string, callback?: (err: Error) => void): void;
export function readJson(file: string, options?: OpenOptions, callback?: (err: Error) => void): void;
export function readJSON(file: string, callback?: (err: Error) => void): void;
export function readJSON(file: string, options?: OpenOptions, callback?: (err: Error) => void): void;
export function readJsonSync(file: string, options?: OpenOptions): void;
export function readJSONSync(file: string, options?: OpenOptions): void;
export function remove(dir: string, callback?: (err: Error) => void): void;
export function removeSync(dir: string): void;
// export function delete(dir: string, callback?: (err: Error) => void): void;
// export function deleteSync(dir: string): void;
export function writeJson(file: string, object: any, callback?: (err: Error) => void): void;
export function writeJson(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void;
export function writeJSON(file: string, object: any, callback?: (err: Error) => void): void;
export function writeJSON(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void;
export function writeJsonSync(file: string, object: any, options?: OpenOptions): void;
export function writeJSONSync(file: string, object: any, options?: OpenOptions): void;
export function rename(oldPath: string, newPath: string, callback?: (err: Error) => void): void;
export function renameSync(oldPath: string, newPath: string): void;
export function truncate(fd: number, len: number, callback?: (err: Error) => void): void;
export function truncateSync(fd: number, len: number): void;
export function chown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void;
export function chownSync(path: string, uid: number, gid: number): void;
export function fchown(fd: number, uid: number, gid: number, callback?: (err: Error) => void): void;
export function fchownSync(fd: number, uid: number, gid: number): void;
export function lchown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void;
export function lchownSync(path: string, uid: number, gid: number): void;
export function chmod(path: string, mode: number, callback?: (err: Error) => void): void;
export function chmod(path: string, mode: string, callback?: (err: Error) => void): void;
export function chmodSync(path: string, mode: number): void;
export function chmodSync(path: string, mode: string): void;
export function fchmod(fd: number, mode: number, callback?: (err: Error) => void): void;
export function fchmod(fd: number, mode: string, callback?: (err: Error) => void): void;
export function fchmodSync(fd: number, mode: number): void;
export function fchmodSync(fd: number, mode: string): void;
export function lchmod(path: string, mode: string, callback?: (err: Error) => void): void;
export function lchmod(path: string, mode: number, callback?: (err: Error) => void): void;
export function lchmodSync(path: string, mode: number): void;
export function lchmodSync(path: string, mode: string): void;
export function stat(path: string, callback?: (err: Error, stats: Stats) => void): void;
export function lstat(path: string, callback?: (err: Error, stats: Stats) => void): void;
export function fstat(fd: number, callback?: (err: Error, stats: Stats) => void): void;
export function statSync(path: string): Stats;
export function lstatSync(path: string): Stats;
export function fstatSync(fd: number): Stats;
export function link(srcpath: string, dstpath: string, callback?: (err: Error) => void): void;
export function linkSync(srcpath: string, dstpath: string): void;
export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error) => void): void;
export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
export function readlink(path: string, callback?: (err: Error, linkString: string) => void): void;
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => void): void;
export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) => void): void;
export function realpathSync(path: string, cache?: boolean): string;
export function unlink(path: string, callback?: (err: Error) => void): void;
export function unlinkSync(path: string): void;
export function rmdir(path: string, callback?: (err: Error) => void): void;
export function rmdirSync(path: string): void;
export function mkdir(path: string, mode?: number, callback?: (err: Error) => void): void;
export function mkdir(path: string, mode?: string, callback?: (err: Error) => void): void;
export function mkdirSync(path: string, mode?: number): void;
export function mkdirSync(path: string, mode?: string): void;
export function readdir(path: string, callback?: (err: Error, files: string[]) => void ): void;
export function readdirSync(path: string): string[];
export function close(fd: number, callback?: (err: Error) => void): void;
export function closeSync(fd: number): void;
export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fs: number) => void): void;
export function openSync(path: string, flags: string, mode?: string): number;
export function utimes(path: string, atime: number, mtime: number, callback?: (err: Error) => void): void;
export function utimesSync(path: string, atime: number, mtime: number): void;
export function futimes(fd: number, atime: number, mtime: number, callback?: (err: Error) => void): void;
export function futimesSync(fd: number, atime: number, mtime: number): void;
export function fsync(fd: number, callback?: (err: Error) => void): void;
export function fsyncSync(fd: number): void;
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void;
export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void ): void;
export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void;
export function readFile(filename: string, options: OpenOptions, callback: (err: Error, data: string) => void ): void;
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
export function readFileSync(filename: string): NodeBuffer;
export function readFileSync(filename: string, encoding: string): string;
export function readFileSync(filename: string, options: OpenOptions): string;
export function writeFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void;
export function writeFile(filename: string, data: any, options?: OpenOptions, callback?: (err: Error) => void): void;
export function writeFileSync(filename: string, data: any, encoding?: string): void;
export function writeFileSync(filename: string, data: any, option?: OpenOptions): void;
export function appendFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void;
export function appendFile(filename: string, data: any,option?: OpenOptions, callback?: (err: Error) => void): void;
export function appendFileSync(filename: string, data: any, encoding?: string): void;
export function appendFileSync(filename: string, data: any, option?: OpenOptions): void;
export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void;
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void;
export function unwatchFile(filename: string, listener?: Stats): void;
export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
export function exists(path: string, callback?: (exists: boolean) => void ): void;
export function existsSync(path: string): boolean;
export interface OpenOptions {
encoding?: string;
flag?: string;
}
export interface ReadStreamOptions {
flags?: string;
encoding?: string;
fd?: number;
mode?: number;
bufferSize?: number;
}
export interface WriteStreamOptions {
flags?: string;
encoding?: string;
string?: string;
}
export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream;
export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream;
}
+173 -86
View File
@@ -7,29 +7,37 @@
declare module FullCalendar {
export interface Calendar {
/**
* Formats a Date object into a string.
*/
* Formats a Date object into a string.
*/
formatDate(date: Date, format: string, options?: Options): string;
/**
* Formats a date range (two Date objects) into a string.
*/
* Formats a date range (two Date objects) into a string.
*/
formatDates(date1: Date, date2: Date, format: string, options?: Options): string;
/**
* Parses a string into a Date object.
*/
* Parses a string into a Date object.
*/
parseDate(dateString: string, ignoreTimezone?: boolean): Date;
/**
* Parses an ISO8601 string into a Date object.
*/
* Parses an ISO8601 string into a Date object.
*/
parseISO8601(dateString: string, ignoreTimezone?: boolean): Date;
/**
* Gets the version of Fullcalendar
*/
* Gets the version of Fullcalendar
*/
version: string;
}
export interface Options {
// General display - http://arshaw.com/fullcalendar/docs/display/
header?: {
left: string;
center: string;
@@ -43,22 +51,31 @@ declare module FullCalendar {
firstDay?: number;
isRTL?: boolean;
weekends?: boolean;
hiddenDays?: number[];
weekMode?: string;
weekNumbers?: boolean;
weekNumberCalculation?: any; // String/Function
height?: number;
contentHeight?: number;
aspectRation?: number;
viewDisplay?: (view: View) => void;
windowResize?: (view: View) => void;
aspectRatio?: number;
handleWindowResize?: boolean;
viewRender?: (view: View, element: JQuery) => void;
viewDestroy?: (view: View, element: JQuery) => void;
dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void;
windowResize?: (view: View) => void;
// Views - http://arshaw.com/fullcalendar/docs/views/
defaultView?: string;
// Current Date - http://arshaw.com/fullcalendar/docs/current_date/
year?: number;
month?: number;
date?: number;
// Text/Time Customization - http://arshaw.com/fullcalendar/docs/text/
timeFormat?: any; // String/ViewOptionHash
columnFormat?: any; // String/ViewOptionHash
titleFormat?: any; // String/ViewOptionHash
@@ -67,13 +84,17 @@ declare module FullCalendar {
monthNamesShort?: Array<string>;
dayNames?: Array<string>;
dayNamesShort?: Array<string>;
weekNumberTitle?: number;
weekNumberTitle?: string;
// Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/
dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: View) => void;
eventClick?: (event: EventObject, jsEvent: MouseEvent, view: View) => any; // return type boolean or void
eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: View) => void;
eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: View) => void;
// Selection - http://arshaw.com/fullcalendar/docs/selection/
selectable?: any; // Boolean/ViewOptionHash
selectHelper?: any; // Boolean/Function
unselectAuto?: boolean;
@@ -81,26 +102,51 @@ declare module FullCalendar {
select?: (startDate: Date, endDate: Date, allDay: boolean, jsEvent: MouseEvent, view: View) => void;
unselect?: (view: View, jsEvent: Event) => void;
eventSources?: Array<EventSource>;
// Event Data - http://arshaw.com/fullcalendar/docs/event_data/
/**
* This has one of the following types:
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date, end: Date, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
/**
* An array, each element being one of the following types:
*
* - EventSource
* - EventObject[]
* - string (JSON feed)
* - (start: Date, end: Date, callback: {(events: EventObject[]) => void;}) => void;
*/
eventSources?: any[];
allDayDefault?: boolean;
ignoreTimezone?: boolean;
eventDataTransform?: (eventData: any) => EventObject;
startParam?: string;
endParam?: string
lazyFetching?: boolean;
eventDataTransform?: (eventData: any) => EventObject;
loading?: (isLoading: boolean, view: View) => void;
// Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/
eventColor?: string;
eventBackgroundColor?: string;
eventBorderColor?: string;
eventTextColor?: string;
eventRender?: (event: EventObject, element: HTMLDivElement, view: View) => void;
eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: View) => void;
eventAllAfterRender?: (view: View) => void;
eventAfterAllRender?: (view: View) => void;
eventDestroy?: (event: EventObject, element: JQuery, view: View) => void;
// Event Dragging & Resizing
editable?: boolean;
disableDragging?: boolean;
disableResizing?: boolean;
eventStartEditable?: boolean;
eventDurationEditable?: boolean;
dragRevertDuration?: number;
dragOpacity?: any; // Float/ViewOptionHash
eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: View) => void;
@@ -119,7 +165,7 @@ declare module FullCalendar {
name: string;
title: string;
start: Date;
End: Date;
end: Date;
visStart: Date;
visEnd: Date;
}
@@ -137,6 +183,9 @@ declare module FullCalendar {
''?: any;
}
/**
* Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/
*/
export interface AgendaOptions {
allDaySlot?: boolean;
allDayText?: string;
@@ -147,6 +196,7 @@ declare module FullCalendar {
firstHour?: number;
minTime?: any; // Integer/String
maxTime?: any; // Integer/String
slotEventOverlap?: boolean;
}
export interface ButtonTextObject {
@@ -177,7 +227,16 @@ declare module FullCalendar {
}
export interface EventSource extends JQueryAjaxSettings {
/**
* This has one of the following types:
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date, end: Date, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
color?: string;
backgroundColor?: string;
borderColor?: string;
@@ -194,117 +253,145 @@ declare module FullCalendar {
}
interface JQuery {
/**
* Get/Set option value
*/
* Get/Set option value
*/
fullCalendar(method: 'option', option: string, value?: any): void;
/**
* Immediately forces the calendar to render and/or readjusts its size.
*/
* Immediately forces the calendar to render and/or readjusts its size.
*/
fullCalendar(method: 'render'): void;
/**
* Restores the element to the state before FullCalendar was initialized.
*/
* Restores the element to the state before FullCalendar was initialized.
*/
fullCalendar(method: 'destroy'): void;
/**
* Moves the calendar one step back (either by a month, week, or day).
*/
fullCalendar(method: 'prev'): void;
/**
* Moves the calendar one step forward (either by a month, week, or day).
*/
fullCalendar(method: 'next'): void;
/**
* Moves the calendar back one year.
*/
fullCalendar(method: 'prevYear'): void;
/**
* Moves the calendar forward one year.
*/
fullCalendar(method: 'nextYear'): void;
/**
* Moves the calendar to the current date.
*/
fullCalendar(method: 'today'): void;
/**
* Returns the View Object for the current view.
*/
* Returns the View Object for the current view.
*/
fullCalendar(method: 'getView'): FullCalendar.View;
/**
* Immediately switches to a different view.
*/
* Immediately switches to a different view.
*/
fullCalendar(method: 'changeView', viewName: string): void;
/**
* Moves the calendar to an arbitrary year/month/date.
*/
* Moves the calendar one step back (either by a month, week, or day).
*/
fullCalendar(method: 'prev'): void;
/**
* Moves the calendar one step forward (either by a month, week, or day).
*/
fullCalendar(method: 'next'): void;
/**
* Moves the calendar back one year.
*/
fullCalendar(method: 'prevYear'): void;
/**
* Moves the calendar forward one year.
*/
fullCalendar(method: 'nextYear'): void;
/**
* Moves the calendar to the current date.
*/
fullCalendar(method: 'today'): void;
/**
* Moves the calendar to an arbitrary year/month/date.
*/
fullCalendar(method: 'gotoDate', year: number, month?: number, date?: number): void;
/**
* Moves the calendar to an arbitrary date.
*/
* Moves the calendar to an arbitrary date.
*/
fullCalendar(method: 'gotoDate', date: Date): void;
/**
* Moves the calendar forward/backward an arbitrary amount of time.
*/
* Moves the calendar forward/backward an arbitrary amount of time.
*/
fullCalendar(method: 'incrementDate', year: number, month?: number, date?: number): void;
/**
* Returns a Date object for the current date of the calendar.
*/
* Returns a Date object for the current date of the calendar.
*/
fullCalendar(method: 'getDate'): Date;
/**
* A method for programmatically selecting a period of time.
*/
* A method for programmatically selecting a period of time.
*/
fullCalendar(method: 'select', startDate: Date, endDate: Date, allDay: boolean): void;
/**
* A method for programmatically clearing the current selection.
*/
* A method for programmatically clearing the current selection.
*/
fullCalendar(method: 'unselect'): void;
/**
* Reports changes to an event and renders them on the calendar.
*/
* Reports changes to an event and renders them on the calendar.
*/
fullCalendar(method: 'updateEvent', event: FullCalendar.EventObject): void;
/**
* Retrieves events that FullCalendar has in memory.
*/
* Retrieves events that FullCalendar has in memory.
*/
fullCalendar(method: 'clientEvents', idOrfilter?: any): Array<FullCalendar.EventObject>;
/**
* Retrieves events that FullCalendar has in memory.
*/
* Retrieves events that FullCalendar has in memory.
*/
fullCalendar(method: 'clientEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): Array<FullCalendar.EventObject>;
/**
* Removes events from the calendar.
*/
* Removes events from the calendar.
*/
fullCalendar(method: 'removeEvents', idOrfilter?: any): void;
/**
* Removes events from the calendar.
*/
* Removes events from the calendar.
*/
fullCalendar(method: 'removeEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): void;
/**
* Refetches events from all sources and rerenders them on the screen.
*/
* Refetches events from all sources and rerenders them on the screen.
*/
fullCalendar(method: 'refetchEvents'): void;
/**
* Dynamically adds an event source.
*/
* Dynamically adds an event source.
*/
fullCalendar(method: 'addEventSource', source: any): void;
/**
* Dynamically removes an event source.
*/
* Dynamically removes an event source.
*/
fullCalendar(method: 'removeEventSource', source: any): void;
/**
* Renders a new event on the calendar.
*/
* Renders a new event on the calendar.
*/
fullCalendar(method: 'renderEvent', event: FullCalendar.EventObject, stick?: boolean): void;
/**
* Rerenders all events on the calendar.
*/
* Rerenders all events on the calendar.
*/
fullCalendar(method: 'rerenderEvents'): void;
/**
* Create calendar object
*/
* Create calendar object
*/
fullCalendar(options: FullCalendar.Options): JQuery;
/**
* Generic method function
*/
* Generic method function
*/
fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void;
}
+1 -1
View File
@@ -48,7 +48,7 @@ declare module gapi.auth {
/**
* The auth scope or scopes to authorize. Auth scopes for individual APIs can be found in their documentation.
*/
scope?: any[]
scope?: any
}, callback: (token: GoogleApiOAuth2TokenObject) => any): void;
/**
* Initializes the authorization feature. Call this when the client loads to prevent popup blockers from blocking the auth window on gapi.auth.authorize calls.
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="gently.d.ts" />
import Gently = require('gently');
var g = new Gently();
g.expect(null, '', () => {
// ..
})();
g.expect(null, '', 0, () => {
// ..
})();
g.restore(null, '');
+26
View File
@@ -0,0 +1,26 @@
// Type definitions for gently
// Project: https://www.npmjs.org/package/gently
// Definitions by: bonnici <https://github.com/bonnici>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/gently.d.ts
declare module "gently" {
export = Gently;
class Gently {
constructor();
hijacked: any[];
expect(obj: any, method: string, stubFn?: (...args: any[]) => any): (...args: any[]) => any;
expect(obj: any, method: string, count: number, stubFn: (...args: any[]) => any): (...args: any[]) => any;
restore(obj: any, method: string): void;
hijack(realRequire: (id: string) => any): (id: string) => any;
stub(location: string, exportsName?: string): any;
verify(msg?: string): void;
}
}

Some files were not shown because too many files have changed in this diff Show More