Merge remote-tracking branch 'upstream/master'

This commit is contained in:
StefanSchoof
2014-05-14 21:50:51 +02:00
222 changed files with 306085 additions and 30156 deletions

View File

@@ -1,6 +1,6 @@
# 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.
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.
@@ -8,8 +8,10 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -20,8 +22,10 @@ All definitions files include a header with the author and editors, so at some p
* [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/))
@@ -56,10 +60,12 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -75,6 +81,7 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -83,6 +90,7 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -106,11 +114,13 @@ All definitions files include a header with the author and editors, so at some p
* [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)
@@ -130,6 +140,7 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -144,17 +155,20 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -162,6 +176,7 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -187,6 +202,7 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -197,19 +213,27 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -230,6 +254,8 @@ All definitions files include a header with the author and editors, so at some p
* [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))
@@ -251,14 +277,17 @@ All definitions files include a header with the author and editors, so at some p
* [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))

View File

@@ -37,3 +37,5 @@ Here is an updated list of [definitions people have requested](https://github.co
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

View File

@@ -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

View File

@@ -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

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
angular-agility/angular-agility.d.ts vendored Normal file
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;
}
}

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;

View File

@@ -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)]);

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;
}
}

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
///////////////////////////////////////

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>;

View File

@@ -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 {

View File

@@ -11,7 +11,7 @@ var File = pathwatcher.File;
class SampleView extends _atom.ScrollView {
editorId:string;
file:pathwatcher.IFile;
file:PathWatcher.IFile;
editor:AtomCore.IEditor;
static deserialize(state:any):SampleView {

1311
atom/atom.d.ts vendored

File diff suppressed because it is too large Load Diff

25
atpl/atpl-tests.ts Normal file
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
atpl/atpl.d.ts vendored Normal file
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
aws-sdk/aws-sdk-tests.ts Normal file
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
aws-sdk/aws-sdk.d.ts vendored Normal file
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;
}
}
}

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;

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);
}
}
}
}

View File

@@ -1 +0,0 @@
""

248
backbone/backbone.d.ts vendored
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,115 +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[];
set(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;
@@ -257,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;
@@ -279,14 +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;
options: any;
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;
@@ -294,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;
@@ -333,14 +355,12 @@ declare module Backbone {
// SYNC
function sync(method: string, model: Model, options?: JQueryAjaxSettings): any;
function ajax(options?: JQueryAjaxSettings): JQueryXHR;
var emulateHTTP: boolean;
var emulateHTTP: boolean;
var emulateJSONBackbone: boolean;
// Utility
function noConflict(): typeof Backbone;
function setDomLibrary(jQueryNew: any): any;
var $: JQueryStatic;
}
declare module "backbone" {

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"}),

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;
}

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
big-integer/big-integer.d.ts vendored Normal file
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;
}

4
breeze/breeze.d.ts vendored
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;

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 {

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;

View File

@@ -3,6 +3,6 @@
import bufferEqual = require('buffer-equal');
var bool: boolean;
var buf: NodeBuffer;
var buf: Buffer;
bool = bufferEqual(buf, buf);

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;
}

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
chai-datetime/chai-datetime.d.ts vendored Normal file
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;
}

View File

@@ -1 +0,0 @@
""

32
chai/chai.d.ts vendored
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 {

View File

@@ -1 +0,0 @@
""

6
chrome/chrome.d.ts vendored
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;
}
////////////////////

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
consolidate/consolidate.d.ts vendored Normal file
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;
}

View File

