mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
+68
-6
@@ -13,11 +13,17 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [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/))
|
||||
* [angular-file-upload](https://github.com/danialfarid/angular-file-upload) (by [John Reilly](https://github.com/johnnyreilly))
|
||||
* [angular-spinner](https://github.com/urish/angular-spinner) (by [Marcin Biegała](https://github.com/Biegal))
|
||||
* [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib))
|
||||
* [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27))
|
||||
* [angular-http-auth](https://github.com/witoldsz/angular-http-auth) (by [vvakame](https://github.com/vvakame))
|
||||
* [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong))
|
||||
* [Angular notify](https://github.com/cgross/angular-notify) (by [Suwato](https://github.com/Suwato))
|
||||
* [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib))
|
||||
* [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted))
|
||||
* [any-db](https://github.com/grncdr/node-any-db) (by [Rogier Schouten](https://github.com/rogier-schouten))
|
||||
* [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) (by [Rogier Schouten](https://github.com/rogier-schouten))
|
||||
* [AppFramework](http://app-framework-software.intel.com/) (by [Kyo Ago](https://github.com/kyo-ago))
|
||||
* [Arbiter](http://arbiterjs.com/) (by [Arash Shakery](https://github.com/arash16))
|
||||
* [asciify](https://github.com/olizilla/asciify) (by [Alan](http://alan.norbauer.com))
|
||||
@@ -43,7 +49,11 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Breeze](http://www.breezejs.com/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Browser Harness](https://github.com/scriby/browser-harness) (by [Chris Scribner](https://github.com/scriby))
|
||||
* [bucks](https://github.com/CyberAgent/bucks.js) (by [Shunsuke Ohtani](https://github.com/zaneli))
|
||||
* [CasperJS](http://casperjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
|
||||
* [bunyan](https://github.com/trentm/node-bunyan) (by [Alex Mikhalev](https://github.com/amikhalev))
|
||||
* [bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) (by [Aymeric Beaumet](http://aymericbeaumet.me))
|
||||
* [CasperJS](http://casperjs.org) (by [Jed Mao](https://github.com/jedmao))
|
||||
* [CanvasJS](http://canvasjs.com) (by [Mark Overholt](https://github.com/mover5))
|
||||
* [checksum](https://github.com/dshaw/checksum) (by [Rogier Schouten](https://github.com/rogierschouten))
|
||||
* [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle))
|
||||
* [Chosen](http://harvesthq.github.com/chosen/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Chroma.js](https://github.com/gka/chroma.js) (by [Sebastian Brückner](https://github.com/invliD))
|
||||
@@ -52,14 +62,18 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik))
|
||||
* [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans))
|
||||
* [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon))
|
||||
* [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem))
|
||||
* [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame))
|
||||
* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie))
|
||||
* [cookie.js](https://github.com/js-coder/cookie.js) (by [Boltmade](https://github.com/Boltmade))
|
||||
* [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/))
|
||||
* [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus))
|
||||
* [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat))
|
||||
* [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli))
|
||||
* [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts)
|
||||
* [d3.js](http://d3js.org/) (from TypeScript samples)
|
||||
* [dat.GUI](https://github.com/dataarts/dat.gui) (by [gyoh_k](https://github.com/gyohk))
|
||||
* [debug](https://github.com/visionmedia/debug) (by [Seon-Wook Park](https://github.com/swook))
|
||||
* [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) (by [Maksim Kozhukh](http://github.com/mkozhukh))
|
||||
* [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) (by [Maksim Kozhukh](http://github.com/mkozhukh))
|
||||
* [diff](https://github.com/kpdecker/jsdiff) (by [vvakame](http://github.com/vvakame))
|
||||
@@ -71,17 +85,22 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [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))
|
||||
* [Ember.js](http://emberjs.com/) (by [Jed Mao](https://github.com/jedmao) and [Boris Yankov](https://github.com/borisyankov))
|
||||
* [emissary](https://github.com/atom/emissary) (by [vvakame](https://github.com/vvakame))
|
||||
* [Emscripten](http://kripken.github.io/emscripten-site/) (by [Kensuke MATSUZAKI](https://github.com/zakki))
|
||||
* [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))
|
||||
* [EventEmitter2](https://github.com/asyncly/EventEmitter2) (by [Ryo Iwamoto](https://github.com/ryiwamoto))
|
||||
* [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame))
|
||||
* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [express-session](https://www.npmjs.org/package/express-session) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
|
||||
* [express-myconnection](https://www.npmjs.org/package/express-myconnection) (by [Michael Ferris](https://github.com/cellule/)
|
||||
* [Ext JS](http://www.sencha.com/products/extjs/) (by [Brian Kotek](https://github.com/brian428))
|
||||
* [Fabric.js](http://fabricjs.com/) (by [Oliver Klemencic](https://github.com/oklemencic/))
|
||||
* [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [FastClick](https://github.com/ftlabs/fastclick) (by [Shinnosuke Watanabe](https://github.com/shinnn))
|
||||
* [File API: Directories and System](http://www.w3.org/TR/file-system-api/) (by [Kon](http://phyzkit.net/))
|
||||
* [File API: Writer](http://www.w3.org/TR/file-writer-api/) (by [Kon](http://phyzkit.net/))
|
||||
* [Finch](https://github.com/stoodder/finchjs) (by [David Sichau](https://github.com/DavidSichau/))
|
||||
@@ -115,7 +134,9 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [gulp](http://gulpjs.com/) (by [Drew Noakes](https://drewnoakes.com))
|
||||
* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Hapi](http://github.com/spumko/hapi) (by [Hakubo](http://github.com/hakubo))
|
||||
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [HashMap](https://github.com/flesler/hashmap) (by [Rafał Wrzeszcz](https://wrzasq.pl))
|
||||
* [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home))
|
||||
@@ -123,16 +144,20 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [HelloJS](http://adodson.com/hello.js) (by [Pavel Zika](https://github.com/PavelPZ))
|
||||
* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog))
|
||||
* [Highland](http://highlandjs.org/) (by [Bart van der Schoor](https://github.com/Bartvds/))
|
||||
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee))
|
||||
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee) and [Jeremy Hull](https://github.com/sourrust))
|
||||
* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn))
|
||||
* [htmlparser2](https://github.com/fb55/htmlparser2/) (by [James Roland Cabresos](https://github.com/staticfunction))
|
||||
* [http-string-parser](https://github.com/apiaryio/http-string-parser) (by [MIZUNE Pine](https://github.com/pine613))
|
||||
* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac))
|
||||
* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter))
|
||||
* [i18n-node](https://github.com/mashpie/i18n-node) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [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))
|
||||
* [Intercom.js](https://github.com/diy/intercom.js) (by [Spencer Williams](https://github.com/spencerwi))
|
||||
* [Imagemagick](http://github.com/rsms/node-imagemagick) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
|
||||
* [inflection](https://github.com/dreamerslab/node.inflection) (by [Shogo Iwano](https://github.com/shiwano))
|
||||
* [insight](https://github.com/yeoman/insight) (by [vvakame](https://github.com/vvakame))
|
||||
* [interact.js](http://github.com/taye/interact.js) (by [Douglas Eichelberger](https://github.com/dduugg))
|
||||
* [Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) (by [Douglas Eichelberger](https://github.com/dduugg))
|
||||
* [Ionic-Cordova](https://github.com/driftyco/) (by [Hendrik Maus](https://github.com/hendrikmaus))
|
||||
@@ -143,6 +168,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Jasmine-data_driven_tests](https://github.com/gburghardt/jasmine-data_driven_tests) (by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon))
|
||||
* [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))
|
||||
* [Jest](http://facebook.github.io/jest/) (by [Joshua Smith](https://github.com/Josh211ua))
|
||||
* [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)
|
||||
@@ -157,6 +183,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [jQuery.Colorbox](http://www.jacklmoore.com/colorbox/) (by [Gidon Junge](https://github.com/gjunge))
|
||||
* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/))
|
||||
* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode))
|
||||
* [jQuery.customSelect](https://github.com/adamcoulombe/jquery.customSelect) (by [tomato360](https://github.com/tomato360))
|
||||
* [jQuery.Cycle](http://jquery.malsup.com/cycle/) (by [François Guillot](http://fguillot.developpez.com/))
|
||||
* [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) (by [Donny Nadolny](https://github.com/dnadolny))
|
||||
* [jQuery.dataTables](http://www.datatables.net) (by [Armin Sander](https://github.com/pragmatrix))
|
||||
@@ -171,6 +198,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/))
|
||||
* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone))
|
||||
* [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee))
|
||||
* [jQuery.leanModal](http://leanmodal.finelysliced.com.au/)(by [tomato360](https://github.com/tomato360))
|
||||
* [jQuery.notifyBar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/) (by [Shunsuke Ohtani](https://github.com/zaneli))
|
||||
* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
|
||||
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
|
||||
@@ -180,6 +208,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/))
|
||||
* [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle))
|
||||
* [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske))
|
||||
* [jQuery.rowGrid](https://github.com/brunjo/rowGrid.js) (by [Vinayak Garg](https://github.com/vinayak-garg))
|
||||
* [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))
|
||||
@@ -195,6 +224,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [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))
|
||||
* [jquery-handsontable](https://github.com/handsontable/jquery-handsontable) (by [Ted John](https://github.com/intelorca))
|
||||
* [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/))
|
||||
@@ -203,12 +233,14 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk))
|
||||
* [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/))
|
||||
* [JSON-Pointer](https://www.npmjs.org/package/json-pointer) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [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/))
|
||||
* [keymaster.js](https://github.com/madrobby/keymaster) (by [Marting W. Kirst](https://github.com/nitram509/))
|
||||
* [Keypress](https://github.com/dmauro/Keypress/) (by [Roger Chen](https://github.com/rcchen/))
|
||||
* [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat))
|
||||
* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit))
|
||||
* [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
@@ -219,8 +251,10 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel))
|
||||
* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek))
|
||||
* [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613))
|
||||
* [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig))
|
||||
* [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising))
|
||||
* [Knockstrap](http://faulknercs.github.io/Knockstrap/) (by [Adam Pluciński](https://github.com/adaskothebeast))
|
||||
* [ko.editables](http://romanych.github.com/ko.editables/) (by [Oisin Grehan](https://github.com/oising))
|
||||
* [KoLite](https://github.com/CodeSeven/kolite) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Lazy.js](http://danieltao.com/lazy.js/) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
@@ -240,12 +274,15 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga))
|
||||
* [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))
|
||||
* [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613))
|
||||
* [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee))
|
||||
* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk))
|
||||
* [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame))
|
||||
* [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [Mithril](http://lhorie.github.io/mithril) (by [Leo Horie](https://github.com/lhorie) and [Chris Bowdon](https://github.com/cbowdon))
|
||||
* [Mixpanel](https://github.com/mixpanel/mixpanel-js) (by [Knut Eirik Leira Hjelle](https://github.com/hjellek))
|
||||
* [mixto](https://github.com/atom/mixto) (by [vvakame](https://github.com/vvakame))
|
||||
* [mocha-phantomjs](https://github.com/metaskills/mocha-phantomjs) (by [ErikSchierboom](https://github.com/ErikSchierboom))
|
||||
* [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))
|
||||
@@ -253,39 +290,50 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [morgan](https://github.com/expressjs/morgan/) (by [James Roland Cabresos](https://github.com/staticfunction/))
|
||||
* [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))
|
||||
* [msnodesql](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov) and [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [Mustache.js](https://github.com/janl/mustache.js) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [mysql](https://github.com/felixge/node-mysql) (by [William Johnston](https://github.com/wjohnsto))
|
||||
* [nconf](https://github.com/flatiron/nconf) (by [Jeff Goddard](https://github.com/jedigo))
|
||||
* [needle](https://github.com/tomas/needle) (by [San Chen](https://github.com/bigsan))
|
||||
* [nexpect](https://github.com/nodejitsu/nexpect) (by [vvakame](https://github.com/vvakame))
|
||||
* [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-azure](https://github.com/Azure/azure-sdk-for-node) (by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna) and [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [node-ffi](https://github.com/rbranson/node-ffi) (by [Paul Loyd](https://github.com/loyd))
|
||||
* [node-form](https://github.com/rsamec/form) (by [Roman Samec](https://github.com/rsamec))
|
||||
* [node-git](https://github.com/christkv/node-git) (by [vvakame](https://github.com/vvakame))
|
||||
* [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov) and [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [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-tar](https://github.com/npm/node-tar) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [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))
|
||||
* [npm](https://github.com/npm/npm) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [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/))
|
||||
* [object-path](https://github.com/mariocasciaro/object-path) (by [Paulo Cesar](https://github.com/pocesar/))
|
||||
* [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/))
|
||||
* [opn](https://github.com/sindresorhus/opn) (by [Shinnosuke Watanabe](https://github.com/shinnn))
|
||||
* [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/))
|
||||
* [passport-facebook](https://github.com/jaredhanson/passport-facebook) (by [James Roland Cabresos](https://github.com/staticfunction/))
|
||||
* [passport-local](https://github.com/jaredhanson/passport-local) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [passport-strategy](https://github.com/jaredhanson/passport-strategy) (by [Lior Mualem](https://github.com/liorm))
|
||||
* [pathwatcher](http://atom.github.io/node-pathwatcher/) (by [vvakame](https://github.com/vvakame))
|
||||
* [Parallel.js](https://github.com/adambom/parallel.js) (by [Josh Baldwin](https://github.com/jbaldwin))
|
||||
* [Parsimmon](https://github.com/jayferd/parsimmon) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin))
|
||||
* [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura))
|
||||
* [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame))
|
||||
* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto))
|
||||
* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613))
|
||||
* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
|
||||
* [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk))
|
||||
* [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya))
|
||||
* [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments))
|
||||
* [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH))
|
||||
* [podcast](http://github.com/maxnowack/node-podcast) (by [Niklas Mollenhauer](https://github.com/nikeee))
|
||||
@@ -294,6 +342,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [ProgressJs](http://usablica.github.io/progress.js/) (by [Shunsuke Ohtani](https://github.com/zaneli))
|
||||
* [promise-pool](https://github.com/vilic/promise-pool) (by [VILIC VANE](https://github.com/vilic))
|
||||
* [Q](https://github.com/kriskowal/q) (by Barrie Nemetchek, Andrew Gaspar)
|
||||
* [Qajax](https://github.com/gre/qajax) (by [Boltmade](https://github.com/Boltmade))
|
||||
* [Q-io](https://github.com/kriskowal/q-io) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [q-retry](https://github.com/vilic/q-retry) (by [VILIC VANE](https://github.com/vilic))
|
||||
* [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei))
|
||||
@@ -302,6 +351,7 @@ 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))
|
||||
* [React](http://facebook.github.io/react/) (by [Phips Peter](https://github.com/pspeter3)
|
||||
* [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))
|
||||
@@ -315,11 +365,14 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong))
|
||||
* [Semver](https://github.com/isaacs/node-semver) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428))
|
||||
* [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com))
|
||||
* [ShellJS](http://shelljs.org) (by [Niklas Mollenhauer](https://github.com/nikeee))
|
||||
* [Showdown](https://github.com/coreyti/showdown) (by [Chris Bowdon](https://github.com/cbowdon))
|
||||
* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame))
|
||||
* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u))
|
||||
* [SIPml](http://sipml5.org/) (by [Adriaan Groenenboom](https://github.com/chookies))
|
||||
* [sjcl](http://crypto.stanford.edu/sjcl/) (by [Eugene Chernyshov](https://github.com/Evgenus))
|
||||
* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin))
|
||||
* [smoothie](https://github.com/joewalnes/smoothie) (by [Mike H. Hawley](https://github.com/mikehhawley) and [Drew Noakes](https://drewnoakes.com))
|
||||
@@ -331,10 +384,14 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [source-map](https://github.com/mozilla/source-map) (by [Morten Houston Ludvigsen](https://github.com/MortenHoustonLudvigsen))
|
||||
* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [sqlite3](https://github.com/mapbox/node-sqlite3) (by [Nick Malaguti](https://github.com/nmalaguti))
|
||||
* [stampit](https://github.com/ericelliott/stampit) (by [Vasyl Boroviak](https://github.com/koresar))
|
||||
* [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))
|
||||
* [stylus](https://github.com/LearnBoost/stylus) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/))
|
||||
* [svg-pan-zoom] (https://github.com/ariutta/svg-pan-zoom) (by [Chintan Shah] (https://github.com/Promact))
|
||||
* [swfobject](https://code.google.com/p/swfobject/) (by [rou](https://github.com/rou))
|
||||
* [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))
|
||||
@@ -344,6 +401,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [text-buffer](https://github.com/atom/text-buffer) (by [vvakame](https://github.com/vvakame))
|
||||
* [text-encoding](https://github.com/inexorabletash/text-encoding) (by [MIZUNE Pine](https://github.com/pine613))
|
||||
* [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/))
|
||||
* [through2](https://github.com/rvagg/through2) (by [Bart van der Schoor](https://github.com/Bartvds) and [jedmao](https://github.com/jedmao))
|
||||
* [TimelineJS](https://github.com/NUKnightLab/TimelineJS) (by [Roland Zwaga](https://github.com/rolandzwaga))
|
||||
* [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) (by [Rogier Schouten](https://github.com/rogierschouten))
|
||||
* [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
@@ -366,18 +424,22 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/))
|
||||
* [vinyl](https://github.com/wearefractal/vinyl) (by [vvakame](https://github.com/vvakame/))
|
||||
* [vinyl-fs](https://github.com/wearefractal/vinyl-fs) (by [vvakame](https://github.com/vvakame/))
|
||||
* [vinyl-fs](https://github.com/wearefractal/vinyl-fs) (by [vvakame](https://github.com/vvakame/) and [jedmao](https://github.com/jedmao))
|
||||
* [WebRTC](http://dev.w3.org/2011/webrtc/editor/webrtc.html) (by [Ken Smith](https://github.com/smithkl42))
|
||||
* [websocket](https://github.com/Worlize/WebSocket-Node) (by [Paul Loyd](https://github.com/loyd))
|
||||
* [WinJS](http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx) (from TypeScript samples)
|
||||
* [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples)
|
||||
* [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) (by [Ryo Iwamoto](https://github.com/ryiwamoto))
|
||||
* [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd))
|
||||
* [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
|
||||
* [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib))
|
||||
* [xpath](https://github.com/goto100/xpath) (by [Andrew Bradley](https://github.com/cspotcode))
|
||||
* [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [yargs](https://github.com/chevex/yargs) (by [Martin Poelstra](https://github.com/poelstra))
|
||||
* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/))
|
||||
* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [YouTube Data API](https://developers.google.com/youtube/v3/) (by [Frank M](https://github.com/sgtfrankieboy/))
|
||||
* [Zepto.js](http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin))
|
||||
* [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith](https://github.com/ejsmith))
|
||||
* [Parse SDK](https://parse.com/docs/js_guide) (by [Ullisen Media Group, LLC](http://ullisenmedia.com))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/// <reference path="headroom.d.ts" />
|
||||
|
||||
new Headroom(document.getElementById('siteHead'));
|
||||
|
||||
new Headroom(document.getElementsByClassName('siteHead')[0]);
|
||||
|
||||
new Headroom(document.getElementsByClassName('siteHead')[0], {
|
||||
tolerance: 34
|
||||
});
|
||||
|
||||
new Headroom(document.getElementsByClassName('siteHead')[0], {
|
||||
offset: 500
|
||||
});
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
// Type definitions for headroom.js v0.7.0
|
||||
// Project: http://wicky.nillia.ms/headroom.js/
|
||||
// Definitions by: Jakub Olek <https://github.com/hakubo/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface HeadroomOptions {
|
||||
offset?: number;
|
||||
tolerance?: any;
|
||||
classes?: {
|
||||
initial?: string;
|
||||
pinned?: string;
|
||||
unpinned?: string;
|
||||
top?: string;
|
||||
notTop?: string;
|
||||
};
|
||||
scroller?: Element;
|
||||
onPin?: () => void;
|
||||
onUnPin?: () => void;
|
||||
onTop?: () => void;
|
||||
onNotTop?: () => void;
|
||||
|
||||
}
|
||||
|
||||
declare class Headroom {
|
||||
constructor(element: Node, options?: HeadroomOptions);
|
||||
constructor(element: Element, options?: HeadroomOptions);
|
||||
init: () => void;
|
||||
}
|
||||
@@ -1 +1,23 @@
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
function readJSON(target) {
|
||||
return JSON.parse(fs.readFileSync(target, 'utf8'));
|
||||
}
|
||||
|
||||
function getSemFloat(str) {
|
||||
var m = /^[^\d]*(\d+)\.(\d+)/.exec(str);
|
||||
return parseFloat(m[1] + '.' + m[2]);
|
||||
}
|
||||
|
||||
var repo = readJSON(path.resolve(__dirname, '..', 'package.json'));
|
||||
|
||||
var testerPath = path.resolve(__dirname, '..', 'node_modules', 'definition-tester', 'package.json');
|
||||
|
||||
// ultra lame semver major/minor check
|
||||
if (!fs.existsSync(testerPath) || getSemFloat(repo.dependencies['definition-tester']) > getSemFloat(readJSON(testerPath).version)) {
|
||||
console.log('DefinitelyTyped tester needs an update!\n\n please run \'npm install\'\n');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
require('definition-tester');
|
||||
|
||||
+14169
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/// <reference path="angular-file-upload.d.ts" />
|
||||
|
||||
module controllers {
|
||||
|
||||
"use strict";
|
||||
|
||||
var controllerId = "upload";
|
||||
|
||||
class Upload {
|
||||
|
||||
static $inject = ["$upload"];
|
||||
constructor(
|
||||
private $upload: ng.angularFileUpload.IUploadService
|
||||
) {
|
||||
}
|
||||
|
||||
onFileSelect($files: File[]) {
|
||||
//$files: an array of files selected, each file has name, size, and type.
|
||||
var uploads: ng.IPromise<any>[] = [];
|
||||
for (var i = 0; i < $files.length; i++) {
|
||||
var file = $files[i];
|
||||
uploads.push(this.$upload.upload<any>({
|
||||
url: "/api/upload",
|
||||
method: "POST",
|
||||
data: {
|
||||
extraData: {
|
||||
fileName: file.name, test: "anything"
|
||||
}
|
||||
},
|
||||
file: file
|
||||
})
|
||||
.progress((evt: any) => {
|
||||
console.log('progress');
|
||||
})
|
||||
.then(success => {
|
||||
// file is uploaded successfully
|
||||
console.log(success.data);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
angular.module("app").controller(controllerId, Upload);
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for Angular File Upload 1.6.7
|
||||
// Project: https://github.com/danialfarid/angular-file-upload
|
||||
// Definitions by: John Reilly <https://github.com/johnnyreilly>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module ng.angularFileUpload {
|
||||
|
||||
interface IUploadService {
|
||||
|
||||
http<T>(config: IFileUploadConfig): IUploadPromise<T>;
|
||||
upload<T>(config: IFileUploadConfig): IUploadPromise<T>;
|
||||
}
|
||||
|
||||
interface IUploadPromise<T> extends IHttpPromise<T> {
|
||||
|
||||
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
|
||||
}
|
||||
|
||||
interface IFileUploadConfig extends ng.IRequestConfig {
|
||||
|
||||
file: File;
|
||||
fileName?: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path="./angular-http-auth.d.ts" />
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
angular.module('login', ['http-auth-interceptor'])
|
||||
|
||||
.controller('LoginController', ($scope:any, $http:any, authService:ng.httpAuth.IAuthService) => {
|
||||
$scope.submit = () => {
|
||||
$http.post('auth/login').success(() => {
|
||||
authService.loginConfirmed();
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for angular-http-auth 1.2.1
|
||||
// Project: https://github.com/witoldsz/angular-http-auth
|
||||
// Definitions by: vvakame <https://github.com/vvakame>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module ng.httpAuth {
|
||||
interface IAuthService {
|
||||
loginConfirmed(data?:any, configUpdater?:Function):void;
|
||||
loginCancelled(data?:any, reason?:any):void;
|
||||
}
|
||||
|
||||
interface IHttpBuffer {
|
||||
append(config:ng.IRequestConfig, deferred:{resolve(data:any):void; reject(data:any):void;}):void;
|
||||
rejectAll(reason?:any):void;
|
||||
retryAll(updater?:Function):void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/// <reference path="angular-notify.d.ts" />
|
||||
|
||||
var myapp = angular.module("myapp", ["cgNotify"]);
|
||||
|
||||
myapp.controller("MyController", ["$scope", "cgNotify",
|
||||
function ($scope:ng.IScope, notify:ng.cgNotify.INotifyService) { // <-- Inject notify
|
||||
|
||||
var notifyObj = notify("Your notification message"); // <-- Call notify with your message
|
||||
notifyObj.close();
|
||||
|
||||
notify.config({
|
||||
startTop: 10,
|
||||
verticalSpacing: 15,
|
||||
duration: 10000,
|
||||
templateUrl: "angular-notify.html",
|
||||
position: "center",
|
||||
container: document.body
|
||||
});
|
||||
|
||||
notify( {
|
||||
message: "My message",
|
||||
templateUrl: "my_template.html",
|
||||
position: "center",
|
||||
container: document.body,
|
||||
classes: "", // <-- CSS class names
|
||||
$scope: $scope
|
||||
}); // <-- Call notify with your message + option
|
||||
|
||||
notify.closeAll();
|
||||
}
|
||||
]);
|
||||
Vendored
+116
@@ -0,0 +1,116 @@
|
||||
// Type definitions for angular-notify 2.0.2
|
||||
// Project: https://github.com/cgross/angular-notify
|
||||
// Definitions by: Suwato <https://github.com/Suwato/DefinitelyTyped>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module ng.cgNotify {
|
||||
|
||||
interface INotifyService {
|
||||
|
||||
/**
|
||||
* The notify function can either be passed a string or an object.
|
||||
* This function will return an object with a close() method and a message property.
|
||||
* @param message
|
||||
*/
|
||||
(message:string):INotify;
|
||||
|
||||
/**
|
||||
* When passing an object, the object parameters can be:
|
||||
* @param option
|
||||
*/
|
||||
(option:{
|
||||
/**
|
||||
* Required. The message to show.
|
||||
*/
|
||||
message : string;
|
||||
|
||||
/**
|
||||
* Optional. A custom template for the UI of the message.
|
||||
*/
|
||||
templateUrl? : string;
|
||||
|
||||
/**
|
||||
* Optional. A list of custom CSS classes to apply to the message element.
|
||||
*/
|
||||
classes? : string;
|
||||
|
||||
/**
|
||||
* Optional. A string containing any valid Angular HTML which will be shown instead of the regular message text.
|
||||
* The string must contain one root element like all valid Angular HTML templates (so wrap everything in a <span>).
|
||||
*/
|
||||
messageTemplate? : string;
|
||||
|
||||
/**
|
||||
* Optional. A valid Angular scope object. The scope of the template will be created by calling $new() on this scope.
|
||||
*/
|
||||
$scope? : ng.IScope;
|
||||
|
||||
/**
|
||||
* Optional. Currently center and right are the only acceptable values.
|
||||
*/
|
||||
position? : string;
|
||||
|
||||
/**
|
||||
* Optional. Element that contains each notification. Defaults to document.body.
|
||||
*/
|
||||
container? : any;
|
||||
}):INotify;
|
||||
|
||||
|
||||
/**
|
||||
* Call config to set the default configuration options for angular-notify.
|
||||
* The following options may be specified in the given object:
|
||||
* @param option
|
||||
*/
|
||||
config(option:{
|
||||
/**
|
||||
* The default duration (in milliseconds) of each message. A duration of 0 will prevent messages from closing automatically.
|
||||
*/
|
||||
duration? : number;
|
||||
|
||||
/**
|
||||
* The Y pixel value where messages will be shown.
|
||||
*/
|
||||
startTop? : number;
|
||||
|
||||
/**
|
||||
* The number of pixels that should be reserved between messages vertically.
|
||||
*/
|
||||
verticalSpacing? : number;
|
||||
|
||||
/**
|
||||
* The default message template.
|
||||
*/
|
||||
templateUrl? : string;
|
||||
|
||||
/**
|
||||
* The default position of each message. Currently only center and right are the supported values.
|
||||
*/
|
||||
position? : string;
|
||||
|
||||
/**
|
||||
* The default element that contains each notification. Defaults to document.body.
|
||||
*/
|
||||
container? : any;
|
||||
}):void;
|
||||
|
||||
/**
|
||||
* Closes all currently open notifications.
|
||||
*/
|
||||
closeAll():void;
|
||||
}
|
||||
|
||||
interface INotify{
|
||||
/**
|
||||
* The message to show.
|
||||
*/
|
||||
message:string;
|
||||
|
||||
/**
|
||||
* Close this open notifications.
|
||||
*/
|
||||
close():void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path="angular-spinner.d.ts" />
|
||||
|
||||
var myApp = angular.module('testModule');
|
||||
|
||||
module AngularSpinnerTest {
|
||||
var app = angular.module("angularSpinnerTest", ["angular-spinner"]);
|
||||
|
||||
app.config(['usSpinnerService', function(usSpinnerService: ISpinnerService) {
|
||||
usSpinnerService.spin('key1');
|
||||
usSpinnerService.stop('key2');
|
||||
}]);
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for angular-spinner.js 0.5.1
|
||||
// Project: https://github.com/urish/angular-spinner
|
||||
// Definitions by: Marcin Biegała <https://github.com/Biegal>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
/**
|
||||
* SpinnerService
|
||||
* see https://github.com/urish/angular-spinner
|
||||
*/
|
||||
interface ISpinnerService {
|
||||
/**
|
||||
* Start selected spinner
|
||||
*
|
||||
* @param spinner key
|
||||
*/
|
||||
spin(key: string): void;
|
||||
|
||||
/**
|
||||
* Stop selected spinner
|
||||
*
|
||||
* @param spinner key
|
||||
*/
|
||||
stop(key: string): void;
|
||||
}
|
||||
+7
-4
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular Translate (pascalprecht.translate module)
|
||||
// Type definitions for Angular Translate v2.4.0 (pascalprecht.translate module)
|
||||
// Project: https://github.com/PascalPrecht/angular-translate
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -42,7 +42,7 @@ declare module ng.translate {
|
||||
instant(translationId: string, interpolateParams?: any, interpolationId?: string): string;
|
||||
instant(translationId: string[], interpolateParams?: any, interpolationId?: string): { [key: string]: string };
|
||||
isPostCompilingEnabled(): boolean;
|
||||
preferredLanguage(): string;
|
||||
preferredLanguage(langKey?: string): string;
|
||||
proposedLanguage(): string;
|
||||
refresh(langKey?: string): ng.IPromise<void>;
|
||||
storage(): IStorage;
|
||||
@@ -50,6 +50,8 @@ declare module ng.translate {
|
||||
use(): string;
|
||||
use(key: string): ng.IPromise<string>;
|
||||
useFallbackLanguage(langKey?: string): void;
|
||||
versionInfo(): string;
|
||||
loaderCache(): any;
|
||||
}
|
||||
|
||||
interface ITranslateProvider extends ng.IServiceProvider {
|
||||
@@ -61,14 +63,14 @@ declare module ng.translate {
|
||||
useMessageFormatInterpolation(): ITranslateProvider;
|
||||
useInterpolation(factory: string): ITranslateProvider;
|
||||
useSanitizeValueStrategy(value: string): ITranslateProvider;
|
||||
preferredLanguage(): string;
|
||||
preferredLanguage(): ITranslateProvider;
|
||||
preferredLanguage(language: string): ITranslateProvider;
|
||||
translationNotFoundIndicator(indicator: string): ITranslateProvider;
|
||||
translationNotFoundIndicatorLeft(): string;
|
||||
translationNotFoundIndicatorLeft(indicator: string): ITranslateProvider;
|
||||
translationNotFoundIndicatorRight(): string;
|
||||
translationNotFoundIndicatorRight(indicator: string): ITranslateProvider;
|
||||
fallbackLanguage(): string;
|
||||
fallbackLanguage(): ITranslateProvider;
|
||||
fallbackLanguage(language: string): ITranslateProvider;
|
||||
fallbackLanguage(languages: string[]): ITranslateProvider;
|
||||
use(): string;
|
||||
@@ -89,5 +91,6 @@ declare module ng.translate {
|
||||
determinePreferredLanguage(fn?: () => void): ITranslateProvider;
|
||||
registerAvailableLanguageKeys(): string[];
|
||||
registerAvailableLanguageKeys(languageKeys: string[], aliases?: ILanguageKeyAlias): ITranslateProvider;
|
||||
useLoaderCache(cache?: any): ITranslateProvider;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ testApp.config((
|
||||
});
|
||||
|
||||
testApp.controller('TestCtrl', (
|
||||
$scope: ng.IScope,
|
||||
$scope: ng.ui.bootstrap.IModalScope,
|
||||
$log: ng.ILogService,
|
||||
$modal: ng.ui.bootstrap.IModalService,
|
||||
$modalStack: ng.ui.bootstrap.IModalStackService,
|
||||
@@ -147,9 +147,9 @@ testApp.controller('TestCtrl', (
|
||||
$log.log('modal opened');
|
||||
});
|
||||
|
||||
modalInstance.result.then(closeResult=> {
|
||||
modalInstance.result.then((closeResult:any)=> {
|
||||
$log.log('modal closed', closeResult);
|
||||
}, dismissResult=> {
|
||||
}, (dismissResult:any)=> {
|
||||
$log.log('modal dismissed', dismissResult);
|
||||
});
|
||||
|
||||
|
||||
+29
-3
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular UI Bootstrap 0.10.0
|
||||
// Type definitions for Angular UI Bootstrap 0.11.0
|
||||
// Project: https://github.com/angular-ui/bootstrap
|
||||
// Definitions by: Brian Surowiec <https://github.com/xt0rted>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -198,6 +198,22 @@ declare module ng.ui.bootstrap {
|
||||
opened: ng.IPromise<any>;
|
||||
}
|
||||
|
||||
interface IModalScope extends ng.IScope {
|
||||
/**
|
||||
* Those methods make it easy to close a modal window without a need to create a dedicated controller
|
||||
*/
|
||||
|
||||
/**
|
||||
* Dismiss the dialog without assigning a value to the promise output
|
||||
*/
|
||||
$dismiss(reason?: any): void;
|
||||
|
||||
/**
|
||||
* Close the dialog resolving the promise to the given value
|
||||
*/
|
||||
$close(result?: any): void;
|
||||
}
|
||||
|
||||
interface IModalSettings {
|
||||
/**
|
||||
* a path to a template representing modal's content
|
||||
@@ -211,9 +227,9 @@ declare module ng.ui.bootstrap {
|
||||
|
||||
/**
|
||||
* a scope instance to be used for the modal's content (actually the $modal service is going to create a child scope of a provided scope).
|
||||
* Defaults to `$rootScope`
|
||||
* Defaults to `$rootScope`.
|
||||
*/
|
||||
scope?: any;
|
||||
scope?: IModalScope;
|
||||
|
||||
/**
|
||||
* a controller for a modal instance - it can initialize scope used by modal.
|
||||
@@ -246,6 +262,16 @@ declare module ng.ui.bootstrap {
|
||||
* additional CSS class(es) to be added to a modal window template
|
||||
*/
|
||||
windowClass?: string;
|
||||
|
||||
/**
|
||||
* optional size of modal window. Allowed values: 'sm' (small) or 'lg' (large). Requires Bootstrap 3.1.0 or later
|
||||
*/
|
||||
size?: string;
|
||||
|
||||
/**
|
||||
* a path to a template overriding modal's window template
|
||||
*/
|
||||
windowTemplateUrl?: string;
|
||||
}
|
||||
|
||||
interface IModalStackService {
|
||||
|
||||
Vendored
+1
@@ -23,6 +23,7 @@ declare module ng.ui {
|
||||
onEnter?: any;
|
||||
onExit?: any;
|
||||
data?: any;
|
||||
reloadOnSearch?: boolean;
|
||||
}
|
||||
|
||||
interface IStateProvider extends IServiceProvider {
|
||||
|
||||
Vendored
+97
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Angular JS 1.2+ (ngAnimate module)
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="angular.d.ts" />
|
||||
@@ -13,9 +13,104 @@ declare module ng.animate {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// AnimateService
|
||||
// see http://docs.angularjs.org/api/ngAnimate.$animate
|
||||
// see http://docs.angularjs.org/api/ngAnimate/service/$animate
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IAnimateService extends ng.IAnimateService {
|
||||
/**
|
||||
* Globally enables / disables animations.
|
||||
*
|
||||
* @param value If provided then set the animation on or off.
|
||||
* @param element If provided then the element will be used to represent the enable/disable operation.
|
||||
* @returns current animation state
|
||||
*/
|
||||
enabled(value?: boolean, element?: JQuery): boolean;
|
||||
|
||||
/**
|
||||
* Appends the element to the parentElement element that resides in the document and then runs the enter animation.
|
||||
*
|
||||
* @param element the element that will be the focus of the enter animation
|
||||
* @param parentElement the parent element of the element that will be the focus of the enter animation
|
||||
* @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery): ng.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Runs the leave animation operation and, upon completion, removes the element from the DOM.
|
||||
*
|
||||
* @param element the element that will be the focus of the leave animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
leave(element: JQuery): ng.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Fires the move DOM operation. Just before the animation starts, the animate service will either append
|
||||
* it into the parentElement container or add the element directly after the afterElement element if present.
|
||||
* Then the move animation will be run.
|
||||
*
|
||||
* @param element the element that will be the focus of the move animation
|
||||
* @param parentElement the parent element of the element that will be the focus of the move animation
|
||||
* @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): ng.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Triggers a custom animation event based off the className variable and then attaches the className
|
||||
* value to the element as a CSS class.
|
||||
*
|
||||
* @param element the element that will be animated
|
||||
* @param className the CSS class that will be added to the element and then animated
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
addClass(element: JQuery, className: string): ng.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Triggers a custom animation event based off the className variable and then removes the CSS class
|
||||
* provided by the className value from the element.
|
||||
*
|
||||
* @param element the element that will be animated
|
||||
* @param className the CSS class that will be animated and then removed from the element
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
removeClass(element: JQuery, className: string): ng.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback
|
||||
* will be fired (if provided).
|
||||
*
|
||||
* @param element the element which will have its CSS classes changed removed from it
|
||||
* @param add the CSS classes which will be added to the element
|
||||
* @param remove the CSS class which will be removed from the element CSS classes have been set on the element
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
setClass(element: JQuery, add: string, remove: string): ng.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Cancels the provided animation.
|
||||
*/
|
||||
cancel(animationPromise: ng.IPromise<void>): void;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// AngularProvider
|
||||
// see http://docs.angularjs.org/api/ngAnimate/provider/$animateProvider
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IAnimateProvider {
|
||||
/**
|
||||
* Registers a new injectable animation factory function.
|
||||
*
|
||||
* @param name The name of the animation.
|
||||
* @param factory The factory function that will be executed to return the animation object.
|
||||
*/
|
||||
register(name: string, factory: () => ng.IAnimateCallbackObject): void;
|
||||
|
||||
/**
|
||||
* Gets and/or sets the CSS class expression that is checked when performing an animation.
|
||||
*
|
||||
* @param expression The className expression which will be checked against all animations.
|
||||
* @returns The current CSS className expression value. If null then there is no expression value.
|
||||
*/
|
||||
classNameFilter(expression?: RegExp): RegExp;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -75,7 +75,7 @@ declare module ng.route {
|
||||
* - key - {string}: a name of a dependency to be injected into the controller.
|
||||
* - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead.
|
||||
*/
|
||||
resolve?: any;
|
||||
resolve?: {[key: string]: any};
|
||||
/**
|
||||
* {(string|function())=}
|
||||
* Value to update $location path with and trigger route redirection.
|
||||
|
||||
@@ -250,6 +250,12 @@ httpFoo.then((x) => {
|
||||
x.toFixed();
|
||||
});
|
||||
|
||||
httpFoo.success((data, status, headers, config) => {
|
||||
var h = headers("test");
|
||||
h.charAt(0);
|
||||
var hs = headers();
|
||||
hs["content-type"].charAt(1);
|
||||
});
|
||||
|
||||
function test_angular_forEach() {
|
||||
var values: { [key: string]: string } = { name: 'misko', gender: 'male' };
|
||||
@@ -569,3 +575,87 @@ angular.module('docsTabsExample', [])
|
||||
templateUrl: 'my-pane.html'
|
||||
};
|
||||
});
|
||||
|
||||
interface copyExampleUser {
|
||||
name?: string;
|
||||
email?: string;
|
||||
gender?: string;
|
||||
}
|
||||
|
||||
interface copyExampleScope {
|
||||
|
||||
user: copyExampleUser;
|
||||
master: copyExampleUser;
|
||||
update: (copyExampleUser: copyExampleUser) => any;
|
||||
reset: () => any;
|
||||
}
|
||||
|
||||
angular.module('copyExample', [])
|
||||
.controller('ExampleController', ['$scope', function ($scope: copyExampleScope) {
|
||||
$scope.master = { };
|
||||
|
||||
$scope.update = function (user) {
|
||||
// Example with 1 argument
|
||||
$scope.master = angular.copy(user);
|
||||
};
|
||||
|
||||
$scope.reset = function () {
|
||||
// Example with 2 arguments
|
||||
angular.copy($scope.master, $scope.user);
|
||||
};
|
||||
|
||||
$scope.reset();
|
||||
}]);
|
||||
|
||||
module locationTests {
|
||||
|
||||
var $location: ng.ILocationService;
|
||||
|
||||
/*
|
||||
* From https://docs.angularjs.org/api/ng/service/$location
|
||||
*/
|
||||
|
||||
// given url http://example.com/#/some/path?foo=bar&baz=xoxo
|
||||
var searchObject = $location.search();
|
||||
// => {foo: 'bar', baz: 'xoxo'}
|
||||
|
||||
|
||||
// set foo to 'yipee'
|
||||
$location.search('foo', 'yipee');
|
||||
// => $location
|
||||
|
||||
// set foo to 5
|
||||
$location.search('foo', 5);
|
||||
// => $location
|
||||
|
||||
/*
|
||||
* From: https://docs.angularjs.org/guide/$location
|
||||
*/
|
||||
|
||||
// in browser with HTML5 history support:
|
||||
// open http://example.com/#!/a -> rewrite to http://example.com/a
|
||||
// (replacing the http://example.com/#!/a history record)
|
||||
$location.path() == '/a'
|
||||
|
||||
$location.path('/foo');
|
||||
$location.absUrl() == 'http://example.com/foo'
|
||||
|
||||
$location.search() == {}
|
||||
$location.search({ a: 'b', c: true });
|
||||
$location.absUrl() == 'http://example.com/foo?a=b&c'
|
||||
|
||||
$location.path('/new').search('x=y');
|
||||
$location.url() == 'new?x=y'
|
||||
$location.absUrl() == 'http://example.com/new?x=y'
|
||||
|
||||
// in browser without html5 history support:
|
||||
// open http://example.com/new?x=y -> redirect to http://example.com/#!/new?x=y
|
||||
// (again replacing the http://example.com/new?x=y history item)
|
||||
$location.path() == '/new'
|
||||
$location.search() == { x: 'y' }
|
||||
|
||||
$location.path('/foo/bar');
|
||||
$location.path() == '/foo/bar'
|
||||
$location.url() == '/foo/bar?x=y'
|
||||
$location.absUrl() == 'http://example.com/#!/foo/bar?x=y'
|
||||
}
|
||||
Vendored
+355
-49
@@ -20,7 +20,7 @@ declare module ng {
|
||||
|
||||
// not directly implemented, but ensures that constructed class implements $get
|
||||
interface IServiceProviderClass {
|
||||
new(...args: any[]): IServiceProvider;
|
||||
new (...args: any[]): IServiceProvider;
|
||||
}
|
||||
|
||||
interface IServiceProviderFactory {
|
||||
@@ -38,11 +38,134 @@ declare module ng {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IAngularStatic {
|
||||
bind(context: any, fn: Function, ...args: any[]): Function;
|
||||
bootstrap(element: string, modules?: any[]): auto.IInjectorService;
|
||||
bootstrap(element: JQuery, modules?: any[]): auto.IInjectorService;
|
||||
bootstrap(element: Element, modules?: any[]): auto.IInjectorService;
|
||||
bootstrap(element: Document, modules?: any[]): auto.IInjectorService;
|
||||
copy(source: any, destination?: any): any;
|
||||
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: string, modules?: string): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: string, modules?: Function): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: string, modules?: string[]): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: JQuery, modules?: string): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: JQuery, modules?: Function): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: JQuery, modules?: string[]): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: Element, modules?: string): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: Element, modules?: Function): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: Element, modules?: string[]): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: Document, modules?: string): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: Document, modules?: Function): auto.IInjectorService;
|
||||
/**
|
||||
* Use this function to manually start up angular application.
|
||||
*
|
||||
* @param element DOM element which is the root of angular application.
|
||||
* @param modules An array of modules to load into the application.
|
||||
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
||||
* function that will be invoked by the injector as a run block.
|
||||
*/
|
||||
bootstrap(element: Document, modules?: string[]): auto.IInjectorService;
|
||||
|
||||
/**
|
||||
* Creates a deep copy of source, which should be an object or an array.
|
||||
*
|
||||
* - If no destination is supplied, a copy of the object or array is created.
|
||||
* - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it.
|
||||
* - If source is not an object or array (inc. null and undefined), source is returned.
|
||||
* - If source is identical to 'destination' an exception will be thrown.
|
||||
*
|
||||
* @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined.
|
||||
* @param destination Destination into which the source is copied. If provided, must be of the same type as source.
|
||||
*/
|
||||
copy<T>(source: T, destination?: T): T;
|
||||
|
||||
/**
|
||||
* Wraps a raw DOM element or HTML string as a jQuery element.
|
||||
*
|
||||
* If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
|
||||
*/
|
||||
element: IAugmentedJQueryStatic;
|
||||
equals(value1: any, value2: any): boolean;
|
||||
extend(destination: any, ...sources: any[]): any;
|
||||
@@ -114,7 +237,7 @@ declare module ng {
|
||||
major: number;
|
||||
minor: number;
|
||||
dot: number;
|
||||
codename: string;
|
||||
codeName: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -164,8 +287,20 @@ declare module ng {
|
||||
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
|
||||
*/
|
||||
controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
|
||||
controller(object : Object): IModule;
|
||||
controller(object: Object): IModule;
|
||||
/**
|
||||
* Register a new directive with the compiler.
|
||||
*
|
||||
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
|
||||
* @param directiveFactory An injectable directive factory function.
|
||||
*/
|
||||
directive(name: string, directiveFactory: IDirectiveFactory): IModule;
|
||||
/**
|
||||
* Register a new directive with the compiler.
|
||||
*
|
||||
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
|
||||
* @param directiveFactory An injectable directive factory function.
|
||||
*/
|
||||
directive(name: string, inlineAnnotatedFunction: any[]): IModule;
|
||||
directive(object: Object): IModule;
|
||||
/**
|
||||
@@ -245,7 +380,7 @@ declare module ng {
|
||||
// The observer function will be invoked once during the next $digest
|
||||
// following compilation. The observer is then invoked whenever the
|
||||
// interpolated value changes.
|
||||
$observe(name: string, fn:(value?:any)=>any): Function;
|
||||
$observe(name: string, fn: (value?: any) => any): Function;
|
||||
|
||||
// A map of DOM element attribute names to the normalized name. This is needed
|
||||
// to do reverse lookup from normalized name back to actual name.
|
||||
@@ -289,6 +424,7 @@ declare module ng {
|
||||
// Documentation states viewValue and modelValue to be a string but other
|
||||
// types do work and it's common to use them.
|
||||
$setViewValue(value: any): void;
|
||||
$setPristine(): void;
|
||||
$validate(): void;
|
||||
$setTouched(): void;
|
||||
$setUntouched(): void;
|
||||
@@ -310,6 +446,7 @@ declare module ng {
|
||||
$untouched: boolean;
|
||||
|
||||
$validators: IModelValidators;
|
||||
$asyncValidators: IAsyncModelValidators;
|
||||
|
||||
$pristine: boolean;
|
||||
$dirty: boolean;
|
||||
@@ -321,6 +458,10 @@ declare module ng {
|
||||
[index: string]: (...args: any[]) => boolean;
|
||||
}
|
||||
|
||||
interface IAsyncModelValidators {
|
||||
[index: string]: (...args: any[]) => ng.IPromise<boolean>;
|
||||
}
|
||||
|
||||
interface IModelParser {
|
||||
(value: any): any;
|
||||
}
|
||||
@@ -333,31 +474,40 @@ declare module ng {
|
||||
(): void;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Scope and RootScope
|
||||
// see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and http://docs.angularjs.org/api/ng.$rootScope
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* $rootScope - $rootScopeProvider - service in module ng
|
||||
* see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope
|
||||
*/
|
||||
interface IRootScopeService {
|
||||
$apply(): any;
|
||||
$apply(exp: string): any;
|
||||
$apply(exp: (scope: IScope) => any): any;
|
||||
|
||||
$applyAsync(exp: string): any;
|
||||
$applyAsync(exp: (scope: IScope) => any): any;
|
||||
|
||||
$broadcast(name: string, ...args: any[]): IAngularEvent;
|
||||
$destroy(): void;
|
||||
$digest(): void;
|
||||
$emit(name: string, ...args: any[]): IAngularEvent;
|
||||
|
||||
// Documentation says exp is optional, but actual implementaton counts on it
|
||||
$eval(expression: string, args?: Object): any;
|
||||
$eval(expression: (scope: IScope) => any, args?: Object): any;
|
||||
$eval(expression?: string, args?: Object): any;
|
||||
$eval(expression?: (scope: IScope) => any, args?: Object): any;
|
||||
|
||||
// Documentation says exp is optional, but actual implementaton counts on it
|
||||
$evalAsync(expression: string): void;
|
||||
$evalAsync(expression: (scope: IScope) => any): void;
|
||||
$evalAsync(expression?: string): void;
|
||||
$evalAsync(expression?: (scope: IScope) => any): void;
|
||||
|
||||
// Defaults to false by the implementation checking strategy
|
||||
$new(isolate?: boolean): IScope;
|
||||
|
||||
/**
|
||||
* Listens on events of a given type. See $emit for discussion of event life cycle.
|
||||
*
|
||||
* The event listener function format is: function(event, args...).
|
||||
*
|
||||
* @param name Event name to listen on.
|
||||
* @param listener Function to call when the event is emitted.
|
||||
*/
|
||||
$on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function;
|
||||
|
||||
$watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function;
|
||||
@@ -369,14 +519,14 @@ declare module ng {
|
||||
$watchCollection(watchExpression: (scope: IScope) => any, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
|
||||
|
||||
$watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
|
||||
$watchGroup(watchExpressions: {(scope: IScope) : any}[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
|
||||
$watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
|
||||
|
||||
$parent: IScope;
|
||||
|
||||
$root: IRootScopeService;
|
||||
this: IRootScopeService;
|
||||
|
||||
$id: string;
|
||||
$id: number;
|
||||
|
||||
// Hidden members
|
||||
$$isolateBindings: any;
|
||||
@@ -388,14 +538,30 @@ declare module ng {
|
||||
}
|
||||
|
||||
interface IAngularEvent {
|
||||
/**
|
||||
* the scope on which the event was $emit-ed or $broadcast-ed.
|
||||
*/
|
||||
targetScope: IScope;
|
||||
/**
|
||||
* the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null.
|
||||
*/
|
||||
currentScope: IScope;
|
||||
/**
|
||||
* name of the event.
|
||||
*/
|
||||
name: string;
|
||||
preventDefault: Function;
|
||||
defaultPrevented: boolean;
|
||||
|
||||
// Available only events that were $emit-ted
|
||||
/**
|
||||
* calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed).
|
||||
*/
|
||||
stopPropagation?: Function;
|
||||
/**
|
||||
* calling preventDefault sets defaultPrevented flag to true.
|
||||
*/
|
||||
preventDefault: Function;
|
||||
/**
|
||||
* true if preventDefault was called.
|
||||
*/
|
||||
defaultPrevented: boolean;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -432,6 +598,35 @@ declare module ng {
|
||||
cancel(promise: IPromise<any>): boolean;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// AngularProvider
|
||||
// see http://docs.angularjs.org/api/ng/provider/$animateProvider
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IAnimateProvider {
|
||||
/**
|
||||
* Registers a new injectable animation factory function.
|
||||
*
|
||||
* @param name The name of the animation.
|
||||
* @param factory The factory function that will be executed to return the animation object.
|
||||
*/
|
||||
register(name: string, factory: () => IAnimateCallbackObject): void;
|
||||
|
||||
/**
|
||||
* Gets and/or sets the CSS class expression that is checked when performing an animation.
|
||||
*
|
||||
* @param expression The className expression which will be checked against all animations.
|
||||
* @returns The current CSS className expression value. If null then there is no expression value.
|
||||
*/
|
||||
classNameFilter(expression?: RegExp): RegExp;
|
||||
}
|
||||
|
||||
/**
|
||||
* The animation object which contains callback functions for each event that is expected to be animated.
|
||||
*/
|
||||
interface IAnimateCallbackObject {
|
||||
eventFn(element: Node, doneFn: () => void): Function;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// FilterService
|
||||
// see http://docs.angularjs.org/api/ng.$filter
|
||||
@@ -544,25 +739,79 @@ declare module ng {
|
||||
assign(context: any, value: any): any;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// LocationService
|
||||
// see http://docs.angularjs.org/api/ng.$location
|
||||
// see http://docs.angularjs.org/api/ng.$locationProvider
|
||||
// see http://docs.angularjs.org/guide/dev_guide.services.$location
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* $location - $locationProvider - service in module ng
|
||||
* see https://docs.angularjs.org/api/ng/service/$location
|
||||
*/
|
||||
interface ILocationService {
|
||||
absUrl(): string;
|
||||
hash(): string;
|
||||
hash(newHash: string): ILocationService;
|
||||
host(): string;
|
||||
|
||||
/**
|
||||
* Return path of current url
|
||||
*/
|
||||
path(): string;
|
||||
path(newPath: string): ILocationService;
|
||||
|
||||
/**
|
||||
* Change path when called with parameter and return $location.
|
||||
* Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.
|
||||
*
|
||||
* @param path New path
|
||||
*/
|
||||
path(path: string): ILocationService;
|
||||
|
||||
port(): number;
|
||||
protocol(): string;
|
||||
replace(): ILocationService;
|
||||
|
||||
/**
|
||||
* Return search part (as object) of current url
|
||||
*/
|
||||
search(): any;
|
||||
search(parametersMap: any): ILocationService;
|
||||
search(parameter: string, parameterValue: any): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value.
|
||||
*
|
||||
* If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url.
|
||||
*/
|
||||
search(search: any): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
|
||||
*/
|
||||
search(search: string, paramValue: string): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
|
||||
*/
|
||||
search(search: string, paramValue: number): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If paramValue is an array, it will override the property of the search component of $location specified via the first argument.
|
||||
*/
|
||||
search(search: string, paramValue: string[]): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
|
||||
*/
|
||||
search(search: string, paramValue: boolean): ILocationService;
|
||||
|
||||
url(): string;
|
||||
url(url: string): ILocationService;
|
||||
}
|
||||
@@ -653,22 +902,50 @@ declare module ng {
|
||||
}
|
||||
|
||||
interface IPromise<T> {
|
||||
/**
|
||||
* Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
|
||||
*
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => IHttpPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
/**
|
||||
* Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
|
||||
*
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
/**
|
||||
* Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
|
||||
*
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
|
||||
|
||||
/**
|
||||
* Shorthand for promise.then(null, errorCallback)
|
||||
*/
|
||||
catch<TResult>(onRejected: (reason: any) => IHttpPromise<TResult>): IPromise<TResult>;
|
||||
/**
|
||||
* Shorthand for promise.then(null, errorCallback)
|
||||
*/
|
||||
catch<TResult>(onRejected: (reason: any) => IPromise<TResult>): IPromise<TResult>;
|
||||
/**
|
||||
* Shorthand for promise.then(null, errorCallback)
|
||||
*/
|
||||
catch<TResult>(onRejected: (reason: any) => TResult): IPromise<TResult>;
|
||||
|
||||
finally<TResult>(finallyCallback: ()=>any):IPromise<TResult>;
|
||||
/**
|
||||
* Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.
|
||||
*
|
||||
* Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible.
|
||||
*/
|
||||
finally<TResult>(finallyCallback: () => any): IPromise<TResult>;
|
||||
}
|
||||
|
||||
interface IDeferred<T> {
|
||||
resolve(value?: T): void;
|
||||
reject(reason?: any): void;
|
||||
notify(state?:any): void;
|
||||
notify(state?: any): void;
|
||||
promise: IPromise<T>;
|
||||
}
|
||||
|
||||
@@ -697,7 +974,7 @@ declare module ng {
|
||||
|
||||
// Methods bellow are not documented
|
||||
info(): any;
|
||||
get (cacheId: string): ICacheObject;
|
||||
get(cacheId: string): ICacheObject;
|
||||
}
|
||||
|
||||
interface ICacheObject {
|
||||
@@ -709,7 +986,7 @@ declare module ng {
|
||||
//capacity: number;
|
||||
};
|
||||
put(key: string, value?: any): void;
|
||||
get (key: string): any;
|
||||
get(key: string): any;
|
||||
remove(key: string): void;
|
||||
removeAll(): void;
|
||||
destroy(): void;
|
||||
@@ -926,8 +1203,13 @@ declare module ng {
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface IHttpHeadersGetter {
|
||||
(): { [name: string]: string; };
|
||||
(headerName: string): string;
|
||||
}
|
||||
|
||||
interface IHttpPromiseCallback<T> {
|
||||
(data: T, status: number, headers: (headerName: string) => string, config: IRequestConfig): void;
|
||||
(data: T, status: number, headers: IHttpHeadersGetter, config: IRequestConfig): void;
|
||||
}
|
||||
|
||||
interface IHttpPromiseCallbackArg<T> {
|
||||
@@ -1042,6 +1324,29 @@ declare module ng {
|
||||
resourceUrlWhitelist(whitelist: any[]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* $templateRequest service
|
||||
* see http://docs.angularjs.org/api/ng/service/$templateRequest
|
||||
*/
|
||||
interface ITemplateRequestService {
|
||||
/**
|
||||
* Downloads a template using $http and, upon success, stores the
|
||||
* contents inside of $templateCache.
|
||||
*
|
||||
* If the HTTP request fails or the response data of the HTTP request is
|
||||
* empty then a $compile error will be thrown (unless
|
||||
* {ignoreRequestError} is set to true).
|
||||
*
|
||||
* @param tpl The template URL.
|
||||
* @param ignoreRequestError Whether or not to ignore the exception
|
||||
* when the request fails or the template is
|
||||
* empty.
|
||||
*
|
||||
* @return A promise whose value is the template content.
|
||||
*/
|
||||
(tpl: string, ignoreRequestError?: boolean): IPromise<string>;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Directive
|
||||
// see http://docs.angularjs.org/api/ng.$compileProvider#directive
|
||||
@@ -1059,7 +1364,7 @@ declare module ng {
|
||||
instanceAttributes: IAttributes,
|
||||
controller: any,
|
||||
transclude: ITranscludeFunction
|
||||
): void;
|
||||
): void;
|
||||
}
|
||||
|
||||
interface IDirectivePrePost {
|
||||
@@ -1072,13 +1377,14 @@ declare module ng {
|
||||
templateElement: IAugmentedJQuery,
|
||||
templateAttributes: IAttributes,
|
||||
transclude: ITranscludeFunction
|
||||
): IDirectivePrePost;
|
||||
): IDirectivePrePost;
|
||||
}
|
||||
|
||||
interface IDirective {
|
||||
compile?: IDirectiveCompileFn;
|
||||
controller?: any;
|
||||
controllerAs?: string;
|
||||
bindToController?: boolean;
|
||||
link?: IDirectiveLinkFn;
|
||||
name?: string;
|
||||
priority?: number;
|
||||
@@ -1092,12 +1398,12 @@ declare module ng {
|
||||
transclude?: any;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// angular.element
|
||||
// when calling angular.element, angular returns a jQuery object,
|
||||
// augmented with additional methods like e.g. scope.
|
||||
// see: http://docs.angularjs.org/api/angular.element
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* angular.element
|
||||
* when calling angular.element, angular returns a jQuery object,
|
||||
* augmented with additional methods like e.g. scope.
|
||||
* see: http://docs.angularjs.org/api/angular.element
|
||||
*/
|
||||
interface IAugmentedJQueryStatic extends JQueryStatic {
|
||||
(selector: string, context?: any): IAugmentedJQuery;
|
||||
(element: Element): IAugmentedJQuery;
|
||||
@@ -1116,7 +1422,7 @@ declare module ng {
|
||||
find(selector: string): IAugmentedJQuery;
|
||||
find(element: any): IAugmentedJQuery;
|
||||
find(obj: JQuery): IAugmentedJQuery;
|
||||
|
||||
controller(): any;
|
||||
controller(name: string): any;
|
||||
injector(): any;
|
||||
scope(): IScope;
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
/// <reference path="../any-db/any-db.d.ts" />
|
||||
/// <reference path="any-db-transaction.d.ts" />
|
||||
|
||||
"use strict";
|
||||
|
||||
import anyDB = require("any-db");
|
||||
import begin = require("any-db-transaction");
|
||||
|
||||
var conn: anyDB.Connection = anyDB.createConnection("mysql://user:password@localhost/testdb");
|
||||
|
||||
|
||||
var transaction = begin(conn);
|
||||
var transaction2 = begin(transaction);
|
||||
|
||||
begin(conn, { autoRollback: true });
|
||||
begin(conn, (error: Error, result: begin.Transaction): void => {
|
||||
});
|
||||
|
||||
transaction.query("SELECT * FROM MyTable");
|
||||
|
||||
transaction.commit();
|
||||
transaction.commit((error: Error): void => {
|
||||
});
|
||||
|
||||
transaction.rollback();
|
||||
transaction.rollback((error: Error): void => {
|
||||
});
|
||||
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
// Type definitions for any-db-transaction 2.2.1
|
||||
// Project: https://github.com/grncdr/node-any-db-transaction
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../any-db/any-db.d.ts" />
|
||||
|
||||
declare module "any-db-transaction" {
|
||||
import anyDB = require("any-db");
|
||||
|
||||
module begin {
|
||||
/**
|
||||
* Transaction objects are are simple wrappers around a Connection that also implement the Queryable API,
|
||||
* but guarantee that all queries take place within a single database transaction or not at all. Note that
|
||||
* begin also understands how to acquire (and release) a connection from a ConnectionPool as well, so you
|
||||
* can simply pass a pool to it: var tx = begin(pool)
|
||||
*
|
||||
* By default, any queries that error during a transaction will cause an automatic rollback. If a query has
|
||||
* no callback, the transaction will also handle (and re-emit) 'error' events for the Query instance.
|
||||
* This enables handling errors for an entire transaction in a single place.
|
||||
*
|
||||
* Transactions may also be nested by passing a Transaction to begin and these nested transactions can
|
||||
* safely error and rollback without rolling back their parent transaction
|
||||
*
|
||||
* Transaction events:
|
||||
* 'query', query - emitted immediately after .query is called on a connection via tx.query. The argument is a query object.
|
||||
* 'commit:start' - Emitted when .commit() is called.
|
||||
* 'commit:complete' - Emitted after the transaction has committed.
|
||||
* 'rollback:start' - Emitted when .rollback() is called.
|
||||
* 'rollback:complete' - Emitted after the transaction has rolled back.
|
||||
* 'close' - Emitted after rollback or commit completes.
|
||||
* 'error', err - Emitted under three conditions:
|
||||
* There was an error acquiring a connection.
|
||||
* Any query performed in this transaction emits an error that would otherwise go unhandled.
|
||||
* Any of query, begin, commit, or rollback are called after the connection has already been committed or rolled back.
|
||||
* Note that the 'error' event may be emitted multiple times! depending on the callback you are registering, you way want to wrap it using [once][].
|
||||
*/
|
||||
interface Transaction extends anyDB.Queryable {
|
||||
|
||||
/**
|
||||
* Issue a COMMIT (or RELEASE ... in the case of nested transactions) statement to the database.
|
||||
* If a continuation is provided it will be called (possibly with an error) after the COMMIT
|
||||
* statement completes. The transaction object itself will be unusable after calling commit().
|
||||
*/
|
||||
commit(callback?: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* The same as Transaction.commit but issues a ROLLBACK. Again, the transaction will be unusable after calling this method.
|
||||
*/
|
||||
rollback(callback?: (error: Error) => void): void;
|
||||
}
|
||||
|
||||
interface TransactionOptions {
|
||||
/**
|
||||
* Adapter name e.g. 'mysql'
|
||||
*/
|
||||
adapter?: anyDB.Adapter;
|
||||
/**
|
||||
* SQL statement for beginning a transaction, default 'BEGIN'
|
||||
*/
|
||||
begin?: string;
|
||||
/**
|
||||
* SQL statement for committing a transaction, default 'COMMIT'
|
||||
*/
|
||||
commit?: string;
|
||||
/**
|
||||
* SQL statement for rolling back a transaction, default 'ROLLBACK'
|
||||
*/
|
||||
rollback?: string;
|
||||
/**
|
||||
* Callback for transaction
|
||||
*/
|
||||
callback?: (error: Error, transaction: Transaction) => void;
|
||||
/**
|
||||
* Rollback automatically on error, default true
|
||||
*/
|
||||
autoRollback?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a transaction
|
||||
*/
|
||||
function begin(q: anyDB.Queryable, options?: begin.TransactionOptions, callback?: (error: Error, transaction: begin.Transaction) => void): begin.Transaction;
|
||||
function begin(q: anyDB.Queryable, callback?: (error: Error, transaction: begin.Transaction) => void): begin.Transaction;
|
||||
function begin(q: anyDB.Queryable, beginStatement?: string, callback?: (error: Error, transaction: begin.Transaction) => void): begin.Transaction;
|
||||
function begin(q: anyDB.Queryable, options?: begin.TransactionOptions, beginStatement?: string, callback?: (error: Error, transaction: begin.Transaction) => void): begin.Transaction;
|
||||
|
||||
export = begin;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
/// <reference path="any-db.d.ts" />
|
||||
|
||||
"use strict";
|
||||
|
||||
import anyDB = require("any-db");
|
||||
|
||||
var conn: anyDB.Connection = anyDB.createConnection("mysql://user:password@localhost/testdb");
|
||||
var sql: string = "SELECT * FROM questions";
|
||||
|
||||
conn.query(sql, [1, "boo"]);
|
||||
|
||||
conn.query(sql).on("data", (row: Object[]): void => {
|
||||
// nothing
|
||||
});
|
||||
|
||||
conn.query(sql, [1, "s"], (error: Error, result: anyDB.ResultSet): void => {
|
||||
result.rows.length;
|
||||
result.fields.length;
|
||||
});
|
||||
|
||||
conn.end();
|
||||
|
||||
|
||||
var poolConfig: anyDB.PoolConfig = {
|
||||
min: 1,
|
||||
max: 200
|
||||
};
|
||||
|
||||
var pool: anyDB.ConnectionPool = anyDB.createPool("mysql://user:password@localhost/testdb", poolConfig);
|
||||
|
||||
pool.query(sql).on("data", (row: Object[]): void => {
|
||||
// nothing
|
||||
});
|
||||
|
||||
pool.close((error: Error): void => {
|
||||
});
|
||||
|
||||
Vendored
+303
@@ -0,0 +1,303 @@
|
||||
// Type definitions for any-db 2.1.0
|
||||
// Project: https://github.com/grncdr/node-any-db
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "any-db" {
|
||||
import events = require("events");
|
||||
import stream = require("stream");
|
||||
|
||||
export interface ConnectOpts {
|
||||
adapter: string;
|
||||
}
|
||||
|
||||
export interface Adapter {
|
||||
name: string;
|
||||
/**
|
||||
* Create a new connection object. In common usage, config will be created by parse-db-url and passed to the adapter by any-db.
|
||||
* If a continuation is given, it must be called, either with an error or the established connection.
|
||||
*/
|
||||
createConnection(opts: ConnectOpts, callback?: (error: Error, result: Connection) => void): Connection;
|
||||
|
||||
/**
|
||||
* Create a Query that may eventually be executed later on by a Connection. While this function is rarely needed by user code,
|
||||
* it makes it possible for ConnectionPool.query and Transaction.query to fulfill the Queryable.query contract
|
||||
* by synchronously returning a Query stream
|
||||
*/
|
||||
createQuery(text: string, params?: any[], callback?: (error: Error, result: ResultSet) => void): Query;
|
||||
createQuery(query: Query): Query;
|
||||
}
|
||||
/**
|
||||
* Other properties are driver specific
|
||||
*/
|
||||
export interface Field {
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet objects are just plain data that collect results of a query when a continuation
|
||||
* is provided to Queryable.query. The lastInsertId is optional, and currently supported by
|
||||
* sqlite3 and mysql but not postgres, because it is not supported by Postgres itself.
|
||||
*/
|
||||
export interface ResultSet {
|
||||
/**
|
||||
* Affected rows. Note e.g. for INSERT queries the rows property is not filled even
|
||||
* though rowCount is non-zero.
|
||||
*/
|
||||
rowCount: number;
|
||||
/**
|
||||
* Result rows
|
||||
*/
|
||||
rows: Object[];
|
||||
/**
|
||||
* Result field descriptions
|
||||
*/
|
||||
fields: Field[];
|
||||
|
||||
/**
|
||||
* Not supported by all drivers.
|
||||
*/
|
||||
fieldCount?: number;
|
||||
/**
|
||||
* Not supported by all drivers.
|
||||
*/
|
||||
lastInsertId?: any;
|
||||
/**
|
||||
* Not supported by all drivers.
|
||||
*/
|
||||
affectedRows?: number;
|
||||
/**
|
||||
* Not supported by all drivers.
|
||||
*/
|
||||
changedRows?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query objects are returned by the Queryable.query method, available on connections,
|
||||
* pools, and transactions. Queries are instances of Readable, and as such can be piped
|
||||
* through transforms and support backpressure for more efficient memory-usage on very
|
||||
* large results sets. (Note: at this time the sqlite3 driver does not support backpressure)
|
||||
*
|
||||
* Internally, Query instances are created by a database Adapter and may have more methods,
|
||||
* properties, and events than are described here. Consult the documentation for your
|
||||
* specific adapter to find out about any extensions.
|
||||
*
|
||||
* Events:
|
||||
*
|
||||
* Error event
|
||||
* The 'error' event is emitted at most once per query. Note that this event will be
|
||||
* emitted for errors even if a callback was provided, the callback will
|
||||
* simply be subscribed to the 'error' event.
|
||||
* One argument is passed to event listeners:
|
||||
* error - the error object.
|
||||
*
|
||||
* Fields event
|
||||
* A 'fields' event is emmitted before any 'data' events.
|
||||
* One argument is passed to event listeners:
|
||||
* fields - an array of [Field][ResultSet] objects.
|
||||
*
|
||||
* The following events are part of the stream.Readable interface which is implemented by Query:
|
||||
*
|
||||
* Data event
|
||||
* A 'data' event is emitted for each row in the query result set.
|
||||
* One argument is passed to event listeners:
|
||||
* row contains the contents of a single row in the query result
|
||||
*
|
||||
* Close event
|
||||
* A 'close' event is emitted when the query completes.
|
||||
* No arguments are passed to event listeners.
|
||||
*
|
||||
* End event
|
||||
* An 'end' event is emitted after all query results have been consumed.
|
||||
* No arguments are passed to event listeners.
|
||||
*/
|
||||
export interface Query extends stream.Readable {
|
||||
/**
|
||||
* The SQL query as a string. If you are using MySQL this will contain
|
||||
* interpolated values after the query has been enqueued by a connection.
|
||||
*/
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* The array of parameter values.
|
||||
*/
|
||||
values: any[];
|
||||
|
||||
/**
|
||||
* The callback (if any) that was provided to Queryable.query. Note that
|
||||
* Query objects must not use a closed over reference to their callback,
|
||||
* as other any-db libraries may rely on modifying the callback property
|
||||
* of a Query they did not create.
|
||||
*/
|
||||
callback: (error: Error, results: ResultSet) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Events:
|
||||
* The 'query' event is emitted immediately before a query is executed. One argument is passed to event handlers:
|
||||
* - query: a Query object
|
||||
*/
|
||||
export interface Queryable extends events.EventEmitter {
|
||||
/**
|
||||
* The Adapter instance that will be used by this Queryable for creating Query instances and/or connections.
|
||||
*/
|
||||
adapter: Adapter;
|
||||
|
||||
/**
|
||||
* Execute a SQL statement using bound parameters (if they are provided) and return a Query object
|
||||
* that is a Readable stream of the resulting rows. If a Continuation<ResultSet> is provided the rows
|
||||
* returned by the database will be aggregated into a [ResultSet][] which will be passed to the
|
||||
* continuation after the query has completed.
|
||||
* The second form is not needed for normal use, but must be implemented by adapters to work correctly
|
||||
* with ConnectionPool and Transaction. See Adapter.createQuery for more details.
|
||||
*/
|
||||
query(text: string, params?: any[], callback?: (error: Error, results: ResultSet) => void): Query
|
||||
|
||||
/**
|
||||
* The second form is not needed for normal use, but must be implemented by adapters to work correctly
|
||||
* with ConnectionPool and Transaction. See Adapter.createQuery for more details.
|
||||
*/
|
||||
// query(query: Query): Query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connection objects are obtained using createConnection from Any-DB or ConnectionPool.acquire,
|
||||
* both of which delegate to the createConnection implementation of the specified adapter.
|
||||
* While all Connection objects implement the Queryable interface, the implementations in
|
||||
* each adapter may add additional methods or emit additional events. If you need to access a
|
||||
* feature of your database that is not described here (such as Postgres' server-side prepared
|
||||
* statements), consult the documentation for your adapter.
|
||||
*
|
||||
* Events:
|
||||
* Error event
|
||||
* The 'error' event is emitted when there is a connection-level error.
|
||||
* No arguments are passed to event listeners.
|
||||
*
|
||||
* Open event
|
||||
* The 'open' event is emitted when the connection has been established and is ready to query.
|
||||
* No arguments are passed to event listeners.
|
||||
*
|
||||
* Close event
|
||||
* The 'close' event is emitted when the connection has been closed.
|
||||
* No arguments are passed to event listeners.
|
||||
*/
|
||||
export interface Connection extends Queryable {
|
||||
/**
|
||||
* Close the database connection. If a continuation is provided it
|
||||
* will be called after the connection has closed.
|
||||
*/
|
||||
end(callback?: (error: Error) => void): void;
|
||||
}
|
||||
|
||||
export interface ConnectionStatic {
|
||||
new(): Connection;
|
||||
|
||||
name: string;
|
||||
createConnection(): void;
|
||||
createPool(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* ConnectionPool events
|
||||
* 'acquire' - emitted whenever pool.acquire is called
|
||||
* 'release' - emitted whenever pool.release is called
|
||||
* 'query', query - emitted immediately after .query is called on a
|
||||
* connection via pool.query. The argument is a Query object.
|
||||
* 'close' - emitted when the connection pool has closed all of it
|
||||
* connections after a call to close().
|
||||
*/
|
||||
export interface ConnectionPool extends Queryable {
|
||||
/**
|
||||
* Implements Queryable.query by automatically acquiring a connection
|
||||
* and releasing it when the query completes.
|
||||
*/
|
||||
query(text: string, params?: any[], callback?: (error: Error, results: ResultSet) => void): Query;
|
||||
|
||||
/**
|
||||
* Remove a connection from the pool. If you use this method you must
|
||||
* return the connection back to the pool using ConnectionPool.release
|
||||
*/
|
||||
acquire(callback: (error: Error, result: Connection) => void): void;
|
||||
|
||||
/**
|
||||
* Return a connection to the pool. This should only be called with connections
|
||||
* you've manually acquired. You must not continue to use the connection after releasing it.
|
||||
*/
|
||||
release(connection: Connection): void;
|
||||
|
||||
/**
|
||||
* Stop giving out new connections, and close all existing database connections as they
|
||||
* are returned to the pool.
|
||||
*/
|
||||
close(callback?: (error: Error) => void): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* A PoolConfig is generally a plain object with any of the following properties (they are all optional):
|
||||
*/
|
||||
export interface PoolConfig {
|
||||
/**
|
||||
* min (default 0) The minimum number of connections to keep open in the pool.
|
||||
*/
|
||||
min?: number;
|
||||
/**
|
||||
* max (default 10) The maximum number of connections to keep open in the pool.
|
||||
* When this limit is reached further requests for connections will queue waiting
|
||||
* for an existing connection to be released back into the pool.
|
||||
*/
|
||||
max?: number;
|
||||
/**
|
||||
* (default 30000) The maximum amount of time a connection can sit idle in the pool before being reaped
|
||||
*/
|
||||
idleTimeout?: number;
|
||||
/**
|
||||
* (default 1000) How frequently the pool should check for connections that are old enough to be reaped.
|
||||
*/
|
||||
reapInterval?: number;
|
||||
/**
|
||||
* (default true) When this is true, the pool will reap connections that
|
||||
* have been idle for more than idleTimeout milliseconds.
|
||||
*/
|
||||
refreshIdle?: boolean;
|
||||
/**
|
||||
* Called immediately after a connection is first established. Use this to do one-time setup of new connections.
|
||||
* The supplied Connection will not be added to the pool until you pass it to the done continuation.
|
||||
*/
|
||||
onConnect?: (connection: Connection, ready: (error: Error, result: Connection) => void) => void;
|
||||
/**
|
||||
* Called each time a connection is returned to the pool. Use this to restore a connection to
|
||||
* it's original state (e.g. rollback transactions, set the database session vars). If reset
|
||||
* fails to call the done continuation the connection will be lost in limbo.
|
||||
*/
|
||||
reset?: (connection: Connection, done: (error: Error) => void) => void;
|
||||
/**
|
||||
* (default function (err) { return true }) - Called when an error is encountered
|
||||
* by pool.query or emitted by an idle connection. If shouldDestroyConnection(error)
|
||||
* is truthy the connection will be destroyed, otherwise it will be reset.
|
||||
*/
|
||||
shouldDestroyConnection?: (error: Error) => boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a database connection.
|
||||
* @param url String of the form adapter://user:password@host/database
|
||||
* @param callback
|
||||
* @returns Connection object.
|
||||
*/
|
||||
export function createConnection(url: string, callback?: (error: Error, connection: Connection) => void): Connection;
|
||||
|
||||
/**
|
||||
* Create a database connection.
|
||||
* @param opts Object with adapter name and any properties that the given adapter requires
|
||||
* @param callback
|
||||
* @returns Connection object.
|
||||
*/
|
||||
export function createConnection(opts: ConnectOpts, callback?: (error: Error, connection: Connection) => void): Connection;
|
||||
|
||||
|
||||
export function createPool(url: string, config: PoolConfig): ConnectionPool;
|
||||
export function createPool(opts: ConnectOpts, config: PoolConfig): ConnectionPool;
|
||||
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
"--noImplicitAny --module commonjs"
|
||||
--noImplicitAny --module commonjs
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
Vendored
+19
-1
@@ -31,6 +31,23 @@ interface AsyncQueue<T> {
|
||||
kill(): void;
|
||||
}
|
||||
|
||||
interface AsyncPriorityQueue<T> {
|
||||
length(): number;
|
||||
concurrency: number;
|
||||
started: boolean;
|
||||
paused: boolean;
|
||||
push(task: T, priority: number, callback?: AsyncMultipleResultsCallback<T>): void;
|
||||
push(task: T[], priority: number, callback?: AsyncMultipleResultsCallback<T>): void;
|
||||
saturated: () => any;
|
||||
empty: () => any;
|
||||
drain: () => any;
|
||||
running(): number;
|
||||
idle(): boolean;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
kill(): void;
|
||||
}
|
||||
|
||||
interface Async {
|
||||
|
||||
// Collections
|
||||
@@ -56,7 +73,7 @@ interface Async {
|
||||
some<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
|
||||
any<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
|
||||
every<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: (result: boolean) => any): any;
|
||||
all<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: (result: boolean) => any): any;
|
||||
all<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: (result: boolean) => any): any;
|
||||
concat<T, R>(arr: T[], iterator: AsyncIterator<T, R[]>, callback: AsyncMultipleResultsCallback<R>): any;
|
||||
concatSeries<T, R>(arr: T[], iterator: AsyncIterator<T, R[]>, callback: AsyncMultipleResultsCallback<R>): any;
|
||||
|
||||
@@ -72,6 +89,7 @@ interface Async {
|
||||
waterfall<T>(tasks: T[], callback?: AsyncMultipleResultsCallback<T>): void;
|
||||
waterfall<T>(tasks: T, callback?: AsyncMultipleResultsCallback<T>): void;
|
||||
queue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncQueue<T>;
|
||||
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
|
||||
// auto(tasks: any[], callback?: AsyncMultipleResultsCallback<T>): void;
|
||||
auto(tasks: any, callback?: AsyncMultipleResultsCallback<any>): void;
|
||||
iterator(tasks: Function[]): Function;
|
||||
|
||||
@@ -1 +1 @@
|
||||
--noImplicitAny --module commonjs --target es5
|
||||
--noImplicitAny --module commonjs --target es5
|
||||
|
||||
Vendored
+108
-8
@@ -497,6 +497,35 @@ declare module AtomCore {
|
||||
screenRangeChanged():any;
|
||||
}
|
||||
|
||||
interface IDecorationParams {
|
||||
id?: number;
|
||||
class: string;
|
||||
type: any /* string or string[] */;
|
||||
}
|
||||
|
||||
interface IDecorationStatic {
|
||||
isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean;
|
||||
new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration;
|
||||
}
|
||||
|
||||
interface IDecoration extends Emissary.IEmitter {
|
||||
marker: IDisplayBufferMarker;
|
||||
displayBuffer: IDisplayBuffer;
|
||||
params: IDecorationParams
|
||||
id: number;
|
||||
flashQueue: any[];
|
||||
isDestroyed: boolean;
|
||||
|
||||
destroy():void;
|
||||
update(newParams:IDecorationParams):void;
|
||||
getMarker():IDisplayBufferMarker;
|
||||
getParams():IDecorationParams;
|
||||
isType(type:string):boolean;
|
||||
matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean;
|
||||
flash(klass:string, duration?:number):void;
|
||||
consumeNextFlash():any;
|
||||
}
|
||||
|
||||
interface IEditor {
|
||||
// Serializable.includeInto(Editor);
|
||||
// Delegator.includeInto(Editor);
|
||||
@@ -509,6 +538,8 @@ declare module AtomCore {
|
||||
cursors:ICursor[];
|
||||
selections: ISelection[];
|
||||
suppressSelectionMerging:boolean;
|
||||
updateBatchDepth: number;
|
||||
selectionFlashDuration: number;
|
||||
softTabs: boolean;
|
||||
displayBuffer: IDisplayBuffer;
|
||||
|
||||
@@ -522,6 +553,8 @@ declare module AtomCore {
|
||||
subscriptionsByObject: any; /* WeakMap */
|
||||
subscriptions: Emissary.ISubscription[];
|
||||
|
||||
mini: any;
|
||||
|
||||
serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;};
|
||||
deserializeParams(params:any):any;
|
||||
subscribeToBuffer():void;
|
||||
@@ -532,10 +565,7 @@ declare module AtomCore {
|
||||
getTitle():string;
|
||||
getLongTitle():string;
|
||||
setVisible(visible:boolean):void;
|
||||
setScrollTop(scrollTop:any):void;
|
||||
getScrollTop():number;
|
||||
setScrollLeft(scrollLeft:any):void;
|
||||
getScrollLeft():number;
|
||||
setMini(mini:any):void;
|
||||
setEditorWidthInChars(editorWidthInChars:any):void;
|
||||
getSoftWrapColumn():number;
|
||||
getSoftTabs():boolean;
|
||||
@@ -545,6 +575,7 @@ declare module AtomCore {
|
||||
getTabText():string;
|
||||
getTabLength():number;
|
||||
setTabLength(tabLength:any):void;
|
||||
usesSoftTabs():boolean;
|
||||
clipBufferPosition(bufferPosition:any):void;
|
||||
clipBufferRange(range:any):void;
|
||||
indentationForBufferRow(bufferRow:any):void;
|
||||
@@ -553,6 +584,7 @@ declare module AtomCore {
|
||||
buildIndentString(number:any):string;
|
||||
save():void;
|
||||
saveAs(filePath:any):void;
|
||||
copyPathToClipboard():void;
|
||||
getPath():string;
|
||||
getText():string;
|
||||
setText(text:any):void;
|
||||
@@ -572,6 +604,7 @@ declare module AtomCore {
|
||||
scanInBufferRange():any;
|
||||
backwardsScanInBufferRange():any;
|
||||
isModified():boolean;
|
||||
isEmpty():boolean;
|
||||
shouldPromptToSave():boolean;
|
||||
screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint;
|
||||
bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint;
|
||||
@@ -589,15 +622,19 @@ declare module AtomCore {
|
||||
bufferRangeForScopeAtCursor(selector:string):any;
|
||||
tokenForBufferPosition(bufferPosition:any):IToken;
|
||||
getCursorScopes():string[];
|
||||
logCursorScope():void;
|
||||
insertText(text:string, options?:any):TextBuffer.IRange[];
|
||||
insertNewline():TextBuffer.IRange[];
|
||||
insertNewlineBelow():TextBuffer.IRange[];
|
||||
insertNewlineAbove():any;
|
||||
indent(options?:any):any;
|
||||
backspace():any[];
|
||||
backspaceToBeginningOfWord():any[];
|
||||
backspaceToBeginningOfLine():any[];
|
||||
// deprecated backspaceToBeginningOfWord():any[];
|
||||
// deprecated backspaceToBeginningOfLine():any[];
|
||||
deleteToBeginningOfWord():any[];
|
||||
deleteToBeginningOfLine():any[];
|
||||
delete():any[];
|
||||
deleteToEndOfLine():any[];
|
||||
deleteToEndOfWord():any[];
|
||||
deleteLine():TextBuffer.IRange[];
|
||||
indentSelectedRows():TextBuffer.IRange[][];
|
||||
@@ -620,6 +657,7 @@ declare module AtomCore {
|
||||
foldBufferRow(bufferRow:any):any;
|
||||
unfoldBufferRow(bufferRow:any):any;
|
||||
isFoldableAtBufferRow(bufferRow:any):boolean;
|
||||
isFoldableAtScreenRow(screenRow:any):boolean;
|
||||
createFold(startRow:any, endRow:any):IFold;
|
||||
destroyFoldWithId(id:any):any;
|
||||
destroyFoldsIntersectingBufferRange(bufferRange:any):any;
|
||||
@@ -633,9 +671,12 @@ declare module AtomCore {
|
||||
moveLineUp():ISelection[];
|
||||
moveLineDown():ISelection[];
|
||||
duplicateLines():any[][];
|
||||
duplicateLine():any[][];
|
||||
// duprecated duplicateLine():any[][];
|
||||
mutateSelectedText(fn:(selection:ISelection)=>any):any;
|
||||
replaceSelectedText(options:any, fn:(selection:string)=>any):any;
|
||||
decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]};
|
||||
decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration;
|
||||
decorationForId(id:number):IDecoration;
|
||||
getMarker(id:number):IDisplayBufferMarker;
|
||||
getMarkers():IDisplayBufferMarker[];
|
||||
findMarkers(...args:any[]):IDisplayBufferMarker[];
|
||||
@@ -659,6 +700,7 @@ declare module AtomCore {
|
||||
removeSelection(selection:ISelection):any;
|
||||
clearSelections():boolean;
|
||||
consolidateSelections():boolean;
|
||||
selectionScreenRangeChanged(selection:any):void;
|
||||
getSelections():ISelection[];
|
||||
getSelection(index?:number):ISelection;
|
||||
getLastSelection():ISelection;
|
||||
@@ -694,7 +736,16 @@ declare module AtomCore {
|
||||
moveCursorToBeginningOfNextWord():void;
|
||||
moveCursorToPreviousWordBoundary():void;
|
||||
moveCursorToNextWordBoundary():void;
|
||||
moveCursorToBeginningOfNextParagraph():void;
|
||||
moveCursorToBeginningOfPreviousParagraph():void;
|
||||
scrollToCursorPosition(options:any):any;
|
||||
pageUp():void;
|
||||
pageDown():void;
|
||||
selectPageUp():void;
|
||||
selectPageDown():void;
|
||||
getRowsPerPage():number;
|
||||
moveCursors(fn:(cursor:ICursor)=>any):any;
|
||||
cursorMoved(event:any):void;
|
||||
selectToScreenPosition(position:TextBuffer.IPoint):any;
|
||||
selectRight():ISelection[];
|
||||
selectLeft():ISelection[];
|
||||
@@ -720,6 +771,8 @@ declare module AtomCore {
|
||||
selectToEndOfWord():ISelection[];
|
||||
selectToBeginningOfNextWord():ISelection[];
|
||||
selectWord():ISelection[];
|
||||
selectToBeginningOfNextParagraph():ISelection[];
|
||||
selectToBeginningOfPreviousParagraph():ISelection[];
|
||||
selectMarker(marker:any):any;
|
||||
mergeCursors():number[];
|
||||
expandSelectionsForward():any;
|
||||
@@ -731,16 +784,63 @@ declare module AtomCore {
|
||||
setGrammar(grammer:IGrammar):void;
|
||||
reloadGrammar():any;
|
||||
shouldAutoIndent():boolean;
|
||||
shouldShowInvisibles():boolean;
|
||||
updateInvisibles():void;
|
||||
transact(fn:Function):any;
|
||||
beginTransaction():ITransaction;
|
||||
commitTransaction():any;
|
||||
abortTransaction():any[];
|
||||
inspect():string;
|
||||
logScreenLines(start:number, end:number):any[];
|
||||
handleTokenization():void;
|
||||
handleGrammarChange():void;
|
||||
handleMarkerCreated(marker:any):any;
|
||||
getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; };
|
||||
// joinLine():any; // deprecated
|
||||
getVerticalScrollMargin():number;
|
||||
setVerticalScrollMargin(verticalScrollMargin:number):void;
|
||||
getHorizontalScrollMargin():number;
|
||||
setHorizontalScrollMargin(horizontalScrollMargin:number):void;
|
||||
getLineHeightInPixels():number;
|
||||
setLineHeightInPixels(lineHeightInPixels:number):void;
|
||||
batchCharacterMeasurement(fn:Function):void;
|
||||
getScopedCharWidth(scopeNames:any, char:any):any;
|
||||
setScopedCharWidth(scopeNames:any, char:any, width:any):any;
|
||||
getScopedCharWidths(scopeNames:any):any;
|
||||
clearScopedCharWidths():any;
|
||||
getDefaultCharWidth():number;
|
||||
setDefaultCharWidth(defaultCharWidth:number):void;
|
||||
setHeight(height:number):void;
|
||||
getHeight():number;
|
||||
getClientHeight():number;
|
||||
setWidth(width:number):void;
|
||||
getWidth():number;
|
||||
getScrollTop():number;
|
||||
setScrollTop(scrollTop:number):void;
|
||||
getScrollBottom():number;
|
||||
setScrollBottom(scrollBottom:number):void;
|
||||
getScrollLeft():number;
|
||||
setScrollLeft(scrollLeft:number):void;
|
||||
getScrollRight():number;
|
||||
setScrollRight(scrollRight:number):void;
|
||||
getScrollHeight():number;
|
||||
getScrollWidth():number;
|
||||
getVisibleRowRange():number;
|
||||
intersectsVisibleRowRange(startRow:any, endRow:any):any;
|
||||
selectionIntersectsVisibleRowRange(selection:any):any;
|
||||
pixelPositionForScreenPosition(screenPosition:any):any;
|
||||
pixelPositionForBufferPosition(bufferPosition:any):any;
|
||||
screenPositionForPixelPosition(pixelPosition:any):any;
|
||||
pixelRectForScreenRange(screenRange:any):any;
|
||||
scrollToScreenRange(screenRange:any, options:any):any;
|
||||
scrollToScreenPosition(screenPosition:any, options:any):any;
|
||||
scrollToBufferPosition(bufferPosition:any, options:any):any;
|
||||
horizontallyScrollable():any;
|
||||
verticallyScrollable():any;
|
||||
getHorizontalScrollbarHeight():any;
|
||||
setHorizontalScrollbarHeight(height:any):any;
|
||||
getVerticalScrollbarWidth():any;
|
||||
setVerticalScrollbarWidth(width:any):any;
|
||||
// deprecated joinLine():any;
|
||||
}
|
||||
|
||||
interface IGrammar {
|
||||
|
||||
Vendored
+4
@@ -48,6 +48,10 @@ declare module "aws-sdk" {
|
||||
public client: s3.Client;
|
||||
}
|
||||
|
||||
export class DynamoDB {
|
||||
constructor(options?: any);
|
||||
}
|
||||
|
||||
export module Sqs {
|
||||
|
||||
export interface Client {
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
--target ES5
|
||||
--target ES5
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/// <reference path="bcrypt.d.ts" />
|
||||
|
||||
import bcrypt = require("bcrypt");
|
||||
|
||||
var num: number;
|
||||
var str: string;
|
||||
var bool: boolean;
|
||||
|
||||
str = bcrypt.genSaltSync();
|
||||
str = bcrypt.genSaltSync(num);
|
||||
|
||||
bcrypt.genSalt(function (err: Error, salt: string): void {
|
||||
str = salt;
|
||||
});
|
||||
bcrypt.genSalt(num, function (err: Error, salt: string): void {
|
||||
str = salt;
|
||||
});
|
||||
|
||||
str = bcrypt.hashSync(str, str);
|
||||
str = bcrypt.hashSync(str, num);
|
||||
|
||||
bcrypt.hash(str, str, function (err: Error, encrypted: string):void {
|
||||
str = encrypted;
|
||||
})
|
||||
bcrypt.hash(str, num, function (err: Error, encrypted: string): void {
|
||||
str = encrypted;
|
||||
});
|
||||
|
||||
bool = bcrypt.compareSync(str, str);
|
||||
bcrypt.compare(str, str, function (err: Error, same: boolean): void {
|
||||
bool = same;
|
||||
});
|
||||
|
||||
num = bcrypt.getRounds(str);
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
// Type definitions for bcrypt
|
||||
// Project: https://www.npmjs.org/package/bcrypt
|
||||
// Definitions by: Peter Harris <https://github.com/codeanimal>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "bcrypt" {
|
||||
/**
|
||||
* @param rounds The cost of processing the data. Default 10.
|
||||
*/
|
||||
export function genSaltSync(rounds?: number): string;
|
||||
|
||||
/**
|
||||
* @param rounds The cost of processing the data. Default 10.
|
||||
* @param callback A callback to be fire once the sald has been generated. Uses eio making it asynchronous.
|
||||
*/
|
||||
export function genSalt(rounds: number, callback: (err: Error, salt: string) => void): void;
|
||||
/**
|
||||
* @param callback A callback to be fire once the sald has been generated. Uses eio making it asynchronous.
|
||||
*/
|
||||
export function genSalt(callback: (err: Error, salt: string) => void): void;
|
||||
|
||||
/**
|
||||
* @param data The data to be encrypted.
|
||||
* @param salt The salt to be used in encryption.
|
||||
*/
|
||||
export function hashSync(data: any, salt: string): string;
|
||||
/**
|
||||
* @param data The data to be encrypted.
|
||||
* @param rounds A salt will be generated using the rounds specified.
|
||||
*/
|
||||
export function hashSync(data: any, rounds: number): string;
|
||||
|
||||
/**
|
||||
* @param data The data to be encrypted.
|
||||
* @param salt The salt to be used in encryption.
|
||||
* @param callback A callback to be fired once the data has been encrypted. Uses eio making it asynchronous.
|
||||
*/
|
||||
export function hash(data: any, salt: string, callback: (err: Error, encrypted: string) => void): void;
|
||||
/**
|
||||
* @param data The data to be encrypted.
|
||||
* @param rounds A salt will be generated using the rounds specified.
|
||||
* @param callback A callback to be fired once the data has been encrypted. Uses eio making it asynchronous.
|
||||
*/
|
||||
export function hash(data: any, rounds: number, callback: (err: Error, encrypted: string) => void): void;
|
||||
|
||||
/**
|
||||
* @param data The data to be encrypted.
|
||||
* @param encrypted The data to be compared against.
|
||||
*/
|
||||
export function compareSync(data: any, encrypted: string): boolean;
|
||||
|
||||
/**
|
||||
* @param data The data to be encrypted.
|
||||
* @param encrypted The data to be compared against.
|
||||
* @param callback A callback to be fire once the data has been compared. Uses eio making it asynchronous.
|
||||
*/
|
||||
export function compare(data: any, encrypted: string, callback: (err: Error, same: boolean) => void): void;
|
||||
|
||||
/**
|
||||
* Return the number of rounds used to encrypt a given hash
|
||||
*
|
||||
* @param encrypted Hash from which the number of rounds used should be extracted.
|
||||
*/
|
||||
export function getRounds(encrypted: string): number;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ bi = BigInt.trim(bi, num);
|
||||
BigInt.addInt_(bi, num);
|
||||
BigInt.add_(bi, bi);
|
||||
BigInt.copy_(bi, bi);
|
||||
num = BigInt.copyInt_(bi, num);
|
||||
BigInt.copyInt_(bi, num);
|
||||
BigInt.GCD_(bi, bi);
|
||||
b = BigInt.inverseMod_(bi, bi);
|
||||
BigInt.mod_(bi, bi);
|
||||
|
||||
Vendored
+388
-114
@@ -1,8 +1,11 @@
|
||||
// Type definitions for BigInt v5.5.1
|
||||
// Type definitions for BigInt v5.5.3
|
||||
// Project: https://github.com/Evgenus/BigInt
|
||||
// Definitions by: Eugene Chernyshov <https://github.com/Evgenus>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Development repository: https://github.com/Evgenus/bigint-typescript-definitions
|
||||
// For answers, fixes and cutting edge version please see development repository.
|
||||
|
||||
declare module BigInt {
|
||||
export interface BigInt extends Array<number> {
|
||||
}
|
||||
@@ -11,361 +14,632 @@ declare module BigInt {
|
||||
(): number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a random number generator.
|
||||
*
|
||||
* @param {IRandom} random function that returns random number.
|
||||
*/
|
||||
export function setRandom(random: IRandom): void;
|
||||
|
||||
/**
|
||||
* bigInt add(x,y)
|
||||
* return (x+y) for bigInts x and y.
|
||||
*
|
||||
* @param {BigInt} x The BigInt augend.
|
||||
* @param {BigInt} y The BigInt addend.
|
||||
*
|
||||
* @return {BigInt} A sum as BigInt.
|
||||
*/
|
||||
export function add(x: BigInt, y: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt addInt(x,n)
|
||||
* return (x+n) where x is a bigInt and n is an integer.
|
||||
*
|
||||
* @param {BigInt} x The BigInt augend.
|
||||
* @param {number} n The number addend.
|
||||
*
|
||||
* @return {BigInt} A sum as BigInt.
|
||||
*/
|
||||
export function addInt(x: BigInt, n: number): BigInt;
|
||||
|
||||
interface bigInt2str_T<T> {
|
||||
/**
|
||||
* string bigInt2str(x,base)
|
||||
* return a string form of bigInt x in a given base, with 2 <= base <= 95
|
||||
*/
|
||||
(x: BigInt, base: T): string;
|
||||
}
|
||||
|
||||
interface bigInt2strSignature extends bigInt2str_T<string>, bigInt2str_T<number>{
|
||||
}
|
||||
|
||||
export var bigInt2str: bigInt2strSignature;
|
||||
/**
|
||||
* return a string form of bigInt x in a given base, with 2 <= base <= 95.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to stringify.
|
||||
* @param {number} base The base as radix number.
|
||||
*
|
||||
* @return {string} A string representation of given BigInt.
|
||||
*/
|
||||
export function bigInt2str(x: BigInt, base: number): string;
|
||||
|
||||
/**
|
||||
* int bitSize(x)
|
||||
* return how many bits long the bigInt x is, not counting leading zeros
|
||||
* return a string form of bigInt x in a given base, with 2 <= base <= 95.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to stringify.
|
||||
* @param {string} base The base as vocabulary of characters.
|
||||
*
|
||||
* @return {string} A string representation of given BigInt.
|
||||
*/
|
||||
export function bigInt2str(x: BigInt, base: string): string;
|
||||
|
||||
/**
|
||||
* return how many bits long the bigInt x is, not counting leading zeros.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
*
|
||||
* @return {number} A size in BigInt as number.
|
||||
*/
|
||||
export function bitSize(x: BigInt): number;
|
||||
|
||||
/**
|
||||
* bigInt dup(x)
|
||||
* return a copy of bigInt x
|
||||
* return a copy of bigInt x.
|
||||
*
|
||||
* @param {BigInt} x Source BigInt to be copied.
|
||||
*
|
||||
* @return {BigInt} A copy of this object.
|
||||
*/
|
||||
export function dup(x: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* boolean equals(x,y)
|
||||
* is the bigInt x equal to the bigint y?
|
||||
*
|
||||
* @param {BigInt} x BigInt to be compared.
|
||||
* @param {BigInt} y BigInt to be compared.
|
||||
*
|
||||
* @return {boolean} true if the objects are considered equal, false if they are not.
|
||||
*/
|
||||
export function equals(x: BigInt, y: BigInt): boolean;
|
||||
|
||||
/**
|
||||
* boolean equalsInt(x,y)
|
||||
* is bigint x equal to integer y?
|
||||
*
|
||||
* @param {BigInt} x BigInt to be compared.
|
||||
* @param {BigInt} y BigInt to be compared.
|
||||
*
|
||||
* @return {boolean} true if the objects are considered equal, false if not.
|
||||
*/
|
||||
export function equalsInt(x: BigInt, y: number): boolean;
|
||||
|
||||
/**
|
||||
* bigInt expand(x,n)
|
||||
* return a copy of x with at least n elements, adding leading zeros if needed
|
||||
* return a copy of x with at least n elements, adding leading zeros if needed.
|
||||
*
|
||||
* @param {BigInt} value The source object to copy.
|
||||
* @param {number} n The minimal number of elements.
|
||||
*
|
||||
* @return {BigInt} A copy of given BigInt.
|
||||
*/
|
||||
export function expand(value: BigInt, n: number): BigInt;
|
||||
|
||||
/**
|
||||
* Array findPrimes(n)
|
||||
* return array of all primes less than integer n
|
||||
* return array of all primes less than integer n.
|
||||
*
|
||||
* @param {number} n Upper limit of search.
|
||||
*
|
||||
* @return {Array} The found primes as Array.
|
||||
*/
|
||||
export function findPrimes(n: number): number[];
|
||||
|
||||
/**
|
||||
* bigInt GCD(x,y)
|
||||
* return greatest common divisor of bigInts x and y (each with same number of elements).
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
* @param {BigInt} y The BigInt to process.
|
||||
*
|
||||
* @return {BigInt} A greatest common divisor as BigInt.
|
||||
*/
|
||||
export function GCD(x: BigInt, y: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* boolean greater(x,y)
|
||||
* is x>y? (x and y are nonnegative bigInts)
|
||||
*
|
||||
* @param {BigInt} x BigInt to be compared.
|
||||
* @param {BigInt} y BigInt to be compared.
|
||||
*
|
||||
* @return {boolean} true if x is greater, false if it's not.
|
||||
*/
|
||||
export function greater(x: BigInt, y: BigInt): boolean;
|
||||
|
||||
/**
|
||||
* boolean greaterShift(x,y,shift)
|
||||
* is (x <<(shift*bpe)) > y?
|
||||
*
|
||||
* @param {BigInt} x BigInt to be compared.
|
||||
* @param {BigInt} y BigInt to be compared.
|
||||
* @param {number} shift The shift amount in bits.
|
||||
*
|
||||
* @return {boolean} true if x is greater, false if it's not.
|
||||
*/
|
||||
export function greaterShift(x: BigInt, y: BigInt, shift: number): boolean;
|
||||
|
||||
/**
|
||||
* bigInt int2bigInt(t,n,m)
|
||||
* return a bigInt equal to integer t, with at least n bits and m array elements
|
||||
* return a bigInt equal to integer t, with at least n bits and m array elements.
|
||||
*
|
||||
* @param {number} t The number to process.
|
||||
* @param {number=} n (Optional) the number to process.
|
||||
* @param {number=} m (Optional) the number to process.
|
||||
*
|
||||
* @return {BigInt} A BigInt equivalent of given number.
|
||||
*/
|
||||
export function int2bigInt(t: number, n?: number, m?: number): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt inverseMod(x,n)
|
||||
* return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null
|
||||
* return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base.
|
||||
* @param {BigInt} n The BigInt divisor.
|
||||
*
|
||||
* @return {BigInt} A BigInt remainder.
|
||||
*/
|
||||
export function inverseMod(x: BigInt, n: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* int inverseModInt(x,n)
|
||||
* return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse
|
||||
* return x**(-1) mod n, for integers x and n.
|
||||
* Return 0 if there is no inverse.
|
||||
*
|
||||
* @param {number} x The BigInt base.
|
||||
* @param {number} n The BigInt divisor.
|
||||
*
|
||||
* @return {BigInt} A BigInt remainder.
|
||||
*/
|
||||
export function inverseModInt(x: number, n: number): BigInt;
|
||||
|
||||
/**
|
||||
* boolean isZero(x)
|
||||
* is the bigInt x equal to zero?
|
||||
*
|
||||
* @param {BigInt} x BigInt to be compared.
|
||||
*
|
||||
* @return {boolean} true if zero, false if not.
|
||||
*/
|
||||
export function isZero(x: BigInt): boolean;
|
||||
|
||||
/**
|
||||
* boolean millerRabin(x,b)
|
||||
* does one round of Miller-Rabin base integer b say that bigInt x is possibly prime? (b is bigInt, 1<b<x)
|
||||
* does one round of Miller-Rabin base integer b say that bigInt x is possibly prime?
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
* @param {BigInt} b The BigInt to process. (b is bigInt, 1<b<x)
|
||||
*
|
||||
* @return {boolean} true if it is prime, false if it is not.
|
||||
*/
|
||||
export function millerRabin(x: BigInt, b: BigInt): boolean;
|
||||
|
||||
/**
|
||||
* boolean millerRabinInt(x,b)
|
||||
* does one round of Miller-Rabin base integer b say that bigInt x is possibly prime? (b is int, 1<b<x)
|
||||
* does one round of Miller-Rabin base integer b say that bigInt x is possibly prime?
|
||||
*
|
||||
* @param {number} x The number to process.
|
||||
* @param {number} b The number to process. (b is int, 1<b<x)
|
||||
*
|
||||
* @return {boolean} true if it is prime, false if it is not.
|
||||
*/
|
||||
export function millerRabinInt(x: number, b: number): boolean;
|
||||
|
||||
/**
|
||||
* bigInt mod(x,n)
|
||||
* return a new bigInt equal to (x mod n) for bigInts x and n.
|
||||
*
|
||||
* @param {BigInt} x The dividend.
|
||||
* @param {BigInt} n The divisor.
|
||||
*
|
||||
* @return {BigInt} A remainder as BigInt.
|
||||
*/
|
||||
export function mod(x: BigInt, n: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* int modInt(x,n)
|
||||
* return x mod n for bigInt x and integer n.
|
||||
*
|
||||
* @param {BigInt} x The dividend.
|
||||
* @param {number} n The divisor.
|
||||
*
|
||||
* @return {number} A remainder as number.
|
||||
*/
|
||||
export function modInt(x: BigInt, n: number): number;
|
||||
|
||||
/**
|
||||
* bigInt mult(x,y)
|
||||
* return x*y for bigInts x and y. This is faster when y<x.
|
||||
*
|
||||
* @param {BigInt} x The multiplicand.
|
||||
* @param {BigInt} y The multiplier.
|
||||
*
|
||||
* @return {BigInt} A product as BigInt.
|
||||
*/
|
||||
export function mult(x: BigInt, y: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt multMod(x,y,n)
|
||||
* return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x.
|
||||
* return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x.
|
||||
*
|
||||
* @param {BigInt} x The multiplicand.
|
||||
* @param {BigInt} y The multiplier.
|
||||
* @param {BigInt} n The divisor.
|
||||
*
|
||||
* @return {BigInt} A remainder as BigInt.
|
||||
*/
|
||||
export function multMod(x: BigInt, y: BigInt, n: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* boolean negative(x)
|
||||
* is bigInt x negative?
|
||||
*
|
||||
* @param {BigInt} x BigInt to be compared.
|
||||
*
|
||||
* @return {boolean} true if x is negative, false if x is positive.
|
||||
*/
|
||||
export function negative(x: BigInt): boolean;
|
||||
|
||||
/**
|
||||
* bigInt powMod(x,y,n)
|
||||
* return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n.
|
||||
* return (x**y mod n) where x,y,n are bigInts and ** is exponentiation.
|
||||
* 0**0=1. Faster for odd n.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base.
|
||||
* @param {BigInt} y The BigInt exponent.
|
||||
* @param {BigInt} n The BigInt divisor.
|
||||
*
|
||||
* @return {BigInt} A remainder as BigInt.
|
||||
*/
|
||||
export function powMod(x: BigInt, y: BigInt, n: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt randBigInt(n,s)
|
||||
* return an n-bit random BigInt (n>=1). If s=1, then the most significant of those n bits is set to 1.
|
||||
* return an n-bit random BigInt (n>=1).
|
||||
* If s=1, then the most significant of those n bits is set to 1.
|
||||
*
|
||||
* @param {number} n The number of bits (n>=1).
|
||||
* @param {number} s The sign bit.
|
||||
*
|
||||
* @return {BigInt} A new random BigInt.
|
||||
*/
|
||||
export function randBigInt(n: number, s: number): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt randTruePrime(k)
|
||||
* return a new, random, k-bit, true prime bigInt using Maurer's algorithm.
|
||||
*
|
||||
* @param {number} k The number of bits.
|
||||
*
|
||||
* @return {BigInt} A new random BigInt.
|
||||
*/
|
||||
export function randTruePrime(k: number): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt randProbPrime(k)
|
||||
* return a new, random, k-bit, probable prime bigInt (probability it's composite less than 2^-80).
|
||||
* return a new, random, k-bit, probable prime bigInt.
|
||||
* Probability it's composite less than 2^- 80.
|
||||
*
|
||||
* @param {number} k The number of bits.
|
||||
*
|
||||
* @return {BigInt} A new probably random BigInt.
|
||||
*/
|
||||
export function randProbPrime(k: number): BigInt;
|
||||
|
||||
interface str2bigInt_T<T> {
|
||||
/**
|
||||
* bigInt str2bigInt(s,b,n,m)
|
||||
* return a bigInt for number represented in string s in base b with at least n bits and m array elements
|
||||
*/
|
||||
(s: string, b: T, n?: number, m?: number): BigInt;
|
||||
}
|
||||
|
||||
interface str2bigIntSignature extends str2bigInt_T<number>, str2bigInt_T<string> {
|
||||
}
|
||||
|
||||
export var str2bigInt: str2bigIntSignature;
|
||||
/**
|
||||
* return a bigInt for number represented in string s in base b with at least n bits and m array
|
||||
* elements.
|
||||
*
|
||||
* @param {string} s The string representation of number.
|
||||
* @param {number} b The base as radix number.
|
||||
* @param {number=} n (Optional) minimal bit length as number.
|
||||
* @param {number=} m (Optional) the number of array elements as number.
|
||||
*
|
||||
* @return {BigInt} A parsed BigInt.
|
||||
*/
|
||||
export function str2bigInt(s: string, b: number, n?: number, m?: number): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt sub(x,y)
|
||||
* return (x-y) for bigInts x and y. Negative answers will be 2s complement
|
||||
* return a bigInt for number represented in string s in base b with at least n bits and m array
|
||||
* elements.
|
||||
*
|
||||
* @param {string} s The string representation of number.
|
||||
* @param {string} b The base as string vocabulary of characters.
|
||||
* @param {number=} n (Optional) minimal bit length as number.
|
||||
* @param {number=} m (Optional) the number of array elements as number.
|
||||
*
|
||||
* @return {BigInt} A parsed BigInt.
|
||||
*/
|
||||
export function str2bigInt(s: string, b: string, n?: number, m?: number): BigInt;
|
||||
|
||||
/**
|
||||
* return (x-y) for bigInts x and y.
|
||||
* Negative answers will be 2s complement.
|
||||
*
|
||||
* @param {BigInt} x The minuend as BigInt.
|
||||
* @param {BigInt} y The subtrahend as BigInt.
|
||||
*
|
||||
* @return {BigInt} A difference BigInt.
|
||||
*/
|
||||
export function sub(x: BigInt, y: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* bigInt trim(x,k)
|
||||
* return a copy of x with exactly k leading zero elements
|
||||
* return a copy of x with exactly k leading zero elements.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to be copied.
|
||||
* @param {number} k The number of zeroes.
|
||||
*
|
||||
* @return {BigInt} A copy BigInt.
|
||||
*/
|
||||
export function trim(x: BigInt, k: number): BigInt;
|
||||
|
||||
/**
|
||||
* void addInt_(x,n)
|
||||
* do x=x+n where x is a bigInt and n is an integer
|
||||
* do x=x+n where x is a bigInt and n is an integer.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt accumulator.
|
||||
* @param {number} n The number addend.
|
||||
*/
|
||||
export function addInt_(x: BigInt, n: number): void;
|
||||
|
||||
/**
|
||||
* void add_(x,y)
|
||||
* do x=x+y for bigInts x and y
|
||||
* do x=x+y for bigInts x and y.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt accumulator.
|
||||
* @param {BigInt} y The BigInt addend.
|
||||
*/
|
||||
export function add_(x: BigInt, y: BigInt): void;
|
||||
|
||||
/**
|
||||
* void copy_(x,y)
|
||||
* do x=y on bigInts x and y
|
||||
* do x=y on bigInts x and y.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt destination.
|
||||
* @param {BigInt} y The BigInt source.
|
||||
*/
|
||||
export function copy_(x: BigInt, y: BigInt): void;
|
||||
|
||||
/**
|
||||
* void copyInt_(x,n)
|
||||
* do x=n on bigInt x and integer n
|
||||
* do x=n on bigInt x and integer n.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt destination.
|
||||
* @param {number} n The number source.
|
||||
*/
|
||||
export function copyInt_(x: BigInt, n: number): number;
|
||||
export function copyInt_(x: BigInt, n: number): void;
|
||||
|
||||
/**
|
||||
* void GCD_(x,y)
|
||||
* set x to the greatest common divisor of bigInts x and y, (y is destroyed). (This never overflows its array).
|
||||
* set x to the greatest common divisor of bigInts x and y, (y is destroyed).
|
||||
* This never overflows its array.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt first dividend.
|
||||
* @param {BigInt} y The BigInt second dividend.
|
||||
*/
|
||||
export function GCD_(x: BigInt, y: BigInt): void;
|
||||
|
||||
/**
|
||||
* boolean inverseMod_(x,n)
|
||||
* do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist
|
||||
* do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base and the remainder result.
|
||||
* @param {BigInt} n The BigInt divisor.
|
||||
*
|
||||
* @return {boolean} true if inverse does exist, false if doesn't.
|
||||
*/
|
||||
export function inverseMod_(x: BigInt, n: BigInt): boolean;
|
||||
|
||||
/**
|
||||
* void mod_(x,n)
|
||||
* do x=x mod n for bigInts x and n. (This never overflows its array).
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt dividend and the remainder result.
|
||||
* @param {BigInt} n The BigInt divisor.
|
||||
*/
|
||||
export function mod_(x: BigInt, n: BigInt): void;
|
||||
|
||||
/**
|
||||
* void mult_(x,y)
|
||||
* do x=x*y for bigInts x and y.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt multiplicand and the product result.
|
||||
* @param {BigInt} y The BigInt multiplier.
|
||||
*/
|
||||
export function mult_(x: BigInt, y: BigInt): void;
|
||||
|
||||
/**
|
||||
* void multMod_(x,y,n)
|
||||
* do x=x*y mod n for bigInts x,y,n.
|
||||
* do x=x*y mod n for bigInts x,y,n.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt multiplicand and the remainder result.
|
||||
* @param {BigInt} y The BigInt multiplier.
|
||||
* @param {BigInt} n The BigInt divisor.
|
||||
*/
|
||||
export function multMod_(x: BigInt, y: BigInt, n: BigInt): void;
|
||||
|
||||
/**
|
||||
* void powMod_(x,y,n)
|
||||
* do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1.
|
||||
* do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation.
|
||||
* 0**0=1.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base and the remainder result.
|
||||
* @param {BigInt} y The BigInt exponent.
|
||||
* @param {BigInt} n The BigInt divisor.
|
||||
*/
|
||||
export function powMod_(x: BigInt, y: BigInt, n: BigInt): void;
|
||||
|
||||
/**
|
||||
* void randBigInt_(b,n,s)
|
||||
* do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.
|
||||
* do b = an n-bit random BigInt.
|
||||
* if s=1, then nth bit (most significant bit) is set to 1. n>=1.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} b The BigInt destination.
|
||||
* @param {number} n The number of bits.
|
||||
* @param {number} s The sign bit number.
|
||||
*/
|
||||
export function randBigInt_(b: BigInt, n: number, s: number): void;
|
||||
|
||||
/**
|
||||
* void randTruePrime_(ans,k)
|
||||
* do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} ans The destination.
|
||||
* @param {number} k The number of bits.
|
||||
*/
|
||||
export function randTruePrime_(ans: BigInt, k: number): void;
|
||||
|
||||
/**
|
||||
* void sub_(x,y)
|
||||
* do x=x-y for bigInts x and y. Negative answers will be 2s complement.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt minuend and the result difference.
|
||||
* @param {BigInt} y The BigInt subtrahend .
|
||||
*/
|
||||
export function sub_(x: BigInt, y: BigInt): void;
|
||||
|
||||
/**
|
||||
* void addShift_(x,y,ys)
|
||||
* do x=x+(y<<(ys*bpe))
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt accumulator.
|
||||
* @param {BigInt} y The BigInt addend to be shifted.
|
||||
* @param {number} ys The number of shift amount.
|
||||
*/
|
||||
export function addShift_(x: BigInt, y: BigInt, ys: number): void;
|
||||
|
||||
/**
|
||||
* void carry_(x)
|
||||
* do carries and borrows so each element of the bigInt x fits in bpe bits.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
*/
|
||||
export function carry_(x: BigInt): void;
|
||||
|
||||
/**
|
||||
* void divide_(x,y,q,r)
|
||||
* divide x by y giving quotient q and remainder r
|
||||
* divide x by y giving quotient q and remainder r.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt dividend.
|
||||
* @param {BigInt} y The BigInt divisor.
|
||||
* @param {BigInt} q The BigInt quotient.
|
||||
* @param {BigInt} r The BigInt remainder.
|
||||
*/
|
||||
export function divide_(x: BigInt, y: BigInt, q: BigInt, r: BigInt): void;
|
||||
|
||||
/**
|
||||
* int divInt_(x,n)
|
||||
* do x=floor(x/n) for bigInt x and integer n, and return the remainder. (This never overflows its array).
|
||||
* do x=floor(x/n) for bigInt x and integer n, and return the remainder.
|
||||
* This never overflows its array.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt dividend and the quotient result.
|
||||
* @param {number} n The number divisor.
|
||||
*
|
||||
* @return {number} A number remainder.
|
||||
*/
|
||||
export function divInt_(x: BigInt, n: number): number;
|
||||
|
||||
/**
|
||||
* void eGCD_(x,y,d,a,b)
|
||||
* sets a,b,d to positive bigInts such that d = GCD_(x,y) = a*x-b*y
|
||||
* sets a,b,d to positive bigInts such that d = GCD_(x,y) = a*x-b*y.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
* @param {BigInt} y The BigInt to process.
|
||||
* @param {BigInt} d The BigInt to process.
|
||||
* @param {BigInt} a The BigInt to process.
|
||||
* @param {BigInt} b The BigInt to process.
|
||||
*/
|
||||
export function eGCD_(x: BigInt, y: BigInt, d: BigInt, a: BigInt, b: BigInt): void;
|
||||
|
||||
/**
|
||||
* void halve_(x)
|
||||
* do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement. (This never overflows its array).
|
||||
* do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement.
|
||||
* This never overflows its array.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
*/
|
||||
export function halve_(x: BigInt): void;
|
||||
|
||||
/**
|
||||
* void leftShift_(x,n)
|
||||
* left shift bigInt x by n bits. n<bpe.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
* @param {number} n The number of bits.
|
||||
*/
|
||||
export function leftShift_(x: BigInt, n: number): void;
|
||||
|
||||
/**
|
||||
* void linComb_(x,y,a,b)
|
||||
* do x=a*x+b*y for bigInts x and y and integers a and b
|
||||
* do x=a*x+b*y for bigInts x and y and integers a and b.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt first multiplicand.
|
||||
* @param {BigInt} y The BigInt second multiplicand.
|
||||
* @param {number} a The number first multiplier.
|
||||
* @param {number} b The number second multiplier.
|
||||
*/
|
||||
export function linComb_(x: BigInt, y: BigInt, a: number, b: number): void;
|
||||
|
||||
/**
|
||||
* void linCombShift_(x,y,b,ys)
|
||||
* do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys
|
||||
/**
|
||||
* do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
* @param {BigInt} y The BigInt to process.
|
||||
* @param {number} b The number to process.
|
||||
* @param {number} ys The number shift.
|
||||
*/
|
||||
export function linCombShift_(x: BigInt, y: BigInt, b: number, ys: number): void;
|
||||
|
||||
/**
|
||||
* void mont_(x,y,n,np)
|
||||
* Montgomery multiplication (see comments where the function is defined)
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
* @param {BigInt} y The BigInt to process.
|
||||
* @param {BigInt} n The BigInt to process.
|
||||
* @param {number} np The np.
|
||||
*/
|
||||
export function mont_(x: BigInt, y: BigInt, n: BigInt, np: number): void;
|
||||
|
||||
/**
|
||||
* void multInt_(x,n)
|
||||
* do x=x*n where x is a bigInt and n is an integer.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt multiplicand and the result product.
|
||||
* @param {number} n The number multiplier.
|
||||
*/
|
||||
export function multInt_(x: BigInt, n: number): void;
|
||||
|
||||
/**
|
||||
* void rightShift_(x,n)
|
||||
* right shift bigInt x by n bits. 0 <= n < bpe. (This never overflows its array).
|
||||
* right shift bigInt x by n bits. 0 <= n < bpe.
|
||||
* This never overflows its array.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
* @param {number} n The number to process.
|
||||
*/
|
||||
export function rightShift_(x: BigInt, n: number): void;
|
||||
|
||||
/**
|
||||
* void squareMod_(x,n)
|
||||
* do x=x*x mod n for bigInts x,n
|
||||
* do x=x*x mod n for bigInts x,n.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base and the result remainder.
|
||||
* @param {BigInt} n The BigInt divisor.
|
||||
*/
|
||||
export function squareMod_(x: BigInt, n: BigInt): void;
|
||||
|
||||
/**
|
||||
* void subShift_(x,y,ys)
|
||||
* do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement.
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt minuend and the result difference.
|
||||
* @param {BigInt} y The BigInt shifted subtrahend .
|
||||
* @param {number} ys The number shift amount.
|
||||
*/
|
||||
export function subShift_(x: BigInt, y: BigInt, ys: number): void;
|
||||
}
|
||||
|
||||
@@ -477,10 +477,10 @@ barProm = fooProm.race<Bar>();
|
||||
|
||||
//TODO fix collection inference
|
||||
|
||||
barProm = fooProm.map<Foo, Bar>((item: Foo, index: number, arrayLength: number) => {
|
||||
barArrProm = fooProm.map<Foo, Bar>((item: Foo, index: number, arrayLength: number) => {
|
||||
return bar;
|
||||
});
|
||||
barProm = fooProm.map<Foo, Bar>((item: Foo) => {
|
||||
barArrProm = fooProm.map<Foo, Bar>((item: Foo) => {
|
||||
return bar;
|
||||
});
|
||||
|
||||
@@ -495,10 +495,10 @@ barProm = fooProm.reduce<Foo, Bar>((memo: Bar, item: Foo) => {
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
fooProm = fooProm.filter<Foo>((item: Foo, index: number, arrayLength: number) => {
|
||||
fooArrProm = fooArrProm.filter<Foo>((item: Foo, index: number, arrayLength: number) => {
|
||||
return bool;
|
||||
});
|
||||
fooProm = fooProm.filter<Foo>((item: Foo) => {
|
||||
fooArrProm = fooArrProm.filter<Foo>((item: Foo) => {
|
||||
return bool;
|
||||
});
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -296,8 +296,8 @@ declare class Promise<R> implements Promise.Thenable<R> {
|
||||
* Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U>;
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U): Promise<U>;
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>;
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U): Promise<U[]>;
|
||||
|
||||
/**
|
||||
* Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
@@ -310,8 +310,8 @@ declare class Promise<R> implements Promise.Thenable<R> {
|
||||
* Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<U>;
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean): Promise<U>;
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<U[]>;
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean): Promise<U[]>;
|
||||
|
||||
/**
|
||||
* Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise.
|
||||
|
||||
+52
-49
@@ -2,73 +2,76 @@
|
||||
/// <reference path="bootbox.d.ts" />
|
||||
|
||||
bootbox.alert("Are we ok?");
|
||||
bootbox.alert("Are we ok with Test button?", "Test");
|
||||
bootbox.alert("Are we ok with callback?", function() {
|
||||
bootbox.alert("Are we ok with callback?", function () {
|
||||
console.log("Callback called!");
|
||||
});
|
||||
bootbox.alert("Are we ok with callback and custom button?", "Test", function() {
|
||||
console.log("Callback called!");
|
||||
bootbox.alert({
|
||||
message: "Are we ok with callback and custom button?",
|
||||
callback: function () {
|
||||
console.log("Callback called!");
|
||||
}
|
||||
});
|
||||
|
||||
bootbox.confirm("Click ok to pass test", function(result) {
|
||||
console.log(result);
|
||||
});
|
||||
bootbox.confirm("Click ok to pass test");
|
||||
|
||||
bootbox.confirm("Click cancel to pass test", function(result) {
|
||||
bootbox.confirm("Click cancel to pass test", function (result) {
|
||||
console.log(!result);
|
||||
});
|
||||
|
||||
bootbox.confirm("Click confirm to pass test", "Cancel?", "Confirm?", function(result) {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
bootbox.confirm("Click cancel to pass test", "Cancel?", "Confirm?", function(result) {
|
||||
console.log(!result);
|
||||
bootbox.confirm({
|
||||
message: "Click confirm to pass test",
|
||||
callback: function (result) {
|
||||
console.log(result);
|
||||
}
|
||||
});
|
||||
|
||||
bootbox.prompt("Are we ok?");
|
||||
|
||||
bootbox.prompt("Enter 'ok' to pass test", function(result) {
|
||||
bootbox.prompt("Enter 'ok' to pass test", function (result) {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
bootbox.prompt("Enter 'ok' to pass test", "Cancel?", "Confirm?", function(result) {
|
||||
console.log(result);
|
||||
bootbox.prompt({
|
||||
message: "Enter 'ok' to pass test", callback: function (result) {
|
||||
console.log(result);
|
||||
}
|
||||
});
|
||||
|
||||
bootbox.prompt("Keep default value and click ok", "Cancel?", "Confirm?", function(result) {
|
||||
console.log(result);
|
||||
}, "Test Value");
|
||||
|
||||
bootbox.dialog("Test Dialog");
|
||||
var handler = {
|
||||
label: "OK",
|
||||
class: "MyClass",
|
||||
|
||||
|
||||
bootbox.dialog("Test Dialog", function (result) {
|
||||
return result;
|
||||
});
|
||||
|
||||
bootbox.dialog({
|
||||
message: "Test Dialog",
|
||||
callback: function (result) { }
|
||||
});
|
||||
|
||||
var bdo: BootboxDialogOptions;
|
||||
var sampleButton: BootboxButton = {
|
||||
label: 'ButtonLabelToUse',
|
||||
callback: function () {
|
||||
console.log("Test Dialog");
|
||||
return 'callback of button click'
|
||||
},
|
||||
className: 'additionalButtonClassName'
|
||||
};
|
||||
|
||||
bdo = {
|
||||
message: '',
|
||||
className: 'callName',
|
||||
buttons: {
|
||||
'ButtonTextLabel': sampleButton
|
||||
}
|
||||
};
|
||||
|
||||
var option = {
|
||||
header: "header",
|
||||
headerCloseButton: true
|
||||
};
|
||||
bootbox.dialog(bdo);
|
||||
|
||||
bootbox.dialog("Test Dialog", handler);
|
||||
bootbox.dialog("Test Dialog", [handler], option);
|
||||
bootbox.setDefaults({
|
||||
locale: 'en_US',
|
||||
animate: false,
|
||||
backdrop: false,
|
||||
className: 'newClassName',
|
||||
closeButton: true,
|
||||
show: true
|
||||
})
|
||||
|
||||
bootbox.hideAll();
|
||||
bootbox.animate(false);
|
||||
bootbox.backdrop("backdrop");
|
||||
bootbox.classes("myClass");
|
||||
|
||||
var icons: BootboxIcons = {
|
||||
OK: "OK Icon",
|
||||
CANCEL: "Cancel Icon",
|
||||
CONFIRM: "Confirm Icon"
|
||||
};
|
||||
bootbox.setIcons(icons);
|
||||
|
||||
bootbox.setLocale("en");
|
||||
|
||||
bootbox.addLocale("klingon", { OK: "luq", CANCEL: "qIl", CONFIRM: "Confirm" });
|
||||
bootbox.hideAll();
|
||||
Vendored
+48
-33
@@ -1,48 +1,63 @@
|
||||
// Type definitions for Bootbox 3.0.0
|
||||
// Type definitions for Bootbox 4.0.0
|
||||
// Project: https://github.com/makeusabrew/bootbox
|
||||
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
|
||||
// Definitions by: Vincent Bortone <https://github.com/vbortone/>, Kon Pik <https://github.com/konpikwastaken/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface BootboxLocale {
|
||||
OK: string;
|
||||
CANCEL: string;
|
||||
CONFIRM: string;
|
||||
|
||||
interface BootboxAlertOptions {
|
||||
message: string;
|
||||
callback?: () => any;
|
||||
}
|
||||
|
||||
interface BootboxIcons {
|
||||
OK: any;
|
||||
CANCEL: any;
|
||||
CONFIRM: any;
|
||||
interface BootboxConfirmOptions {
|
||||
message: string;
|
||||
callback?: (result: boolean) => any;
|
||||
}
|
||||
|
||||
interface BootboxHandler {
|
||||
label: string;
|
||||
class: string;
|
||||
callback: (result?: any) => void;
|
||||
interface BootboxPromptOptions {
|
||||
message: string;
|
||||
callback?: (result: string) => any;
|
||||
}
|
||||
|
||||
interface BootboxOption {
|
||||
header: string;
|
||||
headerCloseButton: boolean;
|
||||
interface BootboxButton {
|
||||
label?: string;
|
||||
className?: string;
|
||||
callback?: () => any;
|
||||
}
|
||||
|
||||
interface BootboxDialogOptions {
|
||||
message: any; // String | Element
|
||||
title?: any; // String | Element
|
||||
callback?: (result: boolean) => any;
|
||||
show?: boolean;
|
||||
onEscape?: () => any;
|
||||
backdrop?: boolean;
|
||||
closeButton?: boolean;
|
||||
animate?: boolean;
|
||||
className?: string;
|
||||
buttons?: Object; // complex object where each key is of type BootboxButton
|
||||
}
|
||||
|
||||
interface BootboxDefaultOptions {
|
||||
locale?: string;
|
||||
show?: boolean;
|
||||
backdrop?: boolean;
|
||||
closeButton?: boolean;
|
||||
animate?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
interface BootboxStatic {
|
||||
alert(message: string, callback: () => void): void;
|
||||
alert(message: string, customButtonText?: string, callback?: () => void): void;
|
||||
confirm(message: string, callback: (result: boolean) => void): void;
|
||||
confirm(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: boolean) => void): void;
|
||||
prompt(message: string, callback: (result: string) => void, defaultValue?: string): void;
|
||||
prompt(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: string) => void, defaultValue?: string): void;
|
||||
dialog(message: string, handlers: BootboxHandler[], options?: any): void;
|
||||
dialog(message: string, handler: BootboxHandler): void;
|
||||
dialog(message: string): void;
|
||||
alert(message: string, callback?: () => void): void;
|
||||
alert(options: BootboxAlertOptions): void;
|
||||
confirm(message: string, callback?: (result: boolean) => void): void;
|
||||
confirm(options: BootboxConfirmOptions): void;
|
||||
prompt(message: string, callback?: (result: string) => void): void;
|
||||
prompt(options: BootboxPromptOptions): void;
|
||||
dialog(message: string, callback?: (result: string) => void): void;
|
||||
dialog(options: BootboxDialogOptions): void;
|
||||
setDefaults(options: BootboxDefaultOptions): void;
|
||||
hideAll(): void;
|
||||
animate(shouldAnimate: boolean): void;
|
||||
backdrop(backdropValue: string): void;
|
||||
classes(customCssClasses: string): void;
|
||||
setIcons(icons: BootboxIcons): void;
|
||||
setLocale(localeName: string): void;
|
||||
addLocale(localeName: string, translations: BootboxLocale) : void;
|
||||
}
|
||||
|
||||
declare var bootbox : BootboxStatic;
|
||||
declare var bootbox: BootboxStatic;
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
Vendored
+1
@@ -376,6 +376,7 @@ declare module breeze {
|
||||
clear(): void;
|
||||
createEmptyCopy(): EntityManager;
|
||||
createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol) : Entity;
|
||||
createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: StrategySymbol): Entity;
|
||||
createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol): Entity;
|
||||
detachEntity(entity: Entity): boolean;
|
||||
executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Q.Promise<QueryResult>;
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import browserify = require("browserify");
|
||||
import fs = require("fs");
|
||||
|
||||
var b = browserify();
|
||||
b.add('./browser/main.js');
|
||||
b.transform('deamdify');
|
||||
b.bundle().pipe(fs.createWriteStream('bundle.js'));
|
||||
/// <reference path="browserify.d.ts"/>
|
||||
|
||||
import browserify = require("browserify");
|
||||
import fs = require("fs");
|
||||
|
||||
var b: BrowserifyObject = browserify();
|
||||
b.add('./browser/main.js');
|
||||
b.transform('deamdify');
|
||||
b.bundle().pipe(fs.createWriteStream('bundle.js'));
|
||||
|
||||
var customBrowsify: Browserify = require("browserify");
|
||||
customBrowsify({entries: []});
|
||||
|
||||
Vendored
+41
-38
@@ -1,38 +1,41 @@
|
||||
// Type definitions for Browserify
|
||||
// Project: http://browserify.org/
|
||||
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
interface BrowserifyObject extends NodeJS.EventEmitter {
|
||||
add(file: string): BrowserifyObject;
|
||||
require(file: string, opts?: {
|
||||
expose: string;
|
||||
}): BrowserifyObject;
|
||||
bundle(opts?: {
|
||||
insertGlobals?: boolean;
|
||||
detectGlobals?: boolean;
|
||||
debug?: boolean;
|
||||
standalone?: string;
|
||||
insertGlobalVars?: any;
|
||||
}, cb?: (err: any, src: any) => void): NodeJS.ReadableStream;
|
||||
|
||||
external(file: string): BrowserifyObject;
|
||||
ignore(file: string): BrowserifyObject;
|
||||
transform(tr: string): BrowserifyObject;
|
||||
transform(tr: Function): BrowserifyObject;
|
||||
plugin(plugin: string, opts?: any): BrowserifyObject;
|
||||
plugin(plugin: Function, opts?: any): BrowserifyObject;
|
||||
}
|
||||
|
||||
declare module "browserify" {
|
||||
function browserify(): BrowserifyObject;
|
||||
function browserify(files: string[]): BrowserifyObject;
|
||||
function browserify(opts: {
|
||||
entries?: string[];
|
||||
noParse?: string[];
|
||||
}): BrowserifyObject;
|
||||
|
||||
export = browserify;
|
||||
}
|
||||
// Type definitions for Browserify
|
||||
// Project: http://browserify.org/
|
||||
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
interface BrowserifyObject extends NodeJS.EventEmitter {
|
||||
add(file:string): BrowserifyObject;
|
||||
require(file:string, opts?:{
|
||||
expose: string;
|
||||
}): BrowserifyObject;
|
||||
bundle(opts?:{
|
||||
insertGlobals?: boolean;
|
||||
detectGlobals?: boolean;
|
||||
debug?: boolean;
|
||||
standalone?: string;
|
||||
insertGlobalVars?: any;
|
||||
}, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
|
||||
|
||||
external(file:string): BrowserifyObject;
|
||||
ignore(file:string): BrowserifyObject;
|
||||
transform(tr:string): BrowserifyObject;
|
||||
transform(tr:Function): BrowserifyObject;
|
||||
plugin(plugin:string, opts?:any): BrowserifyObject;
|
||||
plugin(plugin:Function, opts?:any): BrowserifyObject;
|
||||
}
|
||||
|
||||
interface Browserify {
|
||||
(): BrowserifyObject;
|
||||
(files:string[]): BrowserifyObject;
|
||||
(opts:{
|
||||
entries?: string[];
|
||||
noParse?: string[];
|
||||
}): BrowserifyObject;
|
||||
}
|
||||
|
||||
declare module "browserify" {
|
||||
var browserify: Browserify;
|
||||
export = browserify;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path="./bunyan-logentries.d.ts" />
|
||||
/// <reference path="../bunyan/bunyan.d.ts" />
|
||||
|
||||
import bunyan = require("bunyan");
|
||||
import bunyanLogentries = require("bunyan-logentries");
|
||||
|
||||
var logger: bunyan.Logger = bunyan.createLogger({
|
||||
name: "foobar",
|
||||
streams: [{
|
||||
level: "info",
|
||||
stream: bunyanLogentries.createStream({token: "foobar"}),
|
||||
type: "raw"
|
||||
}]
|
||||
});
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for node-bunyan-logentries v0.1.0
|
||||
// Project: https://github.com/nemtsov/node-bunyan-logentries
|
||||
// Definitions by: Aymeric Beaumet <http://aymericbeaumet.me>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../bunyan/bunyan.d.ts" />
|
||||
|
||||
declare module "bunyan-logentries" {
|
||||
import bunyan = require("bunyan");
|
||||
|
||||
interface StreamOptions {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export function createStream(options: StreamOptions): NodeJS.WritableStream;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
/// <reference path="bunyan.d.ts" />
|
||||
|
||||
import bunyan = require('bunyan');
|
||||
|
||||
var ringBufferOptions:bunyan.RingBufferOptions = {
|
||||
limit: 100
|
||||
};
|
||||
var ringBuffer:bunyan.RingBuffer = new bunyan.RingBuffer(ringBufferOptions);
|
||||
ringBuffer.write("hello");
|
||||
ringBuffer.end();
|
||||
ringBuffer.destroy();
|
||||
ringBuffer.destroySoon();
|
||||
|
||||
var level:number;
|
||||
level = bunyan.resolveLevel("trace");
|
||||
level = bunyan.resolveLevel("debug");
|
||||
level = bunyan.resolveLevel("info");
|
||||
level = bunyan.resolveLevel("warn");
|
||||
level = bunyan.resolveLevel("error");
|
||||
level = bunyan.resolveLevel("fatal");
|
||||
level = bunyan.resolveLevel(bunyan.TRACE);
|
||||
level = bunyan.resolveLevel(bunyan.DEBUG);
|
||||
level = bunyan.resolveLevel(bunyan.INFO);
|
||||
level = bunyan.resolveLevel(bunyan.WARN);
|
||||
level = bunyan.resolveLevel(bunyan.ERROR);
|
||||
level = bunyan.resolveLevel(bunyan.FATAL);
|
||||
|
||||
var options:bunyan.LoggerOptions = {
|
||||
name: 'test-logger',
|
||||
streams: [{
|
||||
type: 'stream',
|
||||
stream: process.stdout,
|
||||
level: bunyan.TRACE
|
||||
}, {
|
||||
type: 'file',
|
||||
path: '/tmp/test.log',
|
||||
level: bunyan.DEBUG,
|
||||
closeOnExit: true
|
||||
}, {
|
||||
type: 'rotating-file',
|
||||
path: '/tmp/test2.log',
|
||||
level: bunyan.INFO,
|
||||
closeOnExit: false
|
||||
}, {
|
||||
type: 'raw',
|
||||
stream: process.stderr,
|
||||
level: bunyan.WARN
|
||||
}, {
|
||||
type: 'raw',
|
||||
stream: ringBuffer,
|
||||
level: bunyan.ERROR
|
||||
}]
|
||||
};
|
||||
|
||||
var log = bunyan.createLogger(options);
|
||||
|
||||
log.addSerializers(bunyan.stdSerializers);
|
||||
var child = log.child({name: 'child'});
|
||||
child.reopenFileStreams();
|
||||
log.addStream({path: '/dev/null', name: 'stream1'});
|
||||
child.level(bunyan.DEBUG);
|
||||
child.level('debug');
|
||||
child.levels(0, bunyan.ERROR);
|
||||
child.levels(0, 'error');
|
||||
child.levels('stream1', bunyan.FATAL);
|
||||
child.levels('stream1', 'fatal');
|
||||
|
||||
var buffer = new Buffer(0);
|
||||
var error = new Error('');
|
||||
var object = {
|
||||
test: 123
|
||||
};
|
||||
|
||||
log.trace(buffer);
|
||||
log.trace(error);
|
||||
log.trace(object);
|
||||
log.trace('Hello, %s', 'world!');
|
||||
log.debug(buffer);
|
||||
log.debug(error);
|
||||
log.debug(object);
|
||||
log.debug('Hello, %s', 'world!');
|
||||
log.info(buffer);
|
||||
log.info(error);
|
||||
log.info(object);
|
||||
log.info('Hello, %s', 'world!');
|
||||
log.warn(buffer);
|
||||
log.warn(error);
|
||||
log.warn(object);
|
||||
log.warn('Hello, %s', 'world!');
|
||||
log.error(buffer);
|
||||
log.error(error);
|
||||
log.error(object);
|
||||
log.error('Hello, %s', 'world!');
|
||||
log.fatal(buffer);
|
||||
log.fatal(error);
|
||||
log.fatal(object);
|
||||
log.fatal('Hello, %s', 'world!');
|
||||
|
||||
var recursive = {
|
||||
hello: 'world',
|
||||
whats: {
|
||||
huh: recursive
|
||||
}
|
||||
}
|
||||
|
||||
JSON.stringify(recursive, bunyan.safeCycles());
|
||||
Vendored
+101
@@ -0,0 +1,101 @@
|
||||
// Type definitions for node-bunyan
|
||||
// Project: https://github.com/trentm/node-bunyan
|
||||
// Definitions by: Alex Mikhalev <https://github.com/amikhalev>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "bunyan" {
|
||||
import events = require('events');
|
||||
import EventEmitter = events.EventEmitter;
|
||||
import WritableStream = NodeJS.WritableStream;
|
||||
|
||||
class Logger extends EventEmitter {
|
||||
constructor(options:LoggerOptions);
|
||||
addStream(stream:Stream):void;
|
||||
addSerializers(serializers:Serializers):void;
|
||||
child(options:LoggerOptions, simple?:boolean):Logger;
|
||||
child(obj:Object, simple?:boolean):Logger;
|
||||
reopenFileStreams():void;
|
||||
|
||||
level(value:any /* number | string */):void;
|
||||
levels(name:any /* number | string */, value:any /* number | string */):void;
|
||||
|
||||
trace(error:Error, format?:any, ...params:any[]):void;
|
||||
trace(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
trace(obj:Object, format?:any, ...params:any[]):void;
|
||||
trace(format:string, ...params:any[]):void;
|
||||
debug(error:Error, format?:any, ...params:any[]):void;
|
||||
debug(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
debug(obj:Object, format?:any, ...params:any[]):void;
|
||||
debug(format:string, ...params:any[]):void;
|
||||
info(error:Error, format?:any, ...params:any[]):void;
|
||||
info(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
info(obj:Object, format?:any, ...params:any[]):void;
|
||||
info(format:string, ...params:any[]):void;
|
||||
warn(error:Error, format?:any, ...params:any[]):void;
|
||||
warn(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
warn(obj:Object, format?:any, ...params:any[]):void;
|
||||
warn(format:string, ...params:any[]):void;
|
||||
error(error:Error, format?:any, ...params:any[]):void;
|
||||
error(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
error(obj:Object, format?:any, ...params:any[]):void;
|
||||
error(format:string, ...params:any[]):void;
|
||||
fatal(error:Error, format?:any, ...params:any[]):void;
|
||||
fatal(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
fatal(obj:Object, format?:any, ...params:any[]):void;
|
||||
fatal(format:string, ...params:any[]):void;
|
||||
}
|
||||
|
||||
interface LoggerOptions {
|
||||
name: string;
|
||||
streams?: Stream[];
|
||||
level?: string;
|
||||
stream?: WritableStream;
|
||||
serializers?: Serializers;
|
||||
src?: boolean;
|
||||
}
|
||||
|
||||
interface Serializers {
|
||||
[key:string]: (input:any) => string;
|
||||
}
|
||||
|
||||
interface Stream {
|
||||
type?: string;
|
||||
level?: any; // number | string
|
||||
path?: string;
|
||||
stream?: WritableStream;
|
||||
closeOnExit?: boolean;
|
||||
}
|
||||
|
||||
export var stdSerializers:Serializers;
|
||||
|
||||
export var TRACE:number;
|
||||
export var DEBUG:number;
|
||||
export var INFO:number;
|
||||
export var WARN:number;
|
||||
export var ERROR:number;
|
||||
export var FATAL:number;
|
||||
|
||||
export function resolveLevel(value:any /* number | string */):number;
|
||||
|
||||
export function createLogger(options:LoggerOptions):Logger;
|
||||
|
||||
class RingBuffer extends EventEmitter {
|
||||
constructor(options:RingBufferOptions);
|
||||
|
||||
writable:boolean;
|
||||
records:any[];
|
||||
|
||||
write(record:any):void;
|
||||
end(record?:any):void;
|
||||
destroy():void;
|
||||
destroySoon():void;
|
||||
}
|
||||
|
||||
interface RingBufferOptions {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export function safeCycles():(key:string, value:any) => any;
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../moment/moment.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="business-rules-engine.d.ts" />
|
||||
declare module Validators {
|
||||
class LettersOnlyValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class ZipCodeValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class EmailValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class UrlValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RequiredValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DateValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DateISOValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class NumberValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DigitValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class SignedDigitValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MinLengthValidator implements Validation.IStringValidator {
|
||||
public MinLength: number;
|
||||
constructor(MinLength?: number);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MaxLengthValidator implements Validation.IStringValidator {
|
||||
public MaxLength: number;
|
||||
constructor(MaxLength?: number);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RangeLengthValidator implements Validation.IStringValidator {
|
||||
public RangeLength: number[];
|
||||
constructor(RangeLength?: number[]);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public MinLength : number;
|
||||
public MaxLength : number;
|
||||
public tagName: string;
|
||||
}
|
||||
class MinValidator implements Validation.IPropertyValidator {
|
||||
public Min: number;
|
||||
constructor(Min?: number);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MaxValidator implements Validation.IPropertyValidator {
|
||||
public Max: number;
|
||||
constructor(Max?: number);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RangeValidator implements Validation.IPropertyValidator {
|
||||
public Range: number[];
|
||||
constructor(Range?: number[]);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public Min : number;
|
||||
public Max : number;
|
||||
public tagName: string;
|
||||
}
|
||||
class StepValidator implements Validation.IPropertyValidator {
|
||||
public Step: string;
|
||||
constructor(Step?: string);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class PatternValidator implements Validation.IStringValidator {
|
||||
public Pattern: string;
|
||||
constructor(Pattern?: string);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class ContainsValidator implements Validation.IAsyncPropertyValidator {
|
||||
public Options: Q.Promise<any[]>;
|
||||
constructor(Options: Q.Promise<any[]>);
|
||||
public isAcceptable(s: string): Q.Promise<boolean>;
|
||||
public isAsync: boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
}
|
||||
declare module "node-validators" {export = Validators;}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
declare module Utils {
|
||||
class StringFce {
|
||||
static format(s: string, args: any): string;
|
||||
}
|
||||
class NumberFce {
|
||||
static GetNegDigits(value: string): number;
|
||||
}
|
||||
}
|
||||
declare module "node-utils" {export = Utils;}
|
||||
+241
@@ -0,0 +1,241 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
declare module Validation {
|
||||
interface IErrorCustomMessage {
|
||||
(config: any, args: any): string;
|
||||
}
|
||||
interface IPropertyValidator {
|
||||
isAcceptable(s: any): boolean;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IStringValidator extends IPropertyValidator {
|
||||
isAcceptable(s: string): boolean;
|
||||
}
|
||||
interface IAsyncPropertyValidator {
|
||||
isAcceptable(s: any): Q.Promise<boolean>;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
isAsync: boolean;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator {
|
||||
isAcceptable(s: string): Q.Promise<boolean>;
|
||||
}
|
||||
enum CompareOperator {
|
||||
LessThan = 0,
|
||||
LessThanEqual = 1,
|
||||
Equal = 2,
|
||||
NotEqual = 3,
|
||||
GreaterThanEqual = 4,
|
||||
GreaterThan = 5,
|
||||
}
|
||||
interface IError {
|
||||
HasError: boolean;
|
||||
ErrorMessage: string;
|
||||
TranslateArgs?: IErrorTranslateArgs;
|
||||
}
|
||||
interface IErrorTranslateArgs {
|
||||
TranslateId: string;
|
||||
MessageArgs: any;
|
||||
CustomMessage?: IErrorCustomMessage;
|
||||
}
|
||||
interface IOptional {
|
||||
(): boolean;
|
||||
}
|
||||
interface IValidationFailure extends IError {
|
||||
IsAsync: boolean;
|
||||
Error: IError;
|
||||
}
|
||||
interface IValidationResult {
|
||||
Name: string;
|
||||
Add(validationResult: IValidationResult): void;
|
||||
Remove(index: number): void;
|
||||
Children: IValidationResult[];
|
||||
HasErrors: boolean;
|
||||
HasErrorsDirty: boolean;
|
||||
ErrorMessage: string;
|
||||
ErrorCount: number;
|
||||
Optional?: IOptional;
|
||||
TranslateArgs?: IErrorTranslateArgs[];
|
||||
}
|
||||
interface IValidate {
|
||||
(args: IError): void;
|
||||
}
|
||||
interface IAsyncValidate {
|
||||
(args: IError): Q.Promise<any>;
|
||||
}
|
||||
interface IValidatorFce {
|
||||
Name: string;
|
||||
ValidationFce?: IValidate;
|
||||
AsyncValidationFce?: IAsyncValidate;
|
||||
}
|
||||
interface IValidator {
|
||||
Validate(context: any): IValidationFailure;
|
||||
ValidateAsync(context: any): Q.Promise<IValidationFailure>;
|
||||
Error: IError;
|
||||
}
|
||||
interface IAbstractValidator<T> {
|
||||
RuleFor(prop: string, validator: IPropertyValidator): any;
|
||||
ValidationFor(prop: string, validatorFce: IValidatorFce): any;
|
||||
Validation(validatorFce: IValidatorFce): any;
|
||||
ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>): any;
|
||||
CreateRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractListRule(name: string): IAbstractValidationRule<any>;
|
||||
ForList: boolean;
|
||||
}
|
||||
interface IAbstractValidationRule<T> {
|
||||
Validate(context: T): IValidationResult;
|
||||
ValidateAsync(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateAll(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateProperty(context: T, propName: string): void;
|
||||
ValidationResult: IValidationResult;
|
||||
Rules: {
|
||||
[name: string]: IPropertyValidationRule<T>;
|
||||
};
|
||||
Validators: {
|
||||
[name: string]: IValidator;
|
||||
};
|
||||
Children: {
|
||||
[name: string]: IAbstractValidationRule<any>;
|
||||
};
|
||||
}
|
||||
interface IPropertyValidationRule<T> {
|
||||
Validators: {
|
||||
[name: string]: any;
|
||||
};
|
||||
Validate(context: IValidationContext<T>): IValidationFailure[];
|
||||
ValidateAsync(context: IValidationContext<T>): Q.Promise<IValidationFailure[]>;
|
||||
}
|
||||
interface IValidationContext<T> {
|
||||
Value: string;
|
||||
Key: string;
|
||||
Data: T;
|
||||
}
|
||||
class Error implements IError {
|
||||
public HasError: boolean;
|
||||
public ErrorMessage: string;
|
||||
constructor();
|
||||
}
|
||||
class ValidationFailure implements IError {
|
||||
public Error: IError;
|
||||
public IsAsync: boolean;
|
||||
constructor(Error: IError, IsAsync: boolean);
|
||||
public HasError : boolean;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs;
|
||||
}
|
||||
class ValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
constructor(Name: string);
|
||||
public IsDirty: boolean;
|
||||
public Children : IValidationResult[];
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public Optional: IOptional;
|
||||
public TranslateArgs: IErrorTranslateArgs[];
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
}
|
||||
class CompositeValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
public Children: IValidationResult[];
|
||||
constructor(Name: string);
|
||||
public Optional: IOptional;
|
||||
public AddFirst(error: IValidationResult): void;
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs[];
|
||||
public LogErrors(headerMessage?: string): void;
|
||||
public Errors : {
|
||||
[name: string]: IValidationResult;
|
||||
};
|
||||
private FlattenErros;
|
||||
public SetDirty(): void;
|
||||
public SetPristine(): void;
|
||||
private SetDirtyEx(node, dirty);
|
||||
private flattenErrors(node, errorCollection);
|
||||
private traverse(node, indent);
|
||||
}
|
||||
class AbstractValidator<T> implements IAbstractValidator<T> {
|
||||
public Validators: {
|
||||
[name: string]: IPropertyValidator[];
|
||||
};
|
||||
public AbstractValidators: {
|
||||
[name: string]: IAbstractValidator<any>;
|
||||
};
|
||||
public ValidationFunctions: {
|
||||
[name: string]: IValidatorFce[];
|
||||
};
|
||||
public RuleFor(prop: string, validator: IPropertyValidator): void;
|
||||
public ValidationFor(prop: string, fce: IValidatorFce): void;
|
||||
public Validation(fce: IValidatorFce): void;
|
||||
public ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>, forList?: boolean): void;
|
||||
public CreateAbstractRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateAbstractListRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateRule(name: string): IAbstractValidationRule<T>;
|
||||
public ForList: boolean;
|
||||
}
|
||||
class MessageLocalization {
|
||||
static customMsg: string;
|
||||
static defaultMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static ValidationMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static GetValidationMessage(validator: any): string;
|
||||
}
|
||||
}
|
||||
declare module "node-validation" {export = Validation;}
|
||||
@@ -0,0 +1,32 @@
|
||||
/// <reference path="business-rules-engine.d.ts" />
|
||||
/// <reference path="BasicValidators.d.ts" />
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../moment/moment.d.ts" />
|
||||
|
||||
export interface IPerson{
|
||||
Checked:boolean;
|
||||
FirstName:string;
|
||||
LastName:string;
|
||||
Email:string;
|
||||
}
|
||||
|
||||
|
||||
//create custom composite validator
|
||||
var personValidator = new Validation.AbstractValidator<IPerson>();
|
||||
|
||||
//create field validators
|
||||
var required = new Validators.RequiredValidator();
|
||||
var email = new Validators.EmailValidator();
|
||||
var maxLength = new Validators.MaxLengthValidator();
|
||||
maxLength.MaxLength = 15;
|
||||
|
||||
|
||||
personValidator.RuleFor("FirstName", required);
|
||||
personValidator.RuleFor("FirstName", maxLength);
|
||||
|
||||
personValidator.RuleFor("LastName", required);
|
||||
personValidator.RuleFor("LastName", maxLength);
|
||||
|
||||
personValidator.RuleFor("Email", required);
|
||||
personValidator.RuleFor("Email", email);
|
||||
+242
@@ -0,0 +1,242 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Source: typings/business-rules-engine/Validation.d.ts
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
declare module Validation {
|
||||
interface IErrorCustomMessage {
|
||||
(config: any, args: any): string;
|
||||
}
|
||||
interface IPropertyValidator {
|
||||
isAcceptable(s: any): boolean;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IStringValidator extends IPropertyValidator {
|
||||
isAcceptable(s: string): boolean;
|
||||
}
|
||||
interface IAsyncPropertyValidator {
|
||||
isAcceptable(s: any): Q.Promise<boolean>;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
isAsync: boolean;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator {
|
||||
isAcceptable(s: string): Q.Promise<boolean>;
|
||||
}
|
||||
enum CompareOperator {
|
||||
LessThan = 0,
|
||||
LessThanEqual = 1,
|
||||
Equal = 2,
|
||||
NotEqual = 3,
|
||||
GreaterThanEqual = 4,
|
||||
GreaterThan = 5,
|
||||
}
|
||||
interface IError {
|
||||
HasError: boolean;
|
||||
ErrorMessage: string;
|
||||
TranslateArgs?: IErrorTranslateArgs;
|
||||
}
|
||||
interface IErrorTranslateArgs {
|
||||
TranslateId: string;
|
||||
MessageArgs: any;
|
||||
CustomMessage?: IErrorCustomMessage;
|
||||
}
|
||||
interface IOptional {
|
||||
(): boolean;
|
||||
}
|
||||
interface IValidationFailure extends IError {
|
||||
IsAsync: boolean;
|
||||
Error: IError;
|
||||
}
|
||||
interface IValidationResult {
|
||||
Name: string;
|
||||
Add(validationResult: IValidationResult): void;
|
||||
Remove(index: number): void;
|
||||
Children: IValidationResult[];
|
||||
HasErrors: boolean;
|
||||
HasErrorsDirty: boolean;
|
||||
ErrorMessage: string;
|
||||
ErrorCount: number;
|
||||
Optional?: IOptional;
|
||||
TranslateArgs?: IErrorTranslateArgs[];
|
||||
}
|
||||
interface IValidate {
|
||||
(args: IError): void;
|
||||
}
|
||||
interface IAsyncValidate {
|
||||
(args: IError): Q.Promise<any>;
|
||||
}
|
||||
interface IValidatorFce {
|
||||
Name: string;
|
||||
ValidationFce?: IValidate;
|
||||
AsyncValidationFce?: IAsyncValidate;
|
||||
}
|
||||
interface IValidator {
|
||||
Validate(context: any): IValidationFailure;
|
||||
ValidateAsync(context: any): Q.Promise<IValidationFailure>;
|
||||
Error: IError;
|
||||
}
|
||||
interface IAbstractValidator<T> {
|
||||
RuleFor(prop: string, validator: IPropertyValidator): any;
|
||||
ValidationFor(prop: string, validatorFce: IValidatorFce): any;
|
||||
Validation(validatorFce: IValidatorFce): any;
|
||||
ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>): any;
|
||||
CreateRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractListRule(name: string): IAbstractValidationRule<any>;
|
||||
ForList: boolean;
|
||||
}
|
||||
interface IAbstractValidationRule<T> {
|
||||
Validate(context: T): IValidationResult;
|
||||
ValidateAsync(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateAll(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateProperty(context: T, propName: string): void;
|
||||
ValidationResult: IValidationResult;
|
||||
Rules: {
|
||||
[name: string]: IPropertyValidationRule<T>;
|
||||
};
|
||||
Validators: {
|
||||
[name: string]: IValidator;
|
||||
};
|
||||
Children: {
|
||||
[name: string]: IAbstractValidationRule<any>;
|
||||
};
|
||||
}
|
||||
interface IPropertyValidationRule<T> {
|
||||
Validators: {
|
||||
[name: string]: any;
|
||||
};
|
||||
Validate(context: IValidationContext<T>): IValidationFailure[];
|
||||
ValidateAsync(context: IValidationContext<T>): Q.Promise<IValidationFailure[]>;
|
||||
}
|
||||
interface IValidationContext<T> {
|
||||
Value: string;
|
||||
Key: string;
|
||||
Data: T;
|
||||
}
|
||||
class Error implements IError {
|
||||
public HasError: boolean;
|
||||
public ErrorMessage: string;
|
||||
constructor();
|
||||
}
|
||||
class ValidationFailure implements IError {
|
||||
public Error: IError;
|
||||
public IsAsync: boolean;
|
||||
constructor(Error: IError, IsAsync: boolean);
|
||||
public HasError : boolean;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs;
|
||||
}
|
||||
class ValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
constructor(Name: string);
|
||||
public IsDirty: boolean;
|
||||
public Children : IValidationResult[];
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public Optional: IOptional;
|
||||
public TranslateArgs: IErrorTranslateArgs[];
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
}
|
||||
class CompositeValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
public Children: IValidationResult[];
|
||||
constructor(Name: string);
|
||||
public Optional: IOptional;
|
||||
public AddFirst(error: IValidationResult): void;
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs[];
|
||||
public LogErrors(headerMessage?: string): void;
|
||||
public Errors : {
|
||||
[name: string]: IValidationResult;
|
||||
};
|
||||
private FlattenErros;
|
||||
public SetDirty(): void;
|
||||
public SetPristine(): void;
|
||||
private SetDirtyEx(node, dirty);
|
||||
private flattenErrors(node, errorCollection);
|
||||
private traverse(node, indent);
|
||||
}
|
||||
class AbstractValidator<T> implements IAbstractValidator<T> {
|
||||
public Validators: {
|
||||
[name: string]: IPropertyValidator[];
|
||||
};
|
||||
public AbstractValidators: {
|
||||
[name: string]: IAbstractValidator<any>;
|
||||
};
|
||||
public ValidationFunctions: {
|
||||
[name: string]: IValidatorFce[];
|
||||
};
|
||||
public RuleFor(prop: string, validator: IPropertyValidator): void;
|
||||
public ValidationFor(prop: string, fce: IValidatorFce): void;
|
||||
public Validation(fce: IValidatorFce): void;
|
||||
public ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>, forList?: boolean): void;
|
||||
public CreateAbstractRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateAbstractListRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateRule(name: string): IAbstractValidationRule<T>;
|
||||
public ForList: boolean;
|
||||
}
|
||||
class MessageLocalization {
|
||||
static customMsg: string;
|
||||
static defaultMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static ValidationMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static GetValidationMessage(validator: any): string;
|
||||
}
|
||||
}
|
||||
declare module "business-rule-engine" {export = Validation;}
|
||||
@@ -31,8 +31,8 @@ caml = new CamlBuilder().Where()
|
||||
)
|
||||
.ToString();
|
||||
|
||||
caml = new CamlBuilder().Where()
|
||||
.LookupIdField("Category").In([2, 3, 10])
|
||||
var caml = new CamlBuilder().Where()
|
||||
.LookupField("Category").Id().In([2, 3, 10])
|
||||
.And()
|
||||
.DateField("ExpirationDate").GreaterThan(CamlBuilder.CamlValues.Now)
|
||||
.OrderBy("ExpirationDate")
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
Vendored
+78
-58
@@ -4,48 +4,14 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
declare module Sys {
|
||||
class StringBuilder {
|
||||
/** Appends a string to the string builder */
|
||||
public append(s: string): void;
|
||||
/** Appends a line to the string builder */
|
||||
public appendLine(s: string): void;
|
||||
/** Clears the contents of the string builder */
|
||||
public clear(): void;
|
||||
/** Indicates wherever the string builder is empty */
|
||||
public isEmpty(): boolean;
|
||||
/** Gets the contents of the string builder as a string */
|
||||
public toString(): string;
|
||||
}
|
||||
}
|
||||
declare module SP {
|
||||
/** Defines a writer that provides a set of methods to append text in XML format. Use the static SP.XmlWriter.create(sb) Method to create an SP.XmlWriter object with the Sys.StringBuilder object you pass in. */
|
||||
class XmlWriter {
|
||||
/** Creates a new instance of the XmlWriter class with the specified string builder. */
|
||||
static create(sb: Sys.StringBuilder): XmlWriter;
|
||||
/** Appends a start element tag with the specified name in XML format to the object?s string builder. */
|
||||
public writeStartElement(tagName: string): void;
|
||||
/** Appends an element with the specified tag name and value in XML format to the string builder. */
|
||||
public writeElementString(tagName: string, value: string): void;
|
||||
/** Appends an end element tag in XML format to the object?s string builder. This method appends the end element tag ?/>? if the start element tag is not closed; otherwise, it appends a full end element tag ?</tagName>? to the string builder. */
|
||||
public writeEndElement(): void;
|
||||
/** Appends an attribute with the specified name and value in XML format to the object?s string builder. */
|
||||
public writeAttributeString(localName: string, value: string): void;
|
||||
/** This method only appends the name of the attribute. You can append the value of the attribute by calling the SP.XmlWriter.writeString(value) Method, and close the attribute by calling the SP.XmlWriter.writeEndAttribute() Method. */
|
||||
public writeStartAttribute(localName: string): void;
|
||||
/** Appends an end of an attribute in XML format to the object?s string builder. */
|
||||
public writeEndAttribute(): void;
|
||||
/** Appends the specified value for an element tag or attribute to the object?s string builder. */
|
||||
public writeString(value: string): void;
|
||||
/** Appends the specified text to the object?s string builder. */
|
||||
public writeRaw(xml: string): void;
|
||||
/** This member is reserved for internal use and is not intended to be used directly from your code. */
|
||||
public close(): void;
|
||||
}
|
||||
}
|
||||
declare class CamlBuilder {
|
||||
constructor();
|
||||
/** Generate CAML Query, starting from <Where> tag */
|
||||
public Where(): CamlBuilder.IFieldExpression;
|
||||
/** Generate <View> tag for SP.CamlQuery
|
||||
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
|
||||
Specifying view fields is a good practice, as it decreases traffic between server and client. */
|
||||
public View(viewFields?: string[]): CamlBuilder.IView;
|
||||
/** Use for:
|
||||
1. SPServices CAMLQuery attribute
|
||||
2. Creating partial expressions
|
||||
@@ -54,8 +20,40 @@ declare class CamlBuilder {
|
||||
static Expression(): CamlBuilder.IFieldExpression;
|
||||
}
|
||||
declare module CamlBuilder {
|
||||
interface IView {
|
||||
interface IView extends IJoinable, IFinalizable {
|
||||
Query(): IQuery;
|
||||
RowLimit(limit: number, paged?: boolean): IView;
|
||||
Scope(scope: ViewScope): IView;
|
||||
}
|
||||
interface IJoinable {
|
||||
/** Join the list you're querying with another list.
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@alias alias for the joined list */
|
||||
InnerJoin(lookupFieldInternalName: string, alias: string): IJoin;
|
||||
/** Join the list you're querying with another list.
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@alias alias for the joined list */
|
||||
LeftJoin(lookupFieldInternalName: string, alias: string): IJoin;
|
||||
}
|
||||
interface IJoin extends IJoinable {
|
||||
/** Select projected field for using in the main Query body
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
|
||||
}
|
||||
interface IProjectableView extends IView {
|
||||
/** Select projected field for using in the main Query body
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
|
||||
}
|
||||
enum ViewScope {
|
||||
/** */
|
||||
Recursive = 0,
|
||||
/** */
|
||||
RecursiveAll = 1,
|
||||
/** */
|
||||
FilesOnly = 2,
|
||||
}
|
||||
interface IQuery {
|
||||
Where(): IFieldExpression;
|
||||
@@ -63,6 +61,8 @@ declare module CamlBuilder {
|
||||
interface IFinalizable {
|
||||
/** Get the resulting CAML query as string */
|
||||
ToString(): string;
|
||||
/** Get the resulting CAML query as SP.CamlQuery object */
|
||||
ToCamlQuery(): any;
|
||||
}
|
||||
interface ISortable extends IFinalizable {
|
||||
/** Adds OrderBy clause to the query
|
||||
@@ -81,7 +81,7 @@ declare module CamlBuilder {
|
||||
interface IGroupable extends ISortable {
|
||||
/** Adds GroupBy clause to the query.
|
||||
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */
|
||||
GroupBy(fieldInternalName): IGroupedQuery;
|
||||
GroupBy(fieldInternalName: any): IGroupedQuery;
|
||||
}
|
||||
interface IExpression extends IGroupable {
|
||||
/** Adds And clause to the query. */
|
||||
@@ -122,12 +122,10 @@ declare module CamlBuilder {
|
||||
UserField(internalName: string): IUserFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Lookup */
|
||||
LookupField(internalName: string): ILookupFieldExpression;
|
||||
/** DEPRECATED. Please use LookupField(...).Id() instead */
|
||||
LookupIdField(internalName: string): INumberFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is LookupMulti */
|
||||
LookupMultiField(internalName: string): ILookupMultiFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is UserMulti */
|
||||
UserMultiField(internalName: string): ILookupMultiFieldExpression;
|
||||
UserMultiField(internalName: string): IUserMultiFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Date */
|
||||
DateField(internalName: string): IDateTimeFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is DateTime */
|
||||
@@ -289,30 +287,52 @@ declare module CamlBuilder {
|
||||
ValueAsBoolean(): IBooleanFieldExpression;
|
||||
}
|
||||
interface ILookupMultiFieldExpression {
|
||||
/** Checks whether the value of the field is equal to the specified value */
|
||||
EqualTo(value: string): IExpression;
|
||||
/** Checks whether the value of the field is not equal to the specified value */
|
||||
NotEqualTo(value: string): IExpression;
|
||||
/** Checks whether the values of the field includes the specified value */
|
||||
Includes(value): IExpression;
|
||||
/** Checks whether the values of the field not includes the specified value */
|
||||
NotIncludes(value): IExpression;
|
||||
/** Checks a condition against every item in the multi lookup value */
|
||||
IncludesSuchItemThat(): ILookupFieldExpression;
|
||||
/** Checks whether the field values collection is empty */
|
||||
IsNull(): IExpression;
|
||||
/** Checks whether the field values collection is not empty */
|
||||
IsNotNull(): IExpression;
|
||||
/** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().EqualTo(value)" instead. */
|
||||
Includes(value: any): IExpression;
|
||||
/** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().NotEqualTo(value)" instead. */
|
||||
NotIncludes(value: any): IExpression;
|
||||
/** DEPRECATED: "Eq" operation in CAML works exactly the same as "Includes". To avoid confusion, please use Includes. */
|
||||
EqualTo(value: any): IExpression;
|
||||
/** DEPRECATED: "Neq" operation in CAML works exactly the same as "NotIncludes". To avoid confusion, please use NotIncludes. */
|
||||
NotEqualTo(value: any): IExpression;
|
||||
}
|
||||
interface IUserMultiFieldExpression {
|
||||
/** Checks a condition against every item in the multi lookup value */
|
||||
IncludesSuchItemThat(): IUserFieldExpression;
|
||||
/** Checks whether the field values collection is empty */
|
||||
IsNull(): IExpression;
|
||||
/** Checks whether the field values collection is not empty */
|
||||
IsNotNull(): IExpression;
|
||||
/** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().EqualTo(value)" instead. */
|
||||
Includes(value: any): IExpression;
|
||||
/** DEPRECATED: use "IncludesSuchItemThat().ValueAsText().NotEqualTo(value)" instead. */
|
||||
NotIncludes(value: any): IExpression;
|
||||
/** DEPRECATED: "Eq" operation in CAML works exactly the same as "Includes". To avoid confusion, please use Includes. */
|
||||
EqualTo(value: any): IExpression;
|
||||
/** DEPRECATED: "Neq" operation in CAML works exactly the same as "NotIncludes". To avoid confusion, please use NotIncludes. */
|
||||
NotEqualTo(value: any): IExpression;
|
||||
}
|
||||
enum DateRangesOverlapType {
|
||||
/** Returns events for today */
|
||||
Now,
|
||||
Now = 0,
|
||||
/** Returns events for one day, specified by CalendarDate in QueryOptions */
|
||||
Day,
|
||||
Day = 1,
|
||||
/** Returns events for one week, specified by CalendarDate in QueryOptions */
|
||||
Week,
|
||||
Week = 2,
|
||||
/** Returns events for one month, specified by CalendarDate in QueryOptions.
|
||||
Caution: usually also returns few days from previous and next months */
|
||||
Month,
|
||||
Month = 3,
|
||||
/** Returns events for one year, specified by CalendarDate in QueryOptions */
|
||||
Year,
|
||||
Year = 4,
|
||||
}
|
||||
class Internal {
|
||||
static createView(): IView;
|
||||
static createView(viewFields?: string[]): IView;
|
||||
static createWhere(): IFieldExpression;
|
||||
static createExpression(): IFieldExpression;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
/// <reference path="canvasjs.d.ts" />
|
||||
|
||||
module CanvasJS.Tests {
|
||||
// Column Chart
|
||||
var columnChart = new CanvasJS.Chart("chartContainer",
|
||||
{
|
||||
title: {
|
||||
text: "Top Oil Reserves",
|
||||
},
|
||||
axisY: {
|
||||
title: "Reserves(MMbbl)"
|
||||
},
|
||||
legend: {
|
||||
verticalAlign: "bottom",
|
||||
horizontalAlign: "center"
|
||||
},
|
||||
theme: "theme2",
|
||||
data: [
|
||||
{
|
||||
type: "column",
|
||||
showInLegend: true,
|
||||
legendMarkerColor: "grey",
|
||||
legendText: "MMbbl = one million barrels",
|
||||
dataPoints: [
|
||||
{ y: 297571, label: "Venezuela" },
|
||||
{ y: 267017, label: "Saudi" },
|
||||
{ y: 175200, label: "Canada" },
|
||||
{ y: 154580, label: "Iran" },
|
||||
{ y: 116000, label: "Russia" },
|
||||
{ y: 97800, label: "UAE" },
|
||||
{ y: 20682, label: "US" },
|
||||
{ y: 20350, label: "China" }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
columnChart.render();
|
||||
|
||||
// Line Chart
|
||||
var lineChart = new CanvasJS.Chart("chartContainer",
|
||||
{
|
||||
theme: "theme2",
|
||||
title: {
|
||||
text: "Earthquakes - per month"
|
||||
},
|
||||
axisX: {
|
||||
valueFormatString: "MMM",
|
||||
interval: 1,
|
||||
intervalType: "month"
|
||||
|
||||
},
|
||||
axisY: {
|
||||
includeZero: false
|
||||
|
||||
},
|
||||
data: [
|
||||
{
|
||||
type: "line",
|
||||
//lineThickness: 3,
|
||||
dataPoints: [
|
||||
{ x: new Date(2012, 0, 1), y: 450 },
|
||||
{ x: new Date(2012, 1, 1), y: 414 },
|
||||
{ x: new Date(2012, 2, 1), y: 520, indexLabel: "highest", markerColor: "red", markerType: "triangle" },
|
||||
{ x: new Date(2012, 3, 1), y: 460 },
|
||||
{ x: new Date(2012, 4, 1), y: 450 },
|
||||
{ x: new Date(2012, 5, 1), y: 500 },
|
||||
{ x: new Date(2012, 6, 1), y: 480 },
|
||||
{ x: new Date(2012, 7, 1), y: 480 },
|
||||
{ x: new Date(2012, 8, 1), y: 410, indexLabel: "lowest", markerColor: "DarkSlateGrey", markerType: "cross" },
|
||||
{ x: new Date(2012, 9, 1), y: 500 },
|
||||
{ x: new Date(2012, 10, 1), y: 480 },
|
||||
{ x: new Date(2012, 11, 1), y: 510 }
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
});
|
||||
lineChart.render();
|
||||
|
||||
// Spline Chart
|
||||
var splineChart = new CanvasJS.Chart("chartContainer",
|
||||
{
|
||||
theme: "theme2",
|
||||
title: {
|
||||
text: "Game of Thrones, Viewers of the first airing on HBO"
|
||||
},
|
||||
axisY: {
|
||||
includeZero: false,
|
||||
// suffix: " k",
|
||||
valueFormatString: "#,,.",
|
||||
suffix: " mn"
|
||||
},
|
||||
toolTip: {
|
||||
shared: true
|
||||
},
|
||||
data: [
|
||||
{
|
||||
type: "spline",
|
||||
showInLegend: true,
|
||||
name: "Season 2",
|
||||
// markerSize: 0,
|
||||
// color: "rgba(54,158,173,.6)",
|
||||
dataPoints: [
|
||||
{ label: "Ep. 1", y: 3858000 },
|
||||
{ label: "Ep. 2", y: 3759000 },
|
||||
{ label: "Ep. 3", y: 3766000 },
|
||||
{ label: "Ep. 4", y: 3654000 },
|
||||
{ label: "Ep. 5", y: 3903000 },
|
||||
{ label: "Ep. 6", y: 3879000 },
|
||||
{ label: "Ep. 7", y: 3694000 },
|
||||
{ label: "Ep. 8", y: 3864000 },
|
||||
{ label: "Ep. 9", y: 3384000 },
|
||||
{ label: "Ep. 10", y: 4200000 }
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "spline",
|
||||
showInLegend: true,
|
||||
// markerSize: 0,
|
||||
name: "Season 1",
|
||||
dataPoints: [
|
||||
{ label: "Ep. 1", y: 2220000 },
|
||||
{ label: "Ep. 2", y: 2200000 },
|
||||
{ label: "Ep. 3", y: 2440000 },
|
||||
{ label: "Ep. 4", y: 2450000 },
|
||||
{ label: "Ep. 5", y: 2580000 },
|
||||
{ label: "Ep. 6", y: 2440000 },
|
||||
{ label: "Ep. 7", y: 2400000 },
|
||||
{ label: "Ep. 8", y: 2720000 },
|
||||
{ label: "Ep. 9", y: 2660000 },
|
||||
{ label: "Ep. 10", y: 3040000 }
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
legend: {
|
||||
cursor: "pointer",
|
||||
itemclick: function (e) {
|
||||
if (typeof (e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
|
||||
e.dataSeries.visible = false;
|
||||
}
|
||||
else {
|
||||
e.dataSeries.visible = true;
|
||||
}
|
||||
splineChart.render();
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
splineChart.render();
|
||||
|
||||
// Bar Chart
|
||||
var barChart = new CanvasJS.Chart("chartContainer", {
|
||||
|
||||
title: {
|
||||
text: "Fortune Global 500 Companies by Country"
|
||||
},
|
||||
axisX: {
|
||||
interval: 1,
|
||||
gridThickness: 0,
|
||||
labelFontSize: 10,
|
||||
labelFontStyle: "normal",
|
||||
labelFontWeight: "normal",
|
||||
labelFontFamily: "Lucida Sans Unicode"
|
||||
},
|
||||
axisY: {
|
||||
interlacedColor: "rgba(1,77,101,.2)",
|
||||
gridColor: "rgba(1,77,101,.1)"
|
||||
},
|
||||
data: [
|
||||
{
|
||||
type: "bar",
|
||||
name: "companies",
|
||||
axisYType: "secondary",
|
||||
color: "#014D65",
|
||||
dataPoints: [
|
||||
{ y: 5, label: "Sweden" },
|
||||
{ y: 6, label: "Taiwan" },
|
||||
{ y: 7, label: "Russia" },
|
||||
{ y: 8, label: "Spain" },
|
||||
{ y: 8, label: "Brazil" },
|
||||
{ y: 8, label: "India" },
|
||||
{ y: 9, label: "Italy" },
|
||||
{ y: 9, label: "Australia" },
|
||||
{ y: 12, label: "Canada" },
|
||||
{ y: 13, label: "South Korea" },
|
||||
{ y: 13, label: "Netherlands" },
|
||||
{ y: 15, label: "Switzerland" },
|
||||
{ y: 28, label: "Britain" },
|
||||
{ y: 32, label: "Germany" },
|
||||
{ y: 32, label: "France" },
|
||||
{ y: 68, label: "Japan" },
|
||||
{ y: 73, label: "China" },
|
||||
{ y: 132, label: "US" }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
barChart.render();
|
||||
|
||||
// Pie Chart
|
||||
var pieChart = new CanvasJS.Chart("chartContainer",
|
||||
{
|
||||
title: {
|
||||
text: "Desktop Search Engine Market Share, Dec-2012"
|
||||
},
|
||||
legend: {
|
||||
verticalAlign: "center",
|
||||
horizontalAlign: "left",
|
||||
fontSize: 20,
|
||||
fontFamily: "Helvetica"
|
||||
},
|
||||
theme: "theme2",
|
||||
data: [
|
||||
{
|
||||
type: "pie",
|
||||
indexLabelFontFamily: "Garamond",
|
||||
indexLabelFontSize: 20,
|
||||
indexLabel: "{label} {y}%",
|
||||
startAngle: -20,
|
||||
showInLegend: true,
|
||||
toolTipContent: "{legendText} {y}%",
|
||||
dataPoints: [
|
||||
{ y: 83.24, legendText: "Google", label: "Google" },
|
||||
{ y: 8.16, legendText: "Yahoo!", label: "Yahoo!" },
|
||||
{ y: 4.67, legendText: "Bing", label: "Bing" },
|
||||
{ y: 1.67, legendText: "Baidu", label: "Baidu" },
|
||||
{ y: 0.98, legendText: "Others", label: "Others" }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
pieChart.render();
|
||||
|
||||
addColorSet("MyColorSet", [
|
||||
"123456",
|
||||
"blue",
|
||||
"red",
|
||||
"orange"
|
||||
]);
|
||||
|
||||
addCultureInfo("js", {
|
||||
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
||||
});
|
||||
}
|
||||
Vendored
+959
@@ -0,0 +1,959 @@
|
||||
// Type definitions for CanvasJS v1.5.1 GA
|
||||
// Project: http://canvasjs.com/
|
||||
// Definitions by: Mark Overholt <https://github.com/mover5>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module CanvasJS {
|
||||
class Chart {
|
||||
|
||||
/**
|
||||
* The current options of the chart.
|
||||
*/
|
||||
options: ChartOptions;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of CanvasJS Chart.
|
||||
* @param containerId the DOM ID of the location where the chart is to be rendered
|
||||
* @param options the options used to render the chart
|
||||
*/
|
||||
constructor(containerId: string, options?: ChartOptions);
|
||||
|
||||
/**
|
||||
* Renders the chart.
|
||||
* @param options an optional set of options that will override the constructed values.
|
||||
*/
|
||||
render(options?: ChartOptions): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new chart color set
|
||||
* @param the name of the color set
|
||||
* @param an array of colors.
|
||||
*/
|
||||
function addColorSet(colorSetName: string, colorSetArray: string[]): void;
|
||||
|
||||
|
||||
/**
|
||||
* Adds a new culture info for your chart
|
||||
* @param culture the name of the culture
|
||||
* @param the information used by this culture
|
||||
*/
|
||||
function addCultureInfo(culture: string, info: CultureInfo): void;
|
||||
|
||||
interface CultureInfo {
|
||||
/**
|
||||
* Character used to separate fractional part from the whole number.
|
||||
*/
|
||||
decimalSeparator?: string;
|
||||
/**
|
||||
* Also referred to as Thousand Separator
|
||||
*/
|
||||
digitGroupSeparator?: string;
|
||||
/**
|
||||
* Text is shown inside the Button till v1.4
|
||||
* v1.5 onwards Text is shown as tooltip.
|
||||
*/
|
||||
zoomText?: string;
|
||||
/**
|
||||
* Text is shown inside the Button till v1.4
|
||||
* v1.5 onwards Text is shown as tooltip.
|
||||
*/
|
||||
panText?: string;
|
||||
/**
|
||||
* Text is shown inside the Button till v1.4
|
||||
* v1.5 onwards Text is shown as tooltip.
|
||||
*/
|
||||
resetText?: string;
|
||||
/**
|
||||
* Set text is shown instead of Save as PNG.
|
||||
*/
|
||||
savePNGText?: string;
|
||||
/**
|
||||
* Set text is shown instead of Save as JPG.
|
||||
*/
|
||||
saveJPGText?: string;
|
||||
/**
|
||||
* Tool Tip for Menu Button.
|
||||
*/
|
||||
menuText?: string;
|
||||
/**
|
||||
* Day names starting from Sunday. Should be exactly 7 in total.
|
||||
*/
|
||||
days?: string[];
|
||||
/**
|
||||
* Short Day names starting from Sunday. Should be exactly 7 in total.
|
||||
*/
|
||||
shortDays?: string[];
|
||||
/**
|
||||
* Month Names starting from January
|
||||
*/
|
||||
months?: string[];
|
||||
/**
|
||||
* Short Month Names starting from January
|
||||
*/
|
||||
shortMonths?: string[];
|
||||
}
|
||||
|
||||
interface ChartOptions {
|
||||
/**
|
||||
* Enables / Disables Chart interactivity like toolTip, mouse and touch events
|
||||
* Default: true
|
||||
* Example: false, true
|
||||
*/
|
||||
interactivityEnabled?: boolean;
|
||||
/**
|
||||
* Enables Animation while rendering the Chart.
|
||||
* Default: true
|
||||
* Example: false, true
|
||||
*/
|
||||
animationEnabled?: boolean;
|
||||
/**
|
||||
* While exporting any chart, “Chart” is used as the default fine name with corresponding extension “jpg” or “png”. You can override this name using exportFileName property.
|
||||
* Default: Chart
|
||||
*/
|
||||
exportFileName?: string;
|
||||
/**
|
||||
* Setting exportEnabled to true enables the export feature. As of now JPG & PNG formats are supported. Export feature is available in all Chart Types.
|
||||
* Default: false
|
||||
* Options: true, false
|
||||
*/
|
||||
exportEnabled?: boolean;
|
||||
/**
|
||||
* Setting zoomEnabled to true enables zooming and panning feature of Chart. This way you can zoom into an area of interest when there is a large amount of data. This will also allow you to pan through the chart. If not set, the property is automatically enabled for large number of dataPoints. You can switch between zooming & panning using the toolbar that appears on the chart. After Zooming in, you can reset the chart by clicking the reset button.
|
||||
* Default: false
|
||||
* Options: true, false
|
||||
*/
|
||||
zoomEnabled?: boolean;
|
||||
/**
|
||||
* Sets the theme of the Chart. Various predefined themes are bundled along with the library. User can easily switch these themes by changing theme property to the below mentioned options.
|
||||
* Default: “theme1″
|
||||
* Options: “theme1″,”theme2″, “theme3″
|
||||
*/
|
||||
theme?: string;
|
||||
/**
|
||||
* Sets the background color of entire Chart Area. Values can be “HTML Color Name”, “hex code” or “rgba values”
|
||||
* Default: “white”
|
||||
* Example: “yellow”, “#F5DEB3″..
|
||||
*/
|
||||
backgroundColor?: string;
|
||||
/**
|
||||
* Sets the colorSet of the Chart. Color Set is an array of colors that are used to render data. Various predefined Color Sets are bundled along with the library. You can either choose from the pre-defined Color Sets or define your own Color Set.
|
||||
* Default: “colorset1″ or as defined in the selected theme
|
||||
* Example: “colorSet1″, “colorSet2″, “colorSet3″
|
||||
*/
|
||||
colorSet?: string;
|
||||
/**
|
||||
* CanvasJS allows you to localize various culture / language / country specific elements in the Chart like number formatting style – where you can choose which character to use as a decimal separator and as a digit group separator (also referred to as a thousand separator). By default CanvasJS is set to Neutral English Culture – “en”.
|
||||
* Default: “en”
|
||||
*/
|
||||
culture?: string;
|
||||
/**
|
||||
* Sets the width of the Chart.
|
||||
* Default: Takes chart container’s width by default. If the width is not set for the chart container, defaults to 500.
|
||||
* Example: 380, 500, 720
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* Sets the width of the Chart
|
||||
* Default: Takes chart container’s height by default. If the height is not set for the chart container, defaults to 400.
|
||||
* Example: 260, 300, 400
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Title allows you to set content, appearance and position of Chart’s Title.
|
||||
*/
|
||||
title: ChartTitleOptions;
|
||||
/**
|
||||
* Whenever the chart contains multiple dataSeries, it is recommended to represent each dataSeries in a legend. This way it becomes easier for the user to know what exactly is represented by each of the dataSeries. In case of Pie and Doughnut charts, an entry is created for each dataPoint and in rest of the chart types entries are created for each dataSeries.
|
||||
* You can selectively show or hide a dataSeries in the Legend using showInLegend property of dataSeries.
|
||||
*/
|
||||
legend?: ChartLegendOptions;
|
||||
/**
|
||||
* axisX object lets you set various parameters of X Axis like interval, grid lines, etc. It is mostly horizontal, except when we are working with Bar Charts, where axisX is vertical.
|
||||
*/
|
||||
axisX?: ChartAxisXOptions;
|
||||
/**
|
||||
* axisY object lets you set various parameters of Y Axis like interval, grid lines, etc. It is mostly vertical, except when we are working with Bar Charts, where axisY is horizontal.
|
||||
*/
|
||||
axisY?: ChartAxisYOptions;
|
||||
/**
|
||||
* toolTip object lets user set behaviour of toolTip at global level like enabling/disabling animation, setting Border Color, sharing toolTip between multiple dataSeries, etc. You can also disable the toolTip by setting enabled property to false.
|
||||
*/
|
||||
toolTip?: ChartToolTipOptions;
|
||||
/**
|
||||
* data is an array of dataSeries Objects.
|
||||
*/
|
||||
data: ChartDataOptions[];
|
||||
}
|
||||
|
||||
interface ChartTitleOptions {
|
||||
/**
|
||||
* Sets the Title’s text.
|
||||
* Default: null
|
||||
* Example: “Chart title”
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* This property lets you align the Chart Title vertically.
|
||||
* Default: “top”
|
||||
* Options: “top”, “center”, “bottom”
|
||||
*/
|
||||
verticalAlign?: string;
|
||||
/**
|
||||
* This property lets you align the Chart Title horizontally.
|
||||
* Default: “center”
|
||||
* Options: “left”, “right”, “center”
|
||||
*/
|
||||
horizontalAlign?: string;
|
||||
/**
|
||||
* Sets the font Size of Chart Title in pixels.
|
||||
* Default: Automatically Calculated based on Chart Size
|
||||
* Example: 16,18,22 ..
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the Font Family of Chart Title.
|
||||
* Default: “Calibri, Optima, Candara, Verdana, Geneva, sans-serif”
|
||||
* Example: “arial” , “tahoma”, “verdana” ..
|
||||
*/
|
||||
fontFamily?: string;
|
||||
/**
|
||||
* Sets the Font Weight used in the Chart Title.
|
||||
* Default: “bold”
|
||||
* Options: “lighter”, “normal”, “bold” , “bolder”
|
||||
*/
|
||||
fontWeight?: string;
|
||||
/**
|
||||
* Sets the font color of Chart Title. The value of fontColor can be a “HTML Color Name” or “hex” code .
|
||||
* Default: “#3A3A3A”
|
||||
* Example: “red”, “#FAC003″ ..
|
||||
*/
|
||||
fontColor?: string;
|
||||
/**
|
||||
* Sets the fontStyle of Chart Title. fontStyle can be set to one of the below options.
|
||||
* Default: “normal”
|
||||
* Options: “normal”, “italic” , “oblique”
|
||||
*/
|
||||
fontStyle?: string;
|
||||
/**
|
||||
* Sets the thickness of border around the Title in pixels. To display border around title, set the borderThickness to a number greater than zero.
|
||||
* Default: 0
|
||||
* Example: 2,4 ..
|
||||
*/
|
||||
borderThickness?: number;
|
||||
/**
|
||||
* To display rounded borders around the title, set the cornerRadius of title. Higher the value, more rounded are the corners.
|
||||
* Default: 0
|
||||
* Options: 5,8 ..
|
||||
*/
|
||||
cornerRadius?: number;
|
||||
/**
|
||||
* Sets the color of border around Chart Title. Values of borderColor can be “HTML Color Name” or “hex” code .
|
||||
* Default: “black”
|
||||
* Example: “red”, “#FF0000″ ..
|
||||
*/
|
||||
borderColor?: string;
|
||||
/**
|
||||
* Sets the background color of Chart Title. Values can be “HTML Color Name” or “hex” code.
|
||||
* Default: null
|
||||
* Example: “red”, “#FF0000″ ..
|
||||
*/
|
||||
backgroundColor?: string;
|
||||
/**
|
||||
* This property lets you set margin around the Chart Title in pixels.
|
||||
* Default: 10
|
||||
* Example: 4,12 ..
|
||||
*/
|
||||
margin?: number;
|
||||
/**
|
||||
* This property allows you to set the padding for Chart Title
|
||||
* Default: 0
|
||||
* Example: 5, 8 ..
|
||||
*/
|
||||
padding?: number;
|
||||
}
|
||||
|
||||
interface ChartLegendOptions {
|
||||
/**
|
||||
* Sets the font Size of Legend Text in pixels.
|
||||
* Default: 12
|
||||
* Example: 16,18,22 ..
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Sets the Font Family of Legend Text.
|
||||
* Default: “calibri”
|
||||
* Example: “arial” , “tahoma”, “verdana” ..
|
||||
*/
|
||||
fontFamily?: string;
|
||||
/**
|
||||
* Sets the font color of Legend Text . The value of fontColor can be a “HTML Color Name” or “hex” code .
|
||||
* Default: “black”
|
||||
* Example: “red”, “#FAC003″ ..
|
||||
*/
|
||||
fontColor?: string;
|
||||
/**
|
||||
* Sets the Font Weight of Legend Text.
|
||||
* Default: “normal”
|
||||
* Example: “lighter”, “normal”, “bold” , “bolder”
|
||||
*/
|
||||
fontWeight?: string;
|
||||
/**
|
||||
* Sets the fontStyle of Legend Text. fontStyle can be set to one of the below options.
|
||||
* Default: “normal”
|
||||
* Example: “normal”, “italic” , “oblique”
|
||||
*/
|
||||
fontStyle?: string;
|
||||
/**
|
||||
* This property lets you align the Legend Position vertically.
|
||||
* Default: “bottom”
|
||||
* Example: “top”, “center”, “bottom”
|
||||
*/
|
||||
verticalAlign?: string;
|
||||
/**
|
||||
* This property lets you align the Legend Position horizontally.
|
||||
* Default: “right”
|
||||
* Example: “left”, “right”, “center”
|
||||
*/
|
||||
horizontalAlign?: string;
|
||||
/**
|
||||
* Sets the mouseover event handler for the legend, which is triggered when the user moves the mouse(input device) over a legend item. After the event is triggered, the event related data is passed as a parameter to the assigned event handler. Parameters passed to the function are shown in the Event Object section below.
|
||||
* @param event a chart event
|
||||
*/
|
||||
itemmouseover?: (event: ChartEvent) => void;
|
||||
/**
|
||||
* Sets the mousemove event handler for the legend, which is triggered when the user moves the mouse(input device) within a legend item. When the event is triggered, the event related data is passed as a parameter to the assigned event handler. Parameters passed to the function are shown in the Event Object section below.
|
||||
* @param event a chart event
|
||||
*/
|
||||
itemmousemove?: (event: ChartEvent) => void;
|
||||
/**
|
||||
* Sets the mouseout event handler for the legend, which is triggered when the user moves the mouse pointer outside a legend item. After the event is triggered, the event related data is passed as a parameter to the assigned event handler. Parameters passed to the function are shown in the Event Object section below.
|
||||
* @param event a chart event
|
||||
*/
|
||||
itemmouseout?: (event: ChartEvent) => void;
|
||||
/**
|
||||
* Sets the click event handler for the legend, which is triggered when the user clicks on a legend item. After the event is triggered, the event related data is passed as a parameter to the assigned event handler. Parameters passed to the function are shown in the Event Object section below.
|
||||
* @param event a chart event
|
||||
*/
|
||||
itemclick?: (event: ChartEvent) => void;
|
||||
}
|
||||
|
||||
interface ChartEvent {
|
||||
/**
|
||||
* The x value of the item
|
||||
*/
|
||||
x: any;
|
||||
/**
|
||||
* The y value of the item
|
||||
*/
|
||||
y: number;
|
||||
/**
|
||||
* The chart object
|
||||
*/
|
||||
chart: Chart;
|
||||
/**
|
||||
* The datapoint options
|
||||
*/
|
||||
dataPoint: ChartDataPoint;
|
||||
/**
|
||||
* The data series options
|
||||
*/
|
||||
dataSeries: ChartDataOptions;
|
||||
/**
|
||||
* The index of the data point
|
||||
*/
|
||||
dataPointIndex: number;
|
||||
/**
|
||||
* The index of the data series
|
||||
*/
|
||||
dataSeriesIndex: number;
|
||||
}
|
||||
|
||||
interface ChartAxisXOptions {
|
||||
/**
|
||||
* Sets the Axis Title.
|
||||
* Default: null
|
||||
* Example: “Axis X Title”
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Sets the Font Color of Axis Title. The value of titleFontColor can be a “HTML Color Name” or “hex” code .
|
||||
* Default: “#666666″
|
||||
* Example: “red”, “#006400″ .
|
||||
*/
|
||||
titleFontColor?: string;
|
||||
/**
|
||||
* Sets the Font Size of Axis Title in pixels.
|
||||
* Default: Automatically Calculated based on Chart Size
|
||||
* Example: 16, 25 ..
|
||||
*/
|
||||
titleFontSize?: number;
|
||||
/**
|
||||
* Sets the Font Family of Axis Title.
|
||||
* Default: “Calibri, Optima, Candara, Verdana, Geneva, sans-serif”
|
||||
* Example: “calibri”, “tahoma, “verdana” ..
|
||||
*/
|
||||
titleFontFamily?: string;
|
||||
/**
|
||||
* Sets the Font Weight used in the Axis Title. It can be set to one of the options below.
|
||||
* Default: “normal”
|
||||
* Options: “lighter”, “normal”, “bold” , “bolder”
|
||||
*/
|
||||
titleFontWeight?: string;
|
||||
/**
|
||||
* Sets the Font Style of Axis Title. It can be set to one of the below options.
|
||||
* Default: “normal”
|
||||
* Options: “normal”, “italic” , “oblique”
|
||||
*/
|
||||
titleFontStyle?: string;
|
||||
/**
|
||||
* This property lets you set margin between chart’s boundary and Axis.
|
||||
* Default: 2
|
||||
* Example: 8, 10..
|
||||
*/
|
||||
margin?: number;
|
||||
/**
|
||||
* Sets the angle for Axis Labels.
|
||||
* Default: null
|
||||
* Example: 20, 45, -30 ..
|
||||
*/
|
||||
labelAngle?: number;
|
||||
/**
|
||||
* Sets the Axis Label color. The value of labelFontColor can be a “HTML Color Name” or “hex” code .
|
||||
* Default: “grey”
|
||||
* Example: “red”, “#FAC003″ ..
|
||||
*/
|
||||
labelFontColor?: string;
|
||||
/**
|
||||
* Sets the Axis Label Font Size in pixels.
|
||||
* Default: Automatically Calculated based on Chart Size
|
||||
* Example: 16, 18, 22..
|
||||
*/
|
||||
labelFontSize?: number;
|
||||
/**
|
||||
* Sets the Font Family of Axis labels.
|
||||
* Default: “Calibri, Optima, Candara, Verdana, Geneva, sans-serif”
|
||||
* Example: “calibri”, “tahoma”, “verdana” ..
|
||||
*/
|
||||
labelFontFamily?: string;
|
||||
/**
|
||||
* Set the font Weight used in Axis Labels. It can be set to one of the options below.
|
||||
* Default: “normal”
|
||||
* Options: “lighter”, “normal”, “bold” , “bolder”
|
||||
*/
|
||||
labelFontWeight?: string;
|
||||
/**
|
||||
* Sets the Font Style of Axis Labels. It can be set to one of the below options.
|
||||
* Default: “normal”
|
||||
* Options: “italic”, “oblique”, “normal”
|
||||
*/
|
||||
labelFontStyle?: string;
|
||||
/**
|
||||
* A string that prepends all the labels on axisX.
|
||||
* Default: null
|
||||
* Example: “$”,”cat”..
|
||||
*/
|
||||
prefix?: string;
|
||||
/**
|
||||
* A string that appends all the labels on axisX.
|
||||
* Default: null
|
||||
* Example: “$”,”cat”..
|
||||
*/
|
||||
suffix?: string;
|
||||
/**
|
||||
* Defines how values must be formatted before they appear on Axis X. You can format numbers and date time values using this property. Below you will find descriptive table explaining various specifiers with example.
|
||||
*/
|
||||
valueFormatString?: string;
|
||||
/**
|
||||
* Sets the minimum value of Axis. Values smaller than minimum are clipped.
|
||||
* Default: Automatically Calculated based on the data
|
||||
* Example: 100, 350..
|
||||
*/
|
||||
minimum?: number;
|
||||
/**
|
||||
* Sets the maximum value permitted on Axis. Values greater than maximum are clipped.
|
||||
* Default: Automatically Calculated based on the data
|
||||
* Example: 100, 350..
|
||||
*/
|
||||
maximum?: number;
|
||||
/**
|
||||
* Sets the distance between Tick Marks, Grid Lines and Interlaced Colors.
|
||||
* Default: Automatically Calculated
|
||||
* Example: 50, 75..
|
||||
*/
|
||||
interval?: number;
|
||||
/**
|
||||
* intervalType is the unit of interval property. intervalType is by default set to “number” and hence you need to specify the interval type (eg “week”, “month”, etc) depending on the type of interval you intend to set. If required interval is 3 months, you need to provide interval as 3 and intervalType as “month”
|
||||
* Default: Automatically handled when interval property is not set. Defaults to “number” when you set the interval.
|
||||
* Option: “number”,”millisecond” ,”second”,” minute”, “hour”, “day”, “month” ,”year”
|
||||
* Example: for interval as 15 minutes, set interval as 15, and set intervalType as “minute”,
|
||||
*/
|
||||
intervalType?: string;
|
||||
/**
|
||||
* Sets the length of Tick Marks that are drawn on the Axis.
|
||||
* Default: 5
|
||||
* Example: 10, 14..
|
||||
*/
|
||||
tickLength?: number;
|
||||
/**
|
||||
* Sets the color of Tick Marks drawn on the axis. The value of tickColor can be a “HTML Color Name” or “hex” code .
|
||||
* Default: “#BBBBBB”
|
||||
* Example: “red”, “#006400″.
|
||||
*/
|
||||
tickColor?: string;
|
||||
/**
|
||||
* Sets the thickness of the Tick Marks in pixels.
|
||||
* Default: 2
|
||||
* Example: 3, 4..
|
||||
*/
|
||||
tickThickness?: number;
|
||||
/**
|
||||
* Sets the color of Axis line. Axis line color can be a “HTML Color Name” or “hex” code .
|
||||
* Default: “#BBBBBB”
|
||||
* Example: “blue”,”#21AB13″..
|
||||
*/
|
||||
lineColor?: string;
|
||||
/**
|
||||
* Sets the Thickness of Axis line in pixels.
|
||||
* Default: 2
|
||||
* Example: 2, 4..
|
||||
*/
|
||||
lineThickness?: string;
|
||||
/**
|
||||
* Sets the Interlacing Color that alternates between the set interval. If the interval is not set explicitly, then the auto calculated interval is considered. The value of interlacedColor can be a “HTML Color Name” or “hex” code .
|
||||
* Default: null
|
||||
* Example: “#F8F1E4″, “#FEFDDF” ….
|
||||
*/
|
||||
interlaceColor?: string;
|
||||
/**
|
||||
* Sets the Thickness of Grid Lines. To display grid on Axis X, set the Grid Thickness to a number greater than zero.
|
||||
* Default: 0
|
||||
* Example: 2,4 ..
|
||||
*/
|
||||
gridThickness?: number;
|
||||
/**
|
||||
* Sets the Color of Grid Lines. Value of gridColor can be a “HTML Color Name” or “hex” code .
|
||||
* Default: “#BBBBBB”
|
||||
* Example: “red”, “#FEFDDF” ..
|
||||
*/
|
||||
gridColor?: string;
|
||||
/**
|
||||
* Strip Lines are vertical or horizontal lines used to highlight/mark a certain region on the plot area. You can choose whether to draw a line at a specific position or shade a region on the plot area. Strip Lines are sometimes referred to as trend lines.
|
||||
* If you want to just mark a certain position on the axis, you can set the value attribute and it’ll draw a line at that position with the set thickness. If you want to shade a region instead, you need to set startValue and endValue attributes. This will fill the area within the specified range.
|
||||
* In the case you set startValue and endValue attributes, value and thickness attributes are ignored (as either a single thread of line can exist, or a shaded region between two given points).
|
||||
* Strip Lines can be displayed using AxisX or AxisY’s stripLines array. This allows you to have one or more strip lines on both x & y axis.
|
||||
*/
|
||||
stripLines?: ChartStripLines;
|
||||
}
|
||||
|
||||
interface ChartStripLines {
|
||||
/**
|
||||
* Sets the point where the stripLine has to be plotted or drawn along the axis X.
|
||||
* Default: null
|
||||
* Example: 20,30,100,50
|
||||
*/
|
||||
value?: number;
|
||||
/**
|
||||
* Sets the point where the stripLine’s shaded region begins on the x-axis.
|
||||
* Default: null
|
||||
* Example: 20,30,100,50
|
||||
*/
|
||||
startValue?: number;
|
||||
/**
|
||||
* Sets the point where the stripLine’s shaded region ends on the x-axis.
|
||||
* Default: null
|
||||
* Example: 50,60,200,300
|
||||
*/
|
||||
endValue?: number;
|
||||
/**
|
||||
* Sets the thickness of the stripLine in pixels.
|
||||
* Default: 2
|
||||
* Example: 2,4,5,6
|
||||
*/
|
||||
thickness?: number;
|
||||
/**
|
||||
* Sets the color of the stripLine.
|
||||
* Default: “orange”
|
||||
* Example: “green”, “#23EA23″
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* Sets the label of the stripLine. These are shown on top of axis labels.
|
||||
* Default: “” (empty string)
|
||||
* Example: “Threshold”, “Deaths in 1920″
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* Sets the background color of stripLine’s label.
|
||||
* Default: “#eeeeee”
|
||||
* Example: “red”,”#fabd76″
|
||||
*/
|
||||
labelBackgroundColor?: string;
|
||||
/**
|
||||
* Sets the font-family of stripLine’s label. If the first font is not found in the system from the specified font-family list, it tries to use the next font in the list.
|
||||
* Default: “arial”
|
||||
* Example: “Arial, Trebuchet MS, Tahoma, sans-serif”
|
||||
*/
|
||||
labelFontFamily?: string;
|
||||
/**
|
||||
* Sets the font color of label.
|
||||
* Default: “orange”
|
||||
* Example: “blue”,”#4135e9″
|
||||
*/
|
||||
labelFontColor?: string;
|
||||
/**
|
||||
* Sets the font size of the label in pixels.
|
||||
* Default: 12
|
||||
* Example: 18,19,20,22
|
||||
*/
|
||||
labelFontSize?: number;
|
||||
/**
|
||||
* Sets the font weight of stripLine’s label.
|
||||
* Default: “normal”
|
||||
* Example: “lighter”,”normal”,”bold”,”bolder”
|
||||
*/
|
||||
labelFontWeight?: string;
|
||||
/**
|
||||
* Sets the font style of stripLine’s label.
|
||||
* Default: “normal”
|
||||
* Example: “normal”,”italic”,”oblique”
|
||||
*/
|
||||
labelFontStyle?: string;
|
||||
}
|
||||
|
||||
interface ChartAxisYOptions extends ChartAxisXOptions {
|
||||
/**
|
||||
* When includeZero is set to true, axisY sets the range in such a way that Zero is a part of it. It is set to true by default. But, whenever y values are very big and difference among dataPoints are hard to judge, setting includeZero to false makes axisY to set a range that makes the differences prominently visible.
|
||||
* Default: true
|
||||
* Example: true, false
|
||||
*/
|
||||
includeZero?: boolean;
|
||||
}
|
||||
|
||||
interface ChartToolTipOptions {
|
||||
/**
|
||||
* Enables or Disables the toolTip for the chart.
|
||||
* Default: True
|
||||
* Example: True, False
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* In a Multi-Series or a Combination Chart, it is often required to display all values common to x value in a single bubble. Setting shared to true will show in a common bubble all the values of y from each series next to their name.
|
||||
* Default: True
|
||||
* Example: True, False
|
||||
*/
|
||||
shared?: boolean;
|
||||
/**
|
||||
* toolTip for entire chart can be set by adding content at toolTip object. content can either be a string or a custom function that returns HTML/String to be displayed inside the toolTip.
|
||||
* Default: auto
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* While mouse hovers from one dataPoint to another there is a smooth transition in toolTip. This effect can be controlled by animationEnabled Property. Setting it to false, will disable the animation and toolTip will directly switch from one dataPoint to the other.
|
||||
* Default: True
|
||||
* Example: True, False
|
||||
*/
|
||||
animationEnabled?: boolean;
|
||||
/**
|
||||
* Sets the border color around Tool Tip. When not set it takes the color of corresponding dataSeries or dataPoint.
|
||||
* Default: dataSeries color/ dataPoint color
|
||||
* Example: “red”, “#808080″..
|
||||
*/
|
||||
borderColor?: string;
|
||||
}
|
||||
|
||||
interface ChartDataCommon {
|
||||
/**
|
||||
* Sets the dataPoint Name. dataPoint name is shown in various places like toolTip & legend unless overridden.
|
||||
* Default: Automatically Named (“dataPoint 1″, “dataPoint 2″ .. )
|
||||
* Example: “apple”, “mango” ..
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Sets the color of dataSeries. The value of tickColor can be a “HTML Color Name” or “Hex Code”.
|
||||
* Default: Automatically set from Theme.
|
||||
* Example: “red”, “green” ..
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* Instead of setting string values for all indexLabels, you can also use keywords like x, y, etc that will automatically show corresponding properties as indexLabel. This will allow you to define indexLabel at the series level once. While setting indexLabel you specify a keyword by enclosing it in flower brackets like {x}, {y}, {color}, etc.
|
||||
* Range Charts have two indexLabels – one for each y value. This requires the use of a special keyword #index to show index label on either sides of the column/bar/area.
|
||||
* eg: indexLabel: “{x}: {y[#index]}”
|
||||
* Important keywords to keep in mind are. {x}, {y}, {name}, {label}.
|
||||
* Default: null
|
||||
* Example: “{label}”, “Win”, “x: {x}, y: {y} ”
|
||||
*/
|
||||
indexLabel?: string;
|
||||
/**
|
||||
* Using this property you can define whether to render indexLabel “inside” or “outside” the dataPoint.
|
||||
* Default: “outside”
|
||||
* Example: “outside”, “inside”
|
||||
*/
|
||||
indexLabelPlacement?: string;
|
||||
/**
|
||||
* Sets the Orientation of indexLabel to “horizontal” or “vertical”.
|
||||
* Default: “horizontal”
|
||||
* Options: “horizontal”, “vertical”
|
||||
*/
|
||||
indexLabelOrientation?: string;
|
||||
/**
|
||||
* Sets the Background color of Index Labels. The value of indexLabelBackgroundColor can be a “HTML Color Name” or “Hex Code”.
|
||||
* Default: null
|
||||
* Example: “red”, “#FAC003″ ..
|
||||
*/
|
||||
indexLabelBackgroundColor?: string;
|
||||
/**
|
||||
* Sets the Index Label’s Font Style. It can be set to one of the below options.
|
||||
* Default: “normal”
|
||||
* Options: “italic”, “oblique”, “normal”
|
||||
*/
|
||||
indexLabelFontStyle?: string;
|
||||
/**
|
||||
* Sets the Index Label’s Font color. The value of IndexLabelFontColor can be a “HTML Color Name” or “Hex Code”.
|
||||
* Default: “grey”
|
||||
* Example: “red”, “#FAC003″ ..
|
||||
*/
|
||||
indexLabelFontColor?: string;
|
||||
/**
|
||||
* Sets the Index Label’s Font Size in pixels.
|
||||
* Default: 18
|
||||
* Example: 12, 16, 22..
|
||||
*/
|
||||
indexLabelFontSize?: number;
|
||||
/**
|
||||
* Sets the Index Label’s Font Family.
|
||||
* Default: “Calibri, Optima, Candara, Verdana, Geneva, sans-serif”
|
||||
* Example: “calibri”, “tahoma”, “verdana”..
|
||||
*/
|
||||
indexLabelFontFamily?: string;
|
||||
/**
|
||||
* Sets the Index Label’s Font Weight. It can be set to one of the below options.
|
||||
* Default: “normal”
|
||||
* Example: “lighter”, “normal” ,”bold” , “bolder”
|
||||
*/
|
||||
indexLabelFontWeight?: string;
|
||||
/**
|
||||
* Sets the color of line connecting index labels with their dataPoint. It is only applicable for pie and doughnut chart when indexLabelPlacment is outside. The value of indexLineColor can be a “HTML Color Name” or “Hex Code”.
|
||||
* Default: “lightgrey”
|
||||
* Example: “red”, “#FAC003″ ..
|
||||
*/
|
||||
indexLabelLineColor?: string;
|
||||
/**
|
||||
* Sets the thickness of line connecting indexLabel with its corresponding dataPoint. It is only applicable for pie and doughnut chart when indexLabelPlacement is set to “outside”.
|
||||
* Default: 2
|
||||
* Example: 4, 6
|
||||
*/
|
||||
indexLabelLineThickness?: string;
|
||||
/**
|
||||
* Default Tooltip can be modified at dataSeries or dataPoint level. You can add content to be displayed in toolTip using toolTipContent. toolTipContent set at dataPoint will override toolTipContent set at dataSeries level.
|
||||
* Default: auto set depending on chart type.
|
||||
*/
|
||||
toolTipContent?: string;
|
||||
/**
|
||||
* Sets marker type to be rendered at each dataPoint. While markers are helpful in highlighting individual dataPoints, they do not help much when the dataPoints are crowded. In case of large number of dataPoints it is recommended to disable markers in order to improve the appearance and performance of chart.
|
||||
* Same marker type is also used in legend unless overridden by legendMarkerType property.
|
||||
* Default: “circle”
|
||||
* Options: “none”, “circle”, “square”, “triangle” and “cross”
|
||||
*/
|
||||
markerType?: string;
|
||||
/**
|
||||
* Sets the color of marker that is displayed on the Chart. Legend Marker for the series uses the same Color as set here unless overridden using legendMarkerColor property.
|
||||
* Default: dataSeries Color
|
||||
* Example: “red”, “#008000″ ..
|
||||
*/
|
||||
markerColor?: string;
|
||||
/**
|
||||
* Sets the Size of the marker that is drawn. To display marker in area Chart, set markerSize to a value greater than zero. For line, scatter chart, size it is automatically set unless overridden.
|
||||
* Default: auto. Zero for area chart
|
||||
* Example: 5, 10..
|
||||
*/
|
||||
markerSize?: number;
|
||||
/**
|
||||
* Sets the border color around marker. Value of markerBorderColor can be “HTML Color Name” or “hex code”.
|
||||
* Default: dataSeries color.
|
||||
* Example: “red”, “#008000″ ..
|
||||
*/
|
||||
markerBorderColor?: string;
|
||||
/**
|
||||
* Sets the thickness of the Marker’s Border in pixels.
|
||||
* Default: 1
|
||||
* Example: 2,4 ..
|
||||
*/
|
||||
markerBorderThickness?: number;
|
||||
/**
|
||||
* Sets the text that describes the dataSeries in legend.
|
||||
* Default: “DataSeries 1″, “DataSeries 2″ ..etc
|
||||
* Example: “2010″, “2011″..
|
||||
*/
|
||||
legendText?: string;
|
||||
/**
|
||||
* Sets the Legend Marker to one of the options below. This property is used to override the default marker in legend, which is same as dataSeries Marker Type.
|
||||
* Default: same as markerType
|
||||
* Options: “circle”, “square”, “cross” and “triangle”
|
||||
*/
|
||||
legendMarkerType?: string;
|
||||
/**
|
||||
* Sets the click event handler for dataSeries which is triggered when user clicks on a dataSeries. Upon event, a parameter that contains event related data is sent to the assigned event handler. Parameter includes dataPoint and dataSeries corresponding to the event.
|
||||
* Default: null
|
||||
*/
|
||||
click?: (event: ChartEvent) => void;
|
||||
/**
|
||||
* Sets the color of marker that is displayed on legend. This property overrides default Marker’s Color in Legend, which is same as dataSeries Marker Color. Value of legendMarkerColor can be “HTML Color Name” or “hex code”.
|
||||
* Default: dataSeries marker color
|
||||
* Example: “red”, “#008000″ ..
|
||||
*/
|
||||
legendMarkerColor?: string;
|
||||
/**
|
||||
* Sets the mouseover event handler for dataSeries which is triggered when user moves Mouse Over a dataSeries. Upon event, a parameter that contains event related data is sent to the assigned event handler. Parameter includes dataPoint and dataSeries corresponding to the event.
|
||||
* Default: null
|
||||
*/
|
||||
mouseover?: (event: ChartEvent) => void;
|
||||
/**
|
||||
* Sets the mousemove event handler for dataSeries which is triggered when user Moves mouse on a dataSeries. Upon event, a parameter that contains event related data is sent to the assigned event handler. Parameter includes dataPoint and dataSeries corresponding to the event.
|
||||
* Default: null
|
||||
*/
|
||||
mousemove?: (event: ChartEvent) => void;
|
||||
/**
|
||||
* Sets the mouseout event handler for dataSeries which is triggered when user moves mouse out of a dataSeries. Upon event, a parameter that contains event related data is sent to the assigned event handler. Parameter includes dataPoint and dataSeries corresponding to the event.
|
||||
* Default: null
|
||||
*/
|
||||
mouseout?: (event: ChartEvent) => void;
|
||||
}
|
||||
|
||||
interface ChartDataOptions extends ChartDataCommon {
|
||||
/**
|
||||
* Sets the visibility of dataSeries. Data Series is visible by default and you can hide the same by setting visible property to false.
|
||||
* Default: true
|
||||
* Example: true, false
|
||||
*/
|
||||
visible?: boolean;
|
||||
/**
|
||||
* Sets the type of chart to be rendered for corresponding dataSeries. One can choose from the following options.
|
||||
* Default: “column”
|
||||
* Options:
|
||||
* “line”
|
||||
* “column”
|
||||
* “bar”
|
||||
* “area”
|
||||
* “spline”
|
||||
* “splineArea”
|
||||
* “stepLine”
|
||||
* “scatter”
|
||||
* “bubble”
|
||||
* “stackedColumn”
|
||||
* “stackedBar”
|
||||
* “stackedArea”
|
||||
* “stackedColumn100″
|
||||
* “stackedBar100″
|
||||
* “stackedArea100″
|
||||
* “pie”
|
||||
* “doughnut”
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* Setting axisYType lets you choose between primary and secondary Y Axis for a dataSeries to plot against. By choosing “secondary” Axis you can plot the series against axisY2.
|
||||
* In case of Multi-Series or Combinational Charts, one can assign primary axis to some series and secondary axis to other series.
|
||||
* This is helpful when dataSeries objects use different unit of measurement or range of data. By default, all series are plotted against primary Y axis.
|
||||
* Default: “primary”
|
||||
* Options: “primary”, “secondary”
|
||||
*/
|
||||
axisYType?: string;
|
||||
/**
|
||||
* This defines the data type of x values. Data Type is normally figured out by default based on the object type that is assigned to x. But if you are providing time stamp (which is integer) values instead of Date objects, you’ll have to explicitly set the xValueType to “dateTime”.
|
||||
* Default: Automatically Calculated
|
||||
* Options: “number”, “dateTime”
|
||||
*/
|
||||
xValueType?: string;
|
||||
/**
|
||||
* Defines how y axis values must be formatted before they appear on the indexLabel or toolTip. You can format numbers and date time values using this property.
|
||||
*/
|
||||
yValueFormatString?: string;
|
||||
/**
|
||||
* Defines how x axis values must be formatted before they appear on the indexLabel or toolTip. You can format numbers and date time values using this property.
|
||||
*/
|
||||
xValueFormatString?: string;
|
||||
/**
|
||||
* Defines how z values is formatted before they appear on the indexLabel or toolTip. You can format numbers using this property.
|
||||
*/
|
||||
zValueFormatString?: string;
|
||||
/**
|
||||
* Sets the bevel property, which creates a chiselled effect at the corners of a Column Charts and Bar Charts.
|
||||
* Default: “true”
|
||||
* Example: “true”, “false”
|
||||
*/
|
||||
bevelEnabled?: boolean;
|
||||
/**
|
||||
* Sets opacity of the filled color.
|
||||
* Default: .7 for Area Charts and 1 for all other chart types.
|
||||
*/
|
||||
fillOpacity?: number;
|
||||
/**
|
||||
* Sets the starting Angle of the Pie or Doughnut Chart in degrees.
|
||||
* Default: 0
|
||||
* Example: 30, 240, -100..
|
||||
*/
|
||||
startAngle?: number;
|
||||
/**
|
||||
* Sets the thickness of line in line charts and area charts.
|
||||
* Default: 2
|
||||
* Example: 3,4..
|
||||
*/
|
||||
lineThickness?: number;
|
||||
/**
|
||||
* Setting this property to true makes the dataSeries to appear in legend. In case of pie/ doughnut chart, dataPoints of the single series chart appear in legend.
|
||||
* Default: false
|
||||
* Options: false, true
|
||||
*/
|
||||
showInLegend?: boolean;
|
||||
/**
|
||||
* In candle Stick chart, when Closing Price is greater than Opening price, the body is filled with white by default and it can be overridden by risingColor property.
|
||||
* Default: “white”
|
||||
* Options: “red”, “#DD7E86″, etc.
|
||||
*/
|
||||
risingColor?: string;
|
||||
/**
|
||||
* It represents collection dataPoint inside dataSeries .
|
||||
*/
|
||||
dataPoints: ChartDataPoint[];
|
||||
}
|
||||
|
||||
interface ChartDataPoint extends ChartDataCommon {
|
||||
/**
|
||||
* Sets the x value. It determines the position of the dataPoint on X Axis. It can be numeric or a dateTime value. Values can be positive or Negative.
|
||||
* Default: null
|
||||
* Example: 10, 20, 30 ..
|
||||
* new Date(2011, 08, 01)
|
||||
*/
|
||||
x?: any;
|
||||
/**
|
||||
* Sets the y value of dataPoint. It determines the position of dataPoint on Y Axis. Values can be positive or Negative
|
||||
* Default: null
|
||||
* Example: 5, 20, -30 ..
|
||||
*/
|
||||
y?: number;
|
||||
/**
|
||||
* Sets the z value of dataPoint. It is only applicable in case of Bubble chart. This value determines the size of the bubble.
|
||||
* Default: 1
|
||||
* Example: 10, 20, 35..
|
||||
*/
|
||||
z?: number;
|
||||
/**
|
||||
* Sets label value of a dataPoint. The value appears next to the dataPoint on axisX Line. If not provided, it takes x value for label.
|
||||
* Default: x value
|
||||
* Example: “label1″, “label2″..
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* Sets the exploded value of dataPoint. It is applicable only in case of Pie and Doughnut Charts. This property causes the Pie/Doughnut slice to separate out.
|
||||
* Default: true
|
||||
* Example: true, false
|
||||
*/
|
||||
exploded?: boolean;
|
||||
/**
|
||||
* Sets the color of marker that is displayed on legend. This property works only with Pie and Doughnut charts. Value of legendMarkerColor can be “HTML Color Name” or “hex” code.
|
||||
* Default: dataSeries marker color
|
||||
* Example: “red”, “#008000″..
|
||||
*/
|
||||
legendMarkerColor?: string;
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for CasperJS v1.0.0 API
|
||||
// Project: http://casperjs.org/
|
||||
// Definitions by: Jed Hunsaker <https://github.com/jedhunsaker>
|
||||
// Definitions by: Jed Mao <https://github.com/jedmao>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../phantomjs/phantomjs.d.ts" />
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
""
|
||||
|
||||
|
||||
Vendored
+1
@@ -94,6 +94,7 @@ declare module chai {
|
||||
that: Expect;
|
||||
and: Expect;
|
||||
have: Expect;
|
||||
has: Expect;
|
||||
with: Expect;
|
||||
at: Expect;
|
||||
of: Expect;
|
||||
|
||||
Vendored
+1
@@ -41,6 +41,7 @@ declare module Chalk {
|
||||
cyan: ChalkChain;
|
||||
white: ChalkChain;
|
||||
gray: ChalkChain;
|
||||
grey: ChalkChain;
|
||||
|
||||
// Background colors
|
||||
bgBlack: ChalkChain;
|
||||
|
||||
@@ -0,0 +1,343 @@
|
||||
/// <reference path="chart.d.ts" />
|
||||
|
||||
var canvas = <HTMLCanvasElement>document.getElementById('example-chart');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
Chart.defaults.global = {
|
||||
animation: true,
|
||||
animationSteps: 60,
|
||||
animationEasing: "easeOutQuart",
|
||||
showScale: true,
|
||||
scaleOverride: false,
|
||||
scaleSteps: null,
|
||||
scaleStepWidth: null,
|
||||
scaleStartValue: null,
|
||||
scaleLineColor: "rgba(0,0,0,.1)",
|
||||
scaleLineWidth: 1,
|
||||
scaleShowLabels: true,
|
||||
scaleLabel: "<%=value%>",
|
||||
scaleIntegersOnly: true,
|
||||
scaleBeginAtZero: false,
|
||||
scaleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
||||
scaleFontSize: 12,
|
||||
scaleFontStyle: "normal",
|
||||
scaleFontColor: "#666",
|
||||
responsive: false,
|
||||
maintainAspectRatio: true,
|
||||
showTooltips: true,
|
||||
tooltipEvents: ["mousemove", "touchstart", "touchmove"],
|
||||
tooltipFillColor: "rgba(0,0,0,0.8)",
|
||||
tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
||||
tooltipFontSize: 14,
|
||||
tooltipFontStyle: "normal",
|
||||
tooltipFontColor: "#fff",
|
||||
tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
||||
tooltipTitleFontSize: 14,
|
||||
tooltipTitleFontStyle: "bold",
|
||||
tooltipTitleFontColor: "#fff",
|
||||
tooltipYPadding: 6,
|
||||
tooltipXPadding: 6,
|
||||
tooltipCaretSize: 8,
|
||||
tooltipCornerRadius: 6,
|
||||
tooltipXOffset: 10,
|
||||
tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",
|
||||
multiTooltipTemplate: "<%= value %>",
|
||||
onAnimationProgress: function () { },
|
||||
onAnimationComplete: function () { }
|
||||
}
|
||||
|
||||
var lineData: LinearChartData = {
|
||||
labels: ['03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'Accepted',
|
||||
fillColor: 'rgba(220,220,220,0.2)',
|
||||
strokeColor: 'rgba(220,220,220,1)',
|
||||
pointColor: 'rgba(220,220,220,1)',
|
||||
pointStrokeColor: '#fff',
|
||||
pointHighlightFill: '#fff',
|
||||
pointHighlightStroke: 'rgba(220,220,220,1)',
|
||||
data: [65, 59, 80, 81, 56, 55, 40]
|
||||
},
|
||||
{
|
||||
label: 'Quarantined',
|
||||
fillColor: 'rgba(151,187,205,0.2)',
|
||||
strokeColor: 'rgba(151,187,205,1)',
|
||||
pointColor: 'rgba(151,187,205,1)',
|
||||
pointStrokeColor: '#fff',
|
||||
pointHighlightFill: '#fff',
|
||||
pointHighlightStroke: 'rgba(151,187,205,1)',
|
||||
data: [28, 48, 40, 19, 86, 27, 90]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var myLineChart = new Chart(ctx).Line(lineData, {
|
||||
scaleShowGridLines: true,
|
||||
scaleGridLineColor: "rgba(0,0,0,.05)",
|
||||
scaleGridLineWidth: 1,
|
||||
bezierCurve: true,
|
||||
bezierCurveTension: 0.4,
|
||||
pointDot: true,
|
||||
pointDotRadius: 4,
|
||||
pointDotStrokeWidth: 1,
|
||||
pointHitDetectionRadius: 20,
|
||||
datasetStroke: true,
|
||||
datasetStrokeWidth: 2,
|
||||
datasetFill: true,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
|
||||
});
|
||||
|
||||
var myLineChartLegend: string = myLineChart.generateLegend();
|
||||
var myLineChartImage: string = myLineChart.toBase64Image();
|
||||
myLineChart.addData([1, 2, 3, 4, 5, 6, 7], 'new');
|
||||
myLineChart.clear();
|
||||
myLineChart.removeData();
|
||||
myLineChart.resize();
|
||||
myLineChart.update();
|
||||
myLineChart.stop();
|
||||
myLineChart.destroy();
|
||||
|
||||
var barData: LinearChartData = {
|
||||
labels: ["January", "February", "March", "April", "May", "June", "July"],
|
||||
datasets: [
|
||||
{
|
||||
label: "My First dataset",
|
||||
fillColor: "rgba(220,220,220,0.5)",
|
||||
strokeColor: "rgba(220,220,220,0.8)",
|
||||
highlightFill: "rgba(220,220,220,0.75)",
|
||||
highlightStroke: "rgba(220,220,220,1)",
|
||||
data: [65, 59, 80, 81, 56, 55, 40]
|
||||
},
|
||||
{
|
||||
label: "My Second dataset",
|
||||
fillColor: "rgba(151,187,205,0.5)",
|
||||
strokeColor: "rgba(151,187,205,0.8)",
|
||||
highlightFill: "rgba(151,187,205,0.75)",
|
||||
highlightStroke: "rgba(151,187,205,1)",
|
||||
data: [28, 48, 40, 19, 86, 27, 90]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var myBarChart = new Chart(ctx).Bar(barData, {
|
||||
scaleBeginAtZero: true,
|
||||
scaleShowGridLines: true,
|
||||
scaleGridLineColor: "rgba(0,0,0,.05)",
|
||||
scaleGridLineWidth: 1,
|
||||
barShowStroke: true,
|
||||
barStrokeWidth: 2,
|
||||
barValueSpacing: 5,
|
||||
barDatasetSpacing: 1,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
|
||||
});
|
||||
|
||||
var myBarChartLegend: string = myBarChart.generateLegend();
|
||||
var myBarChartImage: string = myBarChart.toBase64Image();
|
||||
myBarChart.addData([1, 2, 3, 4, 5, 6, 7], 'new');
|
||||
myBarChart.clear();
|
||||
myBarChart.removeData();
|
||||
myBarChart.resize();
|
||||
myBarChart.update();
|
||||
myBarChart.stop();
|
||||
myBarChart.destroy();
|
||||
|
||||
var radarData: LinearChartData = {
|
||||
labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
|
||||
datasets: [
|
||||
{
|
||||
label: "My First dataset",
|
||||
fillColor: "rgba(220,220,220,0.2)",
|
||||
strokeColor: "rgba(220,220,220,1)",
|
||||
pointColor: "rgba(220,220,220,1)",
|
||||
pointStrokeColor: "#fff",
|
||||
pointHighlightFill: "#fff",
|
||||
pointHighlightStroke: "rgba(220,220,220,1)",
|
||||
data: [65, 59, 90, 81, 56, 55, 40]
|
||||
},
|
||||
{
|
||||
label: "My Second dataset",
|
||||
fillColor: "rgba(151,187,205,0.2)",
|
||||
strokeColor: "rgba(151,187,205,1)",
|
||||
pointColor: "rgba(151,187,205,1)",
|
||||
pointStrokeColor: "#fff",
|
||||
pointHighlightFill: "#fff",
|
||||
pointHighlightStroke: "rgba(151,187,205,1)",
|
||||
data: [28, 48, 40, 19, 96, 27, 100]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var myRadarChart = new Chart(ctx).Radar(radarData, {
|
||||
scaleShowLine: true,
|
||||
angleShowLineOut: true,
|
||||
scaleShowLabels: false,
|
||||
scaleBeginAtZero: true,
|
||||
angleLineColor: "rgba(0,0,0,.1)",
|
||||
angleLineWidth: 1,
|
||||
pointLabelFontFamily: "'Arial'",
|
||||
pointLabelFontStyle: "normal",
|
||||
pointLabelFontSize: 10,
|
||||
pointLabelFontColor: "#666",
|
||||
pointDot: true,
|
||||
pointDotRadius: 3,
|
||||
pointDotStrokeWidth: 1,
|
||||
pointHitDetectionRadius: 20,
|
||||
datasetStroke: true,
|
||||
datasetStrokeWidth: 2,
|
||||
datasetFill: true,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
|
||||
});
|
||||
|
||||
var myRadarChartLegend: string = myRadarChart.generateLegend();
|
||||
var myRadarChartImage: string = myRadarChart.toBase64Image();
|
||||
myRadarChart.addData([1, 2, 3, 4, 5, 6, 7], 'new');
|
||||
myRadarChart.clear();
|
||||
myRadarChart.removeData();
|
||||
myRadarChart.resize();
|
||||
myRadarChart.update();
|
||||
myRadarChart.stop();
|
||||
myRadarChart.destroy();
|
||||
|
||||
var polarAreaData: CircularChartData[] = [
|
||||
{
|
||||
value: 300,
|
||||
color: "#F7464A",
|
||||
highlight: "#FF5A5E",
|
||||
label: "Red"
|
||||
},
|
||||
{
|
||||
value: 50,
|
||||
color: "#46BFBD",
|
||||
highlight: "#5AD3D1",
|
||||
label: "Green"
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
color: "#FDB45C",
|
||||
highlight: "#FFC870",
|
||||
label: "Yellow"
|
||||
},
|
||||
{
|
||||
value: 40,
|
||||
color: "#949FB1",
|
||||
highlight: "#A8B3C5",
|
||||
label: "Grey"
|
||||
},
|
||||
{
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
var myPolarAreaChart = new Chart(ctx).PolarArea(polarAreaData, {
|
||||
scaleShowLabelBackdrop: true,
|
||||
scaleBackdropColor: "rgba(255,255,255,0.75)",
|
||||
scaleBeginAtZero: true,
|
||||
scaleBackdropPaddingY: 2,
|
||||
scaleBackdropPaddingX: 2,
|
||||
scaleShowLine: true,
|
||||
segmentShowStroke: true,
|
||||
segmentStrokeColor: "#fff",
|
||||
segmentStrokeWidth: 2,
|
||||
animationSteps: 100,
|
||||
animationEasing: "easeOutBounce",
|
||||
animateRotate: true,
|
||||
animateScale: false,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
|
||||
});
|
||||
|
||||
var myPolarAreaChartLegend: string = myPolarAreaChart.generateLegend();
|
||||
var myPolarAreaChartImage: string = myPolarAreaChart.toBase64Image();
|
||||
myPolarAreaChart.addData([{
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
myPolarAreaChart.clear();
|
||||
myPolarAreaChart.removeData(0);
|
||||
myPolarAreaChart.resize();
|
||||
myPolarAreaChart.update();
|
||||
myPolarAreaChart.stop();
|
||||
myPolarAreaChart.destroy();
|
||||
|
||||
var pieData: CircularChartData[] = [
|
||||
{
|
||||
value: 300,
|
||||
color: "#F7464A",
|
||||
highlight: "#FF5A5E",
|
||||
label: "Red"
|
||||
},
|
||||
{
|
||||
value: 50,
|
||||
color: "#46BFBD",
|
||||
highlight: "#5AD3D1",
|
||||
label: "Green"
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
color: "#FDB45C",
|
||||
highlight: "#FFC870",
|
||||
label: "Yellow"
|
||||
}
|
||||
];
|
||||
|
||||
// For a pie chart
|
||||
var myPieChart = new Chart(ctx).Pie(pieData, {
|
||||
segmentShowStroke: true,
|
||||
segmentStrokeColor: "#fff",
|
||||
segmentStrokeWidth: 2,
|
||||
percentageInnerCutout: 0,
|
||||
animationSteps: 100,
|
||||
animationEasing: "easeOutBounce",
|
||||
animateRotate: true,
|
||||
animateScale: false,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
|
||||
});
|
||||
|
||||
var myPieChartLegend: string = myPieChart.generateLegend();
|
||||
var myPieChartImage: string = myPieChart.toBase64Image();
|
||||
myPieChart.addData([{
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
myPieChart.clear();
|
||||
myPieChart.removeData(0);
|
||||
myPieChart.resize();
|
||||
myPieChart.update();
|
||||
myPieChart.stop();
|
||||
myPieChart.destroy();
|
||||
|
||||
// And for a doughnut chart
|
||||
var myDoughnutChart = new Chart(ctx).Doughnut(pieData, {
|
||||
segmentShowStroke: true,
|
||||
segmentStrokeColor: "#fff",
|
||||
segmentStrokeWidth: 2,
|
||||
percentageInnerCutout: 50,
|
||||
animationSteps: 100,
|
||||
animationEasing: "easeOutBounce",
|
||||
animateRotate: true,
|
||||
animateScale: false,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
|
||||
});
|
||||
|
||||
var myDoughnutChartLegend: string = myDoughnutChart.generateLegend();
|
||||
var myDoughnutChartImage: string = myDoughnutChart.toBase64Image();
|
||||
myPieChart.addData([{
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
myDoughnutChart.clear();
|
||||
myDoughnutChart.removeData(0);
|
||||
myDoughnutChart.resize();
|
||||
myDoughnutChart.update();
|
||||
myDoughnutChart.stop();
|
||||
myDoughnutChart.destroy();
|
||||
Vendored
+205
@@ -0,0 +1,205 @@
|
||||
// Type definitions for Chart.js
|
||||
// Project: https://github.com/nnnick/Chart.js
|
||||
// Definitions by: Steve Fenton <https://github.com/Steve-Fenton>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface ChartDataSet {
|
||||
label: string;
|
||||
fillColor: string;
|
||||
strokeColor: string;
|
||||
|
||||
/* Line, Radar */
|
||||
pointColor?: string;
|
||||
pointStrokeColor?: string;
|
||||
pointHighlightFill?: string;
|
||||
pointHighlightStroke?: string;
|
||||
|
||||
/* Bar */
|
||||
highlightFill?: string;
|
||||
highlightStroke?: string;
|
||||
data: number[];
|
||||
}
|
||||
|
||||
interface LinearChartData {
|
||||
labels: string[];
|
||||
datasets: ChartDataSet[];
|
||||
}
|
||||
|
||||
interface CircularChartData {
|
||||
value: number;
|
||||
color: string;
|
||||
highlight: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface ChartSettings {
|
||||
animation: boolean;
|
||||
animationSteps: number;
|
||||
animationEasing: string;
|
||||
showScale: boolean;
|
||||
scaleOverride: boolean;
|
||||
scaleSteps: number;
|
||||
scaleStepWidth: number;
|
||||
scaleStartValue: number;
|
||||
scaleLineColor: string;
|
||||
scaleLineWidth: number;
|
||||
scaleShowLabels: boolean;
|
||||
scaleLabel: string;
|
||||
scaleIntegersOnly: boolean;
|
||||
scaleBeginAtZero: boolean;
|
||||
scaleFontFamily: string;
|
||||
scaleFontSize: number;
|
||||
scaleFontStyle: string;
|
||||
scaleFontColor: string;
|
||||
responsive: boolean;
|
||||
maintainAspectRatio: boolean;
|
||||
showTooltips: boolean;
|
||||
tooltipEvents: string[];
|
||||
tooltipFillColor: string;
|
||||
tooltipFontFamily: string;
|
||||
tooltipFontSize: number;
|
||||
tooltipFontStyle: string;
|
||||
tooltipFontColor: string;
|
||||
tooltipTitleFontFamily: string;
|
||||
tooltipTitleFontSize: number;
|
||||
tooltipTitleFontStyle: string;
|
||||
tooltipTitleFontColor: string;
|
||||
tooltipYPadding: number;
|
||||
tooltipXPadding: number;
|
||||
tooltipCaretSize: number;
|
||||
tooltipCornerRadius: number;
|
||||
tooltipXOffset: number;
|
||||
tooltipTemplate: string;
|
||||
multiTooltipTemplate: string;
|
||||
onAnimationProgress: () => any;
|
||||
onAnimationComplete: () => any;
|
||||
}
|
||||
|
||||
interface ChartOptions {
|
||||
scaleShowGridLines?: boolean;
|
||||
scaleGridLineColor?: string;
|
||||
scaleGridLineWidth?: number;
|
||||
legendTemplate?: string;
|
||||
}
|
||||
|
||||
interface PointsAtEvent {
|
||||
value: number;
|
||||
label: string;
|
||||
datasetLabel: string;
|
||||
strokeColor: string;
|
||||
fillColor: string;
|
||||
highlightFill: string;
|
||||
highlightStroke: string;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
interface ChartInstance {
|
||||
clear: () => void;
|
||||
stop: () => void;
|
||||
resize: () => void;
|
||||
destroy: () => void;
|
||||
toBase64Image: () => string;
|
||||
generateLegend: () => string;
|
||||
}
|
||||
|
||||
interface LinearInstance extends ChartInstance {
|
||||
getPointsAtEvent: (event: Event) => PointsAtEvent[];
|
||||
update: () => void;
|
||||
addData: (valuesArray: number[], label: string) => void;
|
||||
removeData: () => void;
|
||||
}
|
||||
|
||||
interface CircularInstance extends ChartInstance {
|
||||
getSegmentsAtEvent: (event: Event) => {}[];
|
||||
update: () => void;
|
||||
addData: (valuesArray: CircularChartData[], index: number) => void;
|
||||
removeData: (index: number) => void;
|
||||
}
|
||||
|
||||
interface LineChartOptions extends ChartOptions {
|
||||
bezierCurve?: boolean;
|
||||
bezierCurveTension?: number;
|
||||
pointDot?: boolean;
|
||||
pointDotRadius?: number;
|
||||
pointDotStrokeWidth?: number;
|
||||
pointHitDetectionRadius?: number;
|
||||
datasetStroke?: boolean;
|
||||
datasetStrokeWidth?: number;
|
||||
datasetFill?: boolean;
|
||||
}
|
||||
|
||||
interface BarChartOptions extends ChartOptions {
|
||||
scaleBeginAtZero?: boolean;
|
||||
barShowStroke?: boolean;
|
||||
barStrokeWidth?: number;
|
||||
barValueSpacing?: number;
|
||||
barDatasetSpacing?: number;
|
||||
}
|
||||
|
||||
interface RadarChartOptions {
|
||||
scaleShowLine?: boolean;
|
||||
angleShowLineOut?: boolean;
|
||||
scaleShowLabels?: boolean;
|
||||
scaleBeginAtZero?: boolean;
|
||||
angleLineColor?: string;
|
||||
angleLineWidth?: number;
|
||||
pointLabelFontFamily?: string;
|
||||
pointLabelFontStyle?: string;
|
||||
pointLabelFontSize?: number;
|
||||
pointLabelFontColor?: string;
|
||||
pointDot?: boolean;
|
||||
pointDotRadius?: number;
|
||||
pointDotStrokeWidth?: number;
|
||||
pointHitDetectionRadius?: number;
|
||||
datasetStroke?: boolean;
|
||||
datasetStrokeWidth?: number;
|
||||
datasetFill?: boolean;
|
||||
legendTemplate?: string;
|
||||
}
|
||||
|
||||
interface PolarAreaChartOptions {
|
||||
scaleShowLabelBackdrop?: boolean;
|
||||
scaleBackdropColor?: string;
|
||||
scaleBeginAtZero?: boolean;
|
||||
scaleBackdropPaddingY?: number;
|
||||
scaleBackdropPaddingX?: number;
|
||||
scaleShowLine?: boolean;
|
||||
segmentShowStroke?: boolean;
|
||||
segmentStrokeColor?: string;
|
||||
segmentStrokeWidth?: number;
|
||||
animationSteps?: number;
|
||||
animationEasing?: string;
|
||||
animateRotate?: boolean;
|
||||
animateScale?: boolean;
|
||||
legendTemplate?: string;
|
||||
}
|
||||
|
||||
interface PieChartOptions {
|
||||
segmentShowStroke?: boolean;
|
||||
segmentStrokeColor?: string;
|
||||
segmentStrokeWidth?: number;
|
||||
percentageInnerCutout?: number;
|
||||
animationSteps?: number;
|
||||
animationEasing?: string;
|
||||
animateRotate?: boolean;
|
||||
animateScale?: boolean;
|
||||
legendTemplate?: string;
|
||||
}
|
||||
|
||||
interface Chart {
|
||||
Line(data: LinearChartData, options?: LineChartOptions): LinearInstance;
|
||||
Bar(data: LinearChartData, options?: BarChartOptions): LinearInstance;
|
||||
Radar(data: LinearChartData, options?: RadarChartOptions): LinearInstance;
|
||||
|
||||
PolarArea(data: CircularChartData[], options?: PolarAreaChartOptions): CircularInstance;
|
||||
Pie(data: CircularChartData[], options?: PieChartOptions): CircularInstance;
|
||||
Doughnut(data: CircularChartData[], options?: PieChartOptions): CircularInstance;
|
||||
}
|
||||
|
||||
declare var Chart: {
|
||||
new (context: CanvasRenderingContext2D): Chart;
|
||||
defaults: {
|
||||
global: ChartSettings;
|
||||
}
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user