@@ -143,9 +143,9 @@ interface ContactName {
/** The contact's middle name. */
middleName?: string;
/** The contact's prefix (example Mr. or Dr.) */
honorifixPrefix?: string;
honorificPrefix?: string;
/** The contact's suffix (example Esq.). */
honorifixSuffix?: string;
honorificSuffix?: string;
}
declare var ContactName: {
@@ -154,8 +154,8 @@ declare var ContactName: {
familyName?: string,
givenName?: string,
middleName?: string,
honorifixPrefix?: string,
honorifixSuffix?: string): ContactName
honorificPrefix?: string,
honorificSuffix?: string): ContactName
};
/**
@@ -171,19 +171,19 @@ declare var ContactName: {
* contains a base64-encoded image string.
*/
interface ContactField {
/** Set to true if this ContactField contains the user's preferred value. */
pref: boolean;
/** 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,
pref?: boolean,
value?: string): ContactField
value?: string,
pref?: boolean): ContactField
};
/**

View File

@@ -25,17 +25,7 @@ interface Window {
/** This interface represents a file system. */
interface FileSystem {
/**
* Constructor for FileSystem object
* @param name This is the name of the file system. The specifics of naming filesystems
* is unspecified, but a name must be unique across the list of exposed file systems.
* @param root The root directory of the file system.
*/
new (name: string, root: DirectoryEntry)
/**
* This is the name of the file system. The specifics of naming filesystems
* is unspecified, but a name must be unique across the list of exposed file systems.
*/
/* 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;
@@ -46,8 +36,6 @@ interface FileSystem {
* each of which may be a File or DirectoryEntry.
*/
interface Entry {
/** Constructor for Entry object */
new ( isFile: boolean, isDirectory: boolean, name: string, fullPath: string, fileSystem: FileSystem, nativeURL: string) ;
/** Entry is a file. */
isFile: boolean;
/** Entry is a directory. */
@@ -265,13 +253,13 @@ interface FileSaver extends EventTarget {
*/
interface FileWriter extends FileSaver {
/**
* The byte offset at which the next write to the file will occur. This must be no greater than length.
* A newly-created FileWriter must have position set to 0.
* 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 must be the highest byte offset at which the user has written.
* this will be the highest byte offset at which the user has written.
*/
length: number;
/**
@@ -287,7 +275,7 @@ interface FileWriter extends FileSaver {
seek(offset: number): void;
/**
* Changes the length of the file to that specified. If shortening the file, data beyond the new length
* must be discarded. If extending the file, the existing data must be zero-padded up to 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;

View File

@@ -27,19 +27,6 @@ declare var Media: {
* W3C specification and may deprecate the current APIs.
*/
interface Media {
/**
* Constructor for Media object.
* @param src A URI containing the audio content.
* @param mediaSuccess The callback that executes after a Media object has completed
* the current play, record, or stop action.
* @param mediaError The callback that executes if an error occurs.
* @param mediaStatus The callback that executes to indicate status changes.
*/
new (
src: string,
mediaSuccess: () => void,
mediaError?: (error: MediaError) => any,
mediaStatus?: (status: number) => void): 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.

View File

@@ -1,5 +1,5 @@
// Type definitions for Apache Cordova WebSQL plugin.
// Project: https://github.com/sgrebnov/cordova-plugin-websql
// Project: https://github.com/MSOpenTech/cordova-plugin-websql
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
@@ -43,7 +43,7 @@ interface Database {
successCallback?: () => void): void;
name: string;
version: string;
displayname: string;
displayName: string;
size: number;
}

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;

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

6
d3/d3.d.ts vendored
View File

@@ -710,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: {
@@ -723,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: {
@@ -809,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;

View File

@@ -1 +0,0 @@
""

42
elm/elm-tests.ts Normal file
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
elm/elm.d.ts vendored Normal file
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;
}

View File

@@ -30,16 +30,26 @@ declare module Emissary {
}
interface ISubscriber {
subscribeWith(eventEmitter:any, methodName:string, args:any):any;
subscribeWith(eventEmitter:any, methodName:string, args:any):ISubscription;
addSubscription(subscription:any):any;
addSubscription(subscription:any):ISubscription;
subscribe(eventEmitterOrSubscription:any, ...args:any[]):any;
subscribe(eventEmitterOrSubscription:any, ...args:any[]):ISubscription;
subscribeToCommand(eventEmitter:any, ...args:any[]):any;
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" {

163
esprima/esprima-tests.ts Normal file
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
esprima/esprima.d.ts vendored Normal file
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
}

View File

@@ -240,7 +240,7 @@ declare module "express" {
count: number;
}
interface Request extends Express.Request {
interface Request extends http.ServerRequest, Express.Request {
session: Session;

29
fbsdk/fbsdk-tests.ts Normal file
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
fbsdk/fbsdk.d.ts vendored Normal file
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
fibers/fibers-tests.ts Normal file
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
fibers/fibers.d.ts vendored Normal file
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;
}

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
form-data/form-data.d.ts vendored Normal file
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
fs-extra/fs-extra-tests.ts Normal file
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
fs-extra/fs-extra.d.ts vendored Normal file
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;
}

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;
}

2
gapi/gapi.d.ts vendored
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
gently/gently-tests.ts Normal file
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
gently/gently.d.ts vendored Normal file
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;
}
}

View File

@@ -3,13 +3,13 @@
class User extends Giraffe.Model {
}
class MainView extends Giraffe.View {
class MainView extends Giraffe.View<User> {
constructor(options?) {
this.appEvents = {
'startup': 'app_onStartup'
}
super(options)
}
super(options);
}
app_onStartup() {
@@ -23,15 +23,15 @@ class MyApp extends Giraffe.App {
this.routes= {
'': 'home'
}
super()
super();
}
home() {
this.attach( new MainView )
this.attach(new MainView);
}
}
var app= new MyApp();
app.start();
app.start();

75
giraffe/giraffe.d.ts vendored
View File

@@ -38,8 +38,8 @@ declare module Giraffe {
interface AppMap {
[ cid:string ]: App;
}
interface ViewMap {
[ cid:string ]: View;
interface ViewMap<TModel extends Model> {
[ cid:string ]: View<TModel>;
}
interface StringMap {
[ def:string ]: string;
@@ -49,7 +49,7 @@ declare module Giraffe {
var apps: AppMap;
var defaultOptions: DefaultOptions;
var version: string;
var views: ViewMap;
var views: ViewMap<Model>;
function bindAppEvents( instance:GiraffeObject ): GiraffeObject;
function bindDataEvents( instance:GiraffeObject ): GiraffeObject;
@@ -64,9 +64,10 @@ declare module Giraffe {
function wrapFn( obj:any, name:string, before:Function, after:Function);
class Collection extends Backbone.Collection implements GiraffeObject {
class Collection<TModel extends Model> extends Backbone.Collection<TModel> implements GiraffeObject {
app: App;
model: Model;
//model: typeof TModel;
model: { new (): TModel; }; // workaround
}
class Model extends Backbone.Model implements GiraffeObject {
@@ -85,46 +86,46 @@ declare module Giraffe {
reload( url:string );
}
class View extends Backbone.View implements GiraffeObject {
class View<TModel extends Model> extends Backbone.View<TModel> implements GiraffeObject {
app: App;
appEvents: StringMap;
children: View[];
children: View<TModel>[];
dataEvents: StringMap;
defaultOptions: DefaultOptions;
documentTitle: string;
parent: View;
parent: View<TModel>;
template: any;
ui: StringMap;
attachTo( el:any, options?:AttachmentOptions ): View;
attach( view:View, options?:AttachmentOptions ): View;
attachTo( el:any, options?:AttachmentOptions ): View<TModel>;
attach( view:View<TModel>, options?:AttachmentOptions ): View<TModel>;
isAttached( el:any ): boolean;
render( options?:any ): View;
render( options?:any ): View<TModel>;
beforeRender();
afterRender();
templateStrategy(): string;
serialize(): any;
setParent( parent:View ): View;
setParent( parent:View<TModel> ): View<TModel>;
addChild( child:View ): View;
addChildren( children:View[] ): View;
removeChild( child:View, preserve?:boolean ): View;
removeChildren( preserve?:boolean ): View;
addChild( child:View<TModel> ): View<TModel>;
addChildren( children:View<TModel>[] ): View<TModel>;
removeChild( child:View<TModel>, preserve?:boolean ): View<TModel>;
removeChildren( preserve?:boolean ): View<TModel>;
detach( preserve?:boolean ): View;
detachChildren( preserve?:boolean ): View;
detach( preserve?:boolean ): View<TModel>;
detachChildren( preserve?:boolean ): View<TModel>;
invoke( method:string, ...args:any[] );
dispose(): View;
beforeDispose(): View;
afterDispose(): View;
dispose(): View<TModel>;
beforeDispose(): View<TModel>;
afterDispose(): View<TModel>;
static detachByElement( el:any, preserve?:boolean ): View;
static getClosestView( el:any ): View;
static getByCid( cid:string ): View;
static detachByElement( el:any, preserve?:boolean ): View<Model>;
static getClosestView<TModel>( el:any ): View<Model>;
static getByCid( cid:string ): View<Model>;
static to$El( el:any, parent?:any, allowParentMatch?:boolean ): JQuery;
static setDocumentEvents( events:string[], prefix?:string ): string[];
static removeDocumentEvents( prefix?:string );
@@ -132,7 +133,7 @@ declare module Giraffe {
static setTemplateStrategy( strategy:any, instance?:any );
}
class App extends View {
class App extends View<Model> {
routes: StringMap;
addInitializer( initializer:( options?:any, callback?:()=>void )=>void ): App;
@@ -146,23 +147,23 @@ declare module Giraffe {
app: App;
}
class CollectionView extends View {
class CollectionView<TModel extends Model> extends View<TModel> {
collection: Collection;
modelView: View;
collection: Collection<TModel>;
modelView: View<TModel>;
modelViewArgs: any[];
modelViewEl: any;
renderOnChange: boolean;
findByModel( model:Model ): View;
addOne( model:Model ): View;
removeOne( model:Model ): View;
findByModel( model:Model ): View<TModel>;
addOne( model:Model ): View<TModel>;
removeOne( model:Model ): View<TModel>;
static getDefaults( ctx:any ): any;
}
class FastCollectionView extends View {
collection: Collection;
class FastCollectionView<TModel extends Model> extends View<TModel> {
collection: Collection<TModel>;
modelTemplate: any;
modelTemplateStrategy: string;
modelEl: any;
@@ -170,11 +171,11 @@ declare module Giraffe {
modelSerialize(): any;
addAll(): View;
addOne( model:Model ): View;
removeOne( model:Model ): View;
addAll(): View<TModel>;
addOne( model:Model ): View<TModel>;
removeOne( model:Model ): View<TModel>;
removeByIndex( index:number ): View;
removeByIndex( index:number ): View<TModel>;
findElByModel( model:Model ): JQuery;
findElByIndex( index:number ): JQuery;
findModelByEl( el:any ): Model;

View File

@@ -3,6 +3,6 @@
import fs = require('graceful-fs');
var str: string;
var buf: NodeBuffer;
var buf: Buffer;
fs.renameSync(str, str);

View File

@@ -0,0 +1,37 @@
/// <reference path="gridfs-stream.d.ts" />
/// <reference path="../mongodb/mongodb.d.ts" />
/// <reference path="../node/node.d.ts" />
// Samples from:
// https://github.com/aheckmann/gridfs-stream
import fs = require('fs');
import mongo = require('mongodb');
import Grid = require('gridfs-stream');
// create or use an existing mongodb-native db instance
var db = new mongo.Db('gridfs-stream-test', new mongo.Server("127.0.0.1", 27017));
var gfs = Grid(db, mongo);
// streaming to gridfs
var writestream = gfs.createWriteStream({
filename: 'my_file.txt'
});
fs.createReadStream('blob.txt').pipe(writestream);
// streaming from gridfs
var readstream = gfs.createReadStream({
filename: 'my_file.txt'
});
//error handling, e.g. file does not exist
readstream.on('error', function (err: any) {
console.log('An error occurred!', err);
throw err;
});
var bufs: Array<any> = [];
readstream.on('data', function(d: any){ bufs.push(d); });
readstream.on('end', function() {
var buf = Buffer.concat(bufs);
});

68
gridfs-stream/gridfs-stream.d.ts vendored Normal file
View File

@@ -0,0 +1,68 @@
// Type definitions for gridfs-stream 0.5.0
// Project: https://github.com/aheckmann/gridfs-stream
// Definitions by: Lior Mualem <https://github.com/liorm/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../mongodb/mongodb.d.ts" />
declare module GridFSStream {
export interface Range {
startPos: number;
endPos: number;
}
export interface Options {
_id?: string;
filename?: string;
mode?: string;
range?: Range;
// any other options from the GridStore may be passed too, e.g.
chunkSize?: number;
content_type?: string;
root?: string;
metadata?: any;
}
export interface WriteStream extends NodeJS.WritableStream {
writable: boolean;
name: string;
id: string;
options: Options;
mode: string;
}
export interface ReadStream extends NodeJS.ReadableStream {
readable: boolean;
paused: boolean;
}
}
declare module "gridfs-stream" {
import mongo = require('mongodb');
// Merged declaration, g is both a callable function and a namespace
function g(db: any, mongo: any): g.Grid;
module g {
export class Grid {
files: mongo.Collection;
collection(name?: string): mongo.Collection;
createWriteStream(options?: GridFSStream.Options): GridFSStream.WriteStream;
createReadStream(options?: GridFSStream.Options): GridFSStream.ReadStream;
createWriteStream(options?: string): GridFSStream.WriteStream;
createReadStream(options?: string): GridFSStream.ReadStream;
remove(options: GridFSStream.Options, callback: (err: Error) => void): void;
exist(options: GridFSStream.Options, callback: (err: Error, found: boolean) => void): void;
}
}
export = g;
}

16
gruntjs/gruntjs.d.ts vendored
View File

@@ -336,7 +336,7 @@ declare module grunt {
* whose return value will be used as the destination file's contents. If
* this function returns `false`, the file copy will be aborted.
*/
process?: (buffer: NodeBuffer) => boolean
process?: (buffer: Buffer) => boolean
}
/**
@@ -370,21 +370,21 @@ declare module grunt {
* Returns a string, unless options.encoding is null in which case it returns a Buffer.
*/
read(filepath: string): string
read(filepath: string, options: IFileEncodedOption): NodeBuffer
read(filepath: string, options: IFileEncodedOption): Buffer
/**
* Read a file's contents, parsing the data as JSON and returning the result.
* @see FileModule.read for a list of supported options.
*/
readJSON(filepath: string): any
readJSON(filepath: string, options: IFileEncodedOption): NodeBuffer
readJSON(filepath: string, options: IFileEncodedOption): Buffer
/**
* Read a file's contents, parsing the data as YAML and returning the result.
* @see FileModule.read for a list of supported options.
*/
readYAML(filepath: string): any
readYAML(filepath: string, options: IFileEncodedOption): NodeBuffer
readYAML(filepath: string, options: IFileEncodedOption): Buffer
/**
* Write the specified contents to a file, creating intermediate directories if necessary.
@@ -394,7 +394,7 @@ declare module grunt {
* @param options If an encoding is not specified, default to grunt.file.defaultEncoding.
*/
write(filepath: string, contents: string, options?: IFileEncodedOption): void
write(filepath: string, contents: NodeBuffer): void
write(filepath: string, contents: Buffer): void
/**
* Copy a source file to a destination path, creating intermediate directories if necessary.
@@ -1293,3 +1293,9 @@ interface IGrunt extends grunt.IConfigComponents, grunt.fail.FailModule, grunt.I
*/
version: string
}
// NodeJS Support
declare module 'grunt' {
var grunt: IGrunt;
export = grunt;
}

View File

@@ -4,20 +4,42 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Use either HandlebarsStatic or HandlebarsRuntimeStatic
declare var Handlebars: HandlebarsStatic;
//declare var Handlebars: HandlebarsRuntimeStatic;
interface HandlebarsStatic {
/**
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
**/
interface HandlebarsTemplatable {
template: HandlebarsTemplateDelegate;
}
interface HandlebarsTemplateDelegate {
(context: any, options?: any): string;
}
interface HandlebarsCommon {
registerHelper(name: string, fn: Function, inverse?: boolean): void;
registerPartial(name: string, str: any): void;
K(): void;
createFrame(object: any): any;
Exception(message: string): void;
SafeString: typeof SafeString;
parse(input: string): boolean;
logger: Logger;
log(level: number, obj: any): void;
compile(input: any, options?: any): (context?: any, options?: any) => string;
Logger: typeof Logger;
}
interface HandlebarsStatic extends HandlebarsCommon {
parse(input: string): boolean;
compile(input: any, options?: any): HandlebarsTemplateDelegate;
}
interface HandlebarsRuntimeStatic extends HandlebarsCommon {
// Handlebars.templates is the default template namespace in precompiler.
templates: { (s: string): HandlebarsTemplateDelegate }[];
}
declare class SafeString {

View File

@@ -22,9 +22,9 @@ var strArr: string[];
var numArr: string[];
var funcArr: Function[];
var readable: ReadableStream;
var writable: WritableStream;
var emitter: NodeEventEmitter;
var readable: NodeJS.ReadableStream;
var writable: NodeJS.WritableStream;
var emitter: NodeJS.EventEmitter;
// - - - - - - - - - - - - - - - - -

View File

@@ -62,8 +62,8 @@ interface HighlandStatic {
<R>(xs: (push: (err: Error, x?: R) => void, next: () => void) => void): Highland.Stream<R>;
<R>(xs: Highland.Stream<R>): Highland.Stream<R>;
<R>(xs: ReadableStream): Highland.Stream<R>;
<R>(xs: NodeEventEmitter): Highland.Stream<R>;
<R>(xs: NodeJS.ReadableStream): Highland.Stream<R>;
<R>(xs: NodeJS.EventEmitter): Highland.Stream<R>;
// moar (promise for everything?)
<R>(xs: Highland.Thenable<Highland.Stream<R>>): Highland.Stream<R>;
@@ -365,7 +365,7 @@ declare module Highland {
/**
* Actual Stream constructor wrapped the the main exported function
*/
interface Stream<R> extends NodeEventEmitter {
interface Stream<R> extends NodeJS.EventEmitter {
/**
* Pauses the stream. All Highland Streams start in the paused state.
@@ -419,8 +419,8 @@ declare module Highland {
* @api public
*/
pipe<U>(dest: Stream<U>): Stream<U>;
pipe<U>(dest: ReadWriteStream): Stream<U>;
pipe(dest: WritableStream): void;
pipe<U>(dest: NodeJS.ReadWriteStream): Stream<U>;
pipe(dest: NodeJS.WritableStream): void;
/**
* Destroys a stream by unlinking it from any consumers and sources. This will

View File

@@ -0,0 +1,27 @@
/// <reference path="imagemagick.d.ts" />
/// <reference path="../node/node.d.ts" />
import imagemagick = require('imagemagick');
import child_process = require('child_process');
var str: string = null;
var num: number = 0;
var cp: child_process.ChildProcess;
cp = imagemagick.identify(str, (err: Error, res: imagemagick.Features) => {
str = res.format;
num = res.width;
num = res.height;
num = res.depth;
});
cp = imagemagick.convert(str, num, (err: Error, res: any) => {
});
cp = imagemagick.resize({
width: num,
height: num
}, (err: Error, res: any) => {
});

59
imagemagick/imagemagick.d.ts vendored Normal file
View File

@@ -0,0 +1,59 @@
// Type definitions for imagemagick
// Project: http://github.com/rsms/node-imagemagick
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/imagemagick.d.ts
/// <reference path="../node/node.d.ts" />
declare module "imagemagick" {
import child_process = require("child_process");
export function identify(path: string, callback: (err: Error, features: Features) => void): child_process.ChildProcess;
export function identify(path: any[], callback: (err: Error, result: string) => void): child_process.ChildProcess;
export module identify {
export var path: string;
}
export function readMetadata(path: string, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function convert(args: any, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function convert(args: any, timeout: number, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export module convert {
export var path: string;
}
export function resize(options: Options, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function crop(options: Options, callback: (err: Error, result: any) => void): child_process.ChildProcess;
export function resizeArgs(options: Options): ResizeArgs;
export interface Features {
format?: string;
width?: number;
height?: number;
depth?: number;
}
export interface Options {
srcPath?: string; //: null,
srcData?: string; //: null,
srcFormat?: string; //: null,
dstPath?: string; //: null,
quality?: number; //: 0.8,
format?: string; //: 'jpg',
progressive?: boolean; //: false,
colorspace?: any; //: null,
width?: number; //: 0,
height?: number; //: 0,
strip?: boolean; //: true,
filter?: string; //: 'Lagrange',
sharpening?: number; //: 0.2,
customArgs?: any[]; //: [],
timeout?: number; //: 0
}
export interface ResizeArgs {
opt: Options;
args: string[];
}
}

24
jake/jake.d.ts vendored
View File

@@ -133,7 +133,7 @@ declare module jake{
* @event stderr When the stderr for the child-process recieves data. This streams the stderr data. Passes one arg, the chunk of data.
* @event error When a shell-command
*/
export interface Exec extends NodeEventEmitter {
export interface Exec extends NodeJS.EventEmitter {
append(cmd:string): void;
run(): void;
}
@@ -187,7 +187,7 @@ declare module jake{
*
* @event complete
*/
export class Task implements NodeEventEmitter {
export class Task implements NodeJS.EventEmitter {
/**
* @name name The name of the Task
* @param prereqs Prerequisites to be run before this task
@@ -206,11 +206,11 @@ declare module jake{
*/
reenable(): void;
addListener(event: string, listener: Function): NodeEventEmitter;
on(event: string, listener: Function): NodeEventEmitter;
once(event: string, listener: Function): NodeEventEmitter;
removeListener(event: string, listener: Function): NodeEventEmitter;
removeAllListeners(event?: string): NodeEventEmitter;
addListener(event: string, listener: Function): NodeJS.EventEmitter;
on(event: string, listener: Function): NodeJS.EventEmitter;
once(event: string, listener: Function): NodeJS.EventEmitter;
removeListener(event: string, listener: Function): NodeJS.EventEmitter;
removeAllListeners(event?: string): NodeJS.EventEmitter;
setMaxListeners(n: number): void;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
@@ -381,11 +381,11 @@ declare module jake{
constructor(name:string, definition?:()=>void);
}
export function addListener(event: string, listener: Function): NodeEventEmitter;
export function on(event: string, listener: Function): NodeEventEmitter;
export function once(event: string, listener: Function): NodeEventEmitter;
export function removeListener(event: string, listener: Function): NodeEventEmitter;
export function removeAllListener(event: string): NodeEventEmitter;
export function addListener(event: string, listener: Function): NodeJS.EventEmitter;
export function on(event: string, listener: Function): NodeJS.EventEmitter;
export function once(event: string, listener: Function): NodeJS.EventEmitter;
export function removeListener(event: string, listener: Function): NodeJS.EventEmitter;
export function removeAllListener(event: string): NodeJS.EventEmitter;
export function setMaxListeners(n: number): void;
export function listeners(event: string): Function[];
export function emit(event: string, ...args: any[]): boolean;

View File

@@ -0,0 +1,74 @@
/// <reference path="jdataview.d.ts" />
/// <reference path="../jquery/jquery.d.ts" />
interface TARMetaData {
name: string;
mode: number;
owner: number;
group: number;
size: number;
modtime: number;
checksum: number;
link: string;
name_linked: string;
ustar: string;
ustar_version: number;
owner_name: string;
group_name: string;
device: number[];
name_prefix: string;
}
// Download the file
$.get('jquery.tar', function (data) {
// Make a view on the data
var view = new jDataView(data);
// console.log(view.getUint32(0, true));
// console.log(view.getUint32(0, false));
// view.seek(0);
while (view.tell() < view.byteLength) {
// Parse the file meta data
var metadata: TARMetaData = {
name: view.getString(100).replace(/\0+$/, ''),
mode: parseInt(view.getString(8), 8),
owner: parseInt(view.getString(8), 8),
group: parseInt(view.getString(8), 8),
size: parseInt(view.getString(12), 8),
modtime: parseInt(view.getString(12), 8),
checksum: parseInt(view.getString(8), 8),
link: view.getChar(),
name_linked: view.getString(100).replace(/\0+$/, ''),
ustar: view.getString(6),
ustar_version: parseInt(view.getString(2), 8),
owner_name: view.getString(32).replace(/\0+$/, ''),
group_name: view.getString(32).replace(/\0+$/, ''),
device: [parseInt(view.getString(8), 8), parseInt(view.getString(8), 8)],
name_prefix: view.getString(155).replace(/\0+$/, '')
};
// Padding
if (view.tell() % 512 !== 0) {
view.seek(view.tell() + 512 - (view.tell() % 512));
}
// Get the file
if (isNaN(metadata.size)) {
break;
}
var content = view.getString(metadata.size);
// Padding
if (view.tell() % 512 != 0) {
view.seek(view.tell() + 512 - (view.tell() % 512));
}
// Print the file
$(document.body).append($('<pre></pre>').html(JSON.stringify(metadata, null, ' ')));
if (metadata.size) {
$('body').append($('<textarea></textarea>').val(content));
}
}
});

105
jdataview/jdataview.d.ts vendored Normal file
View File

@@ -0,0 +1,105 @@
// Type definitions for jDataView
// Project: https://github.com/jDataView/jDataView
// Definitions by: Ingvar Stepanyan <https://github.com/RReverser>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class jDataView implements DataView {
constructor(byteCount: number, offset?: number, length?: number, littleEndian?: boolean)
constructor(buffer: string, offset?: number, length?: number, littleEndian?: boolean)
constructor(buffer: jDataView.Bytes, offset?: number, length?: number, littleEndian?: boolean)
buffer: any
byteOffset: number
byteLength: number
// 64 bit integers
getInt64(byteOffset?: number, littleEndian?: boolean): jDataView.Int64
setInt64(byteOffset: number, value: jDataView.Int64, littleEndian?: boolean): void
writeInt64(value: jDataView.Int64, littleEndian?: boolean): void
getUint64(byteOffset?: number, littleEndian?: boolean): jDataView.Uint64
setUint64(byteOffset: number, value: jDataView.Uint64, littleEndian?: boolean): void
writeUint64(value: jDataView.Uint64, littleEndian?: boolean): void
// Bitfields
getSigned(bitLength: number, byteOffset?: number): number
setSigned(byteOffset: number, value: number, bitLength: number): void
writeSigned(value: number, bitLength: number): void
getUnsigned(bitLength: number, byteOffset?: number): number
setUnsigned(byteOffset: number, value: number, bitLength: number): void
writeUnsigned(value: number, bitLength: number): void
// Internal utilities
wrapBuffer(string: string): jDataView.Buffer
wrapBuffer(bytes: jDataView.Bytes): jDataView.Buffer
wrapBuffer(byteCount: number): jDataView.Buffer
createBuffer(...bytes: number[]): jDataView.Buffer
// Operation control
seek(byteOffset: number): number
tell(): number
skip(byteLength: number): number
slice(start: number, end?: number, forceCopy?: boolean): jDataView
// Specification getters
getInt8(byteOffset?: number): number
getUint8(byteOffset?: number): number
getInt16(byteOffset?: number, littleEndian?: boolean): number
getUint16(byteOffset?: number, littleEndian?: boolean): number
getInt32(byteOffset?: number, littleEndian?: boolean): number
getUint32(byteOffset?: number, littleEndian?: boolean): number
getFloat32(byteOffset?: number, littleEndian?: boolean): number
getFloat64(byteOffset?: number, littleEndian?: boolean): number
// Specification setters
setInt8(byteOffset: number, value: number): void
setUint8(byteOffset: number, value: number): void
setInt16(byteOffset: number, value: number, littleEndian?: boolean): void
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void
setInt32(byteOffset: number, value: number, littleEndian?: boolean): void
setUint32(byteOffset: number, value: number, littleEndian?: boolean): void
setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void
// Strings and Blobs
getChar(byteOffset?: number): string
setChar(byteOffset: number, char: string): void
writeChar(char: string): void
getString(byteLength: number, byteOffset?: number, encoding?: string): string
setString(byteOffset: number, chars: string, encoding?: string): void
writeString(chars: string, encoding?: string): void
getBytes(length: number, byteOffset?: number, littleEndian?: boolean, toArray?: boolean): number[]
setBytes(byteOffset: number, bytes: number[], littleEndian?: boolean): void
writeBytes(bytes: number[], littleEndian?: boolean): void
// writeXXX methods
writeInt8(value: number): void
writeUint8(value: number): void
writeInt16(value: number, littleEndian?: boolean): void
writeUint16(value: number, littleEndian?: boolean): void
writeInt32(value: number, littleEndian?: boolean): void
writeUint32(value: number, littleEndian?: boolean): void
writeFloat32(value: number, littleEndian?: boolean): void
writeFloat64(value: number, littleEndian?: boolean): void
}
declare module jDataView {
interface Bytes {
length: number;
[index: number]: number;
}
interface Buffer extends Bytes {
byteLength: number;
}
class Uint64 {
lo: number
hi: number
constructor(lo: number, hi: number)
valueOf(): number
static fromNumber(number: number): Uint64
}
class Int64 extends Uint64 {
static fromNumber(number: number): Int64
}
}

2
joi/joi.d.ts vendored
View File

@@ -1,4 +1,4 @@
// Type definitions for joi v3.1.0
// Type definitions for joi v4.0.0
// Project: https://github.com/spumko/joi
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

14
jointjs/jointjs.d.ts vendored
View File

@@ -38,20 +38,19 @@ declare module joint {
attr(attrs: any): Cell;
}
class Element extends Cell {
position(x: number, y: number): Element;
translate(tx: number, ty?: number): Element;
resize(width: number, height: number): Element;
rotate(angle: number, absolute): Element;
}
interface IDefaults {
type: string;
}
class Link extends Cell {
defaults: IDefaults;
defaults(): IDefaults;
disconnect(): Link;
label(idx?: number, value?: any): any; // @todo: returns either a label under idx or Link if both idx and value were passed
}
@@ -65,7 +64,7 @@ declare module joint {
linkView: LinkView;
}
class Paper extends Backbone.View {
class Paper extends Backbone.View<Backbone.Model> {
options: IOptions;
setDimensions(width: number, height: number);
scale(sx: number, sy?: number, ox?: number, oy?: number): Paper;
@@ -80,7 +79,8 @@ declare module joint {
class ElementView extends CellView {
scale(sx: number, sy: number);
}
class CellView extends Backbone.View {
class CellView extends Backbone.View<Cell> {
getBBox(): { x: number; y: number; width: number; height: number; };
highlight(el?: any);
unhighlight(el?: any);
@@ -94,7 +94,9 @@ declare module joint {
}
}
module ui { }
module shapes {
module basic {
class Generic extends joint.dia.Element { }
@@ -104,6 +106,7 @@ declare module joint {
class Image extends Generic { }
}
}
module util {
function uuid(): string;
function guid(obj: any): string;
@@ -112,4 +115,5 @@ declare module joint {
function deepMixin(objects: any[]): any;
function deepSupplement(objects: any[], defaultIndicator?: any): any;
}
}

View File

@@ -0,0 +1,37 @@
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="jquery.finger.d.ts"/>
$.Finger.doubleTapInterval = 400;
$.Finger.flickDuration = 250;
$.Finger.pressDuration = 100;
$.Finger.motionThreshhold = 10;
$.Finger.preventDefault = true;
var fingerEventObject: JQueryFingerEventObject;
fingerEventObject.x = 1;
fingerEventObject.y = 2;
fingerEventObject.dx = 3;
fingerEventObject.dy = 4;
fingerEventObject.adx = 3;
fingerEventObject.ady = 4;
fingerEventObject.orientation = 'horizontal';
fingerEventObject.direction = 1;
$('body').on('drag', e => {
if ('vertical' == e.orientation) return;
e.preventDefault();
});
$('body').on('drag', '.drag', e => {
if ('vertical' == e.orientation) return;
e.preventDefault();
});
$('#menu').on('flick', function (e) {
if ('horizontal' == e.orientation) {
if (1 == e.direction) {
$(this).addClass('is-opened');
}
else {
$(this).removeClass('is-opened');
}
}
});

109
jquery.finger/jquery.finger.d.ts vendored Normal file
View File

@@ -0,0 +1,109 @@
// Type definitions for jquery.finger.js
// Project: http://ngryman.sh/jquery.finger/
// Definitions by: Max Ackley <https://github.com/maxackley/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
declare module JQueryFinger {
export interface JQueryFingerOptions {
/**
* The time the user must hold in order to fire a press event. If this
* time is not reached, a tap event will be fired instead.
* Default: 300(ms).
*/
pressDuration: number;
/**
* The maximum time between two tap events to fire a doubletap event.
* If this time is reached, two distinct tap events will be fired instead.
* Default: 300(ms).
*/
doubleTapInterval: number;
/**
* The maximum time the user will have to swipe in order to fire a flick
* event. If this time is reached, only drag events will continue to be
* fired.
* Default: 150(ms).
*/
flickDuration: number;
/**
* The number of pixels the user will have to move in order to fire motion
* events (drag or flick). If this time is not reached, no motion will
* be handled and tap, doubletap or press event will be fired.
* Default: 5(px).
*/
motionThreshhold: number;
/**
* Globally prevents every native default behavior.
* Default: undefined.
*/
preventDefault: boolean;
}
}
interface JQueryFingerEventObject extends JQueryEventObject {
/**
* The x page coordinate.
*/
x: number;
/**
* The y page coordinate.
*/
y: number;
/**
* The x delta since the last event.
*/
dx: number;
/**
* The y delta since the last event.
*/
dy: number;
/**
* The absolute x delta since the last event.
*/
adx: number;
/**
* The absolute y delta since the last event.
*/
ady: number;
/**
* The orientation of the motion. Adjusted by $.Finger.motionThreshhold.
* Value is 'horizontal' or 'vertical'.
*/
orientation: string;
/**
* The direction of the motion. Value is 1 if the motion is 'positive'
* (left-to-right or top-to-bottom) or -1 if 'negative'(right-to-left or
* bottom-to-top).
*/
direction: number;
}
interface JQuery {
on(events: 'tap', handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'doubletap', handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'press', handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'drag', handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'flick', handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'tap', data: any, handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'doubletap', data: any, handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'press', data: any, handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'drag', data: any, handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
on(events: 'flick', data: any, handler: (eventObject: JQueryFingerEventObject, ...args: any[]) => any): JQuery;
}
interface JQueryStatic {
Finger: JQueryFinger.JQueryFingerOptions;
}

View File

@@ -0,0 +1,5 @@
/// <reference path="jquery.tile.d.ts"/>
$('div').tile();
$('div').tile(4);

16
jquery.tile/jquery.tile.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// Type definitions for jquery.tile.js 1.1.0
// Project: https://github.com/urin/jquery.tile.js
// Definitions by: Shunsuke Ohtani <https://github.com/zaneli>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface JQuery {
/**
* Align the height of the largest of the elements arranged in the same row.
* if columns is not specified, align the height of the largest of the all elements.
*
* @param columns Number of elements in a row
*/
tile(columns?: number): void;
}

View File

@@ -0,0 +1,21 @@
// Type definitions for jQueryTotalStorage 1.1.2
// Project: https://github.com/Upstatement/jquery-total-storage
// Definitions by: Jeremy Brooks <https://github.com/JeremyCBrooks/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="jquery.total-storage.d.ts"/>
//direct call
$.totalStorage("test_key1", "test_value");
var val1:string = $.totalStorage("test_key");
//set/get
$.totalStorage.setItem("test_key2", 123);
var val2:number = $.totalStorage.getItem("test_key2");
//get all items
var list = $.totalStorage.getAll();
//delete item
var deleted = $.totalStorage.deleteItem("test_key1");

View File

@@ -0,0 +1,64 @@
// Type definitions for jQueryTotalStorage 1.1.2
// Project: https://github.com/Upstatement/jquery-total-storage
// Definitions by: Jeremy Brooks <https://github.com/JeremyCBrooks/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/**
* @desc Set the value of a key to a string
* @example $.totalStorage('the_key', 'the_value');
* @desc Set the value of a key to a number
* @example $.totalStorage('the_key', 800.2);
* @desc Set the value of a key to a complex Array
* @example var myArray = new Array();
* myArray.push({name:'Jared', company:'Upstatement', zip:63124});
* myArray.push({name:'McGruff', company:'Police', zip:60652};
* $.totalStorage('people', myArray);
* //to return:
* $.totalStorage('people');
*
*/
interface JQueryTotalStorage {
/**
* @desc Set or get a key's value
* @param key Key to set.
* @param value Value to set for key. If ommited, current value for key is returned.
* @param options Not implemented.
*/
(key: string, value?: any, options?: JQueryTotalStorageOptions): any;
/**
* @desc Set a key's value
* @param key Key to set.
* @param value Value to set for key.
*/
setItem(key: string, value: any): any;
/**
* @desc Get a key's value
* @param key Key to get.
*/
getItem(key: string): any;
/**
* @desc Get all set values
*/
getAll(): any[];
/**
* @desc Delete item by key
* @param key Key of item to delete
*/
deleteItem(key: string): boolean;
}
interface JQueryTotalStorageOptions {
//not implemented...
}
interface JQueryStatic {
totalStorage: JQueryTotalStorage;
}

32
jquery/jquery.d.ts vendored
View File

@@ -1512,7 +1512,37 @@ interface JQuery {
*
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
*/
val(func: (index: number, value: any) => any): JQuery;
val(func: (index: number, value: string) => string): JQuery;
/**
* Set the value of each element in the set of matched elements.
*
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
*/
val(func: (index: number, value: string[]) => string): JQuery;
/**
* Set the value of each element in the set of matched elements.
*
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
*/
val(func: (index: number, value: number) => string): JQuery;
/**
* Set the value of each element in the set of matched elements.
*
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
*/
val(func: (index: number, value: string) => string[]): JQuery;
/**
* Set the value of each element in the set of matched elements.
*
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
*/
val(func: (index: number, value: string[]) => string[]): JQuery;
/**
* Set the value of each element in the set of matched elements.
*
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
*/
val(func: (index: number, value: number) => string[]): JQuery;
/**
* Get the value of style properties for the first element in the set of matched elements.

View File

@@ -1270,6 +1270,125 @@ function test_datepicker() {
// setter
var $set: JQuery = $(".selector").datepicker("option", "calculateWeek", myWeekCalc);
}
function changeMonth() {
$(".selector").datepicker({ changeMonth: true });
var changeMonth: boolean = $(".selector").datepicker("option", "changeMonth");
// setter
var $set: JQuery = $(".selector").datepicker("option", "changeMonth", true);
}
function changeYear() {
$(".selector").datepicker({ changeYear: true });
var changeYear: boolean = $(".selector").datepicker("option", "changeYear");
// setter
var $set: JQuery = $(".selector").datepicker("option", "changeYear", true);
}
function closeText() {
$(".selector").datepicker({ closeText: "Close" });
var closeText: string = $(".selector").datepicker("option", "closeText");
// setter
var $set: JQuery = $(".selector").datepicker("option", "closeText", "Close");
}
function constrainInput() {
$(".selector").datepicker({ constrainInput: false });
var constrainInput: boolean = $(".selector").datepicker("option", "constrainInput");
// setter
var $set: JQuery = $(".selector").datepicker("option", "constrainInput", false);
}
function currentText() {
$(".selector").datepicker({ currentText: "Now" });
var currentText: string = $(".selector").datepicker("option", "currentText");
// setter
var $set: JQuery = $(".selector").datepicker("option", "currentText", "Now");
}
function dateFormat() {
$(".selector").datepicker({ dateFormat: "yy-mm-dd" });
var dateFormat: string = $(".selector").datepicker("option", "dateFormat");
// setter
var $set: JQuery = $(".selector").datepicker("option", "dateFormat", "yy-mm-dd");
}
function dayNames() {
$(".selector").datepicker({ dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] });
var dayNames: string[] = $(".selector").datepicker("option", "dayNames");
// setter
var $set: JQuery = $(".selector").datepicker("option", "dayNames", ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"]);
}
function dayNamesMin() {
$(".selector").datepicker({ dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"] });
var dayNamesMin: string[] = $(".selector").datepicker("option", "dayNamesMin");
// setter
var $set: JQuery = $(".selector").datepicker("option", "dayNamesMin", ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"]);
}
function dayNamesShort() {
$(".selector").datepicker({ dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] });
var dayNamesShort: string[] = $(".selector").datepicker("option", "dayNamesShort");
// setter
var $set: JQuery = $(".selector").datepicker("option", "dayNamesShort", ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"]);
}
function defaultDate() {
$(".selector").datepicker({ defaultDate: +7 });
var defaultDate: any = $(".selector").datepicker("option", "defaultDate");
// setter
var $set: JQuery = $(".selector").datepicker("option", "defaultDate", +7);
$set = $(".selector").datepicker("option", "defaultDate", new Date());
$set = $(".selector").datepicker("option", "defaultDate", "+1m +7d");
}
function duration() {
$(".selector").datepicker({ duration: "slow" });
var duration: string = $(".selector").datepicker("option", "duration");
// setter
var $set: JQuery = $(".selector").datepicker("option", "duration", "slow");
}
function firstDay() {
$(".selector").datepicker({ firstDay: 1 });
var firstDay: number = $(".selector").datepicker("option", "firstDay");
// setter
var $set: JQuery = $(".selector").datepicker("option", "firstDay", 1);
}
function gotoCurrent() {
$(".selector").datepicker({ gotoCurrent: true });
var gotoCurrent: boolean = $(".selector").datepicker("option", "gotoCurrent");
// setter
var $set: JQuery = $(".selector").datepicker("option", "gotoCurrent", true);
}
}

231
jqueryui/jqueryui.d.ts vendored
View File

@@ -180,7 +180,7 @@ declare module JQueryUI {
* Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday.
* String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today.
*/
defaultDateType?: any; // Date, number or string
defaultDate?: any; // Date, number or string
/**
* Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast").
*/
@@ -1278,19 +1278,242 @@ interface JQuery {
* Get the calculateWeek option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonText'
* @param optionName 'calculateWeek'
*/
datepicker(methodName: 'option', optionName: 'calculateWeek'): (date: Date) => string;
/**
* Set the calculateWeek option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonText'
* @param optionName 'calculateWeek'
* @param calculateWeekValue A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year.
*/
datepicker(methodName: 'option', optionName: 'calculateWeek', calculateWeekValue: (date: Date) => string): JQuery;
/**
* Get the changeMonth option, after initialization
*
* @param methodName 'option'
* @param optionName 'changeMonth'
*/
datepicker(methodName: 'option', optionName: 'changeMonth'): boolean;
/**
* Set the changeMonth option, after initialization
*
* @param methodName 'option'
* @param optionName 'changeMonth'
* @param changeMonthValue Whether the month should be rendered as a dropdown instead of text.
*/
datepicker(methodName: 'option', optionName: 'changeMonth', changeMonthValue: boolean): JQuery;
/**
* Get the changeYear option, after initialization
*
* @param methodName 'option'
* @param optionName 'changeYear'
*/
datepicker(methodName: 'option', optionName: 'changeYear'): boolean;
/**
* Set the changeYear option, after initialization
*
* @param methodName 'option'
* @param optionName 'changeYear'
* @param changeYearValue Whether the year should be rendered as a dropdown instead of text. Use the yearRange option to control which years are made available for selection.
*/
datepicker(methodName: 'option', optionName: 'changeYear', changeYearValue: boolean): JQuery;
/**
* Get the closeText option, after initialization
*
* @param methodName 'option'
* @param optionName 'closeText'
*/
datepicker(methodName: 'option', optionName: 'closeText'): string;
/**
* Set the closeText option, after initialization
*
* @param methodName 'option'
* @param optionName 'closeText'
* @param closeTextValue The text to display for the close link. Use the showButtonPanel option to display this button.
*/
datepicker(methodName: 'option', optionName: 'closeText', closeTextValue: string): JQuery;
/**
* Get the constrainInput option, after initialization
*
* @param methodName 'option'
* @param optionName 'constrainInput'
*/
datepicker(methodName: 'option', optionName: 'constrainInput'): boolean;
/**
* Set the constrainInput option, after initialization
*
* @param methodName 'option'
* @param optionName 'constrainInput'
* @param constrainInputValue When true, entry in the input field is constrained to those characters allowed by the current dateFormat option.
*/
datepicker(methodName: 'option', optionName: 'constrainInput', constrainInputValue: boolean): JQuery;
/**
* Get the currentText option, after initialization
*
* @param methodName 'option'
* @param optionName 'currentText'
*/
datepicker(methodName: 'option', optionName: 'currentText'): string;
/**
* Set the currentText option, after initialization
*
* @param methodName 'option'
* @param optionName 'currentText'
* @param currentTextValue The text to display for the current day link. Use the showButtonPanel option to display this button.
*/
datepicker(methodName: 'option', optionName: 'currentText', currentTextValue: string): JQuery;
/**
* Get the dateFormat option, after initialization
*
* @param methodName 'option'
* @param optionName 'dateFormat'
*/
datepicker(methodName: 'option', optionName: 'dateFormat'): string;
/**
* Set the dateFormat option, after initialization
*
* @param methodName 'option'
* @param optionName 'dateFormat'
* @param dateFormatValue The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function.
*/
datepicker(methodName: 'option', optionName: 'dateFormat', dateFormatValue: string): JQuery;
/**
* Get the dayNames option, after initialization
*
* @param methodName 'option'
* @param optionName 'dayNames'
*/
datepicker(methodName: 'option', optionName: 'dayNames'): string[];
/**
* Set the dayNames option, after initialization
*
* @param methodName 'option'
* @param optionName 'dayNames'
* @param dayNamesValue The list of long day names, starting from Sunday, for use as requested via the dateFormat option.
*/
datepicker(methodName: 'option', optionName: 'dayNames', dayNamesValue: string[]): JQuery;
/**
* Get the dayNamesMin option, after initialization
*
* @param methodName 'option'
* @param optionName 'dayNamesMin'
*/
datepicker(methodName: 'option', optionName: 'dayNamesMin'): string[];
/**
* Set the dayNamesMin option, after initialization
*
* @param methodName 'option'
* @param optionName 'dayNamesMin'
* @param dayNamesMinValue The list of minimised day names, starting from Sunday, for use as column headers within the datepicker.
*/
datepicker(methodName: 'option', optionName: 'dayNamesMin', dayNamesMinValue: string[]): JQuery;
/**
* Get the dayNamesShort option, after initialization
*
* @param methodName 'option'
* @param optionName 'dayNamesShort'
*/
datepicker(methodName: 'option', optionName: 'dayNamesShort'): string[];
/**
* Set the dayNamesShort option, after initialization
*
* @param methodName 'option'
* @param optionName 'dayNamesShort'
* @param dayNamesShortValue The list of abbreviated day names, starting from Sunday, for use as requested via the dateFormat option.
*/
datepicker(methodName: 'option', optionName: 'dayNamesShort', dayNamesShortValue: string[]): JQuery;
/**
* Get the defaultDate option, after initialization
*
* @param methodName 'option'
* @param optionName 'defaultDate'
*/
datepicker(methodName: 'option', optionName: 'defaultDate'): any;
/**
* Set the defaultDate option, after initialization
*
* @param methodName 'option'
* @param optionName 'defaultDate'
* @param defaultDateValue A date object containing the default date.
*/
datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: Date): JQuery;
/**
* Set the defaultDate option, after initialization
*
* @param methodName 'option'
* @param optionName 'defaultDate'
* @param defaultDateValue A number of days from today. For example 2 represents two days from today and -1 represents yesterday.
*/
datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: number): JQuery;
/**
* Set the defaultDate option, after initialization
*
* @param methodName 'option'
* @param optionName 'defaultDate'
* @param defaultDateValue A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today.
*/
datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: string): JQuery;
/**
* Get the duration option, after initialization
*
* @param methodName 'option'
* @param optionName 'duration'
*/
datepicker(methodName: 'option', optionName: 'duration'): string;
/**
* Set the duration option, after initialization
*
* @param methodName 'option'
* @param optionName 'duration'
* @param durationValue Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast").
*/
datepicker(methodName: 'option', optionName: 'duration', durationValue: string): JQuery;
/**
* Get the firstDay option, after initialization
*
* @param methodName 'option'
* @param optionName 'firstDay'
*/
datepicker(methodName: 'option', optionName: 'firstDay'): number;
/**
* Set the firstDay option, after initialization
*
* @param methodName 'option'
* @param optionName 'firstDay'
* @param firstDayValue Set the first day of the week: Sunday is 0, Monday is 1, etc.
*/
datepicker(methodName: 'option', optionName: 'firstDay', firstDayValue: number): JQuery;
/**
* Get the gotoCurrent option, after initialization
*
* @param methodName 'option'
* @param optionName 'gotoCurrent'
*/
datepicker(methodName: 'option', optionName: 'gotoCurrent'): boolean;
/**
* Set the gotoCurrent option, after initialization
*
* @param methodName 'option'
* @param optionName 'gotoCurrent'
* @param gotoCurrentValue When true, the current day link moves to the currently selected date instead of today.
*/
datepicker(methodName: 'option', optionName: 'gotoCurrent', gotoCurrentValue: boolean): JQuery;
/**
* Gets the value currently associated with the specified optionName.
*

9
js-url/js-url-test.ts Normal file
View File

@@ -0,0 +1,9 @@
/// <reference path="js-url.d.ts" />
url();
url('domain');
url(1);
url('domain', 'test.www.example.com/path/here');
url(-1, 'test.www.example.com/path/here');

14
js-url/js-url.d.ts vendored Normal file
View File

@@ -0,0 +1,14 @@
// Type definitions for url() v1.8.6
// Project: https://github.com/websanova/js-url
// Definitions by: MIZUNE Pine <https://github.com/pine613>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface UrlStatic {
(): string;
(pattern: string): string;
(pattern: number): string;
(pattern: string, url: string): string;
(pattern: number, url: string): string;
}
declare var url: UrlStatic;

67
jstree/jstree-test.ts Normal file
View File

@@ -0,0 +1,67 @@
/// <reference path="jstree.d.ts" />
// gets version of lib
var version: string = $.jstree.version;
// create new instance
var instance1: JSTree = $('div').jstree();
// get existing reference
var existingReference: JSTree = $.jstree.reference('sds');
// advanced tree creation
var advancedTree = $("#briefcasetree").jstree({
plugins: ['contextmenu', 'dnd', 'state', 'types', 'unique'],
core: {
check_callback: true,
data: {
cache: false,
url: 'Briefcase/GetProjectTree',
async: true,
type: 'GET',
dataType: 'json'
}
},
types: {
max_depth: -2,
max_children: -2,
valid_children: ['root_folder_all', 'root_folder'],
types: {
root_folder_all: {
valid_children: ['sub_folder_all'],
start_drag: false,
move_node: false,
delete_node: false,
remove: false
},
sub_folder_all: {
valid_children: ['sub_folder_all', 'saved_all'],
start_drag: false,
move_node: false,
delete_node: false,
remove: false
},
saved_all: {
valid_children: [],
start_drag: false,
move_node: false,
delete_node: false,
remove: false
},
root_folder: {
valid_children: ['sub_folder'],
start_drag: false,
move_node: false,
delete_node: false,
remove: false
},
sub_folder: {
valid_children: ['sub_folder', 'saved_single']
},
saved_single: {
valid_children: 'none'
}
}
}
});

1104
jstree/jstree.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

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