mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{*.json,*.yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -29,6 +29,9 @@ _infrastructure/tests/build
|
||||
*.iml
|
||||
*.js.map
|
||||
|
||||
#decimal.js
|
||||
!decimal.js
|
||||
|
||||
#rx.js
|
||||
!rx.js
|
||||
|
||||
|
||||
+58
-16
@@ -22,15 +22,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](angularjs/angular-route.d.ts) [Angular JS (ngRoute module)](http://angularjs.org) by [Jonathan Park](https://github.com/park9140)
|
||||
* [:link:](angularjs/angular-sanitize.d.ts) [Angular JS (ngSanitize module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
|
||||
* [:link:](angular-ui-router/angular-ui-router.d.ts) [Angular JS (ui.router module)](https://github.com/angular-ui/ui-router) by [Michel Salib](https://github.com/michelsalib)
|
||||
* [:link:](angular-material/angular-material.d.ts) [Angular Material (ng.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham)
|
||||
* [:link:](angular-material/angular-material.d.ts) [Angular Material (angular.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham)
|
||||
* [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong)
|
||||
* [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano)
|
||||
* [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib)
|
||||
* [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted)
|
||||
* [:link:](angular-wizard/angular-wizard.d.ts) [Angular Wizard](https://github.com/mgonto/angular-wizard) by [Marko Jurisic](https://github.com/mjurisic)
|
||||
* [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga)
|
||||
* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27), [Stefan Steinhart](https://github.com/reppners)
|
||||
* [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev),[Chris Woolum](https://github.com/cwoolum)
|
||||
* [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev)
|
||||
* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped)
|
||||
* [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann)
|
||||
* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal)
|
||||
@@ -57,10 +58,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](asyncblock/asyncblock.d.ts) [asyncblock](https://github.com/scriby/asyncblock) by [Hiroki Horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter)
|
||||
* [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](atom/api-docs.d.ts) [Atom API docs](https://github.com/atom/atom/blob/master/build/tasks/docs-task.coffee) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](atpl/atpl.d.ts) [atpl](https://github.com/soywiz/atpl.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
|
||||
* [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
|
||||
* [:link:](auth0.lock/auth0.lock.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
|
||||
* [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
|
||||
* [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl)
|
||||
* [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41)
|
||||
* [:link:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing)
|
||||
@@ -85,11 +87,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](bootbox/bootbox.d.ts) [Bootbox](https://github.com/makeusabrew/bootbox) by [Vincent Bortone](https://github.com/vbortone), [Kon Pik](https://github.com/konpikwastaken)
|
||||
* [:link:](bootstrap/bootstrap.d.ts) [Bootstrap](http://twitter.github.com/bootstrap) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts) [Bootstrap datetimepicker v3](http://eonasdan.github.io/bootstrap-datetimepicker) by [Jesica N. Fera](https://github.com/bayitajesi)
|
||||
* [:link:](bootstrap-touchspin/bootstrap-touchspin.d.ts) [Bootstrap TouchSpin](http://www.virtuosoft.eu/code/bootstrap-touchspin) by [Albin Sunnanbo](https://github.com/albinsunnanbo)
|
||||
* [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski)
|
||||
* [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker)
|
||||
* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin)
|
||||
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
|
||||
* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin)
|
||||
* [:link:](breeze/breeze.d.ts) [Breeze 1.5.x](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze)
|
||||
* [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby)
|
||||
* [:link:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com)
|
||||
@@ -97,10 +100,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli)
|
||||
* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](buffers/buffers.d.ts) [buffers](https://github.com/substack/node-buffers) by [Robert Hencke](https://github.com/rhencke)
|
||||
* [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](bunyan-prettystream/bunyan-prettystream.d.ts) [bunyan-prettystream](https://www.npmjs.com/package/bunyan-prettystream) by [Jason Swearingen](https://github.com/jasonswearingen)
|
||||
* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec)
|
||||
* [:link:](byline/byline.d.ts) [byline](https://github.com/jahewson/node-byline) by [Stefan Steinhart](https://github.com/reppners)
|
||||
* [:link:](calq/calq.d.ts) [calq](https://calq.io/docs/client/javascript/reference) by [Eirik Hoem](https://github.com/eirikhm)
|
||||
* [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com)
|
||||
* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5)
|
||||
* [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao)
|
||||
@@ -121,6 +126,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](chroma-js/chroma-js.d.ts) [Chroma.js](https://github.com/gka/chroma.js) by [Sebastian Brückner](https://github.com/invliD)
|
||||
* [:link:](chrome/chrome.d.ts) [Chrome extension development](http://developer.chrome.com/extensions) by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10)
|
||||
* [:link:](chrome/chrome-app.d.ts) [Chrome packaged application development](http://developer.chrome.com/apps) by [Adam Lay](https://github.com/AdamLay), [MIZUNE Pine](https://github.com/pine613), [MIZUSHIMA Junki](https://github.com/mzsm)
|
||||
* [:link:](circular-json/circular-json.d.ts) [circular-json](https://github.com/WebReflection/circular-json) by [Jonathan Pevarnek](https://github.com/jpevarnek)
|
||||
* [:link:](ckeditor/ckeditor.d.ts) [CKEditor](http://ckeditor.com) by [Ondrej Sevcik](https://github.com/ondrejsevcik)
|
||||
* [:link:](cli-color/cli-color.d.ts) [cli-color](https://github.com/medikoo/cli-color) by [Joel Spadin](https://github.com/ChaosinaCan)
|
||||
* [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped)
|
||||
@@ -130,6 +136,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](commander/commander.d.ts) [commanderjs](https://github.com/visionmedia/commander.js) by [Marcelo Dezem](http://github.com/mdezem), [vvakame](http://github.com/vvakame)
|
||||
* [:link:](compression/compression.d.ts) [compression](https://github.com/expressjs/compression) by [Santi Albo](https://github.com/santialbo)
|
||||
* [:link:](configstore/configstore.d.ts) [configstore](https://github.com/yeoman/configstore) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](connect-flash/connect-flash.d.ts) [connect-flash](https://github.com/jaredhanson/connect-flash) by [Andreas Gassmann](https://github.com/AndreasGassmann)
|
||||
* [:link:](connect-slashes/connect-slashes.d.ts) [connect-slashes](https://github.com/avinoamr/connect-slashes) by [Sam Herrmann](https://github.com/samherrmann)
|
||||
* [:link:](consolidate/consolidate.d.ts) [consolidate](https://github.com/visionmedia/consolidate.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](content-type/content-type.d.ts) [content-type](https://github.com/deoxxa/content-type) by [Pine Mizune](https://github.com/pine613)
|
||||
* [:link:](convert-source-map/convert-source-map.d.ts) [convert-source-map](https://github.com/thlorenz/convert-source-map) by [Andrew Gaspar](https://github.com/AndrewGaspar)
|
||||
@@ -140,6 +148,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus)
|
||||
* [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat)
|
||||
* [:link:](createjs/createjs.d.ts) [CreateJS](http://www.createjs.com) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist), [Satoru Kimura](https://github.com/gyohk)
|
||||
* [:link:](cron/cron.d.ts) [cron](https://www.npmjs.com/package/cron) by [Hiroki Horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](crossfilter/crossfilter.d.ts) [CrossFilter](https://github.com/square/crossfilter) by [Schmulik Raskin](https://github.com/schmuli)
|
||||
* [:link:](crossroads/crossroads.d.ts) [Crossroads.js](http://millermedeiros.github.io/crossroads.js) by [Diullei Gomes](https://github.com/diullei)
|
||||
* [:link:](crypto-js/crypto-js.d.ts) [crypto-js](https://github.com/evanvosberg/crypto-js) by [Michael Zabka](https://github.com/misak113)
|
||||
@@ -147,6 +156,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](googlemaps.infobubble/google.maps.infobubble.d.ts) [CSS3 InfoBubble with tabs for Google Maps API V3](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src) by [Johan Nilsson](https://github.com/Dashue)
|
||||
* [:link:](csurf/csurf.d.ts) [csurf](https://www.npmjs.org/package/csurf) by [Hiroki Horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](csv-stringify/csv-stringify.d.ts) [csv-stringify](https://github.com/wdavidw/node-csv-stringify) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](custom-error-generator/custom-error-generator.d.ts) [custom-error-generator](https://github.com/jproulx/node-custom-error) by [Thierry Miceli](https://github.com/thmiceli)
|
||||
* [:link:](md5/md5.d.ts) [CybozuLabs.MD5](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) by [MIZUNE Pine](https://github.com/pine613)
|
||||
* [:link:](d3/d3.d.ts) [d3JS](http://d3js.org) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](d3.cloud.layout/d3.cloud.layout.d.ts) [d3JS cloud layout plugin by Jason Davies](https://github.com/jasondavies/d3-cloud) by [hans windhoff](https://github.com/hansrwindhoff)
|
||||
@@ -157,6 +167,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](datejs/datejs.d.ts) [DateJS](http://www.datejs.com) by [David Khristepher Santos](http://github.com/rupertavery)
|
||||
* [:link:](dcjs/dc.d.ts) [DCJS](https://github.com/dc-js/dc.js) by [hans windhoff](https://github.com/hansrwindhoff), [matt traynham](https://github.com/mtraynham)
|
||||
* [:link:](debug/debug.d.ts) [debug](https://github.com/visionmedia/debug) by [Seon-Wook Park](https://github.com/swook)
|
||||
* [:link:](decimal.js/decimal.js.d.ts) [decimal.js](http://mikemcl.github.io/decimal.js) by [Joseph Rossi](http://github.com/musicist288)
|
||||
* [:link:](deep-diff/deep-diff.d.ts) [deep-diff](https://github.com/flitbit/diff) by [ZauberNerd](https://github.com/ZauberNerd)
|
||||
* [:link:](deep-freeze/deep-freeze.d.ts) [deep-freeze](https://github.com/substack/deep-freeze) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](del/del.d.ts) [del](https://github.com/sindresorhus/del) by [Asana](https://asana.com)
|
||||
@@ -171,17 +182,21 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com)
|
||||
* [:link:](documentdb/documentdb.d.ts) [DocumentDB](https://github.com/Azure/azure-documentdb-node) by [Noel Abrahams](https://github.com/NoelAbrahams)
|
||||
* [:link:](dojo/dojo.d.ts) [Dojo](http://dojotoolkit.org) by [Michael Van Sickle](https://github.com/vansimke)
|
||||
* [:link:](dompurify/dompurify.d.ts) [DOM Purify](https://github.com/cure53/DOMPurify) by [Dave Taylor](http://davetayls.me)
|
||||
* [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton)
|
||||
* [:link:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd)
|
||||
* [:link:](donna/donna.d.ts) [donna](https://github.com/atom/donna) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](dot/dot.d.ts) [doT](https://github.com/olado/doT) by [ZombieHunter](https://github.com/ZombieHunter)
|
||||
* [:link:](dotdotdot/dotdotdot.d.ts) [dotdotdot](http://dotdotdot.frebsite.nl) by [Milan Jaros](https://github.com/milanjaros)
|
||||
* [:link:](doublearray/doublearray.d.ts) [doublearray](https://github.com/takuyaa/doublearray) by [MIZUSHIMA Junki](https://github.com/mzsm)
|
||||
* [:link:](drop/drop.d.ts) [Drop](http://github.hubspot.com/drop) by [Adi Dahiya](https://github.com/adidahiya)
|
||||
* [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments)
|
||||
* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo)
|
||||
* [:link:](dsv/dsv.d.ts) [dsv](https://www.npmjs.com/package/dsv) by [Jason Swearingen](https://jasonswearingen.github.io)
|
||||
* [:link:](dts-bundle/dts-bundle.d.ts) [dts-bundle](https://github.com/TypeStrong/dts-bundle) by [Asana](https://asana.com)
|
||||
* [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire)
|
||||
* [:link:](easeljs/easeljs.d.ts) [EaselJS](http://www.createjs.com/#!/EaselJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist)
|
||||
* [:link:](easy-session/easy-session.d.ts) [easy-session](https://github.com/DeadAlready/node-easy-session) by [Karl Düüna](https://github.com/DeadAlready)
|
||||
* [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin)
|
||||
* [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000)
|
||||
@@ -205,6 +220,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/LearnBoost/expect.js) by [Teppei Sato](https://github.com/teppeis)
|
||||
* [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](express-debug/express-debug.d.ts) [express-debug](https://github.com/devoidfury/express-debug) by [Federico Bond](https://github.com/federicobond)
|
||||
* [:link:](express-jwt/express-jwt.d.ts) [express-jwt](https://www.npmjs.org/package/express-jwt) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [:link:](express-myconnection/express-myconnection.d.ts) [express-myconnection](https://www.npmjs.org/package/express-myconnection) by [Michael Ferris](https://github.com/Cellule)
|
||||
* [:link:](express-partials/express-partials.d.ts) [express-partials](https://github.com/publicclass/express-partials) by [jt000](https://github.com/jt000)
|
||||
@@ -265,11 +281,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com)
|
||||
* [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy)
|
||||
* [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT)
|
||||
* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk)
|
||||
* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy)
|
||||
* [:link:](google.picker/google.picker.d.ts) [Google Picker API](https://developers.google.com/picker) by [grapswiz](https://github.com/grapswiz)
|
||||
* [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73)
|
||||
* [:link:](grecaptcha/grecaptcha.d.ts) [Google Recaptcha v2](https://www.google.com/recaptcha) by [Kristof Mattei](http://kristofmattei.be)
|
||||
* [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy)
|
||||
* [:link:](gapi.urlshortener/gapi.urlshortener.d.ts) [Google Url Shortener API](https://developers.google.com/url-shortener) by [Frank M](https://github.com/sgtfrankieboy)
|
||||
* [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig)
|
||||
@@ -279,9 +296,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt)
|
||||
* [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm)
|
||||
* [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat)
|
||||
* [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
|
||||
* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
|
||||
* [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
|
||||
* [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
|
||||
* [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com)
|
||||
* [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com)
|
||||
* [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
|
||||
@@ -314,6 +331,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog)
|
||||
* [:link:](highland/highland.d.ts) [Highland](http://highlandjs.org) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](highlightjs/highlightjs.d.ts) [highlight.js](https://github.com/isagalaev/highlight.js) by [Niklas Mollenhauer](https://github.com/nikeee), [Jeremy Hull](https://github.com/sourrust)
|
||||
* [:link:](highcharts/highstock.d.ts) [Highstock](http://www.highcharts.com) by [David Deutsch](http://github.com/DavidKDeutsch)
|
||||
* [:link:](history/history.d.ts) [History.js](https://github.com/browserstate/history.js) by [Boris Yankov](https://github.com/borisyankov), [Gidon Junge](https://github.com/gjunge)
|
||||
* [:link:](howlerjs/howler.d.ts) [howler.js](https://github.com/goldfire/howler.js) by [Pedro Casaubon](https://github.com/xperiments)
|
||||
* [:link:](touch-events/touch-events.d.ts) [HTML Touch Events](http://www.w3.org/TR/touch-events) by [Kevin Barabash](https://github.com/kevinb7)
|
||||
@@ -322,6 +340,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](http-status/http-status.d.ts) [http-status](https://github.com/wdavidw/node-http-status) by [Michael Zabka](https://github.com/misak113)
|
||||
* [:link:](http-string-parser/http-string-parser.d.ts) [http-string-parser](https://github.com/apiaryio/http-string-parser) by [MIZUNE Pine](https://github.com/pine613)
|
||||
* [:link:](humane/humane.d.ts) [Humane](http://wavded.github.com/humane-js) by [jmvrbanac](https://github.com/jmvrbanac)
|
||||
* [:link:](hypertext-application-language/hypertext-application-language.d.ts) [Hypertext Application Language Draft 6](https://tools.ietf.org/html/draft-kelly-json-hal-06) by [Maks3w](https://github.com/maks3w)
|
||||
* [:link:](i18n-node/i18n-node.d.ts) [i18n-node](https://github.com/mashpie/i18n-node) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter)
|
||||
* [:link:](iban/iban.d.ts) [iban.js](https://github.com/arhs/iban.js) by [Cyril Schumacher](https://github.com/cyrilschumacher)
|
||||
@@ -335,6 +354,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](insight/insight.d.ts) [insight](https://github.com/yeoman/insight) by [vvakame](http://github.com/vvakame)
|
||||
* [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya)
|
||||
* [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi)
|
||||
* [:link:](inversify/inversify.d.ts) [inversify](https://github.com/inversify/InversifyJS) by [inversify](https://github.com/inversify)
|
||||
* [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus)
|
||||
* [:link:](is_js/is_js.d.ts) [is.js](http://arasatasaygin.github.io/is.js) by [Rodrigo Cabral](https://github.com/cabralRodrigo)
|
||||
* [:link:](iscroll/iscroll.d.ts) [iScroll](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski)
|
||||
@@ -351,6 +371,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](java-applet/java-applet.d.ts) [Java Applet](https://www.java.com) by [Cyril Schumacher](https://github.com/cyrilschumacher)
|
||||
* [:link:](hooker/hooker.d.ts) [JavaScript Hooker](https://github.com/cowboy/javascript-hooker) by [Michael Zabka](https://github.com/misak113)
|
||||
* [:link:](oauth.js/oauth.js.d.ts) [JavaScript software for implementing an OAuth consumer](https://code.google.com/p/oauth) by [NOBUOKA Yu](https://github.com/nobuoka)
|
||||
* [:link:](jbinary/jbinary.d.ts) [jBinary](https://github.com/jDataView/jBinary) by [Tim Bureck](https://github.com/tbureck)
|
||||
* [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser)
|
||||
* [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com)
|
||||
@@ -407,6 +428,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jquery.gridster/gridster.d.ts) [jQuery.gridster](https://github.com/jbaldwin/gridster) by [Josh Baldwin](https://github.com/jbaldwin)
|
||||
* [:link:](jquery.jnotify/jquery.jnotify.d.ts) [jQuery.jNotify](http://jnotify.codeplex.com) by [James Curran](https://github.com/jamescurran)
|
||||
* [:link:](jquery.jsignature/jquery.jsignature.d.ts) [jQuery.jsignature v2](https://github.com/willowsystems/jSignature) by [Patrick Magee](https://github.com/pjmagee)
|
||||
* [:link:](jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts) [jquery.jsonrpc](https://github.com/Textalk/jquery.jsonrpcclient.js) by [Maksim Karelov](https://github.com/Ty3uK)
|
||||
* [:link:](jquery.noty/jquery.noty.d.ts) [jQuery.noty](http://needim.github.io/noty) by [Aaron King](https://github.com/kingdango)
|
||||
* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith)
|
||||
* [:link:](jquery.pjax.falsandtru/jquery.pjax.d.ts) [jquery.pjax.ts by falsandtru](https://github.com/falsandtru/jquery.pjax.js) by [新ゝ月 NewNotMoon](http://new.not-moon.net)
|
||||
@@ -442,8 +464,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](hashset/hashset.d.ts) [jshashset](http://www.timdown.co.uk/jshashtable/jshashset.html) by [Sergey Gerasimov](https://github.com/gerich-home)
|
||||
* [:link:](hashtable/hashtable.d.ts) [jshashtable](http://www.timdown.co.uk/jshashtable) by [Sergey Gerasimov](https://github.com/gerich-home)
|
||||
* [:link:](jsnox/jsnox.d.ts) [JSnoX](https://github.com/af/jsnox) by [Steve Baker](https://github.com/stkb)
|
||||
* [:link:](json-patch/json-patch.d.ts) [json-patch](https://github.com/bruth/jsonpatch-js) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](json-pointer/json-pointer.d.ts) [json-pointer 1.0 l](https://www.npmjs.org/package/json-pointer) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](json5/json5.d.ts) [JSON5](http://json5.org) by [Jason Swearingen](https://jasonswearingen.github.io)
|
||||
* [:link:](jsoneditoronline/jsoneditoronline.d.ts) [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](jsonpath/jsonpath.d.ts) [jsonpath](https://www.npmjs.org/package/jsonpath) by [Hiroki Horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](JSONStream/JSONStream.d.ts) [JSONStream](http://github.com/dominictarr/JSONStream) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](jsonwebtoken/jsonwebtoken.d.ts) [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](jsplumb/jquery.jsPlumb.d.ts) [jsPlumb 1.3.16 jQuery adapter](http://jsplumb.org) by [Steve Shearn](https://github.com/shearnie)
|
||||
@@ -488,7 +513,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](leaflet-label/leaflet-label.d.ts) [Leaflet.label](https://github.com/Leaflet/Leaflet.label) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](jquery.leanModal/jquery.leanModal.d.ts) [leanModal.js](http://leanmodal.finelysliced.com.au) by [FinelySliced](https://github.com/FinelySliced)
|
||||
* [:link:](leapmotionTS/LeapMotionTS.d.ts) [Leap Motion TS](https://github.com/logotype/LeapMotionTS) by [Victor Norgren](https://github.com/logotype)
|
||||
* [:link:](less/less.d.ts) [LESS](http://lesscss.org) by [AndrewGaspar](https://github.com/AndrewGaspar)
|
||||
* [:link:](less/less.d.ts) [LESS](http://lesscss.org) by [Tom Hasner](https://github.com/thasner)
|
||||
* [:link:](less-middleware/less-middleware.d.ts) [less-middleware](https://github.com/emberfeather/less.js-middleware) by [Federico Bond](https://github.com/federicobond)
|
||||
* [:link:](levelup/levelup.d.ts) [LevelUp](https://github.com/rvagg/node-levelup) by [Bret Little](https://github.com/blittle)
|
||||
* [:link:](libxmljs/libxmljs.d.ts) [Libxmljs](https://github.com/polotek/libxmljs) by [François de Campredon](https://github.com/fdecampredon)
|
||||
* [:link:](dustjs-linkedin/dustjs-linkedin.d.ts) [linkedin dustjs](https://github.com/linkedin/dustjs) by [Marcelo Dezem](http://github.com/mdezem)
|
||||
@@ -504,11 +530,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](lolex/lolex.d.ts) [lolex](https://github.com/sinonjs/lolex) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug)
|
||||
* [:link:](lory.js/lory.js.d.ts) [lory](https://github.com/meandmax/lory) by [kubosho](https://github.com/kubosho)
|
||||
* [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](lscache/lscache.d.ts) [lscache](https://github.com/pamelafox/lscache) by [Chris Martinez](https://github.com/Chris-Martinezz)
|
||||
* [:link:](lunr/lunr.d.ts) [lunr.js](https://github.com/olivernn/lunr.js) by [Sebastian Lenz](https://github.com/sebastian-lenz)
|
||||
* [:link:](lz-string/lz-string.d.ts) [lz-string](https://github.com/pieroxy/lz-string) by [Roman Nikitin](https://github.com/M0ns1gn0r)
|
||||
* [:link:](mailcheck/mailcheck.d.ts) [Mailcheck](https://github.com/mailcheck/mailcheck) by [Paulo Cesar](http://github.com/pocesar)
|
||||
* [:link:](main-bower-files/main-bower-files.d.ts) [main-bower-files](https://github.com/ck86/main-bower-files) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
|
||||
* [:link:](mandrill-api/mandrill-api.d.ts) [Mandrill API 1.x](http://mandrill.com) by [Paulo Cesar](https://github.com/pocesar)
|
||||
* [:link:](mapbox/mapbox.d.ts) [Mapbox](https://www.mapbox.com/mapbox.js) by [Maxime Fabre](https://github.com/anahkiasen)
|
||||
* [:link:](mapsjs/mapsjs.d.ts) [Mapsjs](https://github.com/mapsjs) by [Matthew James Davis](https://github.com/davismj)
|
||||
* [:link:](mariasql/mariasql.d.ts) [mariasql](https://github.com/mscdex/node-mariasql) by [MichaelBennett](https://github.com/bennett000)
|
||||
@@ -524,7 +553,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave)
|
||||
* [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo)
|
||||
* [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee)
|
||||
* [:link:](xrm/xrm.d.ts) [Microsoft Dynamics xRM API](http://www.microsoft.com/en-us/download/details.aspx?id=44567) by [David Berry](https://github.com/6ix4our), [Matt Ngan](https://github.com/mattngan)
|
||||
* [:link:](xrm/xrm-6.d.ts) [Microsoft Dynamics xRM API v6](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
|
||||
* [:link:](xrm/clientglobalcontext.d.ts) [Microsoft Dynamics xRM ClientGlobalContext.js.aspx](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
|
||||
* [:link:](microsoft-live-connect/microsoft-live-connect.d.ts) [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) by [John Vilk](https://github.com/jvilk)
|
||||
* [:link:](xrm/parature.d.ts) [Microsoft Parature extentions to Xrm.Page - available for CRM Online Only](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
|
||||
* [:link:](azure-mobile-services-client/AzureMobileServicesClient.d.ts) [Microsoft Windows AzureMobile Service](http://www.windowsazure.com/en-us/develop/mobile) by [Morosinotto Daniele](https://github.com/dmorosinotto)
|
||||
* [:link:](bingmaps/Microsoft.Maps.d.ts) [Microsoft.Maps](http://msdn.microsoft.com/en-us/library/gg427611.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](bingmaps/Microsoft.Maps.AdvancedShapes.d.ts) [Microsoft.Maps.AdvancedShapes](http://msdn.microsoft.com/en-us/library/hh921952.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
@@ -557,7 +590,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz)
|
||||
* [:link:](mousetrap/mousetrap-global-bind.d.ts) [Mousetrap 1.4.6's global-bind extension](http://craig.is/killing/mice#extensions.global) by [Andrew Bradley](https://github.com/cspotcode)
|
||||
* [:link:](moviedb/moviedb.d.ts) [MovieDB](https://github.com/danzajdband/moviedb) by [Basarat Ali Syed](https://github.com/basarat)
|
||||
* [:link:](mozilla-spidermonkey-parser-api/mozilla-spidermonkey-parser-api.d.ts) [Mozilla SpiderMonkey Parser API](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](firefox/firefox.d.ts) [Mozilla Web API](https://developer.mozilla.org/en-US/docs/Web/API) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](localForage/localForage.d.ts) [Mozilla's localForage](https://github.com/mozilla/localforage) by [david pichsenmeister](https://github.com/3x14159265)
|
||||
* [:link:](msgpack/msgpack.d.ts) [msgpack.js - MessagePack JavaScript Implementation](https://github.com/uupaa/msgpack.js) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)
|
||||
@@ -598,23 +630,24 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm)
|
||||
* [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped)
|
||||
* [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle)
|
||||
* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](acl/acl-mongodbBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](acl/acl-redisBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners)
|
||||
* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113)
|
||||
* [:link:](nodemailer/nodemailer-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-direct-transport/nodemailer-direct-transport.d.ts) [Nodemailer](https://github.com/andris9/nodemailer-direct-transport) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts) [Nodemailer](https://github.com/andris9/nodemailer-smptp-transport) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-smtp-pool/nodemailer-smtp-pool.d.ts) [Nodemailer](https://github.com/andris9/nodemailer-smtp-pool) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-direct-transport/nodemailer-direct-transport.d.ts) [nodemailer-direct-transport](https://github.com/andris9/nodemailer-direct-transport) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-smtp-pool/nodemailer-smtp-pool.d.ts) [nodemailer-smtp-pool](https://github.com/andris9/nodemailer-smtp-pool) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts) [nodemailer-smtp-transport](https://github.com/andris9/nodemailer-smtp-transport) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo)
|
||||
* [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral)
|
||||
* [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc)
|
||||
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
|
||||
* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar)
|
||||
* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj)
|
||||
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
|
||||
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj)
|
||||
* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj)
|
||||
* [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42)
|
||||
* [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](nprogress/NProgress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com)
|
||||
@@ -661,10 +694,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](poly2tri/poly2tri.d.ts) [poly2tri](http://github.com/r3mi/poly2tri.js) by [Elemar Junior](https://github.com/elemarjr)
|
||||
* [:link:](polymer/polymer.d.ts) [polymer](https://github.com/polymer) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.paper-dialog.d.ts) [polymer's paper-dialog](https://github.com/Polymer/paper-dialog) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.core-overlay.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.paper-toast.d.ts) [polymer's paper-toast](https://github.com/Polymer/paper-toast) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.core-drawer-panel.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-drawer-panel) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.core-overlay.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.core-selector.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.paper-toast.d.ts) [polymer's paper-toast](https://github.com/Polymer/paper-toast) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz)
|
||||
* [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U)
|
||||
* [:link:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame)
|
||||
@@ -731,6 +764,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising)
|
||||
* [:link:](sanitize-filename/sanitize-filename.d.ts) [sanitize-filename](https://github.com/parshap/node-sanitize-filename) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](sanitize-html/sanitize-html.d.ts) [sanitize-html](https://github.com/punkave/sanitize-html) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](sanitizer/sanitizer.d.ts) [Sanitizer](https://github.com/theSmaw/Caja-HTML-Sanitizer) by [Dave Taylor](http://davetayls.me)
|
||||
* [:link:](sax/sax.d.ts) [sax js](https://github.com/isaacs/sax-js) by [Asana](https://asana.com)
|
||||
* [:link:](screenfull/screenfull.d.ts) [screenfull.js](https://github.com/sindresorhus/screenfull.js) by [Ilia Choly](http://github.com/icholy)
|
||||
* [:link:](select2/select2.d.ts) [Select2](http://ivaynberg.github.com/select2) by [Boris Yankov](https://github.com/borisyankov)
|
||||
@@ -774,6 +808,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](spectrum/spectrum.d.ts) [spectrum](https://github.com/bgrins/spectrum) by [Mordechai Zuber](https://github.com/M-Zuber)
|
||||
* [:link:](spin/spin.d.ts) [Spin.js](http://fgnass.github.com/spin.js) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb)
|
||||
* [:link:](split/split.d.ts) [split](https://github.com/dominictarr/split) by [Marcin Porębski](https://github.com/marcinporebski)
|
||||
* [:link:](sprintf-js/sprintf-js.d.ts) [sprintf-js](https://www.npmjs.com/package/sprintf-js) by [Jason Swearingen](https://jasonswearingen.github.io)
|
||||
* [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](sharepoint/SharePoint.d.ts) [sptypescript](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru), [Andrey Markeev](http://markeev.com)
|
||||
* [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti)
|
||||
@@ -786,6 +821,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
|
||||
* [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Eric J. Smith](https://github.com/ejsmith)
|
||||
* [:link:](stripe/stripe-node.d.ts) [stripe-node](https://github.com/stripe/stripe-node) by [William Johnston](https://github.com/wjohnsto)
|
||||
* [:link:](strophe/strophe.d.ts) [Strophe.js](http://strophe.im/strophejs) by [David Deutsch](https://github.com/DavidKDeutsch)
|
||||
* [:link:](stylus/stylus.d.ts) [stylus](https://github.com/LearnBoost/stylus) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](sugar/sugar.d.ts) [Sugar](http://sugarjs.com) by [Josh Baldwin](https://github.com/jbaldwin)
|
||||
* [:link:](superagent/superagent.d.ts) [SuperAgent](https://github.com/visionmedia/superagent) by [Alex Varju](https://github.com/varju)
|
||||
@@ -795,6 +832,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](svg2png/svg2png.d.ts) [svg2png node package](https://github.com/domenic/svg2png) by [hans windhoff](https://github.com/hansrwindhoff)
|
||||
* [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs)
|
||||
* [:link:](swag/swag.d.ts) [swag](https://github.com/elving/swag) by [Shogo Iwano](https://github.com/shiwano)
|
||||
* [:link:](sweetalert/sweetalert.d.ts) [SweetAlert](https://github.com/t4t5/sweetalert) by [Markus Peloso](https://github.com/ToastHawaii)
|
||||
* [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou)
|
||||
* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano)
|
||||
@@ -842,6 +880,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](twitter/twitter.d.ts) [Twitter for Websites](https://dev.twitter.com/web) by [Chitoku](https://github.com/chitoku-k)
|
||||
* [:link:](jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts) [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) by [Blake Niemyjski](https://github.com/niemyjski)
|
||||
* [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](type-name/type-name.d.ts) [type-name](https://github.com/twada/type-name) by [OKUNOKENTARO](https://github.com/armorik83)
|
||||
* [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge)
|
||||
* [:link:](typescript/typescript.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org)
|
||||
* [:link:](typescript-deferred/typescript-deferred.d.ts) [typescript-deferred](https://github.com/DirtyHairy/typescript-deferred) by [Christian Speckner](https://github.com/DirtyHairy)
|
||||
@@ -850,6 +889,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin)
|
||||
* [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau)
|
||||
* [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine)
|
||||
* [:link:](uniq/uniq.d.ts) [uniq](https://www.npmjs.com/package/uniq) by [Hans Windhoff](https://github.com/hansrwindhoff)
|
||||
* [:link:](universal-analytics/universal-analytics.d.ts) [universal-analytics](https://github.com/peaksandpies/universal-analytics) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](uri-templates/uri-templates.d.ts) [uri-templates](https://github.com/geraintluff/uri-templates) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
@@ -880,6 +920,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](webix/webix.d.ts) [Webix UI](http://webix.com) by [Maksim Kozhukh](http://github.com/mkozhukh)
|
||||
* [:link:](webrtc/MediaStream.d.ts) [WebRTC](http://dev.w3.org/2011/webrtc) by [Ken Smith](https://github.com/smithkl42)
|
||||
* [:link:](websocket/websocket.d.ts) [websocket](https://github.com/Worlize/WebSocket-Node) by [Paul Loyd](https://github.com/loyd)
|
||||
* [:link:](websql/websql.d.ts) [websql](http://www.w3.org/TR/webdatabase) by [TeamworkGuy2](https://github.com/TeamworkGuy2)
|
||||
* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone), [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](which/which.d.ts) [which](https://github.com/isaacs/node-which) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](jquery.window/jquery.window.d.ts) [Window plugin for jQuery](http://fstoke.me/jquery/window) by [Ryan Graham](https://github.com/ryan-codingintrigue)
|
||||
@@ -896,6 +937,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode)
|
||||
* [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](xsockets/XSockets.d.ts) [XSockets.NET](http://xsockets.net) by [Jeffery Grajkowski](https://github.com/pushplay)
|
||||
* [:link:](xss-filters/xss-filters.d.ts) [Yahoo XSS Filters](https://github.com/yahoo/xss-filters) by [Dave Taylor](http://davetayls.me)
|
||||
* [:link:](yamljs/yamljs.d.ts) [yamljs](https://github.com/jeremyfa/yaml.js) by [Tim Jonischkat](http://www.tim-jonischkat.de)
|
||||
* [:link:](yargs/yargs.d.ts) [yargs](https://github.com/chevex/yargs) by [Martin Poelstra](https://github.com/poelstra)
|
||||
* [:link:](yeoman-generator/yeoman-generator.d.ts) [yeoman-generator](https://github.com/yeoman/generator) by [Kentaro Okuno](http://github.com/armorik83)
|
||||
|
||||
@@ -131,6 +131,7 @@ testApp.controller('TestCtrl', (
|
||||
var modalInstance = $modal.open({
|
||||
backdrop: 'static',
|
||||
controller: 'ModalTestCtrl',
|
||||
controllerAs: 'vm',
|
||||
keyboard: true,
|
||||
resolve: {
|
||||
items: ()=> {
|
||||
|
||||
+7
-1
@@ -229,7 +229,7 @@ declare module angular.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`.
|
||||
*/
|
||||
scope?: IModalScope;
|
||||
scope?: angular.IScope|IModalScope;
|
||||
|
||||
/**
|
||||
* a controller for a modal instance - it can initialize scope used by modal.
|
||||
@@ -237,6 +237,12 @@ declare module angular.ui.bootstrap {
|
||||
*/
|
||||
controller?: any;
|
||||
|
||||
/**
|
||||
* an alternative to the controller-as syntax, matching the API of directive definitions.
|
||||
* Requires the controller option to be provided as well
|
||||
*/
|
||||
controllerAs?: string;
|
||||
|
||||
/**
|
||||
* members that will be resolved and passed to the controller as locals; it is equivalent of the `resolve` property for AngularJS routes
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
/// <reference path="../jasmine/jasmine.d.ts" />
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
/// <reference path="angular-wizard.d.ts" />
|
||||
|
||||
// test file taken from https://github.com/mgonto/angular-wizard
|
||||
|
||||
|
||||
interface WizardScope extends ng.IScope {
|
||||
referenceCurrentStep:string;
|
||||
stepValidation:()=>void;
|
||||
finishedWizard:()=>void;
|
||||
enterValidation:()=>void;
|
||||
}
|
||||
|
||||
describe('AngularWizard', function () {
|
||||
var $compile:ng.ICompileService,
|
||||
$rootScope:ng.IRootScopeService, WizardHandler:angular.mgoAngularWizard.WizardHandler, scope:WizardScope;
|
||||
|
||||
/**
|
||||
* Create the view with wizard to test
|
||||
* @param {Scope} scope A scope to bind to
|
||||
* @return {[DOM element]} A DOM element compiled
|
||||
*/
|
||||
function createView(scope:WizardScope) {
|
||||
scope.referenceCurrentStep = null;
|
||||
var element = angular.element('<wizard on-finish="finishedWizard()" current-step="referenceCurrentStep" ng-init="msg = 14" >'
|
||||
+ ' <wz-step title="Starting" canenter="enterValidation">'
|
||||
+ ' <h1>This is the first step</h1>'
|
||||
+ ' <p>Here you can use whatever you want. You can use other directives, binding, etc.</p>'
|
||||
+ ' <input type="submit" wz-next value="Continue" />'
|
||||
+ ' </wz-step>'
|
||||
+ ' <wz-step title="Continuing" canexit="stepValidation">'
|
||||
+ ' <h1>Continuing</h1>'
|
||||
+ ' <p>You have continued here!</p>'
|
||||
+ ' <input type="submit" wz-next value="Go on" />'
|
||||
+ ' </wz-step>'
|
||||
+ ' <wz-step title="More steps" canenter="enterValidation">'
|
||||
+ ' <p>Even more steps!!</p>'
|
||||
+ ' <input type="submit" wz-next value="Finish now" />'
|
||||
+ ' </wz-step>'
|
||||
+ '</wizard>');
|
||||
var elementCompiled = $compile(element)(scope);
|
||||
$rootScope.$digest();
|
||||
return elementCompiled;
|
||||
}
|
||||
|
||||
it("should correctly create the wizard", function () {
|
||||
var view = createView(scope);
|
||||
expect(WizardHandler).toBeTruthy();
|
||||
expect(view.find('section').length).toEqual(3);
|
||||
// expect the correct step to be desirable one
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
});
|
||||
|
||||
it("should go to the next step", function () {
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
});
|
||||
it("should return to a previous step", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
WizardHandler.wizard().previous();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
});
|
||||
it("should go to a step specified by name", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().goTo('More steps');
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('More steps');
|
||||
});
|
||||
it("should go to a step specified by index", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().goTo(2);
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('More steps');
|
||||
});
|
||||
it("should go to next step becasue callback is truthy", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next(function () {
|
||||
return true
|
||||
});
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
});
|
||||
it("should NOT go to next step because callback is falsey", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next(function () {
|
||||
return false
|
||||
});
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
});
|
||||
it("should go to next step because CANEXIT is UNDEFINED", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
});
|
||||
it("should go to next step because CANEXIT is TRUE", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
scope.stepValidation = function () {
|
||||
return true;
|
||||
};
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('More steps');
|
||||
});
|
||||
it("should NOT go to next step because CANEXIT is FALSE", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
scope.stepValidation = function () {
|
||||
return false;
|
||||
};
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
});
|
||||
it("should go to next step because CANENTER is TRUE", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
scope.enterValidation = function () {
|
||||
return true;
|
||||
};
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('More steps');
|
||||
});
|
||||
it("should NOT go to next step because CANENTER is FALSE", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
scope.enterValidation = function () {
|
||||
return false;
|
||||
};
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
});
|
||||
it("should NOT return to a previous step. Although CANEXIT is false and we are heading to a previous state, the can enter validation is false", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
scope.stepValidation = function () {
|
||||
return false;
|
||||
};
|
||||
scope.enterValidation = function () {
|
||||
return false;
|
||||
};
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
WizardHandler.wizard().previous();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
});
|
||||
it("should return to a previous step even though CANEXIT is false", function () {
|
||||
|
||||
var view = createView(scope);
|
||||
scope.stepValidation = function () {
|
||||
return false;
|
||||
};
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().next();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Continuing');
|
||||
WizardHandler.wizard().previous();
|
||||
$rootScope.$digest();
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
});
|
||||
it("should finish", function () {
|
||||
|
||||
var flag = false;
|
||||
scope.finishedWizard = function () {
|
||||
flag = true;
|
||||
};
|
||||
var view = createView(scope);
|
||||
expect(scope.referenceCurrentStep).toEqual('Starting');
|
||||
WizardHandler.wizard().finish();
|
||||
expect(flag).toBeTruthy();
|
||||
$rootScope.$digest();
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for Angular Wizard 0.4.2
|
||||
// Project: https://github.com/mgonto/angular-wizard
|
||||
// Definitions by: Marko Jurisic <https://github.com/mjurisic>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module angular.mgoAngularWizard {
|
||||
interface WizardHandler {
|
||||
wizard(name?:string): Wizard;
|
||||
addWizard(name:string, wizard:Wizard):void;
|
||||
removeWizard(name:string):void;
|
||||
}
|
||||
|
||||
interface Wizard {
|
||||
next(nextHandler?:Function):void;
|
||||
previous():void;
|
||||
goTo(step:number):void;
|
||||
goTo(step:string):void;
|
||||
finish():void;
|
||||
currentStepNumber():number;
|
||||
}
|
||||
}
|
||||
Vendored
+9
-6
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Angular JS 1.3 (ngCookies module)
|
||||
// Type definitions for Angular JS 1.4 (ngCookies module)
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: Diego Vilar <http://github.com/diegovilar>
|
||||
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Anthony Ciccarello <http://github.com/aciccarello>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
@@ -28,10 +28,13 @@ declare module angular.cookies {
|
||||
// CookieStoreService
|
||||
// see http://docs.angularjs.org/api/ngCookies.$cookieStore
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface ICookieStoreService {
|
||||
get(key: string): any;
|
||||
put(key: string, value: any): void;
|
||||
remove(key: string): void;
|
||||
interface ICookiesService {
|
||||
get(key: string): string;
|
||||
getObject(key: string): any;
|
||||
getAll(): any;
|
||||
put(key: string, value: string, options?: any): void;
|
||||
putObject(key: string, value: any, options?: any): void;
|
||||
remove(key: string, options?: any): void;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/// <reference path="ansi-styles.d.ts" />
|
||||
|
||||
import ansi = require('ansi-styles');
|
||||
|
||||
|
||||
var styles = [
|
||||
ansi.reset,
|
||||
|
||||
ansi.bold,
|
||||
ansi.dim,
|
||||
ansi.italic,
|
||||
ansi.underline,
|
||||
ansi.inverse,
|
||||
ansi.hidden,
|
||||
ansi.strikethrough,
|
||||
|
||||
ansi.black,
|
||||
ansi.red,
|
||||
ansi.green,
|
||||
ansi.yellow,
|
||||
ansi.blue,
|
||||
ansi.magenta,
|
||||
ansi.cyan,
|
||||
ansi.white,
|
||||
ansi.gray,
|
||||
|
||||
ansi.bgBlack,
|
||||
ansi.bgRed,
|
||||
ansi.bgGreen,
|
||||
ansi.bgYellow,
|
||||
ansi.bgBlue,
|
||||
ansi.bgMagenta,
|
||||
ansi.bgCyan,
|
||||
ansi.bgWhite
|
||||
]
|
||||
|
||||
for (var key in styles) {
|
||||
check(key, styles[key])
|
||||
}
|
||||
|
||||
function check(key:string, escapeCodes:ansi.EscapeCodePair): void {
|
||||
if (uninitialized(escapeCodes.open)) {
|
||||
throw new Error('key not found ~> ' + key + '.open')
|
||||
}
|
||||
if (uninitialized(escapeCodes.close)) {
|
||||
throw new Error('key not found ~> ' + key + '.close')
|
||||
}
|
||||
}
|
||||
|
||||
function uninitialized(val:any): boolean {
|
||||
return val === null || val === undefined
|
||||
}
|
||||
|
||||
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
// Type definitions for ansi-styles 2.0.1
|
||||
// Project: https://github.com/sindresorhus/ansi-styles
|
||||
// Definitions by: bryn austin bellomy <https://github.com/brynbellomy>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
declare module "ansi-styles"
|
||||
{
|
||||
export interface EscapeCodePair {
|
||||
open: string;
|
||||
close: string;
|
||||
}
|
||||
|
||||
export var reset: EscapeCodePair;
|
||||
|
||||
export var bold: EscapeCodePair;
|
||||
export var dim: EscapeCodePair;
|
||||
export var italic: EscapeCodePair;
|
||||
export var underline: EscapeCodePair;
|
||||
export var inverse: EscapeCodePair;
|
||||
export var hidden: EscapeCodePair;
|
||||
export var strikethrough: EscapeCodePair;
|
||||
|
||||
export var black: EscapeCodePair;
|
||||
export var red: EscapeCodePair;
|
||||
export var green: EscapeCodePair;
|
||||
export var yellow: EscapeCodePair;
|
||||
export var blue: EscapeCodePair;
|
||||
export var magenta: EscapeCodePair;
|
||||
export var cyan: EscapeCodePair;
|
||||
export var white: EscapeCodePair;
|
||||
export var gray: EscapeCodePair;
|
||||
|
||||
export var bgBlack: EscapeCodePair;
|
||||
export var bgRed: EscapeCodePair;
|
||||
export var bgGreen: EscapeCodePair;
|
||||
export var bgYellow: EscapeCodePair;
|
||||
export var bgBlue: EscapeCodePair;
|
||||
export var bgMagenta: EscapeCodePair;
|
||||
export var bgCyan: EscapeCodePair;
|
||||
export var bgWhite: EscapeCodePair;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/// <reference path="buffers.d.ts" />
|
||||
import Buffers = require('buffers');
|
||||
|
||||
var any: any;
|
||||
var num: number;
|
||||
var str: string;
|
||||
var buf = new Buffer([1, 2, 3]);
|
||||
var bufs: Buffers = new Buffers(); // with new, as type
|
||||
|
||||
bufs = Buffers(); // no new
|
||||
|
||||
// with self
|
||||
bufs = Buffers(bufs);
|
||||
bufs = new Buffers(bufs);
|
||||
|
||||
// with array of buffers.
|
||||
bufs = Buffers([buf, buf]);
|
||||
bufs = new Buffers([buf, buf]);
|
||||
|
||||
num = bufs.push(buf);
|
||||
num = bufs.push(buf, buf);
|
||||
|
||||
num = bufs.unshift(buf);
|
||||
num = bufs.unshift(buf, buf);
|
||||
|
||||
buf = bufs.slice();
|
||||
buf = bufs.slice(num);
|
||||
buf = bufs.slice(num, num);
|
||||
|
||||
bufs = bufs.splice(num);
|
||||
bufs = bufs.splice(num, num);
|
||||
bufs = bufs.splice(num, num, buf);
|
||||
bufs = bufs.splice(num, num, buf, buf);
|
||||
|
||||
num = bufs.copy(buf);
|
||||
num = bufs.copy(buf, num, num, num);
|
||||
|
||||
any = bufs.get(num);
|
||||
bufs.set(num, any);
|
||||
|
||||
num = bufs.indexOf(str);
|
||||
num = bufs.indexOf(str, num);
|
||||
num = bufs.indexOf(buf);
|
||||
num = bufs.indexOf(buf, num);
|
||||
|
||||
buf = bufs.toBuffer();
|
||||
|
||||
str = buf.toString();
|
||||
str = buf.toString(any, num, num);
|
||||
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// Type definitions for buffers 0.1.1
|
||||
// Project: https://github.com/substack/node-buffers
|
||||
// Definitions by: Robert Hencke <https://github.com/rhencke/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "buffers" {
|
||||
|
||||
interface BuffersStatics {
|
||||
new (bufs?: Buffer[]|Buffers): Buffers;
|
||||
(bufs?: Buffer[]| Buffers): Buffers;
|
||||
prototype: Buffers;
|
||||
}
|
||||
|
||||
interface Buffers {
|
||||
buffers: Buffer[];
|
||||
length: number;
|
||||
|
||||
push(...items: Buffer[]): number;
|
||||
unshift(...items: Buffer[]): number;
|
||||
slice(i?: number, j?: number): Buffer;
|
||||
splice(i: number, howMany?: number, ...items: Buffer[]): Buffers;
|
||||
copy(dst: Buffer, dstStart?: number, start?: number, end?: number): number;
|
||||
get(i: number): any;
|
||||
set(i: number, b: any): void;
|
||||
indexOf(needle: string|Buffer, offset?: number): number;
|
||||
toBuffer(): Buffer;
|
||||
toString(encoding?: any, start?: number, end?: number): string;
|
||||
}
|
||||
|
||||
var Buffers: BuffersStatics;
|
||||
|
||||
export = Buffers;
|
||||
|
||||
}
|
||||
@@ -337,6 +337,11 @@ function deepEqual3(Date) {
|
||||
expect(a).not.to.deep.equal({});
|
||||
}
|
||||
|
||||
function deepInclude(val) {
|
||||
expect(['foo', 'bar']).to.deep.include(['bar', 'foo']);
|
||||
expect(['foo', 'bar']).not.to.deep.equal(['foo', 'baz' ]);
|
||||
}
|
||||
|
||||
function empty() {
|
||||
function FakeArgs() { };
|
||||
FakeArgs.prototype.length = 0;
|
||||
|
||||
Vendored
+1
@@ -132,6 +132,7 @@ declare module chai {
|
||||
|
||||
interface Deep {
|
||||
equal: Equal;
|
||||
include: Include;
|
||||
property: Property;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,13 @@ chrome.app.runtime.onLaunched.addListener(function (launchData: runtime.LaunchDa
|
||||
|
||||
chrome.app.runtime.onRestarted.addListener(function () { return; });
|
||||
|
||||
// Get Current Window
|
||||
// retrieving windows
|
||||
var currentWindow: cwindow.AppWindow = chrome.app.window.current();
|
||||
var otherWindow: cwindow.AppWindow = chrome.app.window.get('some-string');
|
||||
var allWindows: cwindow.AppWindow[] = chrome.app.window.getAll();
|
||||
|
||||
// check platform capabilities
|
||||
var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces();
|
||||
|
||||
// FileSystem
|
||||
// https://developer.chrome.com/apps/fileSystem
|
||||
|
||||
Vendored
+3
@@ -126,6 +126,9 @@ declare module chrome.app.window {
|
||||
|
||||
export function create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void;
|
||||
export function current(): AppWindow;
|
||||
export function get(id: string): AppWindow;
|
||||
export function getAll(): AppWindow[];
|
||||
export function canSetVisibleOnAllWorkspaces(): boolean;
|
||||
|
||||
interface WindowEvent {
|
||||
addListener(callback: () => void): void;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/// <reference path="./colorbrewer.d.ts" />
|
||||
|
||||
var accent3: string[] = colorbrewer.Accent[3];
|
||||
var accent4: string[] = colorbrewer.Accent[4];
|
||||
var accent5: string[] = colorbrewer.Accent[5];
|
||||
var accent6: string[] = colorbrewer.Accent[6];
|
||||
var accent7: string[] = colorbrewer.Accent[7];
|
||||
var accent8: string[] = colorbrewer.Accent[8];
|
||||
Vendored
+76
@@ -0,0 +1,76 @@
|
||||
// Type definitions for colorbrewer v1.0.0
|
||||
// Project: https://github.com/jeanlauliac/colorbrewer
|
||||
// Definitions by: Matt Traynham <https://github.com/mtraynham>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var colorbrewer: ColorBrewer.Base;
|
||||
|
||||
declare module ColorBrewer {
|
||||
interface ColorScheme {
|
||||
[n: number]: string[];
|
||||
}
|
||||
|
||||
interface EightColorScheme extends ColorScheme {
|
||||
3: [string, string, string];
|
||||
4: [string, string, string, string];
|
||||
5: [string, string, string, string, string];
|
||||
6: [string, string, string, string, string, string];
|
||||
7: [string, string, string, string, string, string, string];
|
||||
8: [string, string, string, string, string, string, string, string];
|
||||
}
|
||||
|
||||
interface NineColorScheme extends EightColorScheme {
|
||||
9: [string, string, string, string, string, string, string, string, string];
|
||||
}
|
||||
|
||||
interface ElevenColorScheme extends NineColorScheme {
|
||||
10: [string, string, string, string, string, string, string, string, string, string];
|
||||
11: [string, string, string, string, string, string, string, string, string, string, string];
|
||||
}
|
||||
|
||||
interface TwelveColorScheme extends ElevenColorScheme {
|
||||
12: [string, string, string, string, string, string, string, string, string, string, string, string];
|
||||
}
|
||||
|
||||
interface Base {
|
||||
YlGn: NineColorScheme;
|
||||
YlGnBu: NineColorScheme;
|
||||
GnBu: NineColorScheme;
|
||||
BuGn: NineColorScheme;
|
||||
PuBuGn: NineColorScheme;
|
||||
PuBu: NineColorScheme;
|
||||
BuPu: NineColorScheme;
|
||||
RdPu: NineColorScheme;
|
||||
PuRd: NineColorScheme;
|
||||
OrRd: NineColorScheme;
|
||||
YlOrRd: NineColorScheme;
|
||||
YlOrBr: NineColorScheme;
|
||||
Purples: NineColorScheme;
|
||||
Blues: NineColorScheme;
|
||||
Greens: NineColorScheme;
|
||||
Oranges: NineColorScheme;
|
||||
Reds: NineColorScheme;
|
||||
Greys: NineColorScheme;
|
||||
PuOr: ElevenColorScheme;
|
||||
BrBG: ElevenColorScheme;
|
||||
PRGn: ElevenColorScheme;
|
||||
PiYG: ElevenColorScheme;
|
||||
RdBu: ElevenColorScheme;
|
||||
RdGy: ElevenColorScheme;
|
||||
RdYlBu: ElevenColorScheme;
|
||||
Spectral: ElevenColorScheme;
|
||||
RdYlGn: ElevenColorScheme;
|
||||
Accent: EightColorScheme;
|
||||
Dark2: EightColorScheme;
|
||||
Paired: TwelveColorScheme;
|
||||
Pastel1: NineColorScheme;
|
||||
Pastel2: EightColorScheme;
|
||||
Set1: NineColorScheme;
|
||||
Set2: EightColorScheme;
|
||||
Set3: TwelveColorScheme;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'colorbrewer' {
|
||||
export = colorbrewer;
|
||||
}
|
||||
+7
-7
@@ -6,22 +6,22 @@
|
||||
declare module "convert-source-map" {
|
||||
export interface SourceMapConverter {
|
||||
toObject(): any;
|
||||
toJSON(space?): string;
|
||||
toJSON(space?: any): string;
|
||||
toBase64(): string;
|
||||
toComment(): string;
|
||||
|
||||
addProperty(key, value): SourceMapConverter;
|
||||
setProperty(key, value): SourceMapConverter;
|
||||
addProperty(key: string, value: any): SourceMapConverter;
|
||||
setProperty(key: string, value: any): SourceMapConverter;
|
||||
|
||||
getProperty(key): any;
|
||||
getProperty(key: string): any;
|
||||
}
|
||||
|
||||
export function removeComments(src): string;
|
||||
export function removeComments(src: string): string;
|
||||
export var commentRegex: RegExp;
|
||||
|
||||
export function fromObject(obj): SourceMapConverter;
|
||||
export function fromObject(obj: any): SourceMapConverter;
|
||||
export function fromJSON(json: string): SourceMapConverter;
|
||||
export function fromBase64(base64: string): SourceMapConverter;
|
||||
export function fromComment(comment: string): SourceMapConverter;
|
||||
export function fromSource(source: string): SourceMapConverter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path="./custom-error-generator.d.ts" />
|
||||
|
||||
import createCustomError = require('custom-error-generator');
|
||||
var HTTPError = createCustomError('HTTPError', { 'code' : 500, 'status' : 'Server Error' });
|
||||
var error = new HTTPError('Uh oh');
|
||||
console.log(error.code, error.status);
|
||||
@@ -0,0 +1,11 @@
|
||||
// Type definitions for custom-error-generator 7.0.0
|
||||
// Project: https://github.com/jproulx/node-custom-error
|
||||
// Definitions by: Thierry Miceli <https://github.com/thmiceli>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "custom-error-generator" {
|
||||
function createError(name: string, parameters?: Object, Constructor?: any): any;
|
||||
module createError {
|
||||
}
|
||||
export = createError;
|
||||
}
|
||||
Vendored
+17
@@ -371,6 +371,12 @@ declare module D3 {
|
||||
* Request a comma-separated values (CSV) file.
|
||||
*/
|
||||
csv: Dsv;
|
||||
|
||||
/**
|
||||
* Request an arbitrary char-separated values file parser, like semicolon or what ever
|
||||
*/
|
||||
dsv: Dsv;
|
||||
|
||||
/**
|
||||
* Request a tab-separated values (TSV) file
|
||||
*/
|
||||
@@ -708,6 +714,17 @@ declare module D3 {
|
||||
*/
|
||||
(url: string, callback?: (error: any, response: any[]) => void ): Xhr;
|
||||
/**
|
||||
* Arbitrary Delimiters:
|
||||
* Constructs a new parser for the given delimiter and mime type. For example, to parse values separated by "|", the vertical bar character, use:
|
||||
* var dsv = d3.dsv("|", "text/plain");
|
||||
*
|
||||
* returns the new parser
|
||||
*
|
||||
* @param separator seperator character
|
||||
* @param contentType
|
||||
*/
|
||||
(separator: string, contentType:string): (url: string, callback?: (error: any, response: any[]) => void )=> Xhr;
|
||||
/**
|
||||
* Parse a delimited string into objects using the header row.
|
||||
*
|
||||
* @param string delimited formatted string to parse
|
||||
|
||||
@@ -0,0 +1,401 @@
|
||||
/// <reference path="decimal.js.d.ts" />
|
||||
var x = new Decimal(9)
|
||||
var y = new Decimal(x)
|
||||
|
||||
Decimal(435.345)
|
||||
|
||||
new Decimal('5032485723458348569331745.33434346346912144534543')
|
||||
new Decimal('4.321e+4')
|
||||
new Decimal('-735.0918e-430')
|
||||
new Decimal('5.6700000')
|
||||
new Decimal(Infinity)
|
||||
new Decimal(NaN)
|
||||
new Decimal('.5')
|
||||
new Decimal('+2')
|
||||
new Decimal(-10110100.1, 2)
|
||||
new Decimal('123412421.234324', 5)
|
||||
new Decimal('ff.8', 16)
|
||||
|
||||
Decimal.config({ precision: 5 })
|
||||
new Decimal(1.23456789)
|
||||
new Decimal(1.23456789, 10)
|
||||
|
||||
|
||||
Decimal.config({
|
||||
precision: 20,
|
||||
rounding: 4,
|
||||
toExpNeg: -7,
|
||||
toExpPos: 21,
|
||||
minE: -9e15,
|
||||
maxE: 9e15,
|
||||
errors: true,
|
||||
crypto: false,
|
||||
modulo: 1,
|
||||
format: {
|
||||
decimalSeparator: '.',
|
||||
groupSeparator: ',',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 0,
|
||||
fractionGroupSeparator: '\xA0',
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
});
|
||||
|
||||
Decimal.config({
|
||||
format: {
|
||||
|
||||
decimalSeparator: '.',
|
||||
|
||||
groupSeparator: ',',
|
||||
|
||||
groupSize: 3,
|
||||
|
||||
secondaryGroupSize: 0,
|
||||
|
||||
fractionGroupSeparator: ' ',
|
||||
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
});
|
||||
Decimal.config({ rounding: Decimal.ROUND_CEIL })
|
||||
Decimal.config({ rounding: 2 })
|
||||
Decimal.rounding
|
||||
|
||||
x = new Decimal(1.3)
|
||||
x.ceil()
|
||||
y = new Decimal(-1.8)
|
||||
y.ceil()
|
||||
|
||||
x.comparedTo(y)
|
||||
x.comparedTo(x.minus(1))
|
||||
y.cmp(NaN)
|
||||
y.cmp('110', 2)
|
||||
|
||||
x.decimalPlaces()
|
||||
y.dp()
|
||||
|
||||
x.dividedBy(y)
|
||||
x.div(5)
|
||||
x.div(47, 16)
|
||||
|
||||
x.dividedToIntegerBy(y)
|
||||
x.divToInt(0.7)
|
||||
x.divToInt('0.f', 16)
|
||||
|
||||
x.equals('1e-324')
|
||||
new Decimal(-0).eq(x)
|
||||
new Decimal(255).eq('ff', 16)
|
||||
|
||||
y = new Decimal(NaN)
|
||||
y.equals(NaN)
|
||||
|
||||
x = new Decimal(1)
|
||||
x.exponential()
|
||||
y = new Decimal(2)
|
||||
y.exp()
|
||||
|
||||
x = new Decimal(1.8)
|
||||
x.floor()
|
||||
y = new Decimal(-1.3)
|
||||
y.floor()
|
||||
|
||||
x.greaterThan(Decimal(0.3).minus(0.2))
|
||||
new Decimal(0).gt(x)
|
||||
new Decimal(11, 3).gt(11.1, 2)
|
||||
|
||||
|
||||
x = new Decimal(0.3).minus(0.2)
|
||||
x.greaterThanOrEqualTo(0.1)
|
||||
new Decimal(1).gte(x)
|
||||
new Decimal(10, 18).gte('i', 36)
|
||||
|
||||
x = new Decimal(1)
|
||||
x.isFinite()
|
||||
y = new Decimal(Infinity)
|
||||
y.isFinite()
|
||||
|
||||
x = new Decimal(1)
|
||||
x.isInteger()
|
||||
y = new Decimal(123.456)
|
||||
y.isInt()
|
||||
|
||||
x = new Decimal(NaN)
|
||||
x.isNaN()
|
||||
y = new Decimal('Infinity')
|
||||
y.isNaN()
|
||||
|
||||
x = new Decimal(-0)
|
||||
x.isNegative()
|
||||
y = new Decimal(2)
|
||||
y.isNeg
|
||||
|
||||
x = new Decimal(-0)
|
||||
x.isZero() && x.isNeg()
|
||||
y = new Decimal(Infinity)
|
||||
y.isZero()
|
||||
|
||||
x.lessThan(0.1)
|
||||
new Decimal(0).lt(x)
|
||||
new Decimal(11.1, 2).lt(11, 3)
|
||||
|
||||
x.lessThan(0.1)
|
||||
new Decimal(0).lt(x)
|
||||
new Decimal(11.1, 2).lt(11, 3)
|
||||
|
||||
x = new Decimal(0.1)
|
||||
x.lessThanOrEqualTo(Decimal(0.3).minus(0.2))
|
||||
new Decimal(-1).lte(x)
|
||||
new Decimal(10, 18).lte('i', 36)
|
||||
|
||||
x = new Decimal(1000)
|
||||
x.logarithm()
|
||||
y = new Decimal(256)
|
||||
y.log(2)
|
||||
|
||||
x = new Decimal(0.3)
|
||||
x.minus(0.1)
|
||||
x.minus(0.6, 20)
|
||||
|
||||
x = new Decimal(1)
|
||||
x.modulo(0.9)
|
||||
|
||||
y = new Decimal(33)
|
||||
y.mod('a', 33)
|
||||
|
||||
x = new Decimal(8)
|
||||
y = new Decimal(-3)
|
||||
Decimal.modulo = 1
|
||||
x.mod(y)
|
||||
Decimal.modulo = 3
|
||||
x.mod(y)
|
||||
|
||||
x = new Decimal(10)
|
||||
x.naturalLogarithm()
|
||||
y = new Decimal('1.23e+30')
|
||||
y.ln()
|
||||
|
||||
x = new Decimal(1.8)
|
||||
x.negated()
|
||||
y = new Decimal(-1.3)
|
||||
y.neg()
|
||||
|
||||
x = new Decimal(0.1)
|
||||
y = x.plus(0.2)
|
||||
new Decimal(0.7).plus(x).plus(y)
|
||||
x.plus('0.1', 8)
|
||||
|
||||
x = new Decimal(1.234)
|
||||
x.precision()
|
||||
y = new Decimal(987000)
|
||||
y.sd()
|
||||
y.sd(true)
|
||||
|
||||
Decimal.config({ rounding: 4 })
|
||||
x.round()
|
||||
|
||||
Decimal.rounding = Decimal.ROUND_DOWN
|
||||
x.round()
|
||||
x
|
||||
|
||||
x = new Decimal(16)
|
||||
x.squareRoot()
|
||||
y = new Decimal(3)
|
||||
y.sqrt()
|
||||
y.sqrt().eq(y.pow(0.5))
|
||||
|
||||
x = new Decimal(0.6)
|
||||
y = x.times(3)
|
||||
new Decimal('7e+500').times(y)
|
||||
x.times('-a', 16)
|
||||
|
||||
x = new Decimal(12.24567)
|
||||
x.toDecimalPlaces(0)
|
||||
x.toDecimalPlaces(1, 0)
|
||||
|
||||
y = new Decimal(9876.54321)
|
||||
y.toDP(3)
|
||||
y.toDP(1, 0)
|
||||
y.toDP(1, Decimal.ROUND_DOWN)
|
||||
|
||||
y = new Decimal(x)
|
||||
x.toExponential()
|
||||
y.toExponential()
|
||||
x.toExponential(0)
|
||||
y.toExponential(0)
|
||||
x.toExponential(1)
|
||||
y.toExponential(1)
|
||||
y.toExponential(1, 1)
|
||||
x.toExponential(3)
|
||||
y.toExponential(3)
|
||||
|
||||
y = new Decimal(x)
|
||||
x.toFixed()
|
||||
y.toFixed()
|
||||
y.toFixed(0)
|
||||
x.toFixed(2)
|
||||
y.toFixed(2)
|
||||
y.toFixed(2, 1)
|
||||
x.toFixed(5)
|
||||
y.toFixed(5)
|
||||
|
||||
Decimal.config({
|
||||
format: {
|
||||
decimalSeparator: '.',
|
||||
groupSeparator: ',',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 0,
|
||||
fractionGroupSeparator: ' ',
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
});
|
||||
|
||||
x = new Decimal('123456789.123456789')
|
||||
x.toFormat()
|
||||
x.toFormat(1)
|
||||
|
||||
|
||||
Decimal.format.groupSeparator = ' ';
|
||||
Decimal.format.fractionGroupSize = 5;
|
||||
x.toFormat()
|
||||
|
||||
|
||||
Decimal.format = {
|
||||
decimalSeparator: ',',
|
||||
groupSeparator: '.',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 2
|
||||
}
|
||||
|
||||
x.toFormat()
|
||||
|
||||
x.toFraction()
|
||||
|
||||
var pi = new Decimal('3.14159265358')
|
||||
pi.toFraction()
|
||||
pi.toFraction(100000)
|
||||
pi.toFraction(10000)
|
||||
pi.toFraction(100)
|
||||
pi.toFraction(10)
|
||||
pi.toFraction(1)
|
||||
|
||||
|
||||
|
||||
x = new Decimal('177.7e+457')
|
||||
y = new Decimal(235.4325)
|
||||
var z = new Decimal('0.0098074')
|
||||
|
||||
// Serialize an array of three Decimals
|
||||
var str = JSON.stringify([x, y, z])
|
||||
// "["1.777e+459","235.4325","0.0098074"]"
|
||||
|
||||
// Return an array of three Decimals
|
||||
JSON.parse(str, function(key, val) {
|
||||
return key === '' ? val : new Decimal(val)
|
||||
})
|
||||
|
||||
x = new Decimal(1.39)
|
||||
x.toNearest(0.25)
|
||||
|
||||
y = new Decimal(0.75)
|
||||
y.toNearest(0.5, 0)
|
||||
y.toNearest(0.5, 1)
|
||||
|
||||
x = new Decimal(456.789)
|
||||
x.toNumber()
|
||||
|
||||
y = new Decimal('45987349857634085409857349856430985')
|
||||
y.toNumber()
|
||||
|
||||
z = new Decimal(-0)
|
||||
1 / +z
|
||||
1 / z.toNumber()
|
||||
|
||||
Math.pow(0.7, 2)
|
||||
x = new Decimal(0.7)
|
||||
x.toPower(2)
|
||||
new Decimal(3).pow(-2)
|
||||
|
||||
new Decimal(1217652.23).pow('98765.489305603941')
|
||||
y = new Decimal(x)
|
||||
x.toPrecision()
|
||||
y.toPrecision()
|
||||
x.toPrecision(1)
|
||||
y.toPrecision(1)
|
||||
y.toPrecision(2, 0)
|
||||
y.toPrecision(2, 1)
|
||||
x.toPrecision(5)
|
||||
y.toPrecision(5)
|
||||
|
||||
Decimal.config({ precision: 5, rounding: 4 })
|
||||
x = new Decimal(9876.54321)
|
||||
|
||||
x.toSignificantDigits()
|
||||
x.toSignificantDigits(6)
|
||||
x.toSignificantDigits(6, Decimal.ROUND_UP)
|
||||
x.toSD(2)
|
||||
x.toSD(2, 1)
|
||||
|
||||
x = new Decimal(750000)
|
||||
x.toString()
|
||||
Decimal.config({ toExpPos: 5 })
|
||||
x.toString()
|
||||
|
||||
y = new Decimal(362.875)
|
||||
y.toString(2)
|
||||
y.toString(9)
|
||||
y.toString(32)
|
||||
|
||||
Decimal.config({ precision: 4 });
|
||||
z = new Decimal('1.23456789')
|
||||
z.toString()
|
||||
z.toString(10)
|
||||
|
||||
x = new Decimal(123.456)
|
||||
x.truncated()
|
||||
y = new Decimal(-12.3)
|
||||
y.trunc()
|
||||
|
||||
x = new Decimal('1.777e+457')
|
||||
x.valueOf()
|
||||
|
||||
x = Decimal.exp(3)
|
||||
y = new Decimal(3).exp()
|
||||
x.equals(y)
|
||||
|
||||
x = Decimal.ln(4.321)
|
||||
y = new Decimal(4.321).ln()
|
||||
x.equals(y)
|
||||
|
||||
x = Decimal.log(100, 2.5)
|
||||
y = new Decimal(100).log(2.5)
|
||||
x.equals(y)
|
||||
|
||||
x = new Decimal('3257869345.0378653')
|
||||
Decimal.max(4e9, x, '123456789.9')
|
||||
|
||||
var arr = [12, '13', new Decimal(14)]
|
||||
Decimal.max(arr)
|
||||
|
||||
x = new Decimal('3257869345.0378653')
|
||||
Decimal.min(4e9, x, '123456789.9')
|
||||
|
||||
arr = [2, new Decimal(-14), '-15.9999', -12]
|
||||
Decimal.min(arr)
|
||||
|
||||
x = new Decimal(2)
|
||||
var D = Decimal.noConflict()
|
||||
Decimal
|
||||
y = new D(3)
|
||||
|
||||
x = Decimal.pow(3257.4, 17.01)
|
||||
y = new Decimal(3257.4).pow(17.01)
|
||||
x.equals(y)
|
||||
|
||||
Decimal.config({ precision: 10 })
|
||||
Decimal.random()
|
||||
|
||||
Decimal.random(20)
|
||||
|
||||
x = Decimal.sqrt('987654321.123456789')
|
||||
y = new Decimal('987654321.123456789').sqrt()
|
||||
x.equals(y)
|
||||
Vendored
+765
@@ -0,0 +1,765 @@
|
||||
// Type definitions for decimal.js
|
||||
// Project: http://mikemcl.github.io/decimal.js
|
||||
// Definitions by: Joseph Rossi <http://github.com/musicist288>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var Decimal: decimal.IDecimalStatic;
|
||||
|
||||
// Support AMD require
|
||||
declare module 'decimal' {
|
||||
export = Decimal;
|
||||
}
|
||||
|
||||
declare module decimal {
|
||||
|
||||
enum RoundingMode {
|
||||
/**
|
||||
* Rounds away from zero
|
||||
*/
|
||||
ROUND_UP = 0,
|
||||
|
||||
/**
|
||||
* Rounds towards zero
|
||||
*/
|
||||
ROUND_DOWN = 1,
|
||||
|
||||
/**
|
||||
* Rounds towards Infinity
|
||||
*/
|
||||
ROUND_CEIL = 2,
|
||||
|
||||
/**
|
||||
* Rounds towards -Infinity
|
||||
*/
|
||||
ROUND_FLOOR = 3,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds away from zero
|
||||
*/
|
||||
ROUND_HALF_UP = 4,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards zero
|
||||
*/
|
||||
ROUND_HALF_DOWN = 5,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards even neighbour
|
||||
*/
|
||||
ROUND_HALF_EVEN = 6,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards Infinity
|
||||
*/
|
||||
ROUND_HALF_CEIL = 7,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards -Infinity
|
||||
*/
|
||||
ROUND_HALF_FLOOR = 8,
|
||||
|
||||
/**
|
||||
* Not a rounding mode, see modulo
|
||||
*/
|
||||
EUCLID = 9,
|
||||
}
|
||||
|
||||
interface IFormatConfig {
|
||||
decimalSeparator?: string;
|
||||
groupSeparator?: string;
|
||||
groupSize?: number;
|
||||
secondaryGroupSize?: number;
|
||||
fractionGroupSeparator?: string;
|
||||
fractionGroupSize?: number;
|
||||
}
|
||||
|
||||
interface IDecimalConfig {
|
||||
/**
|
||||
* number: integer, 1 to 1e+9 inclusive
|
||||
* Default value: 20
|
||||
*
|
||||
* The maximum number of significant digits of the result of a calculation or base conversion.
|
||||
*
|
||||
* All methods which return a Decimal will round the return value to precision significant digits except absoluteValue, ceil, floor, negated, round, toDecimalPlaces, toNearest and truncated.
|
||||
*
|
||||
* A Decimal constructor will also not round to precision unless a base is specified.
|
||||
*/
|
||||
precision?: number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 8 inclusive
|
||||
* Default value: 4 (ROUND_HALF_UP)
|
||||
*
|
||||
* The default rounding mode used when rounding the result of a calculation or base conversion to precision significant digits, and when rounding the return value of the round, toDecimalPlaces, toExponential, toFixed, toFormat, toNearest, toPrecision and toSignificantDigits methods.
|
||||
*
|
||||
* The rounding modes are available as enumerated properties of the constructor.
|
||||
*/
|
||||
rounding?: RoundingMode;
|
||||
|
||||
/**
|
||||
* number: integer, -9e15 to 0 inclusive
|
||||
* Default value: -7
|
||||
*
|
||||
* The negative exponent value at and below which toString returns exponential notation.
|
||||
* @type {[type]}
|
||||
*/
|
||||
toExpNeg?: number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 9e15 inclusive
|
||||
* Default value: 20
|
||||
*
|
||||
* The positive exponent value at and above which toString returns exponential notation.
|
||||
*/
|
||||
toExpPos?: number;
|
||||
|
||||
/**
|
||||
* number: integer, -9e15 to 0 inclusive
|
||||
* Default value: -9e15
|
||||
*
|
||||
* The negative exponent limit, i.e. the exponent value below which underflow to zero occurs.
|
||||
*
|
||||
* If the Decimal to be returned by a calculation would have an exponent lower than minE then its value becomes zero.
|
||||
*
|
||||
* JavaScript numbers underflow to zero for exponents below -324.
|
||||
*/
|
||||
minE?: number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 9e15 inclusive
|
||||
* Default value: 9e15
|
||||
*
|
||||
* The positive exponent limit, i.e. the exponent value above which overflow to Infinity occurs.
|
||||
*
|
||||
* If the Decimal to be returned by a calculation would have an exponent higher than maxE then its value becomes Infinity.
|
||||
*
|
||||
* JavaScript numbers overflow to Infinity for exponents above 308.
|
||||
*/
|
||||
maxE?: number;
|
||||
|
||||
/**
|
||||
* boolean/number: true, false, 1 or 0
|
||||
* Default value: true
|
||||
*
|
||||
* The value that determines whether Decimal Errors are thrown. If errors is false, this library will not throw errors.
|
||||
*/
|
||||
errors?: boolean | number;
|
||||
|
||||
/**
|
||||
* boolean/number: true, false, 1 or 0
|
||||
* Default value: false
|
||||
*
|
||||
* The value that determines whether cryptographically-secure pseudo-random number generation is used.
|
||||
*
|
||||
* If crypto is truthy then the random method will generate random digits using crypto.getRandomValues in browsers that support it, or crypto.randomBytes if using a version of Node.js that supports it.
|
||||
*
|
||||
* If neither function is supported by the host environment or if crypto is falsey then the source of randomness will be Math.random. If the crypto property is set directly (i.e. without using config) to true, then at the time the random method is called, if errors is true, an error will be thrown if the crypto methods are unavailable.
|
||||
*/
|
||||
crypto?: boolean | number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 9 inclusive
|
||||
* Default value: 1 (ROUND_DOWN)
|
||||
*
|
||||
* The modulo mode used when calculating the modulus: a mod n.
|
||||
*
|
||||
* The quotient, q = a / n, is calculated according to the rounding mode that corresponds to the chosen modulo mode.
|
||||
*
|
||||
* The remainder, r, is calculated as: r = a - n * q.
|
||||
*
|
||||
* The modes that are most commonly used for the modulus/remainder operation are ROUND_UP, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_EVEN, and EUCLID. Although the other rounding modes can be used, they may not give useful results.
|
||||
*/
|
||||
modulo?: RoundingMode;
|
||||
|
||||
/**
|
||||
* The format object configures the format of the string returned by the toFormat method.
|
||||
*
|
||||
* The example below shows the properties of the format object that are recognised, and their default values.
|
||||
*
|
||||
* Unlike setting other properties using config, the values of the properties of the format object will not be checked for validity. The existing format object will simply be replaced by the object that is passed in. Only the toFormat method ever references a Decimal constructor's format object property.
|
||||
*
|
||||
* See toFormat for examples of usage, and of setting format properties individually and directly without using config.
|
||||
*/
|
||||
format?: IFormatConfig;
|
||||
}
|
||||
|
||||
interface IDecimalStatic extends IDecimalConfig {
|
||||
(value: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
new(value: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Configures the 'global' settings for this particular Decimal constructor.
|
||||
*
|
||||
* Returns this Decimal constructor.
|
||||
*/
|
||||
config(object: IDecimalConfig): IDecimalStatic;
|
||||
|
||||
/**
|
||||
* Returns a new independent Decimal constructor with configuration settings as described by object
|
||||
*/
|
||||
constructor(object: IDecimalConfig): IDecimalStatic;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
exp(n: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The natual logarithm is the inverse of the exponential function.
|
||||
*/
|
||||
ln(n: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned.
|
||||
*/
|
||||
log(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the maximum of arg1, arg2,... .
|
||||
*/
|
||||
max(...args: any[]): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the minimum of arg1, arg2,... .
|
||||
*/
|
||||
min(...args: any[]): Decimal;
|
||||
|
||||
/**
|
||||
* Reverts the Decimal variable to the value it had before this library was loaded and returns a reference to the original Decimal constructor so it can be assigned to a variable with a different name.
|
||||
*/
|
||||
noConflict(): IDecimalStatic;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate.
|
||||
*/
|
||||
pow(base: number | string | Decimal, exponent: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal with a pseudo-random value equal to or greater than 0 and less than 1. The return value will have dp decimal places (or less if trailing zeros are produced). If dp is omitted then the number of decimal places will default to the current precision setting.
|
||||
*
|
||||
* Depending on the value of a Decimal constructor's crypto property and the support for the crypto object in the host environment, the random digits of the return value are generated by either Math.random (fastest), crypto.getRandomValues (Web Cryptography API in recent browsers) or crypto.randomBytes (Node.js).
|
||||
*
|
||||
* If crypto is true, i.e. one of the crypto methods is to be used, the value of a returned Decimal should be cryptographically-secure and statistically indistinguishable from a random value.
|
||||
*/
|
||||
random(dp?: number): Decimal;
|
||||
|
||||
/**
|
||||
* The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding.
|
||||
*
|
||||
* This method is much faster than using the toPower method with an exponent of 0.5.
|
||||
*/
|
||||
sqrt(arg: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* A Decimal instance with value one.
|
||||
*/
|
||||
ONE: number;
|
||||
|
||||
/**
|
||||
* Rounds away from zero
|
||||
*/
|
||||
ROUND_UP: number;
|
||||
|
||||
/**
|
||||
* Rounds towards zero
|
||||
*/
|
||||
ROUND_DOWN: number;
|
||||
|
||||
/**
|
||||
* Rounds towards Infinity
|
||||
*/
|
||||
ROUND_CEIL: number;
|
||||
|
||||
/**
|
||||
* Rounds towards -Infinity
|
||||
*/
|
||||
ROUND_FLOOR: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds away from zero
|
||||
*/
|
||||
ROUND_HALF_UP: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards zero
|
||||
*/
|
||||
ROUND_HALF_DOWN: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards even neighbour
|
||||
*/
|
||||
ROUND_HALF_EVEN: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards Infinity
|
||||
*/
|
||||
ROUND_HALF_CEIL: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards -Infinity
|
||||
*/
|
||||
ROUND_HALF_FLOOR: number;
|
||||
|
||||
/**
|
||||
* Not a rounding mode, see modulo
|
||||
*/
|
||||
EUCLID: number;
|
||||
}
|
||||
|
||||
interface Decimal {
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal.
|
||||
*
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
absoluteValue(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal.
|
||||
*
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
abs(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to a whole number in the direction of positive Infinity.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
ceil(): Decimal;
|
||||
|
||||
/**
|
||||
* @return 1, -1, 0, or null
|
||||
* 1 If the value of this Decimal is greater than the
|
||||
* value of n
|
||||
* -1 If the value of this Decimal is less than the value
|
||||
* of n
|
||||
* 0 If this Decimal and n have the same value
|
||||
* null If the value of either this Decimal or n is NaN
|
||||
*/
|
||||
comparedTo(n: number | string | Decimal, base?: number): number;
|
||||
|
||||
/**
|
||||
* Returns 1, -1, 0, or null
|
||||
* 1 If the value of this Decimal is greater than the value
|
||||
* of n
|
||||
* -1 If the value of this Decimal is less than the value
|
||||
* of n
|
||||
* 0 If this Decimal and n have the same value
|
||||
* null If the value of either this Decimal or n is NaN
|
||||
*/
|
||||
cmp(n: number | string | Decimal, base?: number): number;
|
||||
|
||||
/**
|
||||
* Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal.
|
||||
*/
|
||||
decimalPlaces(): number;
|
||||
|
||||
/**
|
||||
* Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal.
|
||||
*/
|
||||
dp(): number;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal divided by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
dividedBy(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal divided by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
div(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Return a new Decimal whose value is the integer part of dividing this Decimal by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
dividedToIntegerBy(n: number | string| Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Return a new Decimal whose value is the integer part of dividing this Decimal by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
divToInt(n: number | string| Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns true if the value of this Decimal equals the value of n, otherwise returns false.
|
||||
*
|
||||
* As with JavaScript, NaN does not equal NaN.
|
||||
*
|
||||
* Note: This method uses the cmp method internally.
|
||||
*/
|
||||
equals(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value of this Decimal equals the value of n, otherwise returns false.
|
||||
*
|
||||
* As with JavaScript, NaN does not equal NaN.
|
||||
*
|
||||
* Note: This method uses the cmp method internally.
|
||||
*/
|
||||
eq(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
exponential(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
exp(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
floor(): Decimal;
|
||||
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
greaterThan(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
gt(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
greaterThanOrEqualTo(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
gte(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* The only possible non-finite values of a Decimal are NaN, Infinity and -Infinity.
|
||||
*/
|
||||
isFinite(): boolean;
|
||||
|
||||
isInteger(): boolean;
|
||||
|
||||
isInt(): boolean;
|
||||
|
||||
isNaN(): boolean;
|
||||
|
||||
isNegative(): boolean;
|
||||
|
||||
isNeg(): boolean;
|
||||
|
||||
isZero(): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lessThan(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lt(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lessThanOrEqualTo(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lte(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned.
|
||||
*/
|
||||
logarithm(n?: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned.
|
||||
*/
|
||||
log(n?: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal minus n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
minus(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal modulo n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. If it is 1 (default value), the result will have the same sign as this Decimal, and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method.
|
||||
*/
|
||||
modulo(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal modulo n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. If it is 1 (default value), the result will have the same sign as this Decimal, and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method.
|
||||
*/
|
||||
mod(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The natual logarithm is the inverse of the exponential function.
|
||||
*/
|
||||
naturalLogarithm(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The natual logarithm is the inverse of the exponential function.
|
||||
*/
|
||||
ln(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
negated(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
neg(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal plus n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
plus(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* If include_zeros is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not.
|
||||
*/
|
||||
precision(include_leading_zeros?: boolean | number): number;
|
||||
|
||||
/**
|
||||
* If include_zeros is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not.
|
||||
*/
|
||||
sd(include_leading_zeros?: boolean | number): number;
|
||||
|
||||
round(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding.
|
||||
*
|
||||
* This method is much faster than using the toPower method with an exponent of 0.5.
|
||||
*/
|
||||
squareRoot(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding.
|
||||
*
|
||||
* This method is much faster than using the toPower method with an exponent of 0.5.
|
||||
*/
|
||||
sqrt(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal times n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
times(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, the return value will have the same value as this Decimal.
|
||||
*
|
||||
* If rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toDecimalPlaces(dp?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, the return value will have the same value as this Decimal.
|
||||
*
|
||||
* If rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toDP(dp?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal in exponential notation rounded using rounding mode rm to dp decimal places, i.e with one digit before the decimal point and dp digits after it.
|
||||
*
|
||||
* If the value of this Decimal in exponential notation has fewer than dp fraction digits, the return value will be appended with zeros accordingly.
|
||||
*
|
||||
* If dp is omitted, or is null or undefined, the number of digits after the decimal point defaults to the minimum number of digits necessary to represent the value exactly.
|
||||
*
|
||||
* If rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toExponential(dp?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal in normal (fixed-point) notation rounded to dp decimal places using rounding mode rm.
|
||||
*
|
||||
* If the value of this Decimal in normal notation has fewer than dp fraction digits , the return value will be appended with zeros accordingly.
|
||||
*
|
||||
* Unlike Number.prototype.toFixed, which returns exponential notation if a number is greater or equal to 1021, this method will always return normal notation.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, then the return value will be unrounded and in normal notation. This is unlike Number.prototype.toFixed, which returns the value to zero decimal places, but is useful when because of the current toExpNeg or toExpNeg values, toString returns exponential notation
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toFixed(dp?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal in fixed-point notation rounded to dp decimal places using rounding mode rm (as toFixed), and formatted according to the properties of this Decimal's constructor's format object property.
|
||||
*
|
||||
* See the examples below for the properties of the format object, their types and their usage.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, then the return value is not rounded to a fixed number of decimal places.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toFormat(dp?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a string array representing the value of this Decimal as a simple fraction with an integer numerator and an integer denominator. The denominator will be a positive non-zero value less than or equal to max_denominator.
|
||||
*
|
||||
* If a maximum denominator is not specified, or is null or undefined, the denominator will be the lowest value necessary to represent the number exactly.
|
||||
*/
|
||||
toFraction(max_denominator?: number | string | Decimal): string[];
|
||||
|
||||
toJSON(): string;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the nearest multiple of n to the value of this Decimal.
|
||||
*
|
||||
* If the value of this Decimal is equidistant from two multiples of n, the rounding mode rm, or rounding if rm is omitted or is null or undefined, determines the direction of the nearest.
|
||||
*
|
||||
* In this context, rounding mode ROUND_HALF_UP is interpreted the same as rounding mode ROUND_UP, and so on. I.e. the rounding is either up, own, to ceil, to floor or to even.
|
||||
*
|
||||
* The return value will always have the same sign as this Decimal, unless either this Decimal or n is NaN, in which case the return value will be also be NaN.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
toNearest(n: number | string | Decimal, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns the value of this Decimal converted to a number primitive.
|
||||
*
|
||||
* Type coercion with, for example, JavaScript's unary plus operator will also work, except that a Decimal with the value minus zero will convert to positive zero.
|
||||
*/
|
||||
toNumber(): number;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate.
|
||||
*/
|
||||
toPower(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate.
|
||||
*/
|
||||
pow(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal rounded to sd significant digits using rounding mode rm.
|
||||
*
|
||||
* If sd is less than the number of digits necessary to represent the integer part of the value in normal (fixed-point) notation, then exponential notation is used.
|
||||
*
|
||||
* If sd is omitted or is null or undefined, then the return value is the same as toString.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toPrecision(sd?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm.
|
||||
*
|
||||
* If sd is omitted or is null or undefined, the return value will be rounded to precision significant digits.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding will be used.
|
||||
*/
|
||||
toSignificantDigits(sd?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm.
|
||||
*
|
||||
* If sd is omitted or is null or undefined, the return value will be rounded to precision significant digits.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding will be used.
|
||||
*/
|
||||
toSD(sd?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* base: number: integer, 2 to 64 inclusive
|
||||
*
|
||||
* Returns a string representing the value of this Decimal in the specified base, or base 10 if base is omitted or is null or undefined.
|
||||
*
|
||||
* For bases above 10, values from 10 to 35 are represented by a-z (as with Number.prototype.toString), 36 to 61 by A-Z, and 62 and 63 by $ and _ respectively.
|
||||
*
|
||||
* If a base is specified the value is rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If a base is not specified and this Decimal has a positive exponent that is equal to or greater than toExpPos, or a negative exponent equal to or less than toExpNeg, then exponential notation is returned.
|
||||
*
|
||||
* If base is null or undefined it is ignored.
|
||||
*/
|
||||
toString(base?: number): string;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal truncated to a whole number.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
truncated(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal truncated to a whole number.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
trunc(): Decimal;
|
||||
|
||||
/**
|
||||
* As toString, but does not accept a base argument.
|
||||
*/
|
||||
valueOf(): string;
|
||||
|
||||
/**
|
||||
* coefficient
|
||||
*
|
||||
* Array of integers, each 0 - 1e7
|
||||
*/
|
||||
c: number[];
|
||||
|
||||
/**
|
||||
* exponent
|
||||
*
|
||||
* Integer, -9e15 to 9e15 inclusive
|
||||
*/
|
||||
e: number;
|
||||
|
||||
/**
|
||||
* sign
|
||||
*
|
||||
* -1 or 1
|
||||
*/
|
||||
s: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
/// <reference path="dexie.d.ts" />
|
||||
|
||||
import Dexie = require("Dexie");
|
||||
|
||||
module Utils {
|
||||
|
||||
export class Console {
|
||||
textarea: HTMLTextAreaElement;
|
||||
|
||||
constructor() {
|
||||
this.textarea = document.createElement('textarea');
|
||||
}
|
||||
|
||||
log(txt: string, type?: string) {
|
||||
if (type) this.textarea.value += type + " ";
|
||||
this.textarea.value += txt + "\n";
|
||||
}
|
||||
error = function (txt: string) {
|
||||
this.log(txt, "ERROR!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module AppDb {
|
||||
|
||||
export class AppDatabase extends Dexie {
|
||||
|
||||
contacts: Dexie.Table<Contact, number>;
|
||||
emails: Dexie.Table<IEmailAddress, number>;
|
||||
phones: Dexie.Table<IPhoneNumber, number>;
|
||||
|
||||
constructor() {
|
||||
|
||||
super("MyTypeScriptAppDb");
|
||||
|
||||
var db = this;
|
||||
|
||||
//
|
||||
// Define tables and indexes
|
||||
//
|
||||
db.version(1).stores({
|
||||
contacts: '++id, first, last',
|
||||
emails: '++id, contactId, type, email',
|
||||
phones: '++id, contactId, type, phone',
|
||||
});
|
||||
|
||||
// Let's physically map Contact class to contacts table.
|
||||
// This will make it possible to call loadEmailsAndPhones()
|
||||
// directly on retrieved database objects.
|
||||
db.contacts.mapToClass(Contact);
|
||||
}
|
||||
}
|
||||
|
||||
/* Just for code completion and compilation - defines
|
||||
* the interface of objects stored in the emails table.
|
||||
*/
|
||||
export interface IEmailAddress {
|
||||
id?: number;
|
||||
contactId: number;
|
||||
type: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
/* Just for code completion and compilation - defines
|
||||
* the interface of objects stored in the phones table.
|
||||
*/
|
||||
export interface IPhoneNumber {
|
||||
id?: number;
|
||||
contactId: number;
|
||||
type: string;
|
||||
phone: string;
|
||||
}
|
||||
|
||||
/* This is a 'physical' class that is mapped to
|
||||
* the contacts table. We can have methods on it that
|
||||
* we could call on retrieved database objects.
|
||||
*/
|
||||
export class Contact {
|
||||
id: number;
|
||||
first: string;
|
||||
last: string;
|
||||
emails: IEmailAddress[];
|
||||
phones: IPhoneNumber[];
|
||||
|
||||
constructor(first: string, last: string, id?: number) {
|
||||
this.first = first;
|
||||
this.last = last;
|
||||
if (id) this.id = id;
|
||||
}
|
||||
|
||||
loadEmailsAndPhones() : Dexie.Promise<Contact> {
|
||||
return Dexie.Promise.all<any>(
|
||||
db.emails
|
||||
.where('contactId').equals(this.id)
|
||||
.toArray(emails => this.emails = emails)
|
||||
,
|
||||
db.phones
|
||||
.where('contactId').equals(this.id)
|
||||
.toArray(phones => this.phones = phones)
|
||||
|
||||
).then(() => this);
|
||||
}
|
||||
|
||||
save() {
|
||||
return db.transaction('rw', db.contacts, db.emails, db.phones, () => {
|
||||
Dexie.Promise.all(
|
||||
// Save existing arrays
|
||||
Dexie.Promise.all(this.emails.map(email => db.emails.put(email))),
|
||||
Dexie.Promise.all(this.phones.map(phone => db.phones.put(phone))))
|
||||
.then(results => {
|
||||
// Remove items from DB that is was not saved here:
|
||||
var emailIds = results[0], // array of resulting primary keys
|
||||
phoneIds = results[1]; // array of resulting primary keys
|
||||
|
||||
db.emails.where('contactId').equals(this.id)
|
||||
.and(email => emailIds.indexOf(email.id) === -1)
|
||||
.delete();
|
||||
|
||||
db.phones.where('contactId').equals(this.id)
|
||||
.and(phone => phoneIds.indexOf(phone.id) === -1)
|
||||
.delete();
|
||||
|
||||
// At last, save our own properties.
|
||||
// (Must not do put(this) because we would get
|
||||
// reduntant emails/phones arrays saved into db)
|
||||
db.contacts.put(
|
||||
new Contact(this.first, this.last, this.id))
|
||||
.then(id => this.id = id);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export var db = new AppDatabase();
|
||||
db.open();
|
||||
}
|
||||
|
||||
|
||||
import Console = Utils.Console;
|
||||
import db = AppDb.db;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
// Initialize our Console widget - it will log browser window.
|
||||
var console = new Console();
|
||||
document.getElementById('consoleArea').appendChild(console.textarea);
|
||||
|
||||
// Test it:
|
||||
console.log("Hello world!");
|
||||
|
||||
// Make sure to never miss any unexpected error:
|
||||
Dexie.Promise.on.error.subscribe(e => {
|
||||
// Log any uncatched error:
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
//
|
||||
// Let's clear and re-seed the database:
|
||||
//
|
||||
clearDatabase()
|
||||
.then(seedDatabase)
|
||||
.then(playALittle_add_phone_to_adam)
|
||||
.then(printContacts);
|
||||
|
||||
function clearDatabase() {
|
||||
console.log("Clearing database...");
|
||||
return Dexie.Promise.all(
|
||||
db.contacts.clear(),
|
||||
db.emails.clear(),
|
||||
db.phones.clear());
|
||||
}
|
||||
|
||||
function seedDatabase() {
|
||||
console.log("Seeding database with some contacts...");
|
||||
return db.transaction('rw', db.contacts, db.emails, db.phones, () => {
|
||||
// Populate a contact
|
||||
db.contacts.add(new AppDb.Contact('Arnold', 'Fitzgerald')).then(id => {
|
||||
// Populate some emails and phone numbers for the contact
|
||||
db.emails.add({ contactId: id, type: 'home', email: 'arnold@email.com' });
|
||||
db.emails.add({ contactId: id, type: 'work', email: 'arnold@abc.com' });
|
||||
db.phones.add({ contactId: id, type: 'home', phone: '12345678' });
|
||||
db.phones.add({ contactId: id, type: 'work', phone: '987654321' });
|
||||
});
|
||||
|
||||
// ... and another one...
|
||||
db.contacts.add(new AppDb.Contact('Adam', 'Tensta')).then(id => {
|
||||
// Populate some emails and phone numbers for the contact
|
||||
db.emails.add({ contactId: id, type: 'home', email: 'adam@tensta.se' });
|
||||
db.phones.add({ contactId: id, type: 'work', phone: '88888888' });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function playALittle_add_phone_to_adam() {
|
||||
// Now, just to examplify how to use the save() method as an alternative
|
||||
// to db.phones.add(), we will add yet another phone number
|
||||
// to an existing contact and then re-save it:
|
||||
console.log("Playing a little: adding another phone entry for Adam Tensta...");
|
||||
return db.contacts
|
||||
.where('last').equals('Tensta').first(c => c.loadEmailsAndPhones())
|
||||
.then(contact => {
|
||||
// Also add another phone number to Adam Tensta:
|
||||
contact.phones.push({
|
||||
contactId: contact.id,
|
||||
type: 'custom',
|
||||
phone: '112'
|
||||
});
|
||||
contact.save();
|
||||
});
|
||||
}
|
||||
|
||||
function printContacts() {
|
||||
|
||||
// Now we're gonna list all contacts starting with letter 'A'
|
||||
// and print them out.
|
||||
// For each contact, also resolve its collection of
|
||||
// phone number entries and email addresses by reverse-quering
|
||||
// the foreign tables.
|
||||
|
||||
// For atomicity and speed, use a single transaction for the
|
||||
// queries to make:
|
||||
db.transaction('r', [db.contacts, db.phones, db.emails], () => {
|
||||
|
||||
// Query some contacts
|
||||
return db.contacts
|
||||
.where('first').startsWithIgnoreCase('a')
|
||||
.sortBy('id')
|
||||
.then(contacts =>
|
||||
|
||||
// Resolve array properties 'emails' and 'phones'
|
||||
// on each and every contact:
|
||||
Dexie.Promise.all(
|
||||
contacts.map(contact =>
|
||||
contact.loadEmailsAndPhones()))
|
||||
);
|
||||
|
||||
}).then(contacts => {
|
||||
|
||||
// Print result
|
||||
console.log("Database contains the following contacts:");
|
||||
contacts.forEach(contact => {
|
||||
console.log(contact.id + ". " + contact.first + " " + contact.last);
|
||||
console.log(" Phone numbers: ");
|
||||
contact.phones.forEach(phone => {
|
||||
console.log(" " + phone.phone + "(" + phone.type + ")");
|
||||
});
|
||||
console.log(" Emails: ");
|
||||
contact.emails.forEach(email => {
|
||||
console.log(" " + email.email + "(" + email.type + ")");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+320
@@ -0,0 +1,320 @@
|
||||
// Type definitions for Dexie v1.1
|
||||
// Project: https://github.com/dfahlander/Dexie.js
|
||||
// Definitions by: David Fahlander <http://github.com/dfahlander>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface Thenable<R> {
|
||||
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected: (error: any) => Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected?: (error: any) => U): Thenable<U>;
|
||||
then<U>(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable<U>;
|
||||
}
|
||||
|
||||
declare class Dexie {
|
||||
constructor(databaseName: string);
|
||||
|
||||
constructor(databaseName: string, options: { addons: Array<(db: Dexie) => void> });
|
||||
|
||||
name: string;
|
||||
tables: Dexie.Table<any, any>[];
|
||||
verno: number;
|
||||
|
||||
static addons: Array<(db: Dexie) => void>;
|
||||
static version: number;
|
||||
|
||||
static getDatabaseNames(): Dexie.Promise<Array<string>>;
|
||||
|
||||
static getDatabaseNames<U>(onFulfilled: (value: Array<string>) => Thenable<U>): Dexie.Promise<U>;
|
||||
|
||||
static getDatabaseNames<U>(onFulfilled: (value: Array<string>) => U): Dexie.Promise<U>;
|
||||
|
||||
static getByKeyPath(obj: Object, keyPath: string): any;
|
||||
|
||||
static setByKeyPath(obj: Object, keyPath: string, value: any): void;
|
||||
|
||||
static delByKeyPath(obj: Object, keyPath: string): void;
|
||||
|
||||
static shallowClone(obj: Object): Object;
|
||||
|
||||
static deepClone(obj: Object): Object;
|
||||
|
||||
version(versionNumber: Number): Dexie.Version
|
||||
|
||||
on: {
|
||||
(eventName: string, subscriber: () => any): void;
|
||||
(eventName: string, subscriber: () => any, bSticky: boolean): void;
|
||||
ready: Dexie.DexieOnReadyEvent;
|
||||
error: Dexie.DexieErrorEvent;
|
||||
populate: Dexie.DexieEvent;
|
||||
blocked: Dexie.DexieEvent;
|
||||
versionchange: Dexie.DexieVersionChangeEvent;
|
||||
}
|
||||
|
||||
open(): Dexie.Promise<void>;
|
||||
|
||||
table(tableName: string): Dexie.Table<any, any>;
|
||||
|
||||
table<T>(tableName: string): Dexie.Table<T, any>;
|
||||
|
||||
table<T, Key>(tableName: string): Dexie.Table<T, Key>;
|
||||
|
||||
transaction<U>(mode: string, table: Dexie.Table<any, any>, scope: () => Thenable<U>): Dexie.Promise<U>;
|
||||
|
||||
transaction<U>(mode: string, table: Dexie.Table<any, any>, table2: Dexie.Table<any, any>, scope: () => Thenable<U>): Dexie.Promise<U>;
|
||||
|
||||
transaction<U>(mode: string, table: Dexie.Table<any, any>, table2: Dexie.Table<any, any>, table3: Dexie.Table<any, any>, scope: () => Thenable<U>): Dexie.Promise<U>;
|
||||
|
||||
transaction<U>(mode: string, tables: Dexie.Table<any, any>[], scope: () => Thenable<U>): Dexie.Promise<U>;
|
||||
|
||||
transaction<U>(mode: string, table: Dexie.Table<any, any>, scope: () => U): Dexie.Promise<U>;
|
||||
|
||||
transaction<U>(mode: string, table: Dexie.Table<any, any>, table2: Dexie.Table<any, any>, scope: () => U): Dexie.Promise<U>;
|
||||
|
||||
transaction<U>(mode: string, table: Dexie.Table<any, any>, table2: Dexie.Table<any, any>, table3: Dexie.Table<any, any>, scope: () => U): Dexie.Promise<U>;
|
||||
|
||||
transaction<U>(mode: string, tables: Dexie.Table<any, any>[], scope: () => U): Dexie.Promise<U>;
|
||||
|
||||
close(): void;
|
||||
|
||||
delete(): Dexie.Promise<void>;
|
||||
|
||||
isOpen(): boolean;
|
||||
|
||||
hasFailed(): boolean;
|
||||
|
||||
backendDB(): IDBDatabase;
|
||||
|
||||
vip<U>(scopeFunction: () => U): U;
|
||||
}
|
||||
|
||||
declare module Dexie {
|
||||
|
||||
class Promise<R> implements Thenable<R> {
|
||||
constructor(callback: (resolve: (value?: Thenable<R>) => void, reject: (error?: any) => void) => void);
|
||||
|
||||
constructor(callback: (resolve: (value?: R) => void, reject: (error?: any) => void) => void);
|
||||
|
||||
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected: (error: any) => Thenable<U>): Promise<U>;
|
||||
|
||||
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected?: (error: any) => U): Promise<U>;
|
||||
|
||||
then<U>(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable<U>): Promise<U>;
|
||||
|
||||
then<U>(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Promise<U>;
|
||||
|
||||
catch<U>(onRejected: (error: any) => Promise<U>): Promise<U>;
|
||||
|
||||
catch<U>(ExceptionType: Function, onRejected: (error : any) => Promise<U>): Promise<U>;
|
||||
|
||||
catch<U>(errorName: string, onRejected: (error : any) => Promise<U>): Promise<U>;
|
||||
|
||||
finally<R>(onFinally: () => any): Promise<R>;
|
||||
|
||||
onuncatched: () => any;
|
||||
}
|
||||
|
||||
module Promise {
|
||||
function resolve<R>(value?: Thenable<R>): Promise<R>;
|
||||
|
||||
function resolve<R>(value?: R): Promise<R>;
|
||||
|
||||
function reject(error: any): Promise<any>;
|
||||
|
||||
function all<R>(promises: Thenable<R>[]): Promise<R[]>;
|
||||
|
||||
function all<R>(...promises: Thenable<R>[]): Promise<R[]>;
|
||||
|
||||
function race<R>(promises: Thenable<R>[]): Promise<R>;
|
||||
|
||||
function newPSD<R>(scope: () => R): R;
|
||||
|
||||
var PSD: any;
|
||||
|
||||
var on: {
|
||||
(eventName: string, subscriber: (...args : any[]) => any): void;
|
||||
error: DexieErrorEvent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface Version {
|
||||
stores(schema: { [key: string]: string }): Version;
|
||||
upgrade(fn: (trans: Transaction) => void): Version;
|
||||
}
|
||||
|
||||
interface Transaction {
|
||||
active: boolean;
|
||||
db: Dexie;
|
||||
mode: string;
|
||||
idbtrans: IDBTransaction;
|
||||
tables: { [type: string]: Table<any, any> };
|
||||
storeNames: Array<string>;
|
||||
on: {
|
||||
(eventName: string, subscriber: () => any): void;
|
||||
complete: DexieEvent;
|
||||
abort: DexieEvent;
|
||||
error: DexieEvent;
|
||||
}
|
||||
abort(): void;
|
||||
table(tableName: string): Table<any, any>;
|
||||
table<T>(tableName: string): Table<T, any>;
|
||||
table<T, Key>(tableName: string): Table<T, Key>;
|
||||
}
|
||||
|
||||
interface DexieEvent {
|
||||
subscribe(fn: () => any) : void;
|
||||
unsubscribe(fn: () => any) : void;
|
||||
fire() : any;
|
||||
}
|
||||
|
||||
interface DexieErrorEvent {
|
||||
subscribe(fn: (error: any) => any) : void;
|
||||
unsubscribe(fn: (error: any) => any) : void;
|
||||
fire(error: any) : any;
|
||||
}
|
||||
|
||||
interface DexieVersionChangeEvent {
|
||||
subscribe(fn: (event: IDBVersionChangeEvent) => any) : void;
|
||||
unsubscribe(fn: (event: IDBVersionChangeEvent) => any) : void;
|
||||
fire(event: IDBVersionChangeEvent) : any;
|
||||
}
|
||||
|
||||
interface DexieOnReadyEvent
|
||||
{
|
||||
subscribe(fn: () => any, bSticky: boolean) : void;
|
||||
unsubscribe(fn: () => any) : void;
|
||||
fire() : any;
|
||||
}
|
||||
|
||||
interface Table<T, Key> {
|
||||
name: string;
|
||||
schema: TableSchema;
|
||||
hook: {
|
||||
(eventName: string, subscriber: () => any): void;
|
||||
creating: DexieEvent;
|
||||
reading: DexieEvent;
|
||||
updating: DexieEvent;
|
||||
deleting: DexieEvent;
|
||||
}
|
||||
|
||||
get(key: Key): Promise<T>;
|
||||
where(index: string): WhereClause<T, Key>;
|
||||
|
||||
filter(fn: (obj: T) => boolean): Collection<T, Key>;
|
||||
|
||||
count(): Promise<number>;
|
||||
count<U>(onFulfilled: (value: number) => Thenable<U>): Promise<U>;
|
||||
count<U>(onFulfilled: (value: number) => U): Promise<U>;
|
||||
|
||||
offset(n: number): Collection<T, Key>;
|
||||
|
||||
limit(n: number): Collection<T, Key>;
|
||||
|
||||
each(callback: (obj: T, cursor: IDBCursor) => any): Promise<void>;
|
||||
|
||||
toArray(): Promise<Array<T>>;
|
||||
toArray<U>(onFulfilled: (value: Array<T>) => Thenable<U>): Promise<U>;
|
||||
toArray<U>(onFulfilled: (value: Array<T>) => U): Promise<U>;
|
||||
|
||||
toCollection(): Collection<T, Key>;
|
||||
orderBy(index: string): Collection<T, Key>;
|
||||
reverse(): Collection<T, Key>;
|
||||
mapToClass(constructor: Function): Function;
|
||||
add(item: T, key?: Key): Promise<Key>;
|
||||
update(key: Key, changes: { [keyPath: string]: any }) : Promise<number>;
|
||||
put(item: T, key?: Key): Promise<Key>;
|
||||
delete(key: Key): Promise<void>;
|
||||
clear(): Promise<void>;
|
||||
}
|
||||
|
||||
interface WhereClause<T, Key> {
|
||||
above(key: number): Collection<T, Key>;
|
||||
above(key: string): Collection<T, Key>;
|
||||
above(key: Date): Collection<T, Key>;
|
||||
above(key: Array<any>): Collection<T, Key>;
|
||||
aboveOrEqual(key: number): Collection<T, Key>;
|
||||
aboveOrEqual(key: string): Collection<T, Key>;
|
||||
aboveOrEqual(key: Date): Collection<T, Key>;
|
||||
aboveOrEqual(key: Array<any>): Collection<T, Key>;
|
||||
anyOf(keys: Array<any>): Collection<T, Key>;
|
||||
anyOf(...keys: any[]): Collection<T, Key>;
|
||||
below(key: number): Collection<T, Key>;
|
||||
below(key: string): Collection<T, Key>;
|
||||
below(key: Date): Collection<T, Key>;
|
||||
below(key: Array<any>): Collection<T, Key>;
|
||||
belowOrEqual(key: number): Collection<T, Key>;
|
||||
belowOrEqual(key: string): Collection<T, Key>;
|
||||
belowOrEqual(key: Date): Collection<T, Key>;
|
||||
belowOrEqual(key: Array<any>): Collection<T, Key>;
|
||||
between(lower: number, upper: number, includeLower?: boolean, includeUpper?: boolean): Collection<T, Key>;
|
||||
between(lower: string, upper: string, includeLower?: boolean, includeUpper?: boolean): Collection<T, Key>;
|
||||
between(lower: Date, upper: Date, includeLower?: boolean, includeUpper?: boolean): Collection<T, Key>;
|
||||
between(lower: Array<any>, upper: Array<any>, includeLower?: boolean, includeUpper?: boolean): Collection<T, Key>;
|
||||
equals(key: number): Collection<T, Key>;
|
||||
equals(key: string): Collection<T, Key>;
|
||||
equals(key: Date): Collection<T, Key>;
|
||||
equals(key: Array<any>): Collection<T, Key>;
|
||||
equalsIgnoreCase(key: string): Collection<T, Key>;
|
||||
startsWith(key: string): Collection<T, Key>;
|
||||
startsWithIgnoreCase(key: string): Collection<T, Key>;
|
||||
}
|
||||
|
||||
interface Collection<T, Key> {
|
||||
and(filter: (x: T) => boolean): Collection<T, Key>;
|
||||
count(): Promise<number>;
|
||||
count<U>(onFulfilled: (value: number) => Thenable<U>): Promise<U>;
|
||||
count<U>(onFulfilled: (value: number) => U): Promise<U>;
|
||||
distinct(): Collection<T, Key>;
|
||||
each(callback: (obj: T, cursor: IDBCursor) => any): Promise<void>;
|
||||
eachKey(callback: (key: Key, cursor: IDBCursor) => any): Promise<void>;
|
||||
eachUniqueKey(callback: (key: Key, cursor: IDBCursor) => any): Promise<void>;
|
||||
first(): Promise<T>;
|
||||
first<U>(onFulfilled: (value: T) => Thenable<U>): Promise<U>;
|
||||
first<U>(onFulfilled: (value: T) => U): Promise<U>;
|
||||
keys(): Promise<Key[]>;
|
||||
keys<U>(onFulfilled: (value: Key[]) => Thenable<U>): Promise<U>;
|
||||
keys<U>(onFulfilled: (value: Key[]) => U): Promise<U>;
|
||||
last(): Promise<T>;
|
||||
last<U>(onFulfilled: (value: T) => Thenable<U>): Promise<U>;
|
||||
last<U>(onFulfilled: (value: T) => U): Promise<U>;
|
||||
limit(n: number): Collection<T, Key>;
|
||||
offset(n: number): Collection<T, Key>;
|
||||
or(indexOrPrimayKey: string): WhereClause<T, Key>;
|
||||
reverse(): Collection<T, Key>;
|
||||
sortBy(keyPath: string): Promise<T[]>;
|
||||
sortBy<U>(keyPath: string, onFulfilled: (value: T[]) => Thenable<U>): Promise<U>;
|
||||
sortBy<U>(keyPath: string, onFulfilled: (value: T[]) => U): Promise<U>;
|
||||
toArray(): Promise<Array<T>>;
|
||||
toArray<U>(onFulfilled: (value: Array<T>) => Thenable<U>): Promise<U>;
|
||||
toArray<U>(onFulfilled: (value: Array<T>) => U): Promise<U>;
|
||||
uniqueKeys(): Promise<Key[]>;
|
||||
uniqueKeys<U>(onFulfilled: (value: Key[]) => Thenable<U>): Promise<U>;
|
||||
uniqueKeys<U>(onFulfilled: (value: Key[]) => U): Promise<U>;
|
||||
until(filter: (value: T) => boolean, includeStopEntry?: boolean): Collection<T, Key>;
|
||||
// WriteableCollection:
|
||||
delete(): Promise<number>;
|
||||
modify(changes: { [keyPath: string]: any }): Promise<number>;
|
||||
modify(changeCallback: (obj: T) => void): Promise<number>;
|
||||
}
|
||||
|
||||
interface TableSchema {
|
||||
name: string;
|
||||
primKey: IndexSpec;
|
||||
indexes: IndexSpec[];
|
||||
mappedClass: Function;
|
||||
}
|
||||
|
||||
interface IndexSpec {
|
||||
name: string;
|
||||
keyPath: any;
|
||||
unique: boolean;
|
||||
multi: boolean;
|
||||
auto: boolean;
|
||||
compound: boolean;
|
||||
src: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'Dexie' {
|
||||
export = Dexie;
|
||||
}
|
||||
+11
-1
@@ -10,7 +10,10 @@ var d = new Drop({
|
||||
constrainToWindow: true,
|
||||
constrainToScrollParent: true,
|
||||
classes: "",
|
||||
tetherOptions: {}
|
||||
tetherOptions: {},
|
||||
remove: true,
|
||||
target: yellowBox,
|
||||
content: greenBox
|
||||
});
|
||||
|
||||
d.open();
|
||||
@@ -19,6 +22,8 @@ d.remove();
|
||||
d.toggle();
|
||||
d.position();
|
||||
d.destroy();
|
||||
d.element.appendChild(document.createElement("div"));
|
||||
d.tether.position();
|
||||
|
||||
d.on("open", () => null);
|
||||
d.on("close", () => null);
|
||||
@@ -26,3 +31,8 @@ d.once("close", () => null);
|
||||
d.off("close", () => null);
|
||||
d.off("open");
|
||||
|
||||
var e = new Drop({
|
||||
target: yellowBox,
|
||||
content: () => greenBox
|
||||
});
|
||||
|
||||
|
||||
Vendored
+4
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Drop v0.5
|
||||
// Type definitions for Drop v0.5.7
|
||||
// Project: http://github.hubspot.com/drop/
|
||||
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -19,7 +19,7 @@ declare module drop {
|
||||
|
||||
interface IDropOptions {
|
||||
target?: Element;
|
||||
content?: Element | string | (() => string);
|
||||
content?: Element | string | ((drop?: Drop) => string) | ((drop?: Drop) => Element);
|
||||
position?: string;
|
||||
openOn?: string;
|
||||
constrainToWindow?: boolean;
|
||||
@@ -30,6 +30,8 @@ declare module drop {
|
||||
|
||||
interface Drop {
|
||||
content: HTMLElement;
|
||||
element: HTMLElement;
|
||||
tether: tether.Tether;
|
||||
open(): void;
|
||||
close(): void;
|
||||
remove(): void;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/// <reference path="dsv.d.ts" />
|
||||
|
||||
import dsv = require("dsv");
|
||||
|
||||
var csv = dsv(",");
|
||||
|
||||
var rows = csv.parse("a,b,c\n1,2,3\n4,5,6");
|
||||
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
// Type definitions for dsv
|
||||
// Project: https://www.npmjs.com/package/dsv
|
||||
// Definitions by: Jason Swearingen <https://jasonswearingen.github.io>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
//commonjs loader
|
||||
declare module "dsv" {
|
||||
|
||||
/** A parser and formatter for DSV (CSV and TSV) files.
|
||||
Extracted from D3. */
|
||||
var loader: (
|
||||
/** the symbol used to seperate cells in the row.*/
|
||||
delimiter: string,
|
||||
/** example: "text/plain" */
|
||||
encoding?: string) => _dsv.Dsv;
|
||||
export = loader;
|
||||
}
|
||||
|
||||
declare module _dsv {
|
||||
/** A parser and formatter for DSV (CSV and TSV) files.
|
||||
Extracted from D3. */
|
||||
export class Dsv {
|
||||
/** Parses the specified string, which is the contents of a CSV file, returning an array of objects representing the parsed rows.
|
||||
The string is assumed to be RFC4180-compliant.
|
||||
Unlike the parseRows method, this method requires that the first line of the CSV file contains a comma-separated list of column names;
|
||||
these column names become the attributes on the returned objects.
|
||||
For example, consider the following CSV file:
|
||||
|
||||
Year,Make,Model,Length
|
||||
1997,Ford,E350,2.34
|
||||
2000,Mercury,Cougar,2.38
|
||||
|
||||
The resulting JavaScript array is:
|
||||
|
||||
[ {"Year": "1997", "Make": "Ford", "Model": "E350", "Length": "2.34"},
|
||||
{"Year": "2000", "Make": "Mercury", "Model": "Cougar", "Length": "2.38"} ]
|
||||
*/
|
||||
public parse<TRow>(
|
||||
table: string,
|
||||
/** coerce cells (strings) into different types or modify them. return null to strip this row from the output results. */
|
||||
accessor?: (row: any) => TRow
|
||||
): TRow[];
|
||||
/** Parses the specified string, which is the contents of a CSV file, returning an array of arrays representing the parsed rows. The string is assumed to be RFC4180-compliant. Unlike the parse method, this method treats the header line as a standard row, and should be used whenever the CSV file does not contain a header. Each row is represented as an array rather than an object. Rows may have variable length. For example, consider the following CSV file:
|
||||
|
||||
1997,Ford,E350,2.34
|
||||
2000,Mercury,Cougar,2.38
|
||||
The resulting JavaScript array is:
|
||||
|
||||
[ ["1997", "Ford", "E350", "2.34"],
|
||||
["2000", "Mercury", "Cougar", "2.38"] ]
|
||||
Note that the values themselves are always strings; they will not be automatically converted to numbers. See parse for details.*/
|
||||
public parseRows<TRow>(
|
||||
table: string,
|
||||
/** coerce cells (strings) into different types or modify them. return null to strip this row from the output results.*/
|
||||
accessor?: (row: string[]) => TRow
|
||||
): TRow[];
|
||||
/** Converts the specified array of rows into comma-separated values format, returning a string. This operation is the reverse of parse. Each row will be separated by a newline (\n), and each column within each row will be separated by a comma (,). Values that contain either commas, double-quotes (") or newlines will be escaped using double-quotes.
|
||||
|
||||
Each row should be an object, and all object properties will be converted into fields. For greater control over which properties are converted, convert the rows into arrays containing only the properties that should be converted and use formatRows. */
|
||||
public format(rows: any[]): string;
|
||||
/** Converts the specified array of rows into comma-separated values format, returning a string. This operation is the reverse of parseRows. Each row will be separated by a newline (\n), and each column within each row will be separated by a comma (,). Values that contain either commas, double-quotes (") or newlines will be escaped using double-quotes. */
|
||||
public formatRows(rows: any[]): string;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+137
-76
@@ -48,11 +48,11 @@ declare module EmberStates {
|
||||
/**
|
||||
A standard promise hook that resolves if the transition
|
||||
succeeds and rejects if it fails/redirects/aborts.
|
||||
|
||||
|
||||
Forwards to the internal `promise` property which you can
|
||||
use in situations where you want to pass around a thennable,
|
||||
but not the Transition itself.
|
||||
|
||||
|
||||
@arg {Function} onFulfilled
|
||||
@arg {Function} onRejected
|
||||
@arg {String} label optional string for labeling the promise. Useful for tooling.
|
||||
@@ -64,7 +64,7 @@ declare module EmberStates {
|
||||
Forwards to the internal `promise` property which you can
|
||||
use in situations where you want to pass around a thennable,
|
||||
but not the Transition itself.
|
||||
|
||||
|
||||
@method catch
|
||||
@arg {Function} onRejection
|
||||
@arg {String} label optional string for labeling the promise.
|
||||
@@ -77,7 +77,7 @@ declare module EmberStates {
|
||||
Forwards to the internal `promise` property which you can
|
||||
use in situations where you want to pass around a thennable,
|
||||
but not the Transition itself.
|
||||
|
||||
|
||||
@method finally
|
||||
@arg {Function} callback
|
||||
@arg {String} label optional string for labeling the promise.
|
||||
@@ -85,7 +85,7 @@ declare module EmberStates {
|
||||
@return {Promise}
|
||||
*/
|
||||
finally(callback: Function, label?: string): Ember.RSVP.Promise;
|
||||
|
||||
|
||||
/**
|
||||
Aborts the Transition. Note you can also implicitly abort a transition
|
||||
by initiating another transition while a previous one is underway.
|
||||
@@ -123,9 +123,9 @@ declare module EmberStates {
|
||||
Fires an event on the current list of resolved/resolving
|
||||
handlers within this transition. Useful for firing events
|
||||
on route hierarchies that haven't fully been entered yet.
|
||||
|
||||
|
||||
Note: This method is also aliased as `send`
|
||||
|
||||
|
||||
@arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error
|
||||
@arg {String} name the name of the event to fire
|
||||
*/
|
||||
@@ -134,9 +134,9 @@ declare module EmberStates {
|
||||
Fires an event on the current list of resolved/resolving
|
||||
handlers within this transition. Useful for firing events
|
||||
on route hierarchies that haven't fully been entered yet.
|
||||
|
||||
|
||||
Note: This method is also aliased as `send`
|
||||
|
||||
|
||||
@arg {String} name the name of the event to fire
|
||||
*/
|
||||
trigger(eventName: string): void;
|
||||
@@ -147,7 +147,7 @@ declare module EmberStates {
|
||||
that will follow any redirects that occur and fulfill
|
||||
with the value fulfilled by any redirecting transitions
|
||||
that occur.
|
||||
|
||||
|
||||
@return {Promise} a promise that fulfills with the same
|
||||
value that the final redirecting transition fulfills with
|
||||
*/
|
||||
@@ -412,7 +412,7 @@ declare module Ember {
|
||||
**/
|
||||
function A(arr?: any[]): NativeArray;
|
||||
/**
|
||||
The Ember.ActionHandler mixin implements support for moving an actions property to an _actions
|
||||
The Ember.ActionHandler mixin implements support for moving an actions property to an _actions
|
||||
property at extend time, and adding _actions to the object's mergedProperties list.
|
||||
**/
|
||||
class ActionHandlerMixin {
|
||||
@@ -420,7 +420,7 @@ declare module Ember {
|
||||
Triggers a named action on the ActionHandler
|
||||
**/
|
||||
send(name: string, ...args: any[]): void;
|
||||
/**
|
||||
/**
|
||||
The collection of functions, keyed by name, available on this ActionHandler as action targets.
|
||||
**/
|
||||
actions: ActionsHash;
|
||||
@@ -931,49 +931,149 @@ declare module Ember {
|
||||
frozenCopy(): Copyable;
|
||||
}
|
||||
class CoreObject {
|
||||
static detect(obj: any): boolean;
|
||||
static detectInstance(obj: any): boolean;
|
||||
/**
|
||||
Iterate over each computed property for the class, passing its name and any
|
||||
associated metadata (see metaForProperty) to the callback.
|
||||
An overridable method called when objects are instantiated. By default,
|
||||
does nothing unless it is overridden during class definition.
|
||||
@method init
|
||||
**/
|
||||
static eachComputedProperty(callback: Function, binding: {}): void;
|
||||
/**
|
||||
Returns the original hash that was passed to meta().
|
||||
@param key property name
|
||||
**/
|
||||
static metaForProperty(key: string): {};
|
||||
static isClass: boolean;
|
||||
static isMethod: boolean;
|
||||
/**
|
||||
Destroys an object by setting the isDestroyed flag and removing its metadata, which effectively
|
||||
destroys observers and bindings. If you try to set a property on a destroyed object, an exception
|
||||
will be raised. Note that destruction is scheduled for the end of the run loop and does not
|
||||
happen immediately. It will set an isDestroying flag immediately.
|
||||
**/
|
||||
destroy(): CoreObject;
|
||||
init(): void;
|
||||
/**
|
||||
Returns a string representation which attempts to provide more information than Javascript's toString
|
||||
typically does, in a generic way for all Ember objects (e.g., "<App.Person:ember1024>").
|
||||
**/
|
||||
toString(): string;
|
||||
willDestroy(): void;
|
||||
|
||||
/**
|
||||
Defines the properties that will be concatenated from the superclass (instead of overridden).
|
||||
@property concatenatedProperties
|
||||
@type Array
|
||||
@default null
|
||||
**/
|
||||
concatenatedProperties: any[];
|
||||
|
||||
/**
|
||||
Destroyed object property flag. If this property is true the observers and bindings were
|
||||
already removed by the effect of calling the destroy() method.
|
||||
@property isDestroyed
|
||||
@default false
|
||||
**/
|
||||
isDestroyed: boolean;
|
||||
/**
|
||||
Destruction scheduled flag. The destroy() method has been called. The object stays intact
|
||||
until the end of the run loop at which point the isDestroyed flag is set.
|
||||
@property isDestroying
|
||||
@default false
|
||||
**/
|
||||
isDestroying: boolean;
|
||||
|
||||
/**
|
||||
Destroys an object by setting the `isDestroyed` flag and removing its
|
||||
metadata, which effectively destroys observers and bindings.
|
||||
If you try to set a property on a destroyed object, an exception will be
|
||||
raised.
|
||||
Note that destruction is scheduled for the end of the run loop and does not
|
||||
happen immediately. It will set an isDestroying flag immediately.
|
||||
@method destroy
|
||||
@return {Ember.Object} receiver
|
||||
*/
|
||||
destroy(): CoreObject;
|
||||
|
||||
/**
|
||||
Override to implement teardown.
|
||||
@method willDestroy
|
||||
*/
|
||||
willDestroy(): void;
|
||||
|
||||
/**
|
||||
Returns a string representation which attempts to provide more information than Javascript's toString
|
||||
typically does, in a generic way for all Ember objects (e.g., "<App.Person:ember1024>").
|
||||
@method toString
|
||||
@return {String} string representation
|
||||
**/
|
||||
toString(): string;
|
||||
|
||||
static isClass: boolean;
|
||||
static isMethod: boolean;
|
||||
|
||||
/**
|
||||
Creates a new subclass.
|
||||
@method extend
|
||||
@static
|
||||
@param {Object} [args] - Object containing values to use within the new class
|
||||
**/
|
||||
static extend<T>(args ?: CoreObjectArguments): T;
|
||||
/**
|
||||
Creates a new subclass.
|
||||
@method extend
|
||||
@static
|
||||
@param {Mixin} [mixins] - One or more Mixin classes
|
||||
@param {Object} [args] - Object containing values to use within the new class
|
||||
**/
|
||||
static extend<T>(mixins?: Mixin, args?: CoreObjectArguments): T;
|
||||
|
||||
/**
|
||||
Creates a new subclass.
|
||||
@method extend
|
||||
@param {Object} [args] - Object containing values to use within the new class
|
||||
Non-static method because Ember classes aren't currently 'real' TypeScript classes.
|
||||
**/
|
||||
extend<T>(args ?: CoreObjectArguments): T;
|
||||
/**
|
||||
Creates a new subclass.
|
||||
@method extend
|
||||
@param {Mixin} [mixins] - One or more Mixin classes
|
||||
@param {Object} [args] - Object containing values to use within the new class
|
||||
Non-static method because Ember classes aren't currently 'real' TypeScript classes.
|
||||
**/
|
||||
extend<T>(mixins ? : Mixin, args ?: CoreObjectArguments): T;
|
||||
|
||||
/**
|
||||
Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
|
||||
@method createWithMixins
|
||||
@static
|
||||
@param [args]
|
||||
**/
|
||||
static createWithMixins<T extends {}>(args?: {}): T;
|
||||
|
||||
/**
|
||||
Creates an instance of the class.
|
||||
@method create
|
||||
@static
|
||||
@param [args] - A hash containing values with which to initialize the newly instantiated object.
|
||||
**/
|
||||
static create<T extends {}>(args?: {}): T;
|
||||
|
||||
/**
|
||||
Augments a constructor's prototype with additional properties and functions.
|
||||
To add functions and properties to the constructor itself, see reopenClass.
|
||||
@method reopen
|
||||
**/
|
||||
static reopen<T extends {}>(args?: {}): T;
|
||||
|
||||
/**
|
||||
Augments a constructor's own properties and functions.
|
||||
To add functions and properties to instances of a constructor by extending the
|
||||
constructor's prototype see reopen.
|
||||
@method reopenClass
|
||||
**/
|
||||
static reopenClass<T extends {}>(args?: {}): T;
|
||||
|
||||
static detect(obj: any): boolean;
|
||||
static detectInstance(obj: any): boolean;
|
||||
|
||||
/**
|
||||
Returns the original hash that was passed to meta().
|
||||
@method metaForProperty
|
||||
@static
|
||||
@param key {String} property name
|
||||
**/
|
||||
static metaForProperty(key: string): {};
|
||||
|
||||
/**
|
||||
Iterate over each computed property for the class, passing its name and any
|
||||
associated metadata (see metaForProperty) to the callback.
|
||||
|
||||
@method eachComputedProperty
|
||||
@static
|
||||
@param {Function} callback
|
||||
@param {Object} binding
|
||||
**/
|
||||
static eachComputedProperty(callback: Function, binding: {}): void;
|
||||
}
|
||||
/**
|
||||
An abstract class that exists to give view-like behavior to both Ember's main view class Ember.View
|
||||
@@ -1578,45 +1678,6 @@ declare module Ember {
|
||||
}
|
||||
var ORDER_DEFINITION: string[];
|
||||
class Object extends CoreObject implements Observable {
|
||||
/**
|
||||
Creates a subclass of the Object class.
|
||||
**/
|
||||
static extend<T>(args?: CoreObjectArguments): T;
|
||||
static extend<T>(mixins? : Mixin, args?: CoreObjectArguments): T;
|
||||
/**
|
||||
Creates an instance of the class.
|
||||
@param arguments A hash containing values with which to initialize the newly instantiated object.
|
||||
**/
|
||||
static create<T extends {}>(args?: {}): T;
|
||||
/**
|
||||
Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
|
||||
**/
|
||||
static createWithMixins<T extends {}>(args?: {}): T;
|
||||
static detect(obj: any): boolean;
|
||||
static detectInstance(obj: any): boolean;
|
||||
/**
|
||||
Iterate over each computed property for the class, passing its name and any
|
||||
associated metadata (see metaForProperty) to the callback.
|
||||
**/
|
||||
static eachComputedProperty(callback: Function, binding: {}): void;
|
||||
/**
|
||||
Returns the original hash that was passed to meta().
|
||||
@param key property name
|
||||
**/
|
||||
static metaForProperty(key: string): {};
|
||||
/**
|
||||
Augments a constructor's prototype with additional properties and functions.
|
||||
To add functions and properties to the constructor itself, see reopenClass.
|
||||
**/
|
||||
static reopen<T extends {}>(args?: {}): T;
|
||||
/**
|
||||
Augments a constructor's own properties and functions.
|
||||
To add functions and properties to instances of a constructor by extending the
|
||||
constructor's prototype see reopen.
|
||||
**/
|
||||
static reopenClass<T extends {}>(args?: {}): T;
|
||||
static isClass: boolean;
|
||||
static isMethod: boolean;
|
||||
addObserver: ModifyObserver;
|
||||
beginPropertyChanges(): Observable;
|
||||
cacheFor(keyName: string): any;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/// <reference path="./express-validator.d.ts"/>
|
||||
|
||||
/* Usage Example from https://github.com/ctavan/express-validator */
|
||||
|
||||
import util = require('util')
|
||||
import express = require('express')
|
||||
import expressValidator = require('express-validator')
|
||||
var app = express()
|
||||
|
||||
app.use(expressValidator());
|
||||
|
||||
app.post('/:urlparam', function(req: expressValidator.ValidatedRequest, res: express.Response) {
|
||||
|
||||
// checkBody only checks req.body; none of the other req parameters
|
||||
// Similarly checkParams only checks in req.params (URL params) and
|
||||
// checkQuery only checks req.query (GET params).
|
||||
req.checkBody('postparam', 'Invalid postparam').notEmpty().isInt();
|
||||
req.checkParams('urlparam', 'Invalid urlparam').isAlpha();
|
||||
req.checkQuery('getparam', 'Invalid getparam').isInt();
|
||||
|
||||
// OR assert can be used to check on all 3 types of params.
|
||||
// req.assert('postparam', 'Invalid postparam').notEmpty().isInt();
|
||||
// req.assert('urlparam', 'Invalid urlparam').isAlpha();
|
||||
// req.assert('getparam', 'Invalid getparam').isInt();
|
||||
|
||||
req.sanitize('postparam').toBoolean();
|
||||
|
||||
var errors = req.validationErrors();
|
||||
if (errors) {
|
||||
res.status(400).send('There have been validation errors: ' + util.inspect(errors));
|
||||
return;
|
||||
}
|
||||
res.json({
|
||||
urlparam: req.param('urlparam'),
|
||||
getparam: req.param('getparam'),
|
||||
postparam: req.param('postparam')
|
||||
});
|
||||
});
|
||||
|
||||
app.listen(8888);
|
||||
+24
-8
@@ -1,11 +1,10 @@
|
||||
// Type definitions for express-validator
|
||||
// Type definitions for express-validator 2.9.0
|
||||
// Project: https://github.com/ctavan/express-validator
|
||||
// Definitions by: Nathan Ridley <https://github.com/axefrog/>, Jonathan Häberle <http://dreampulse.de>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
|
||||
declare module "express-validator" {
|
||||
import express = require('express');
|
||||
|
||||
@@ -16,14 +15,32 @@ declare module "express-validator" {
|
||||
param: string;
|
||||
}
|
||||
|
||||
interface ValidatorFunction { (item: string, message: string): Validator; }
|
||||
interface SanitizerFunction { (item: string): Sanitizer; }
|
||||
interface Dictionary<T> { [key: string]: T; }
|
||||
|
||||
export interface RequestValidation {
|
||||
check(field:string, message:string): Validator;
|
||||
assert(field:string, message:string): Validator;
|
||||
sanitize(field:string): Sanitizer;
|
||||
onValidationError(func:(msg:string) => void): void;
|
||||
validationErrors() : any;
|
||||
assert: ValidatorFunction;
|
||||
check: ValidatorFunction;
|
||||
checkBody: ValidatorFunction;
|
||||
checkFiles: ValidatorFunction;
|
||||
checkHeader: ValidatorFunction;
|
||||
checkParams: ValidatorFunction;
|
||||
checkQuery: ValidatorFunction;
|
||||
validate: ValidatorFunction;
|
||||
|
||||
filter: SanitizerFunction;
|
||||
sanitize: SanitizerFunction;
|
||||
|
||||
onValidationError(errback: (msg: string) => void): void;
|
||||
validationErrors(mapped?: boolean): Dictionary<any> | any[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for use when using express-validator as middleware for requests
|
||||
*/
|
||||
export interface ValidatedRequest extends express.Request, RequestValidation {}
|
||||
|
||||
export interface Validator {
|
||||
/**
|
||||
* Alias for regex()
|
||||
@@ -168,6 +185,5 @@ declare module "express-validator" {
|
||||
*/
|
||||
function ExpressValidator(middlewareOptions?:any):express.RequestHandler;
|
||||
|
||||
|
||||
export = ExpressValidator;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/// <reference path="eyes.d.ts" />
|
||||
|
||||
import eyes = require('eyes');
|
||||
|
||||
var testObj = {
|
||||
color: 'red',
|
||||
num: 227
|
||||
}
|
||||
|
||||
eyes.inspect(testObj)
|
||||
|
||||
var options = {
|
||||
styles: {
|
||||
all: 'green',
|
||||
label: 'red',
|
||||
other: 'red',
|
||||
key: 'red',
|
||||
special: 'red',
|
||||
'string': 'red',
|
||||
'number': 'red',
|
||||
bool: 'red',
|
||||
regexp: 'red'
|
||||
},
|
||||
|
||||
pretty: false,
|
||||
hideFunctions: true,
|
||||
stream: process.stdout,
|
||||
maxLength: 120
|
||||
}
|
||||
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
// Type definitions for eyes 0.1.8
|
||||
// Project: https://github.com/cloudhead/eyes.js
|
||||
// Definitions by: bryn austin bellomy <https://github.com/brynbellomy>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "eyes"
|
||||
{
|
||||
import stream = require('stream');
|
||||
|
||||
export function inspector(options?:EyesOptions): InspectorFunction;
|
||||
export function inspect(thing:any, label?:string): void;
|
||||
|
||||
export interface InspectorFunction {
|
||||
(thing:any, label?:string): void;
|
||||
}
|
||||
|
||||
export interface EyesOptions
|
||||
{
|
||||
/** Styles applied to stdout */
|
||||
styles?: {
|
||||
/** Overall base style applied to everything */
|
||||
all?: string;
|
||||
/** Style when printing inspection labels, like 'array' in `array: [1, 2, 3]` */
|
||||
label?: string;
|
||||
/** Style when printing objects which don't have a literal representation, such as functions */
|
||||
other?: string;
|
||||
/** Style when printing the keys in object literals, like 'a' in `{a: 1}` */
|
||||
key?: string;
|
||||
/** Style when printing `null`, `undefined`, etc. */
|
||||
special?: string;
|
||||
/** Style when printing strings */
|
||||
string?: string;
|
||||
/** Style when printing numbers */
|
||||
number?: string;
|
||||
/** Style when printing booleans */
|
||||
bool?: string;
|
||||
/** Style when printing RegExps */
|
||||
regexp?: string;
|
||||
};
|
||||
|
||||
/** Indent object literals */
|
||||
pretty?: boolean;
|
||||
/** Don't output functions at all */
|
||||
hideFunctions?: boolean;
|
||||
/** Stream to write to, or null */
|
||||
stream?: stream.Writable;
|
||||
/** Truncate output if longer */
|
||||
maxLength?: number;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,33 @@
|
||||
/// <reference path="highcharts.d.ts" />
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
Highcharts.setOptions({
|
||||
global: {
|
||||
useUTC: false
|
||||
}
|
||||
});
|
||||
|
||||
var animate: HighchartsBoolOrAnimation;
|
||||
animate = true;
|
||||
animate = { duration: 200, easing: "linear" };
|
||||
Highcharts.setOptions({
|
||||
lang: {
|
||||
months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
|
||||
weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var gradient: HighchartsColorOrGradient;
|
||||
gradient = {
|
||||
linearGradient: { x0: 0, y0: 0, x1: 500, y1: 500 },
|
||||
var animate: HighchartsAnimation = {
|
||||
duration: 200,
|
||||
easing: "linear"
|
||||
};
|
||||
|
||||
|
||||
var gradient: HighchartsGradient = {
|
||||
linearGradient: {
|
||||
x0: 0,
|
||||
y0: 0,
|
||||
x1: 500,
|
||||
y1: 500
|
||||
},
|
||||
stops: [
|
||||
[0, 'rgb(255, 255, 255)'],
|
||||
[1, 'rgb(200, 200, 255)']
|
||||
@@ -18,11 +36,6 @@ gradient = {
|
||||
|
||||
var color = "#fcfcff";
|
||||
|
||||
var backgound: HighchartsColorOrGradient;
|
||||
|
||||
backgound = gradient;
|
||||
backgound = color;
|
||||
|
||||
var chart1 = new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: "container"
|
||||
@@ -121,6 +134,6 @@ var highChartSettings: HighchartsOptions = {
|
||||
}]
|
||||
};
|
||||
|
||||
var container = $("#container").highcharts(highChartSettings, function (chart) {
|
||||
var container = $("#container").highcharts(highChartSettings, (chart) => {
|
||||
chart.series[0].setVisible(true, true);
|
||||
});
|
||||
Vendored
+415
-230
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Highcharts 2.3.3
|
||||
// Type definitions for Highcharts 4.0.4
|
||||
// Project: http://www.highcharts.com/
|
||||
// Definitions by: Damiano Gambarotto <http://github.com/damianog>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -151,9 +151,6 @@ interface HighchartsAnimation {
|
||||
easing?: string; // "linear" | "swing"
|
||||
}
|
||||
|
||||
interface HighchartsBoolOrAnimation extends HighchartsAnimation {
|
||||
}
|
||||
|
||||
interface HighchartsSelectionEvent extends Event {
|
||||
xAxis: HighchartsAxisOptions[];
|
||||
yAxis: HighchartsAxisOptions[];
|
||||
@@ -167,7 +164,7 @@ interface HighchartsChartEvents {
|
||||
selection?: (event: HighchartsSelectionEvent) => void;
|
||||
}
|
||||
|
||||
interface HighchartsColorOrGradient {
|
||||
interface HighchartsGradient {
|
||||
linearGradient?: {
|
||||
x0: number; y0: number; x1: number; y1: number;
|
||||
};
|
||||
@@ -175,12 +172,11 @@ interface HighchartsColorOrGradient {
|
||||
cx: number; cy: number; r: number;
|
||||
};
|
||||
stops?: any[][];
|
||||
|
||||
brighten?(amount: number): HighchartsColorOrGradient;
|
||||
get?(type: string): string;
|
||||
brighten? (amount: number): string | HighchartsGradient;
|
||||
get? (type: string): string;
|
||||
}
|
||||
|
||||
interface HighchartsBoolOrShadow {
|
||||
interface HighchartsShadow {
|
||||
color?: string;
|
||||
offsetX?: number;
|
||||
offsetY?: number;
|
||||
@@ -191,21 +187,21 @@ interface HighchartsBoolOrShadow {
|
||||
interface HighchartsChartResetZoomButton {
|
||||
position: HighchartsPosition;
|
||||
relativeTo?: string;
|
||||
theme?: HighchartsChartResetZoomButtonTheme; //TO DO
|
||||
theme?: HighchartsChartResetZoomButtonTheme;
|
||||
}
|
||||
|
||||
interface HighchartsChartResetZoomButtonTheme {
|
||||
fill?:string; //css HEX colours.
|
||||
fill?: string; //css HEX colours.
|
||||
stroke?: string;//css HEX colours.
|
||||
r?: number; // Radius %
|
||||
states?: any; // HTML element states eg: hover, with css attributes in object.
|
||||
display?:string; // css attr eg: 'none'
|
||||
display?: string; // css attr eg: 'none'
|
||||
}
|
||||
|
||||
interface HighchartsChartOptions {
|
||||
alignTicks?: boolean;
|
||||
animation?: HighchartsBoolOrAnimation;
|
||||
backgroundColor?: HighchartsColorOrGradient;
|
||||
animation?: boolean | HighchartsAnimation;
|
||||
backgroundColor?: string | HighchartsGradient;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
@@ -220,17 +216,17 @@ interface HighchartsChartOptions {
|
||||
marginLeft?: number;
|
||||
marginRight?: number;
|
||||
marginTop?: number;
|
||||
plotBackGroundColor?: HighchartsColorOrGradient;
|
||||
plotBackGroundColor?: string | HighchartsGradient;
|
||||
plotBackGroundImage?: string;
|
||||
plotBorderColor?: string;
|
||||
plotBorderWidth?: number;
|
||||
plotShadow?: HighchartsBoolOrShadow;
|
||||
plotShadow?: boolean | HighchartsShadow;
|
||||
polar?: boolean;
|
||||
reflow?: boolean;
|
||||
renderTo?: any;
|
||||
resetZoomButton?: HighchartsChartResetZoomButton;
|
||||
selectionMarkerFill?: string;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showAxes?: boolean;
|
||||
spacingBottom?: number;
|
||||
spacingLeft?: number;
|
||||
@@ -272,7 +268,7 @@ interface HighchartsMenuItem {
|
||||
|
||||
interface HighchartsButton {
|
||||
align?: string;
|
||||
backgroundColor?: HighchartsColorOrGradient;
|
||||
backgroundColor?: string | HighchartsGradient;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
@@ -309,9 +305,11 @@ interface HighchartsExportingOptions {
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface HighchartsGlobalOptions {
|
||||
interface HighchartsGlobalObject {
|
||||
Date?: any;
|
||||
VMLRadialGradientURL?: string;
|
||||
canvasToolsURL?: string;
|
||||
timezoneOffset?: number;
|
||||
useUTC?: boolean;
|
||||
}
|
||||
|
||||
@@ -325,17 +323,19 @@ interface HighchartsLabelsOptions {
|
||||
style?: HighchartsCSSObject;
|
||||
}
|
||||
|
||||
interface HighchartsLangOptions {
|
||||
interface HighchartsLangObject {
|
||||
contextButtonTitle?: string;
|
||||
decimalPoint?: string;
|
||||
downloadJPEG?: string;
|
||||
downloadPDF?: string;
|
||||
downloadPNG?: string;
|
||||
downloadSVG?: string;
|
||||
exportButtonTitle?: string;
|
||||
drillUpText?: string;
|
||||
loading?: string;
|
||||
months?: string[];
|
||||
noData?: string;
|
||||
numericSymbols?: string[];
|
||||
printButtonTitle?: string;
|
||||
printChart?: string;
|
||||
resetZoom?: string;
|
||||
resetZoomTitle?: string;
|
||||
shortMonths?: string[];
|
||||
@@ -345,7 +345,7 @@ interface HighchartsLangOptions {
|
||||
|
||||
interface HighchartsLegendNavigationOptions {
|
||||
activeColor?: string;
|
||||
animation?: HighchartsBoolOrAnimation;
|
||||
animation?: boolean | HighchartsAnimation;
|
||||
arrowSize?: number;
|
||||
inactiveColor?: string;
|
||||
style?: HighchartsCSSObject;
|
||||
@@ -353,7 +353,7 @@ interface HighchartsLegendNavigationOptions {
|
||||
|
||||
interface HighchartsLegendOptions {
|
||||
align?: string;
|
||||
backgroundColor?: HighchartsColorOrGradient;
|
||||
backgroundColor?: string | HighchartsGradient;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
@@ -375,7 +375,7 @@ interface HighchartsLegendOptions {
|
||||
reversed?: boolean;
|
||||
rtl?: boolean;
|
||||
verticalAlign?: string;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
style?: HighchartsCSSObject;
|
||||
symbolPadding?: number;
|
||||
symbolWidth?: number;
|
||||
@@ -401,7 +401,7 @@ interface HighchartsNavigationOptions {
|
||||
|
||||
// Not sure of this interface
|
||||
interface HighchartsPaneBackground {
|
||||
backgroundColor: HighchartsColorOrGradient;
|
||||
backgroundColor: string | HighchartsGradient;
|
||||
borderColor?: string;
|
||||
borderWidth?: number;
|
||||
innerRadius?: string;
|
||||
@@ -412,12 +412,13 @@ interface HighchartsPaneOptions {
|
||||
background?: HighchartsPaneBackground[];
|
||||
center?: [number|string, number|string]; // [x,y] | ["50%","50%" ]
|
||||
endAngle?: number;
|
||||
size?: number | string;
|
||||
startAngle?: number;
|
||||
}
|
||||
|
||||
interface HighchartsDataLabels {
|
||||
align?: string;
|
||||
backgroundColor?: HighchartsColorOrGradient;
|
||||
backgroundColor?: string | HighchartsGradient;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
@@ -428,7 +429,7 @@ interface HighchartsDataLabels {
|
||||
overflow?: string;
|
||||
padding?: number;
|
||||
rotation?: number;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
staggerLines?: any; // ?? need to check API
|
||||
step?: any; // ?? need to check API
|
||||
style?: HighchartsCSSObject;
|
||||
@@ -492,63 +493,23 @@ interface HighchartsBarStates extends HighchartsAreaStates {
|
||||
brightness?: number;
|
||||
}
|
||||
|
||||
interface HighchartsAreaChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
color?: string;
|
||||
connectEnds?: boolean;
|
||||
connectNulls?: boolean;
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dashStyle?: string; //Solid ShortDash ShortDot ShortDashDot ShortDashDotDot Dot Dash LongDash DashDot LongDashDot LongDashDotDot
|
||||
dataLabels?: HighchartsDataLabels;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
fillColor?: HighchartsColorOrGradient;
|
||||
fillOpacity?: boolean;
|
||||
id?: string;
|
||||
lineColor?: string;
|
||||
lineWidth?: number;
|
||||
marker?: HighchartsMarker;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsAreaStates;
|
||||
};
|
||||
stickyTracking?: boolean;
|
||||
threshold?: number;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
trackByArea?: boolean;
|
||||
turboThreshold?: number;
|
||||
visible?: number;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsRangeDataLabels {
|
||||
align?: string;
|
||||
backgroundColor?: HighchartsColorOrGradient;
|
||||
backgroundColor?: string | HighchartsGradient;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
color?: string;
|
||||
crop?: boolean;
|
||||
defer?: boolean;
|
||||
enabled?: boolean;
|
||||
format?: string;
|
||||
formatter?: () => any;
|
||||
inside?: boolean;
|
||||
overflow?: string;
|
||||
padding?: number;
|
||||
rotation?: number;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
staggerLines?: any; // ?? need to check API
|
||||
step?: any; // ?? need to check API
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
style?: HighchartsCSSObject;
|
||||
useHTML?: boolean;
|
||||
verticalAlign?: string;
|
||||
@@ -556,125 +517,6 @@ interface HighchartsRangeDataLabels {
|
||||
xLow?: number;
|
||||
yHigh?: number;
|
||||
yLow?: number;
|
||||
}
|
||||
|
||||
interface HighchartsAreaRangeChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
color?: string;
|
||||
connectNulls?: boolean;
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dashStyle?: string; //Solid ShortDash ShortDot ShortDashDot ShortDashDotDot Dot Dash LongDash DashDot LongDashDot LongDashDotDot
|
||||
dataLabels?: HighchartsRangeDataLabels;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
fillColor?: HighchartsColorOrGradient;
|
||||
fillOpacity?: boolean;
|
||||
id?: string;
|
||||
lineColor?: string;
|
||||
lineWidth?: number;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsAreaStates;
|
||||
};
|
||||
stickyTracking?: boolean;
|
||||
threshold?: number;
|
||||
trackByArea?: boolean;
|
||||
turboThreshold?: number;
|
||||
visible?: number;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsBarChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
color?: string;
|
||||
colorByPoint?: boolean;
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dataLabels?: HighchartsDataLabels;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
groupPadding?: number;
|
||||
grouping?: boolean;
|
||||
id?: string;
|
||||
minPointLength?: number;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPadding?: number;
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointRange?: number;
|
||||
pointStart?: number;
|
||||
pointWidth?: number;
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsBarStates;
|
||||
};
|
||||
stickyTracking?: boolean;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
turboThreshold?: number;
|
||||
visible?: number;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsColumnRangeChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
color?: string;
|
||||
colorByPoint?: boolean;
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dataLabels?: HighchartsRangeDataLabels;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
groupPadding?: number;
|
||||
grouping?: boolean;
|
||||
id?: string;
|
||||
minPointLength?: number;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPadding?: number;
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointRange?: number;
|
||||
pointStart?: number;
|
||||
pointWidth?: number;
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsBarStates;
|
||||
};
|
||||
stickyTracking?: boolean;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
turboThreshold?: number;
|
||||
visible?: number;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
@@ -696,6 +538,283 @@ interface HighchartsPivot {
|
||||
radius?: number;
|
||||
}
|
||||
|
||||
interface HighchartsAreaChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
color?: string;
|
||||
connectEnds?: boolean;
|
||||
connectNulls?: boolean;
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dashStyle?: string; //Solid ShortDash ShortDot ShortDashDot ShortDashDotDot Dot Dash LongDash DashDot LongDashDot LongDashDotDot
|
||||
dataLabels?: HighchartsDataLabels;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
fillColor?: string | HighchartsGradient;
|
||||
fillOpacity?: number;
|
||||
linkedTo?: string;
|
||||
lineColor?: string;
|
||||
lineWidth?: number;
|
||||
marker?: HighchartsMarker;
|
||||
negativeColor?: string;
|
||||
negativeFillColor?: string;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPlacement?: string | number; // null, "on", "between"
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsAreaStates;
|
||||
};
|
||||
step?: string;
|
||||
stickyTracking?: boolean;
|
||||
threshold?: number;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
trackByArea?: boolean;
|
||||
turboThreshold?: number;
|
||||
visible?: boolean;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsAreaRangeChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
color?: string;
|
||||
connectNulls?: boolean;
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dashStyle?: string; //Solid ShortDash ShortDot ShortDashDot ShortDashDotDot Dot Dash LongDash DashDot LongDashDot LongDashDotDot
|
||||
dataLabels?: HighchartsRangeDataLabels;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
fillColor?: string | HighchartsGradient;
|
||||
fillOpacity?: number;
|
||||
lineColor?: string;
|
||||
lineWidth?: number;
|
||||
linkedTo?: string;
|
||||
negativeColor?: string;
|
||||
negativeFillColor?: string;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPlacement?: string | number; // null, "on", "between"
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsAreaStates;
|
||||
};
|
||||
step?: string;
|
||||
stickyTracking?: boolean;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
threshold?: number;
|
||||
trackByArea?: boolean;
|
||||
turboThreshold?: number;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
interface HighchartsAreaSplineChart extends HighchartsAreaChart {
|
||||
connectEnds?: boolean;
|
||||
}
|
||||
|
||||
interface HighchartsAreaSplineRangeChart extends HighchartsAreaRangeChart {
|
||||
}
|
||||
|
||||
interface HighchartsBarChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
color?: string;
|
||||
colorByPoint?: boolean;
|
||||
cropThreshold?: number;
|
||||
colors?: string[];
|
||||
cursor?: string;
|
||||
dataLabels?: HighchartsDataLabels;
|
||||
depth?: number;
|
||||
edgeColor?: string;
|
||||
edgeWidth?: number;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
groupPadding?: number;
|
||||
groupZPadding?: number;
|
||||
grouping?: boolean;
|
||||
linkedTo?: string;
|
||||
minPointLength?: number;
|
||||
negativeColor?: string;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPadding?: number;
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointRange?: number;
|
||||
pointStart?: number;
|
||||
pointWidth?: number;
|
||||
selected?: boolean;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsBarStates;
|
||||
};
|
||||
stickyTracking?: boolean;
|
||||
threshold?: number;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
turboThreshold?: number;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
interface HighchartsBoxPlotChart {
|
||||
allowPointSelect?: boolean;
|
||||
color?: string;
|
||||
colorByPoint?: boolean;
|
||||
colors?: string[];
|
||||
cursor?: string;
|
||||
depth?: number;
|
||||
edgecolor?: string;
|
||||
edgewidth?: number;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
fillColor?: string;
|
||||
groupPadding?: number;
|
||||
groupZPadding?: number;
|
||||
grouping?: boolean;
|
||||
lineWidth?: number;
|
||||
linkedTo?: string;
|
||||
medianColor?: string;
|
||||
negativeColor?: string;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPadding?: number;
|
||||
pointPlacement?: string | number;
|
||||
pointRange?: number;
|
||||
pointStart?: number;
|
||||
pointWidth?: number;
|
||||
selected?: boolean;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
states?: {
|
||||
hover: HighchartsBarStates;
|
||||
};
|
||||
stemColor?: string;
|
||||
stemDashStyle?: string;
|
||||
stemWidth?: number;
|
||||
stickyTracking?: boolean;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
turboThreshold?: number;
|
||||
visible?: boolean;
|
||||
whiskerColor?: string;
|
||||
whiskerLength?: number | string; // 100 | "50%"
|
||||
whiskerWidth?: number;
|
||||
}
|
||||
|
||||
interface HighchartsBubbleChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
color?: string;
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dashStyle?: string; //Solid ShortDash ShortDot ShortDashDot ShortDashDotDot Dot Dash LongDash DashDot LongDashDot LongDashDotDot
|
||||
dataLabels?: HighchartsRangeDataLabels;
|
||||
displayNegative?: boolean;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
lineWidth?: number;
|
||||
linkedTo?: string;
|
||||
marker?: HighchartsMarker;
|
||||
maxSize?: string;
|
||||
minSize?: string;
|
||||
negativeColor?: string;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
sizeBy?: string;
|
||||
states?: {
|
||||
hover: HighchartsBarStates;
|
||||
};
|
||||
stickyTracking?: boolean;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
turboThreshold?: number;
|
||||
visible?: boolean;
|
||||
zMax?: number;
|
||||
zMin?: number;
|
||||
zThreshold?: number;
|
||||
}
|
||||
|
||||
interface HighchartsColumnChart extends HighchartsBarChart {
|
||||
}
|
||||
|
||||
interface HighchartsColumnRangeChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
color?: string;
|
||||
colorByPoint?: boolean;
|
||||
colors?: string[];
|
||||
cropThreshold?: number;
|
||||
cursor?: string;
|
||||
dataLabels?: HighchartsRangeDataLabels;
|
||||
enableMouseTracking?: boolean;
|
||||
events?: HighchartsPlotEvents;
|
||||
groupPadding?: number;
|
||||
grouping?: boolean;
|
||||
linkedTo?: string;
|
||||
minPointLength?: number;
|
||||
negativeColor?: string;
|
||||
point?: {
|
||||
events: HighchartsPointEvents;
|
||||
};
|
||||
pointInterval?: number;
|
||||
pointPadding?: number;
|
||||
pointPlacement?: string | number; // null, "on", "between"
|
||||
pointRange?: number;
|
||||
pointStart?: number;
|
||||
pointWidth?: number;
|
||||
selected?: boolean;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
states?: {
|
||||
hover: HighchartsBarStates;
|
||||
};
|
||||
stickyTracking?: boolean;
|
||||
tooltip?: HighchartsTooltipOptions;
|
||||
turboThreshold?: number;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
interface HighchartsErrorBarChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface HighchartsFunnelChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface HighchartsGaugeChart {
|
||||
animation?: boolean;
|
||||
color?: string;
|
||||
@@ -721,6 +840,10 @@ interface HighchartsGaugeChart {
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsHeatMapChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface HighchartsLineChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
@@ -743,7 +866,7 @@ interface HighchartsLineChart {
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
@@ -771,7 +894,7 @@ interface HighchartsPieChart {
|
||||
events?: HighchartsPlotEvents;
|
||||
id?: string;
|
||||
ignoreHiddenPoint?: boolean;
|
||||
innerSize?: any; // string or number;
|
||||
innerSize?: number | string;
|
||||
lineWidth?: number;
|
||||
marker?: HighchartsMarker;
|
||||
point?: {
|
||||
@@ -779,9 +902,9 @@ interface HighchartsPieChart {
|
||||
};
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showInLegend?: boolean;
|
||||
size?: any; // string or number;
|
||||
size?: number | string;
|
||||
slicedOffset?: number;
|
||||
states?: {
|
||||
hover: HighchartsAreaStates;
|
||||
@@ -792,6 +915,14 @@ interface HighchartsPieChart {
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsPolygonChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface HighchartsPyramidChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface HighchartsScatterChart {
|
||||
allowPointSelect?: boolean;
|
||||
animation?: boolean;
|
||||
@@ -813,7 +944,7 @@ interface HighchartsScatterChart {
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
states?: {
|
||||
@@ -826,6 +957,22 @@ interface HighchartsScatterChart {
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsSolidGaugeChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface HighchartsSplineChart extends HighchartsSeriesChart {
|
||||
}
|
||||
|
||||
interface HighchartsTreeMapChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface HighchartsWaterFallChart {
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
||||
// General options for all series types
|
||||
interface HighchartsSeriesChart {
|
||||
allowPointSelect?: boolean;
|
||||
@@ -849,7 +996,7 @@ interface HighchartsSeriesChart {
|
||||
pointPlacement?: string; // null, "on", "between"
|
||||
pointStart?: number;
|
||||
selected?: boolean;
|
||||
shadow?: HighchartsBoolOrShadow;
|
||||
shadow?: boolean | HighchartsShadow;
|
||||
showCheckbox?: boolean;
|
||||
showInLegend?: boolean;
|
||||
stacking?: string;
|
||||
@@ -863,23 +1010,30 @@ interface HighchartsSeriesChart {
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
interface HighchartsSplineChart extends HighchartsSeriesChart {
|
||||
}
|
||||
|
||||
interface HighchartsPlotOptions {
|
||||
area?: HighchartsAreaChart;
|
||||
arearange?: HighchartsAreaRangeChart;
|
||||
areaspline?: HighchartsAreaChart;
|
||||
areasplinerange?: HighchartsAreaRangeChart;
|
||||
areaspline?: HighchartsAreaSplineChart;
|
||||
areasplinerange?: HighchartsAreaSplineRangeChart;
|
||||
bar?: HighchartsBarChart;
|
||||
column?: HighchartsBarChart;
|
||||
boxplot?: HighchartsBoxPlotChart;
|
||||
bubble?: HighchartsBubbleChart;
|
||||
column?: HighchartsColumnChart;
|
||||
columnrange?: HighchartsColumnRangeChart;
|
||||
errorbar?: HighchartsErrorBarChart;
|
||||
funnel?: HighchartsFunnelChart;
|
||||
gauge?: HighchartsGaugeChart;
|
||||
heatmap?: HighchartsHeatMapChart;
|
||||
line?: HighchartsLineChart;
|
||||
pie?: HighchartsPieChart;
|
||||
polygon?: HighchartsPolygonChart;
|
||||
pyramid?: HighchartsPyramidChart;
|
||||
scatter?: HighchartsScatterChart;
|
||||
series?: HighchartsSeriesChart;
|
||||
solidgauge?: HighchartsSolidGaugeChart;
|
||||
spline?: HighchartsSplineChart;
|
||||
treemap?: HighchartsTreeMapChart;
|
||||
waterfall?: HighchartsWaterFallChart;
|
||||
}
|
||||
|
||||
/* You will rarely, if ever, want to use this interface directly. Instead it is much more useful to use one of the derived
|
||||
@@ -897,18 +1051,29 @@ interface HighchartsIndividualSeriesOptions {
|
||||
}
|
||||
|
||||
interface HighchartsSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsSeriesChart { }
|
||||
|
||||
interface HighchartsAreaChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsAreaChart { }
|
||||
interface HighchartsAreaRangeChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsAreaRangeChart { }
|
||||
interface HighchartsAreaSplineChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsAreaChart { }
|
||||
interface HighchartsAreaSplineRangeChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsAreaRangeChart { }
|
||||
interface HighchartsAreaSplineChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsAreaSplineChart { }
|
||||
interface HighchartsAreaSplineRangeChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsAreaSplineRangeChart { }
|
||||
interface HighchartsBarChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsBarChart { }
|
||||
interface HighchartsColumnChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsBarChart { }
|
||||
interface HighchartsBoxPlotChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsBoxPlotChart { }
|
||||
interface HighchartsBubbleChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsBubbleChart { }
|
||||
interface HighchartsColumnChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsColumnChart { }
|
||||
interface HighchartsColumnRangeChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsColumnRangeChart { }
|
||||
interface HighchartsErrorBarChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsErrorBarChart { }
|
||||
interface HighchartsFunnelChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsFunnelChart { }
|
||||
interface HighchartsGaugeChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsGaugeChart { }
|
||||
interface HighchartsHeatMapSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsHeatMapChart { }
|
||||
interface HighchartsLineChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsLineChart { }
|
||||
interface HighchartsPieChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsPieChart { }
|
||||
interface HighchartsPolygonChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsPolygonChart { }
|
||||
interface HighchartsPyramidChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsPyramidChart { }
|
||||
interface HighchartsScatterChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsScatterChart { }
|
||||
interface HighchartsSolidGaugeChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsSolidGaugeChart { }
|
||||
interface HighchartsSplineChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsSplineChart { }
|
||||
interface HighchartsTreeMapChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsTreeMapChart { }
|
||||
interface HighchartsWaterFallChartSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsWaterFallChart { }
|
||||
|
||||
interface HighchartsDataPoint {
|
||||
color?: string;
|
||||
@@ -923,6 +1088,17 @@ interface HighchartsDataPoint {
|
||||
y?: number;
|
||||
}
|
||||
|
||||
interface HighchartsSeriesOptions extends HighchartsSeriesChart {
|
||||
type?: string;
|
||||
data?: number[]| number[][]| HighchartsDataPoint[];
|
||||
index?: number;
|
||||
legendIndex?: number;
|
||||
name?: string;
|
||||
stack?: string | number;
|
||||
xAxis?: number;
|
||||
yAxis?: number;
|
||||
}
|
||||
|
||||
interface HighchartsSubtitleOptions {
|
||||
align?: string;
|
||||
verticalAlign?: string;
|
||||
@@ -952,7 +1128,7 @@ interface HighchartsPlotPoint {
|
||||
|
||||
interface HighchartsTooltipOptions {
|
||||
animation?: boolean;
|
||||
backgroundColor?: HighchartsColorOrGradient;
|
||||
backgroundColor?: string | HighchartsGradient;
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
borderWidth?: number;
|
||||
@@ -977,13 +1153,14 @@ interface HighchartsOptions {
|
||||
chart?: HighchartsChartOptions;
|
||||
colors?: string[];
|
||||
credits?: HighchartsCreditsOptions;
|
||||
data?: any; // TODO
|
||||
drilldown?: any; // TODO
|
||||
exporting?: HighchartsExportingOptions;
|
||||
global?: HighchartsGlobalOptions;
|
||||
labels?: HighchartsLabelsOptions;
|
||||
lang?: HighchartsLangOptions;
|
||||
legend?: HighchartsLegendOptions;
|
||||
loading?: HighchartsLoadingOptions;
|
||||
navigation?: HighchartsNavigationOptions;
|
||||
noData?: any; // TODO
|
||||
pane?: HighchartsPaneOptions;
|
||||
plotOptions?: HighchartsPlotOptions;
|
||||
series?: HighchartsIndividualSeriesOptions[];
|
||||
@@ -994,6 +1171,10 @@ interface HighchartsOptions {
|
||||
yAxis?: HighchartsAxisOptions;
|
||||
}
|
||||
|
||||
interface HighchartsGlobalOptions extends HighchartsOptions {
|
||||
global?: HighchartsGlobalObject;
|
||||
lang?: HighchartsLangObject;
|
||||
}
|
||||
|
||||
interface HighchartsAxisObject {
|
||||
addPlotBand(options: HighchartsPlotBands): void;
|
||||
@@ -1005,18 +1186,18 @@ interface HighchartsAxisObject {
|
||||
setCategories(categories: string[], redraw: boolean): void;
|
||||
setExtremes(min: number, max: number): void;
|
||||
setExtremes(min: number, max: number, redraw: boolean): void;
|
||||
setExtremes(min: number, max: number, redraw: boolean, animation: HighchartsBoolOrAnimation): void;
|
||||
setExtremes(min: number, max: number, redraw: boolean, animation: boolean | HighchartsAnimation): void;
|
||||
setTitle(title: HighchartsAxisTitle): void;
|
||||
setTitle(title: HighchartsAxisTitle, redraw: boolean): void;
|
||||
}
|
||||
|
||||
interface HighchartsChartObject {
|
||||
addSeries<T extends HighchartsIndividualSeriesOptions>(options: T, redraw?: boolean, animation?: boolean): T;
|
||||
addSeries<T extends HighchartsIndividualSeriesOptions>(options: T, redraw?: boolean, animation?: HighchartsAnimation): T;
|
||||
addAxis(options: HighchartsAxisOptions, isX?: boolean, redraw?: boolean, animation?: boolean): HighchartsAxisObject;
|
||||
addAxis(options: HighchartsAxisOptions, isX?: boolean, redraw?: boolean, animation?: HighchartsAnimation): HighchartsAxisObject;
|
||||
addAxis(options: HighchartsAxisOptions, isX?: boolean, redraw?: boolean, animation?: boolean | HighchartsAnimation): HighchartsAxisObject;
|
||||
addSeries<T extends HighchartsIndividualSeriesOptions>(options: T, redraw?: boolean, animation?: boolean | HighchartsAnimation): T;
|
||||
addSeriesAsDrilldown(point: HighchartsPointObject, seriesOptions: HighchartsSeriesOptions): void;
|
||||
container: HTMLElement;
|
||||
destroy(): void;
|
||||
drillUp(): void;
|
||||
exportChart(): void;
|
||||
exportChart(options: HighchartsExportingOptions): void;
|
||||
exportChart(options: HighchartsExportingOptions, chartOptions: HighchartsChartOptions): void;
|
||||
@@ -1029,12 +1210,14 @@ interface HighchartsChartObject {
|
||||
options: HighchartsChartOptions;
|
||||
print(): void;
|
||||
redraw(): void;
|
||||
reflow(): void;
|
||||
series: HighchartsSeriesObject[];
|
||||
setSize(width: number, height: number): void;
|
||||
setSize(width: number, height: number, anumation: boolean): void;
|
||||
setSize(width: number, height: number, anumation: HighchartsAnimation): void;
|
||||
setSize(width: number, height: number, animation: boolean): void;
|
||||
setSize(width: number, height: number, animation: HighchartsAnimation): void;
|
||||
setTitle(title: HighchartsTitleOptions): void;
|
||||
setTitle(title: HighchartsTitleOptions, subtitle: HighchartsSubtitleOptions): void;
|
||||
setTitle(title: HighchartsTitleOptions, subtitle: HighchartsSubtitleOptions, redraw: boolean): void;
|
||||
showLoading(): void;
|
||||
showLoading(str: string): void;
|
||||
xAxis: HighchartsAxisObject[];
|
||||
@@ -1045,18 +1228,18 @@ interface HighchartsChartObject {
|
||||
|
||||
interface HighchartsChart {
|
||||
new (options: HighchartsOptions): HighchartsChartObject;
|
||||
new (options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void ): HighchartsChartObject;
|
||||
new (options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): HighchartsChartObject;
|
||||
}
|
||||
|
||||
interface HighchartsElementObject {
|
||||
add(): HighchartsElementObject;
|
||||
add(parent: HighchartsElementObject): HighchartsElementObject;
|
||||
animate(attributes: any, animation?: any): HighchartsElementObject;
|
||||
animate(attributes: any, animation?: any): HighchartsElementObject;
|
||||
attr(hash: any): HighchartsElementObject;
|
||||
css(hash: HighchartsCSSObject): HighchartsElementObject;
|
||||
destroy(): void;
|
||||
getBBox(): { x: number; y: number; height: number; width: number; };
|
||||
on(eventType: string, handler: () => void ): HighchartsElementObject;
|
||||
on(eventType: string, handler: () => void): HighchartsElementObject;
|
||||
toFront(): HighchartsElementObject;
|
||||
}
|
||||
|
||||
@@ -1077,15 +1260,16 @@ interface HighchartsRenderer {
|
||||
interface HighchartsStatic {
|
||||
Chart: HighchartsChart;
|
||||
Renderer: HighchartsRenderer;
|
||||
Color(color: HighchartsColorOrGradient): HighchartsColorOrGradient;
|
||||
Color(color: string | HighchartsGradient): string | HighchartsGradient;
|
||||
|
||||
dateFormat(format: string, time?: number, capitalize?: boolean): string;
|
||||
numberFormat(value: number, decimals?: number, decimalPoint?: string, thousandsSep?: string): string;
|
||||
setOptions(options: HighchartsOptions): HighchartsOptions;
|
||||
setOptions(options: HighchartsGlobalOptions): HighchartsOptions;
|
||||
getOptions(): HighchartsOptions;
|
||||
|
||||
map(array: any[], fn: Function): any[];
|
||||
}
|
||||
|
||||
declare var Highcharts: HighchartsStatic;
|
||||
|
||||
interface HighchartsPointObject {
|
||||
@@ -1105,6 +1289,7 @@ interface HighchartsPointObject {
|
||||
slice(sliced: boolean, redraw: boolean): void;
|
||||
slice(sliced: boolean, redraw: boolean, animation: boolean): void;
|
||||
slice(sliced: boolean, redraw: boolean, animation: HighchartsAnimation): void;
|
||||
total: number;
|
||||
update(options: any): void;
|
||||
update(options: any, redraw: boolean): void;
|
||||
update(options: any, redraw: boolean, animation: boolean): void;
|
||||
@@ -1114,20 +1299,19 @@ interface HighchartsPointObject {
|
||||
}
|
||||
|
||||
interface HighchartsSeriesObject {
|
||||
addPoint(options: any): void;
|
||||
addPoint(options: any, redraw: boolean, shift: boolean): void;
|
||||
addPoint(options: any, redraw: boolean, shift: boolean, animation: boolean): void;
|
||||
addPoint(options: any, redraw: boolean, shift: boolean, animation: HighchartsAnimation): void;
|
||||
addPoint(options: number |[number, number]| HighchartsDataPoint): void;
|
||||
addPoint(options: number |[number, number]| HighchartsDataPoint, redraw: boolean, shift: boolean): void;
|
||||
addPoint(options: number |[number, number]| HighchartsDataPoint, redraw: boolean, shift: boolean, animation: boolean): void;
|
||||
addPoint(options: number |[number, number]| HighchartsDataPoint, redraw: boolean, shift: boolean, animation: HighchartsAnimation): void;
|
||||
chart: HighchartsChartObject;
|
||||
data: HighchartsDataPoint[];
|
||||
hide(): void;
|
||||
options: HighchartsIndividualSeriesOptions;
|
||||
name: string;
|
||||
options: HighchartsSeriesOptions;
|
||||
remove(): void;
|
||||
remove(redraw: boolean): void;
|
||||
name: string;
|
||||
points: HighchartsPointObject[];
|
||||
select(): void;
|
||||
select(selected?: boolean): void;
|
||||
select(selected: boolean): void;
|
||||
selected: boolean;
|
||||
setData(data: number[]): void; // [value1,value2, ... ]
|
||||
setData(data: number[], redraw: boolean): void;
|
||||
@@ -1139,6 +1323,7 @@ interface HighchartsSeriesObject {
|
||||
setVisible(visible: boolean, redraw: boolean): void;
|
||||
show(): void;
|
||||
type: string;
|
||||
update(options: HighchartsSeriesOptions, redraw?: boolean): void;
|
||||
visible: boolean;
|
||||
xAxis: HighchartsAxisObject;
|
||||
yAxis: HighchartsAxisObject;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/// <reference path="hypertext-application-language.d.ts"/>
|
||||
|
||||
// Link object
|
||||
|
||||
// Fields format:
|
||||
var link:Hal.Link = {
|
||||
"deprecation": "",
|
||||
"href": "",
|
||||
"hreflang": "",
|
||||
"name": "",
|
||||
"profile": "",
|
||||
"templated": true,
|
||||
"title": "",
|
||||
"type": "",
|
||||
};
|
||||
|
||||
// Required fields:
|
||||
var link:Hal.Link = {
|
||||
"href": "",
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
// Type definitions for Hypertext Application Language Draft 6
|
||||
// Project: https://tools.ietf.org/html/draft-kelly-json-hal-06
|
||||
// Definitions by: Maks3w <https://github.com/maks3w/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module Hal {
|
||||
/**
|
||||
* Describe a HAL Link object
|
||||
*
|
||||
* https://tools.ietf.org/html/draft-kelly-json-hal-06#section-5
|
||||
*/
|
||||
interface Link {
|
||||
deprecation?: string;
|
||||
href: string;
|
||||
hreflang?: string;
|
||||
name?: string;
|
||||
profile?: string;
|
||||
templated?: boolean;
|
||||
title?: string;
|
||||
type?: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/// <reference path="./json-patch.d.ts" />
|
||||
|
||||
import jp = require("json-patch");
|
||||
|
||||
// Add property, result: {foo: 'bar'}
|
||||
jsonpatch.apply({}, [{ op: 'add', path: '/foo', value: 'bar' }]);
|
||||
// Add array element, result: {foo: [1, 2, 3]}
|
||||
jsonpatch.apply({ foo: [1, 3] }, [{ op: 'add', path: '/foo/1', value: 2 }]);
|
||||
// Complex, result: {foo: [{bar: 'baz'}]}
|
||||
jsonpatch.apply({ foo: [{}] }, [{ op: 'add', path: '/foo/0/bar', value: 'baz' }]);
|
||||
|
||||
// Remove property, result: {}
|
||||
jsonpatch.apply({ foo: 'bar' }, [{ op: 'remove', path: '/foo' }]);
|
||||
// Remove array element, result: {foo: [1, 3]}
|
||||
jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'remove', path: '/foo/1' }]);
|
||||
// Complex, result: {foo: [{}]}
|
||||
jsonpatch.apply({ foo: [{ bar: 'baz' }] }, [{ op: 'remove', path: '/foo/0/bar' }]);
|
||||
|
||||
// Replace property, result: {foo: 1}
|
||||
jsonpatch.apply({ foo: 'bar' }, [{ op: 'replace', path: '/foo', value: 1 }]);
|
||||
// Repalce array element, result: {foo: [1, 4, 3]}
|
||||
jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'replace', path: '/foo/1', value: 4 }]);
|
||||
// Complex, result: {foo: [{bar: 1}]}
|
||||
jsonpatch.apply({ foo: [{ bar: 'baz' }] }, [{ op: 'replace', path: '/foo/0/bar', value: 1 }]);
|
||||
|
||||
// Move property, result {bar: [1, 2, 3]}
|
||||
jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'move', from: '/foo', path: '/bar' }]);
|
||||
// Copy property, result {foo: [1, 2, 3], bar: 2}
|
||||
jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'copy', from: '/foo/1', path: '/bar' }]);
|
||||
// Test equality of property to value, result: true
|
||||
jsonpatch.apply({ foo: 'bar' }, [{ op: 'test', path: '/foo', value: 'bar' }]);
|
||||
|
||||
jsonpatch.compile([{ op: 'test', path: '/foo', value: 'bar' }])({ foo: 'bar' });
|
||||
|
||||
jp.apply({}, [{ op: 'add', path: '/foo', value: 'bar' }]);
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
// Type definitions for json-patch
|
||||
// Project: https://github.com/bruth/jsonpatch-js
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module jsonpatch {
|
||||
type OpPatch = AddPath | RemovePath | ReplacePath | MovePath | CopyPath | TestPath;
|
||||
interface Patch {
|
||||
op: string;
|
||||
}
|
||||
interface AddPath extends Patch {
|
||||
path: string;
|
||||
value: any;
|
||||
}
|
||||
interface RemovePath extends Patch {
|
||||
path: string;
|
||||
}
|
||||
interface ReplacePath extends Patch {
|
||||
path: string;
|
||||
value: any;
|
||||
}
|
||||
interface MovePath extends Patch {
|
||||
from: string;
|
||||
path: string;
|
||||
}
|
||||
interface CopyPath extends Patch {
|
||||
from: string;
|
||||
path: string;
|
||||
}
|
||||
interface TestPath extends Patch {
|
||||
path: string;
|
||||
value: any;
|
||||
}
|
||||
|
||||
function apply(document: any, patches: OpPatch[]): any;
|
||||
function compile(patches: OpPatch[]): (document: any) => any;
|
||||
}
|
||||
|
||||
declare module "json-patch" {
|
||||
export = jsonpatch;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference path="json5.d.ts" />
|
||||
import JSON5 = require('json5');
|
||||
|
||||
var obj = JSON5.parse("{ key:'val', 'key2':[0,1,2,] } //comment ");
|
||||
var str = JSON5.stringify(obj, null, "\t");
|
||||
console.log(str);
|
||||
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
// Type definitions for JSON5
|
||||
// Project: http://json5.org/
|
||||
// Definitions by: Jason Swearingen <https://jasonswearingen.github.io>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
//commonjs loader
|
||||
declare module "json5" {
|
||||
/**
|
||||
* The following is the exact list of additions to JSON's syntax introduced by JSON5. All of these are optional, and all of these come from ES5.
|
||||
|
||||
Objects
|
||||
|
||||
Object keys can be unquoted if they're valid identifiers. Yes, even reserved keywords (like default) are valid unquoted keys in ES5 [§11.1.5, §7.6]. (More info)
|
||||
|
||||
(TODO: Unicode characters and escape sequences aren’t yet supported in this implementation.)
|
||||
|
||||
Objects can have trailing commas.
|
||||
|
||||
Arrays
|
||||
|
||||
Arrays can have trailing commas.
|
||||
Strings
|
||||
|
||||
Strings can be single-quoted.
|
||||
|
||||
Strings can be split across multiple lines; just prefix each newline with a backslash. [ES5 §7.8.4]
|
||||
|
||||
Numbers
|
||||
|
||||
Numbers can be hexadecimal (base 16).
|
||||
|
||||
Numbers can begin or end with a (leading or trailing) decimal point.
|
||||
|
||||
Numbers can include Infinity, -Infinity, NaN, and -NaN.
|
||||
|
||||
Numbers can begin with an explicit plus sign.
|
||||
|
||||
Comments
|
||||
|
||||
Both inline (single-line) and block (multi-line) comments are allowed.
|
||||
*/
|
||||
var json5: JSON;
|
||||
export = json5;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/// <reference path="../knockout.punches/knockout.punches.d.ts" />
|
||||
|
||||
|
||||
function test_enable() {
|
||||
|
||||
ko.punches.enableAll();
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for knockout.punches 0.5.1
|
||||
// Project: https://github.com/mbest/knockout.punches
|
||||
// Definitions by: Stephen Lautier <https://github.com/johnnyreilly>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../knockout/knockout.d.ts" />
|
||||
|
||||
interface KnockoutPunchesStatic {
|
||||
enableAll(): void;
|
||||
}
|
||||
|
||||
interface KnockoutStatic {
|
||||
punches: KnockoutPunchesStatic;
|
||||
}
|
||||
|
||||
declare module "knockout.punches" {
|
||||
export = punches;
|
||||
}
|
||||
|
||||
declare var punches: KnockoutPunchesStatic;
|
||||
Regular → Executable
+89
@@ -325,3 +325,92 @@ CustomControl = L.Control.extend<CustomControl.Options, CustomControl>({
|
||||
this.title = title;
|
||||
},
|
||||
});
|
||||
|
||||
// Different latLng and latLngBounds expressions
|
||||
var latLngLiteral = [10, 20];
|
||||
var latLngObjectLiteral = { lat: 10, lng: 10 };
|
||||
var boundsLiteral = [[10, 20], [20, 20]];
|
||||
var boundLiteralOfLatLngObjects = [latLngObjectLiteral, latLngObjectLiteral];
|
||||
|
||||
var circle: L.Circle = L.circle(latLngLiteral, 4);
|
||||
circle = new L.Circle(latLngLiteral, 4);
|
||||
circle.setLatLng(latLngLiteral);
|
||||
|
||||
circle = L.circle(latLngObjectLiteral, 4);
|
||||
circle = new L.Circle(latLngObjectLiteral, 4);
|
||||
circle.setLatLng(latLngObjectLiteral);
|
||||
|
||||
var circleMarker: L.CircleMarker = L.circleMarker(latLngLiteral);
|
||||
circleMarker = new L.CircleMarker(latLngLiteral);
|
||||
circleMarker.setLatLng(latLngLiteral);
|
||||
|
||||
circleMarker = L.circleMarker(latLngObjectLiteral);
|
||||
circleMarker = new L.CircleMarker(latLngObjectLiteral);
|
||||
circleMarker.setLatLng(latLngObjectLiteral);
|
||||
|
||||
var latLng: L.LatLng = L.latLng(latLngLiteral);
|
||||
latLng = new L.LatLng(latLngLiteral);
|
||||
latLng.distanceTo(latLngLiteral);
|
||||
latLng.equals(latLngLiteral);
|
||||
|
||||
latLng = L.latLng(latLngObjectLiteral);
|
||||
latLng = new L.LatLng(latLngObjectLiteral);
|
||||
latLng.distanceTo(latLngObjectLiteral);
|
||||
latLng.equals(latLngObjectLiteral);
|
||||
|
||||
var bounds: L.LatLngBounds = L.latLngBounds(boundsLiteral);
|
||||
bounds = L.latLngBounds(boundLiteralOfLatLngObjects);
|
||||
bounds = new L.LatLngBounds(boundsLiteral);
|
||||
bounds = new L.LatLngBounds(boundLiteralOfLatLngObjects);
|
||||
bounds = new L.LatLngBounds(latLngLiteral, latLngLiteral);
|
||||
|
||||
bounds.extend(latLngLiteral);
|
||||
bounds.extend(latLngObjectLiteral);
|
||||
bounds.extend(boundsLiteral);
|
||||
bounds.extend(boundLiteralOfLatLngObjects);
|
||||
|
||||
bounds.contains(latLngLiteral);
|
||||
bounds.contains(boundLiteralOfLatLngObjects);
|
||||
bounds.contains(boundsLiteral);
|
||||
|
||||
bounds.intersects(boundsLiteral);
|
||||
bounds.intersects(boundLiteralOfLatLngObjects);
|
||||
|
||||
bounds.equals(boundsLiteral);
|
||||
bounds.equals(boundLiteralOfLatLngObjects);
|
||||
|
||||
map.setView(latLngLiteral);
|
||||
map.setView(latLngObjectLiteral);
|
||||
map.setZoomAround(latLngLiteral, 15);
|
||||
map.setZoomAround(latLngObjectLiteral, 15);
|
||||
map.panTo(latLngLiteral);
|
||||
map.panTo(latLngObjectLiteral);
|
||||
map.openPopup('test', latLngLiteral);
|
||||
map.openPopup('test', latLngObjectLiteral);
|
||||
map.latLngToLayerPoint(latLngLiteral);
|
||||
map.latLngToLayerPoint(latLngObjectLiteral);
|
||||
map.latLngToContainerPoint(latLngLiteral);
|
||||
map.latLngToContainerPoint(latLngObjectLiteral);
|
||||
map.project(latLngLiteral);
|
||||
map.project(latLngObjectLiteral);
|
||||
|
||||
marker.setLatLng(latLngLiteral);
|
||||
marker.setLatLng(latLngObjectLiteral);
|
||||
|
||||
var polygon: L.Polygon = L.polygon(boundsLiteral);
|
||||
polygon = L.polygon(boundLiteralOfLatLngObjects);
|
||||
polygon = new L.Polygon(boundsLiteral);
|
||||
polygon = new L.Polygon(boundLiteralOfLatLngObjects);
|
||||
|
||||
var polyline: L.Polyline = L.polyline(boundsLiteral);
|
||||
polyline = L.polyline(boundLiteralOfLatLngObjects);
|
||||
polyline = new L.Polyline(boundsLiteral);
|
||||
polyline = new L.Polyline(boundLiteralOfLatLngObjects);
|
||||
polyline.setLatLngs(boundsLiteral);
|
||||
polyline.setLatLngs(boundLiteralOfLatLngObjects);
|
||||
polyline.addLatLng(latLngLiteral);
|
||||
polyline.addLatLng(latLngObjectLiteral);
|
||||
|
||||
var popup: L.Popup = L.popup();
|
||||
popup.setLatLng(latLngLiteral);
|
||||
popup.setLatLng(latLngObjectLiteral);
|
||||
|
||||
+43
-39
@@ -3,6 +3,10 @@
|
||||
// Definitions by: Vladimir Zotov <https://github.com/rgripper>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module L {
|
||||
type LatLngExpression = LatLng | number[] | ({ lat: number; lng: number })
|
||||
type LatLngBoundsExpression = LatLngBounds | LatLngExpression[];
|
||||
}
|
||||
|
||||
declare module L {
|
||||
|
||||
@@ -180,14 +184,14 @@ declare module L {
|
||||
* Instantiates a circle object given a geographical point, a radius in meters
|
||||
* and optionally an options object.
|
||||
*/
|
||||
function circle(latlng: LatLng, radius: number, options?: PathOptions): Circle;
|
||||
function circle(latlng: LatLngExpression, radius: number, options?: PathOptions): Circle;
|
||||
|
||||
export interface CircleStatic extends ClassStatic {
|
||||
/**
|
||||
* Instantiates a circle object given a geographical point, a radius in meters
|
||||
* and optionally an options object.
|
||||
*/
|
||||
new(latlng: LatLng, radius: number, options?: PathOptions): Circle;
|
||||
new(latlng: LatLngExpression, radius: number, options?: PathOptions): Circle;
|
||||
}
|
||||
export var Circle: CircleStatic;
|
||||
|
||||
@@ -205,7 +209,7 @@ declare module L {
|
||||
/**
|
||||
* Sets the position of a circle to a new location.
|
||||
*/
|
||||
setLatLng(latlng: LatLng): Circle;
|
||||
setLatLng(latlng: LatLngExpression): Circle;
|
||||
|
||||
/**
|
||||
* Sets the radius of a circle. Units are in meters.
|
||||
@@ -227,7 +231,7 @@ declare module L {
|
||||
* an options object. The default radius is 10 and can be altered by passing a
|
||||
* "radius" member in the path options object.
|
||||
*/
|
||||
function circleMarker(latlng: LatLng, options?: PathOptions): CircleMarker;
|
||||
function circleMarker(latlng: LatLngExpression, options?: PathOptions): CircleMarker;
|
||||
|
||||
|
||||
export interface CircleMarkerStatic extends ClassStatic {
|
||||
@@ -236,7 +240,7 @@ declare module L {
|
||||
* an options object. The default radius is 10 and can be altered by passing a
|
||||
* "radius" member in the path options object.
|
||||
*/
|
||||
new(latlng: LatLng, options?: PathOptions): CircleMarker;
|
||||
new(latlng: LatLngExpression, options?: PathOptions): CircleMarker;
|
||||
}
|
||||
export var CircleMarker: CircleMarkerStatic;
|
||||
|
||||
@@ -244,7 +248,7 @@ declare module L {
|
||||
/**
|
||||
* Sets the position of a circle marker to a new location.
|
||||
*/
|
||||
setLatLng(latlng: LatLng): CircleMarker;
|
||||
setLatLng(latlng: LatLngExpression): CircleMarker;
|
||||
|
||||
/**
|
||||
* Sets the radius of a circle marker. Units are in pixels.
|
||||
@@ -1439,7 +1443,7 @@ declare module L {
|
||||
* Creates an object representing a geographical point with the given latitude
|
||||
* and longitude.
|
||||
*/
|
||||
function latLng(coords: number[]): LatLng;
|
||||
function latLng(coords: LatLngExpression): LatLng;
|
||||
|
||||
export interface LatLngStatic extends ClassStatic {
|
||||
/**
|
||||
@@ -1452,7 +1456,7 @@ declare module L {
|
||||
* Creates an object representing a geographical point with the given latitude
|
||||
* and longitude.
|
||||
*/
|
||||
new(coords: number[]): LatLng;
|
||||
new(coords: LatLngExpression): LatLng;
|
||||
|
||||
/**
|
||||
* A multiplier for converting degrees into radians.
|
||||
@@ -1482,13 +1486,13 @@ declare module L {
|
||||
* Returns the distance (in meters) to the given LatLng calculated using the
|
||||
* Haversine formula. See description on wikipedia
|
||||
*/
|
||||
distanceTo(otherLatlng: LatLng): number;
|
||||
distanceTo(otherLatlng: LatLngExpression): number;
|
||||
|
||||
/**
|
||||
* Returns true if the given LatLng point is at the same position (within a small
|
||||
* margin of error).
|
||||
*/
|
||||
equals(otherLatlng: LatLng): boolean;
|
||||
equals(otherLatlng: LatLngExpression): boolean;
|
||||
|
||||
/**
|
||||
* Returns a string representation of the point (for debugging purposes).
|
||||
@@ -1519,26 +1523,26 @@ declare module L {
|
||||
* Creates a LatLngBounds object by defining south-west and north-east corners
|
||||
* of the rectangle.
|
||||
*/
|
||||
function latLngBounds(southWest: LatLng, northEast: LatLng): LatLngBounds;
|
||||
function latLngBounds(southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds;
|
||||
|
||||
/**
|
||||
* Creates a LatLngBounds object defined by the geographical points it contains.
|
||||
* Very useful for zooming the map to fit a particular set of locations with fitBounds.
|
||||
*/
|
||||
function latLngBounds(latlngs: LatLng[]): LatLngBounds;
|
||||
function latLngBounds(latlngs: LatLngBoundsExpression): LatLngBounds;
|
||||
|
||||
export interface LatLngBoundsStatic extends ClassStatic {
|
||||
/**
|
||||
* Creates a LatLngBounds object by defining south-west and north-east corners
|
||||
* of the rectangle.
|
||||
*/
|
||||
new(southWest: LatLng, northEast: LatLng): LatLngBounds;
|
||||
new(southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds;
|
||||
|
||||
/**
|
||||
* Creates a LatLngBounds object defined by the geographical points it contains.
|
||||
* Very useful for zooming the map to fit a particular set of locations with fitBounds.
|
||||
*/
|
||||
new(latlngs: LatLng[]): LatLngBounds;
|
||||
new(latlngs: LatLngBoundsExpression): LatLngBounds;
|
||||
}
|
||||
export var LatLngBounds: LatLngBoundsStatic;
|
||||
|
||||
@@ -1546,12 +1550,12 @@ declare module L {
|
||||
/**
|
||||
* Extends the bounds to contain the given point.
|
||||
*/
|
||||
extend(latlng: LatLng): LatLngBounds;
|
||||
extend(latlng: LatLngExpression): LatLngBounds;
|
||||
|
||||
/**
|
||||
* Extends the bounds to contain the given bounds.
|
||||
*/
|
||||
extend(latlng: LatLngBounds): LatLngBounds;
|
||||
extend(latlng: LatLngBoundsExpression): LatLngBounds;
|
||||
|
||||
/**
|
||||
* Returns the south-west point of the bounds.
|
||||
@@ -1601,23 +1605,23 @@ declare module L {
|
||||
/**
|
||||
* Returns true if the rectangle contains the given one.
|
||||
*/
|
||||
contains(otherBounds: LatLngBounds): boolean;
|
||||
contains(otherBounds: LatLngBoundsExpression): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the rectangle contains the given point.
|
||||
*/
|
||||
contains(latlng: LatLng): boolean;
|
||||
contains(latlng: LatLngExpression): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the rectangle intersects the given bounds.
|
||||
*/
|
||||
intersects(otherBounds: LatLngBounds): boolean;
|
||||
intersects(otherBounds: LatLngBoundsExpression): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the rectangle is equivalent (within a small margin of error)
|
||||
* to the given bounds.
|
||||
*/
|
||||
equals(otherBounds: LatLngBounds): boolean;
|
||||
equals(otherBounds: LatLngBoundsExpression): boolean;
|
||||
|
||||
/**
|
||||
* Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat'
|
||||
@@ -2082,7 +2086,7 @@ declare module L {
|
||||
* Sets the view of the map (geographical center and zoom) with the given
|
||||
* animation options.
|
||||
*/
|
||||
setView(center: LatLng, zoom?: number, options?: ZoomPanOptions): Map;
|
||||
setView(center: LatLngExpression, zoom?: number, options?: ZoomPanOptions): Map;
|
||||
|
||||
/**
|
||||
* Sets the zoom of the map.
|
||||
@@ -2103,7 +2107,7 @@ declare module L {
|
||||
* Zooms the map while keeping a specified point on the map stationary
|
||||
* (e.g. used internally for scroll zoom and double-click zoom).
|
||||
*/
|
||||
setZoomAround(latlng: LatLng, zoom: number, options?: ZoomOptions): Map;
|
||||
setZoomAround(latlng: LatLngExpression, zoom: number, options?: ZoomOptions): Map;
|
||||
|
||||
/**
|
||||
* Sets a map view that contains the given geographical bounds with the maximum
|
||||
@@ -2121,7 +2125,7 @@ declare module L {
|
||||
* Pans the map to a given center. Makes an animated pan if new center is not more
|
||||
* than one screen away from the current one.
|
||||
*/
|
||||
panTo(latlng: LatLng, options?: PanOptions): Map;
|
||||
panTo(latlng: LatLngExpression, options?: PanOptions): Map;
|
||||
|
||||
/**
|
||||
* Pans the map to the closest view that would lie inside the given bounds (if
|
||||
@@ -2253,13 +2257,13 @@ declare module L {
|
||||
* Creates a popup with the specified options and opens it in the given point
|
||||
* on a map.
|
||||
*/
|
||||
openPopup(html: string, latlng: LatLng, options?: PopupOptions): Map;
|
||||
openPopup(html: string, latlng: LatLngExpression, options?: PopupOptions): Map;
|
||||
|
||||
/**
|
||||
* Creates a popup with the specified options and opens it in the given point
|
||||
* on a map.
|
||||
*/
|
||||
openPopup(el: HTMLElement, latlng: LatLng, options?: PopupOptions): Map;
|
||||
openPopup(el: HTMLElement, latlng: LatLngExpression, options?: PopupOptions): Map;
|
||||
|
||||
/**
|
||||
* Closes the popup previously opened with openPopup (or the given one).
|
||||
@@ -2282,7 +2286,7 @@ declare module L {
|
||||
* Returns the map layer point that corresponds to the given geographical coordinates
|
||||
* (useful for placing overlays on the map).
|
||||
*/
|
||||
latLngToLayerPoint(latlng: LatLng): Point;
|
||||
latLngToLayerPoint(latlng: LatLngExpression): Point;
|
||||
|
||||
/**
|
||||
* Returns the geographical coordinates of a given map layer point.
|
||||
@@ -2305,7 +2309,7 @@ declare module L {
|
||||
* Returns the map container point that corresponds to the given geographical
|
||||
* coordinates.
|
||||
*/
|
||||
latLngToContainerPoint(latlng: LatLng): Point;
|
||||
latLngToContainerPoint(latlng: LatLngExpression): Point;
|
||||
|
||||
/**
|
||||
* Returns the geographical coordinates of a given map container point.
|
||||
@@ -2316,7 +2320,7 @@ declare module L {
|
||||
* Projects the given geographical coordinates to absolute pixel coordinates
|
||||
* for the given zoom level (current zoom level by default).
|
||||
*/
|
||||
project(latlng: LatLng, zoom?: number): Point;
|
||||
project(latlng: LatLngExpression, zoom?: number): Point;
|
||||
|
||||
/**
|
||||
* Projects the given absolute pixel coordinates to geographical coordinates
|
||||
@@ -2718,14 +2722,14 @@ declare module L {
|
||||
* Instantiates a Marker object given a geographical point and optionally
|
||||
* an options object.
|
||||
*/
|
||||
function marker(latlng: LatLng, options?: MarkerOptions): Marker;
|
||||
function marker(latlng: LatLngExpression, options?: MarkerOptions): Marker;
|
||||
|
||||
var Marker: {
|
||||
/**
|
||||
* Instantiates a Marker object given a geographical point and optionally
|
||||
* an options object.
|
||||
*/
|
||||
new(latlng: LatLng, options?: MarkerOptions): Marker;
|
||||
new(latlng: LatLngExpression, options?: MarkerOptions): Marker;
|
||||
};
|
||||
|
||||
export interface Marker extends ILayer, IEventPowered<Marker> {
|
||||
@@ -2742,7 +2746,7 @@ declare module L {
|
||||
/**
|
||||
* Changes the marker position to the given point.
|
||||
*/
|
||||
setLatLng(latlng: LatLng): Marker;
|
||||
setLatLng(latlng: LatLngExpression): Marker;
|
||||
|
||||
/**
|
||||
* Changes the marker icon.
|
||||
@@ -3095,7 +3099,7 @@ declare module L {
|
||||
* Opens the popup previously bound by the bindPopup method in the given point,
|
||||
* or in one of the path's points if not specified.
|
||||
*/
|
||||
openPopup(latlng?: LatLng): Path;
|
||||
openPopup(latlng?: LatLngExpression): Path;
|
||||
|
||||
/**
|
||||
* Closes the path's bound popup if it is opened.
|
||||
@@ -3371,7 +3375,7 @@ declare module L {
|
||||
* latlngs array representing the exterior ring while the remaining represent
|
||||
* the holes inside.
|
||||
*/
|
||||
function polygon(latlngs: LatLng[], options?: PolylineOptions): Polygon;
|
||||
function polygon(latlngs: LatLngBoundsExpression, options?: PolylineOptions): Polygon;
|
||||
|
||||
|
||||
export interface PolygonStatic extends ClassStatic {
|
||||
@@ -3382,7 +3386,7 @@ declare module L {
|
||||
* latlngs array representing the exterior ring while the remaining represent
|
||||
* the holes inside.
|
||||
*/
|
||||
new(latlngs: LatLng[], options?: PolylineOptions): Polygon;
|
||||
new(latlngs: LatLngBoundsExpression, options?: PolylineOptions): Polygon;
|
||||
}
|
||||
export var Polygon: PolygonStatic;
|
||||
|
||||
@@ -3396,14 +3400,14 @@ declare module L {
|
||||
* Instantiates a polyline object given an array of geographical points and
|
||||
* optionally an options object.
|
||||
*/
|
||||
function polyline(latlngs: LatLng[], options?: PolylineOptions): Polyline;
|
||||
function polyline(latlngs: LatLngBoundsExpression, options?: PolylineOptions): Polyline;
|
||||
|
||||
export interface PolylineStatic extends ClassStatic {
|
||||
/**
|
||||
* Instantiates a polyline object given an array of geographical points and
|
||||
* optionally an options object.
|
||||
*/
|
||||
new(latlngs: LatLng[], options?: PolylineOptions): Polyline;
|
||||
new(latlngs: LatLngBoundsExpression, options?: PolylineOptions): Polyline;
|
||||
}
|
||||
export var Polyline: PolylineStatic;
|
||||
|
||||
@@ -3411,13 +3415,13 @@ declare module L {
|
||||
/**
|
||||
* Adds a given point to the polyline.
|
||||
*/
|
||||
addLatLng(latlng: LatLng): Polyline;
|
||||
addLatLng(latlng: LatLngExpression): Polyline;
|
||||
|
||||
/**
|
||||
* Replaces all the points in the polyline with the given array of geographical
|
||||
* points.
|
||||
*/
|
||||
setLatLngs(latlngs: LatLng[]): Polyline;
|
||||
setLatLngs(latlngs: LatLngBoundsExpression): Polyline;
|
||||
|
||||
/**
|
||||
* Returns an array of the points in the path.
|
||||
@@ -3510,7 +3514,7 @@ declare module L {
|
||||
/**
|
||||
* Sets the geographical point where the popup will open.
|
||||
*/
|
||||
setLatLng(latlng: LatLng): Popup;
|
||||
setLatLng(latlng: LatLngExpression): Popup;
|
||||
|
||||
/**
|
||||
* Returns the geographical point of popup.
|
||||
|
||||
Vendored
+1182
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
/// <reference path="mandrill-api.d.ts" />
|
||||
|
||||
import mandrill = require('mandrill-api');
|
||||
|
||||
var
|
||||
M = new mandrill.Mandrill('key', false),
|
||||
cb: mandrill.ICallback = function(asd){
|
||||
|
||||
};
|
||||
|
||||
|
||||
M.templates.add({});
|
||||
M.webhooks.delete({id: 1});
|
||||
M.call('url', {}, cb, cb);
|
||||
@@ -23,7 +23,14 @@ var buf : number[] = []
|
||||
uuid.parse(uid4, buf, offset)
|
||||
uuid.unparse(buf, offset)
|
||||
|
||||
uuid.v1(options, padding, offset)
|
||||
uuid.v2(options, padding, offset)
|
||||
uuid.v3(options, padding, offset)
|
||||
uuid.v4(options, padding, offset)
|
||||
var uid21: number[] = uuid.v1(options, padding, offset)
|
||||
var uid22: number[] = uuid.v2(options, padding, offset)
|
||||
var uid23: number[] = uuid.v3(options, padding, offset)
|
||||
var uid24: number[] = uuid.v4(options, padding, offset)
|
||||
|
||||
var buffer: Buffer;
|
||||
|
||||
var uid31: Buffer = uuid.v1(options, buffer, offset)
|
||||
var uid32: Buffer = uuid.v2(options, buffer, offset)
|
||||
var uid33: Buffer = uuid.v3(options, buffer, offset)
|
||||
var uid34: Buffer = uuid.v4(options, buffer, offset)
|
||||
|
||||
Vendored
+16
-12
@@ -11,39 +11,43 @@ interface UUIDOptions {
|
||||
* Node id as Array of 6 bytes (per 4.1.6).
|
||||
* Default: Randomly generated ID. See note 1.
|
||||
*/
|
||||
node: any[]
|
||||
node?: any[]
|
||||
|
||||
/**
|
||||
* (Number between 0 - 0x3fff) RFC clock sequence.
|
||||
* Default: An internally maintained clockseq is used.
|
||||
*/
|
||||
clockseq: number
|
||||
clockseq?: number
|
||||
|
||||
/**
|
||||
* (Number | Date) Time in milliseconds since unix Epoch.
|
||||
* Default: The current time is used.
|
||||
*/
|
||||
msecs: any
|
||||
msecs?: any
|
||||
|
||||
/**
|
||||
* (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if msecs is unspecified.
|
||||
* Default: internal uuid counter is used, as per 4.2.1.2.
|
||||
*/
|
||||
nsecs: number
|
||||
nsecs?: number
|
||||
}
|
||||
|
||||
interface UUID {
|
||||
v1(options?: UUIDOptions, buffer?: number[], offset?: number): string
|
||||
v1(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
|
||||
v1(options?: UUIDOptions): string
|
||||
v1(options?: UUIDOptions, buffer?: number[], offset?: number): number[]
|
||||
v1(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer
|
||||
|
||||
v2(options?: UUIDOptions, buffer?: number[], offset?: number): string
|
||||
v2(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
|
||||
v2(options?: UUIDOptions): string
|
||||
v2(options?: UUIDOptions, buffer?: number[], offset?: number): number[]
|
||||
v2(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer
|
||||
|
||||
v3(options?: UUIDOptions, buffer?: number[], offset?: number): string
|
||||
v3(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
|
||||
v3(options?: UUIDOptions): string
|
||||
v3(options?: UUIDOptions, buffer?: number[], offset?: number): number[]
|
||||
v3(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer
|
||||
|
||||
v4(options?: UUIDOptions, buffer?: number[], offset?: number): string
|
||||
v4(options?: UUIDOptions, buffer?: Buffer, offset?: number): string
|
||||
v4(options?: UUIDOptions): string
|
||||
v4(options?: UUIDOptions, buffer?: number[], offset?: number): number[]
|
||||
v4(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer
|
||||
|
||||
parse(id: string, buffer?: number[], offset?: number): number[]
|
||||
parse(id: string, buffer?: Buffer, offset?: number): Buffer
|
||||
|
||||
Vendored
+65
-1
@@ -15,7 +15,7 @@
|
||||
* *
|
||||
************************************************/
|
||||
declare var process: NodeJS.Process;
|
||||
declare var global: any;
|
||||
declare var global: NodeJS.Global;
|
||||
|
||||
declare var __filename: string;
|
||||
declare var __dirname: string;
|
||||
@@ -190,6 +190,70 @@ declare module NodeJS {
|
||||
send?(message: any, sendHandle?: any): void;
|
||||
}
|
||||
|
||||
export interface Global {
|
||||
Array: typeof Array;
|
||||
ArrayBuffer: typeof ArrayBuffer;
|
||||
Boolean: typeof Boolean;
|
||||
Buffer: typeof Buffer;
|
||||
DataView: typeof DataView;
|
||||
Date: typeof Date;
|
||||
Error: typeof Error;
|
||||
EvalError: typeof EvalError;
|
||||
Float32Array: typeof Float32Array;
|
||||
Float64Array: typeof Float64Array;
|
||||
Function: typeof Function;
|
||||
GLOBAL: Global;
|
||||
Infinity: typeof Infinity;
|
||||
Int16Array: typeof Int16Array;
|
||||
Int32Array: typeof Int32Array;
|
||||
Int8Array: typeof Int8Array;
|
||||
Intl: typeof Intl;
|
||||
JSON: typeof JSON;
|
||||
Map: typeof Map;
|
||||
Math: typeof Math;
|
||||
NaN: typeof NaN;
|
||||
Number: typeof Number;
|
||||
Object: typeof Object;
|
||||
Promise: Function;
|
||||
RangeError: typeof RangeError;
|
||||
ReferenceError: typeof ReferenceError;
|
||||
RegExp: typeof RegExp;
|
||||
Set: typeof Set;
|
||||
String: typeof String;
|
||||
Symbol: Function;
|
||||
SyntaxError: typeof SyntaxError;
|
||||
TypeError: typeof TypeError;
|
||||
URIError: typeof URIError;
|
||||
Uint16Array: typeof Uint16Array;
|
||||
Uint32Array: typeof Uint32Array;
|
||||
Uint8Array: typeof Uint8Array;
|
||||
Uint8ClampedArray: Function;
|
||||
WeakMap: typeof WeakMap;
|
||||
WeakSet: Function;
|
||||
clearImmediate: (immediateId: any) => void;
|
||||
clearInterval: (intervalId: NodeJS.Timer) => void;
|
||||
clearTimeout: (timeoutId: NodeJS.Timer) => void;
|
||||
console: typeof console;
|
||||
decodeURI: typeof decodeURI;
|
||||
decodeURIComponent: typeof decodeURIComponent;
|
||||
encodeURI: typeof encodeURI;
|
||||
encodeURIComponent: typeof encodeURIComponent;
|
||||
escape: (str: string) => string;
|
||||
eval: typeof eval;
|
||||
global: Global;
|
||||
isFinite: typeof isFinite;
|
||||
isNaN: typeof isNaN;
|
||||
parseFloat: typeof parseFloat;
|
||||
parseInt: typeof parseInt;
|
||||
process: Process;
|
||||
root: Global;
|
||||
setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any;
|
||||
setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
|
||||
setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
|
||||
undefined: typeof undefined;
|
||||
unescape: (str: string) => string;
|
||||
}
|
||||
|
||||
export interface Timer {
|
||||
ref() : void;
|
||||
unref() : void;
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/// <reference path="oauth.js.d.ts" />
|
||||
|
||||
var encoded1: string = OAuth.percentEncode("abcあいう");
|
||||
var encoded2: string = OAuth.percentEncode(["abc", "あいう"]);
|
||||
var decoded1: string = OAuth.decodePercent("abc%E3%81%82%E3%81%84%E3%81%86");
|
||||
|
||||
var list: OAuth.ParameterList;
|
||||
list = OAuth.getParameterList([["name1", "value1"], ["name2", "value2"]]);
|
||||
list = OAuth.getParameterList({ name1: "value1", name2: "value2" });
|
||||
list = OAuth.getParameterList("name1=value1&name2=value2");
|
||||
|
||||
var map: OAuth.ParameterMap;
|
||||
map = OAuth.getParameterMap([["name1", "value1"], ["name2", "value2"]]);
|
||||
map = OAuth.getParameterMap({ name1: "value1", name2: "value2" });
|
||||
map = OAuth.getParameterMap("name1=value1&name2=value2");
|
||||
|
||||
var param: string;
|
||||
param = OAuth.getParameter([["name1", "value1"], ["name2", "value2"]], "name1");
|
||||
param = OAuth.getParameter({ name1: "value1", name2: "value2" }, "name1");
|
||||
param = OAuth.getParameter("name1=value1&name2=value2", "name1");
|
||||
|
||||
var formEncoded1: string = OAuth.formEncode([["name1", "value1"], ["name2", "value2"]]);
|
||||
var formEncoded2: string = OAuth.formEncode({ name1: "value1", name2: "value2" });
|
||||
|
||||
var formDecoded1: OAuth.ParameterList = OAuth.decodeForm("name1=value1&name2=value2");
|
||||
|
||||
var message1: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: [] };
|
||||
OAuth.setParameter(message1, "name1", "value1");
|
||||
var message2: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: {} };
|
||||
OAuth.setParameter(message2, "name1", "value1");
|
||||
|
||||
var message3: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: [] };
|
||||
OAuth.setParameters(message3, [["name1", "value1"], ["name2", "value2"]]);
|
||||
OAuth.setParameters(message3, { name3: "value3", name4: "value4" });
|
||||
OAuth.setParameters(message3, "name5=value5&name6=value6");
|
||||
var message4: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: {} };
|
||||
OAuth.setParameters(message4, [["name1", "value1"], ["name2", "value2"]]);
|
||||
OAuth.setParameters(message4, { name3: "value3", name4: "value4" });
|
||||
OAuth.setParameters(message4, "name5=value5&name6=value6");
|
||||
|
||||
var accessor: OAuth.Accessor = { consumerKey: "ck", consumerSecret: "cs", token: "t", tokenSecret: "ts" };
|
||||
var message5: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: [["name1", "value1"]] };
|
||||
OAuth.completeRequest(message5, accessor);
|
||||
var message6: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: { name1: "value1" } };
|
||||
OAuth.completeRequest(message6, accessor);
|
||||
|
||||
var message7: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: [["name1", "value1"]] };
|
||||
OAuth.setTimestampAndNonce(message7);
|
||||
var message8: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: { name1: "value1" } };
|
||||
OAuth.setTimestampAndNonce(message8);
|
||||
|
||||
var url1: string = OAuth.addToURL("http://example.org/", [["name1", "value1"]]);
|
||||
var url2: string = OAuth.addToURL("http://example.org/?name1=value1", [["name1", "value1"]]);
|
||||
var url3: string = OAuth.addToURL("http://example.org/", { name1: "value1" });
|
||||
var url4: string = OAuth.addToURL("http://example.org/?name1=value1", { name1: "value1" });
|
||||
|
||||
var authorizationHeader1: string = OAuth.getAuthorizationHeader("realm", [["name1", "value1"], ["oauth_param1", "oauth_value1"]]);
|
||||
var authorizationHeader2: string = OAuth.getAuthorizationHeader("realm", { name1: "value1", oauth_param1: "oauth_value1" });
|
||||
var authorizationHeader3: string = OAuth.getAuthorizationHeader("realm", "name1=value1&oauth_param1=oauth_value1");
|
||||
|
||||
OAuth.correctTimestampFromSrc();
|
||||
OAuth.correctTimestampFromSrc("timestamp_param_name");
|
||||
|
||||
OAuth.correctTimestamp((new Date()).getTime() / 1000);
|
||||
|
||||
var timeCorrectionMsec: number = OAuth.timeCorrectionMsec;
|
||||
|
||||
var timestamp: number = OAuth.timestamp();
|
||||
|
||||
var nonce: string = OAuth.nonce(16);
|
||||
|
||||
|
||||
var message9: OAuth.Message = { method: "GET", action: "http://example.org/1", parameters: [] };
|
||||
var baseString: string = OAuth.SignatureMethod.getBaseString(message9);
|
||||
|
||||
var normalizedUrl: string = OAuth.SignatureMethod.normalizeUrl("http://example.org:80/2");
|
||||
|
||||
var uri: OAuth.Uri = OAuth.SignatureMethod.parseUri("http://example.org:80/3?name1=value1&name2=value2");
|
||||
|
||||
var normalizedParameters1: string = OAuth.SignatureMethod.normalizeParameters([["name1", "value1"], ["name2", "value2"]]);
|
||||
var normalizedParameters2: string = OAuth.SignatureMethod.normalizeParameters({ name1: "value1", name2: "value2" });
|
||||
|
||||
var message10: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: [["name1", "value1"]] };
|
||||
OAuth.SignatureMethod.sign(message9, accessor);
|
||||
|
||||
var signatureMethodConstructor: { new (): OAuth.SignatureMethod; } =
|
||||
OAuth.SignatureMethod.makeSubclass(function getSignature(baseString) { return this.key });
|
||||
OAuth.SignatureMethod.registerMethodClass(["PLAINTEXT"], signatureMethodConstructor);
|
||||
|
||||
var signatureMethod1: OAuth.SignatureMethod = OAuth.SignatureMethod.newMethod("PLAINTEXT", accessor);
|
||||
var message11: OAuth.Message = { action: "http://example.org/", method: "GET", parameters: [["name1", "value1"]] };
|
||||
var signature: string = signatureMethod1.sign(message11);
|
||||
var signatureMethod2: OAuth.SignatureMethod = new signatureMethodConstructor();
|
||||
signatureMethod2.initialize("PLAINTEXT", accessor);
|
||||
|
||||
Vendored
+197
@@ -0,0 +1,197 @@
|
||||
// Type definitions for JavaScript software for implementing an OAuth consumer
|
||||
// Project: https://code.google.com/p/oauth/
|
||||
// Definitions by: NOBUOKA Yu <https://github.com/nobuoka>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module OAuth {
|
||||
|
||||
/** An Array of name-value pairs [[name, value], [name2, value2]]. */
|
||||
type ParameterList = [string, string][];
|
||||
|
||||
/** A map {name: value, name2: value2}. */
|
||||
type ParameterMap = { [name: string]: string; };
|
||||
|
||||
type ParameterListOrMap = ParameterList|ParameterMap;
|
||||
|
||||
/**
|
||||
* An OAuth message is represented as an object like this:
|
||||
* { method: "GET", action: "http://server.com/path", parameters: ... }
|
||||
*/
|
||||
interface Message {
|
||||
action: string;
|
||||
method: string;
|
||||
parameters: ParameterListOrMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* SignatureMethod expects an accessor object to be like this:
|
||||
* {tokenSecret: "lakjsdflkj...", consumerSecret: "QOUEWRI..", accessorSecret: "xcmvzc..."}
|
||||
* The accessorSecret property is optional.
|
||||
*/
|
||||
interface Accessor {
|
||||
consumerKey: string;
|
||||
consumerSecret: string;
|
||||
accessorSecret?: string;
|
||||
token: string;
|
||||
tokenSecret: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode text value according to OAuth Percent Encoding.
|
||||
* @see {@link https://tools.ietf.org/html/rfc5849#section-3.6}
|
||||
* @param s Target text value.
|
||||
*/
|
||||
function percentEncode(s: string): string;
|
||||
|
||||
/**
|
||||
* Encode text values according to OAuth Percent Encoding.
|
||||
* Encoded values are joined with an ampersand character (&) in between them.
|
||||
* @see {@link https://tools.ietf.org/html/rfc5849#section-3.6}
|
||||
* @param s Target text values.
|
||||
*/
|
||||
function percentEncode(s: string[]): string;
|
||||
|
||||
/**
|
||||
* Decode percent-encoded value.
|
||||
* @see {@link https://tools.ietf.org/html/rfc5849#section-3.6}
|
||||
* @param s Target percent-encoded value.
|
||||
*/
|
||||
function decodePercent(s: string): string;
|
||||
|
||||
/**
|
||||
* Convert the given parameters to an Array of name-value pairs.
|
||||
*/
|
||||
function getParameterList(parameters: ParameterListOrMap): ParameterList;
|
||||
|
||||
/**
|
||||
* Convert the given parameters to an Array of name-value pairs.
|
||||
*/
|
||||
function getParameterList(parameters: string): ParameterList;
|
||||
|
||||
/**
|
||||
* Convert the given parameters to a map from name to value.
|
||||
*/
|
||||
function getParameterMap(parameters: ParameterListOrMap): ParameterMap;
|
||||
|
||||
/**
|
||||
* Convert the given parameters to a map from name to value.
|
||||
*/
|
||||
function getParameterMap(parameters: string): ParameterMap;
|
||||
|
||||
function getParameter(parameters: ParameterListOrMap, name: string): string;
|
||||
function getParameter(parameters: string, name: string): string;
|
||||
|
||||
function formEncode(parameters: ParameterListOrMap): string;
|
||||
|
||||
function decodeForm(form: string): ParameterList;
|
||||
|
||||
function setParameter(message: Message, name: string, value: string): void;
|
||||
|
||||
function setParameters(message: Message, parameters: ParameterListOrMap): void;
|
||||
function setParameters(message: Message, parameters: string): void;
|
||||
|
||||
/**
|
||||
* Fill in parameters to help construct a request message.
|
||||
* This function doesn't fill in every parameter.
|
||||
* @param message Target request message.
|
||||
* @param accessor Accessor object. The accessorSecret property is optional.
|
||||
*/
|
||||
function completeRequest(message: Message, accessor: Accessor): void;
|
||||
|
||||
function setTimestampAndNonce(message: Message): void;
|
||||
|
||||
/**
|
||||
* Add specified parameters into URL as query parameters.
|
||||
* @param url URL that parameters added into.
|
||||
* @param parameters Parameters added into URL.
|
||||
* @return New URL string.
|
||||
*/
|
||||
function addToURL(url: string, parameters: ParameterListOrMap): string;
|
||||
|
||||
/** Construct the value of the Authorization header for an HTTP request. */
|
||||
function getAuthorizationHeader(realm: string, parameters: ParameterListOrMap): string;
|
||||
function getAuthorizationHeader(realm: string, parameters: string): string;
|
||||
|
||||
/** Correct the time using a parameter from the URL from which the last script was loaded. */
|
||||
function correctTimestampFromSrc(parameterName?: string): void;
|
||||
|
||||
/** Generate timestamps starting with the given value. */
|
||||
function correctTimestamp(timestamp: number): void;
|
||||
|
||||
/** The difference between the correct time and my clock. */
|
||||
var timeCorrectionMsec: number;
|
||||
|
||||
function timestamp(): number;
|
||||
|
||||
function nonce(length: number): string;
|
||||
|
||||
interface Uri {
|
||||
source: string;
|
||||
protocol: string;
|
||||
authority: string;
|
||||
userInfo: string;
|
||||
user: string;
|
||||
password: string;
|
||||
host: string;
|
||||
port: string;
|
||||
relative: string;
|
||||
path: string;
|
||||
directory: string;
|
||||
file: string;
|
||||
query: string;
|
||||
anchor: string;
|
||||
}
|
||||
|
||||
interface SignatureMethodStatic {
|
||||
sign(message: Message, accessor: Accessor): void;
|
||||
|
||||
/** Instantiate a SignatureMethod for the given method name. */
|
||||
newMethod(name: string, accessor: Accessor): SignatureMethod;
|
||||
|
||||
/** A map from signature method name to constructor. */
|
||||
REGISTERED: { [name: string]: { new (): SignatureMethod }; };
|
||||
|
||||
/**
|
||||
* Subsequently, the given constructor will be used for the named methods.
|
||||
* The constructor will be called with no parameters.
|
||||
* The resulting object should usually implement getSignature(baseString).
|
||||
* You can easily define such a constructor by calling makeSubclass method.
|
||||
*/
|
||||
registerMethodClass(names: string[], classConstructor: { new(): SignatureMethod }): void;
|
||||
|
||||
/**
|
||||
* Create a subclass of OAuth.SignatureMethod, with the given getSignature function.
|
||||
* @param getSignatureFunction
|
||||
*/
|
||||
makeSubclass(getSignatureFunction: (baseString: string) => string): { new(): SignatureMethod };
|
||||
|
||||
/**
|
||||
* Generate a signature base string from a Message object.
|
||||
* @see {@link https://tools.ietf.org/html/rfc5849#section-3.4.1}
|
||||
* @param message Source of the signature base string.
|
||||
*/
|
||||
getBaseString(message: Message): string;
|
||||
|
||||
normalizeUrl(url: string): string;
|
||||
|
||||
parseUri(str: string): Uri;
|
||||
|
||||
normalizeParameters(parameters: ParameterListOrMap): string;
|
||||
}
|
||||
|
||||
interface SignatureMethod {
|
||||
getSignature(baseString: string): string;
|
||||
|
||||
key: string;
|
||||
|
||||
/** Add a signature to the message. */
|
||||
sign(message: Message): string;
|
||||
|
||||
/** Set the key string for signing. */
|
||||
initialize(name: string, accessor: Accessor): void;
|
||||
}
|
||||
|
||||
var SignatureMethod: SignatureMethodStatic;
|
||||
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -102,3 +102,7 @@ declare class Parallel<T> {
|
||||
public require(fn: Function): Parallel<T>;
|
||||
}
|
||||
|
||||
/* commonjs binding for npm use */
|
||||
declare module "paralleljs" {
|
||||
export = Parallel;
|
||||
}
|
||||
Vendored
+13
-8
@@ -234,6 +234,10 @@ declare module "react/addons" {
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface DragEvent extends SyntheticEvent {
|
||||
dataTransfer: DataTransfer;
|
||||
}
|
||||
|
||||
interface ClipboardEvent extends SyntheticEvent {
|
||||
clipboardData: DataTransfer;
|
||||
}
|
||||
@@ -308,6 +312,7 @@ declare module "react/addons" {
|
||||
(event: E): void;
|
||||
}
|
||||
|
||||
interface DragEventHandler extends EventHandler<DragEvent> {}
|
||||
interface ClipboardEventHandler extends EventHandler<ClipboardEvent> {}
|
||||
interface KeyboardEventHandler extends EventHandler<KeyboardEvent> {}
|
||||
interface FocusEventHandler extends EventHandler<FocusEvent> {}
|
||||
@@ -341,14 +346,14 @@ declare module "react/addons" {
|
||||
onSubmit?: FormEventHandler;
|
||||
onClick?: MouseEventHandler;
|
||||
onDoubleClick?: MouseEventHandler;
|
||||
onDrag?: MouseEventHandler;
|
||||
onDragEnd?: MouseEventHandler;
|
||||
onDragEnter?: MouseEventHandler;
|
||||
onDragExit?: MouseEventHandler;
|
||||
onDragLeave?: MouseEventHandler;
|
||||
onDragOver?: MouseEventHandler;
|
||||
onDragStart?: MouseEventHandler;
|
||||
onDrop?: MouseEventHandler;
|
||||
onDrag?: DragEventHandler;
|
||||
onDragEnd?: DragEventHandler;
|
||||
onDragEnter?: DragEventHandler;
|
||||
onDragExit?: DragEventHandler;
|
||||
onDragLeave?: DragEventHandler;
|
||||
onDragOver?: DragEventHandler;
|
||||
onDragStart?: DragEventHandler;
|
||||
onDrop?: DragEventHandler;
|
||||
onMouseDown?: MouseEventHandler;
|
||||
onMouseEnter?: MouseEventHandler;
|
||||
onMouseLeave?: MouseEventHandler;
|
||||
|
||||
Vendored
+13
-8
@@ -234,6 +234,10 @@ declare module React {
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface DragEvent extends SyntheticEvent {
|
||||
dataTransfer: DataTransfer;
|
||||
}
|
||||
|
||||
interface ClipboardEvent extends SyntheticEvent {
|
||||
clipboardData: DataTransfer;
|
||||
}
|
||||
@@ -308,6 +312,7 @@ declare module React {
|
||||
(event: E): void;
|
||||
}
|
||||
|
||||
interface DragEventHandler extends EventHandler<DragEvent> {}
|
||||
interface ClipboardEventHandler extends EventHandler<ClipboardEvent> {}
|
||||
interface KeyboardEventHandler extends EventHandler<KeyboardEvent> {}
|
||||
interface FocusEventHandler extends EventHandler<FocusEvent> {}
|
||||
@@ -341,14 +346,14 @@ declare module React {
|
||||
onSubmit?: FormEventHandler;
|
||||
onClick?: MouseEventHandler;
|
||||
onDoubleClick?: MouseEventHandler;
|
||||
onDrag?: MouseEventHandler;
|
||||
onDragEnd?: MouseEventHandler;
|
||||
onDragEnter?: MouseEventHandler;
|
||||
onDragExit?: MouseEventHandler;
|
||||
onDragLeave?: MouseEventHandler;
|
||||
onDragOver?: MouseEventHandler;
|
||||
onDragStart?: MouseEventHandler;
|
||||
onDrop?: MouseEventHandler;
|
||||
onDrag?: DragEventHandler;
|
||||
onDragEnd?: DragEventHandler;
|
||||
onDragEnter?: DragEventHandler;
|
||||
onDragExit?: DragEventHandler;
|
||||
onDragLeave?: DragEventHandler;
|
||||
onDragOver?: DragEventHandler;
|
||||
onDragStart?: DragEventHandler;
|
||||
onDrop?: DragEventHandler;
|
||||
onMouseDown?: MouseEventHandler;
|
||||
onMouseEnter?: MouseEventHandler;
|
||||
onMouseLeave?: MouseEventHandler;
|
||||
|
||||
Vendored
+13
-8
@@ -234,6 +234,10 @@ declare module "react" {
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface DragEvent extends SyntheticEvent {
|
||||
dataTransfer: DataTransfer;
|
||||
}
|
||||
|
||||
interface ClipboardEvent extends SyntheticEvent {
|
||||
clipboardData: DataTransfer;
|
||||
}
|
||||
@@ -308,6 +312,7 @@ declare module "react" {
|
||||
(event: E): void;
|
||||
}
|
||||
|
||||
interface DragEventHandler extends EventHandler<DragEvent> {}
|
||||
interface ClipboardEventHandler extends EventHandler<ClipboardEvent> {}
|
||||
interface KeyboardEventHandler extends EventHandler<KeyboardEvent> {}
|
||||
interface FocusEventHandler extends EventHandler<FocusEvent> {}
|
||||
@@ -341,14 +346,14 @@ declare module "react" {
|
||||
onSubmit?: FormEventHandler;
|
||||
onClick?: MouseEventHandler;
|
||||
onDoubleClick?: MouseEventHandler;
|
||||
onDrag?: MouseEventHandler;
|
||||
onDragEnd?: MouseEventHandler;
|
||||
onDragEnter?: MouseEventHandler;
|
||||
onDragExit?: MouseEventHandler;
|
||||
onDragLeave?: MouseEventHandler;
|
||||
onDragOver?: MouseEventHandler;
|
||||
onDragStart?: MouseEventHandler;
|
||||
onDrop?: MouseEventHandler;
|
||||
onDrag?: DragEventHandler;
|
||||
onDragEnd?: DragEventHandler;
|
||||
onDragEnter?: DragEventHandler;
|
||||
onDragExit?: DragEventHandler;
|
||||
onDragLeave?: DragEventHandler;
|
||||
onDragOver?: DragEventHandler;
|
||||
onDragStart?: DragEventHandler;
|
||||
onDrop?: DragEventHandler;
|
||||
onMouseDown?: MouseEventHandler;
|
||||
onMouseEnter?: MouseEventHandler;
|
||||
onMouseLeave?: MouseEventHandler;
|
||||
|
||||
Vendored
+6
-2
@@ -15,7 +15,7 @@ declare module restangular {
|
||||
$object: T;
|
||||
}
|
||||
|
||||
interface ICollectionPromise<T> extends ng.IPromise<T> {
|
||||
interface ICollectionPromise<T> extends ng.IPromise<T[]> {
|
||||
push(object: any): ICollectionPromise<T>;
|
||||
call(methodName: string, params?: any): ICollectionPromise<T>;
|
||||
get(fieldName: string): ICollectionPromise<T>;
|
||||
@@ -93,7 +93,7 @@ declare module restangular {
|
||||
withConfig(configurer: (RestangularProvider: IProvider) => any): IService;
|
||||
restangularizeElement(parent: any, element: any, route: string, collection?: any, reqParams?: any): IElement;
|
||||
restangularizeCollection(parent: any, element: any, route: string): ICollection;
|
||||
service(route: string, parent: any): IService;
|
||||
service(route: string, parent?: any): IService;
|
||||
stripRestangular(element: any): any;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ declare module restangular {
|
||||
patch(queryParams?: any, headers?: any): IPromise<any>;
|
||||
clone(): IElement;
|
||||
plain(): any;
|
||||
plain<T>(): T;
|
||||
withHttpConfig(httpConfig: IRequestConfig): IElement;
|
||||
save(queryParams?: any, headers?: any): IPromise<any>;
|
||||
getRestangularUrl(): string;
|
||||
@@ -130,6 +131,9 @@ declare module restangular {
|
||||
patch(queryParams?: any, headers?: any): IPromise<any>;
|
||||
putElement(idx: any, params: any, headers: any): IPromise<any>;
|
||||
withHttpConfig(httpConfig: IRequestConfig): ICollection;
|
||||
clone(): ICollection;
|
||||
plain(): any;
|
||||
plain<T>(): T[];
|
||||
getRestangularUrl(): string;
|
||||
}
|
||||
}
|
||||
|
||||
+111
-17
@@ -99,23 +99,117 @@ server.del( /(.*)/, send);
|
||||
server.get( /(.*)/, send);
|
||||
server.head(/(.*)/, send);
|
||||
|
||||
new restify.ConflictError("test");
|
||||
new restify.InvalidArgumentError("message");
|
||||
new restify.RestError("message");
|
||||
new restify.BadDigestError("message");
|
||||
new restify.BadMethodError("message");
|
||||
new restify.BadRequestError('test');
|
||||
new restify.InternalError("message");
|
||||
new restify.InvalidContentError("message");
|
||||
new restify.InvalidCredentialsError("message");
|
||||
new restify.InvalidHeaderError("message");
|
||||
new restify.InvalidVersionError("message");
|
||||
new restify.MissingParameterError("message");
|
||||
new restify.NotAuthorizedError("message");
|
||||
new restify.RequestExpiredError("jjmessage");
|
||||
new restify.RequestThrottledError("message");
|
||||
new restify.ResourceNotFoundError("message");
|
||||
new restify.WrongAcceptError("message");
|
||||
|
||||
new restify.BadRequestError();
|
||||
new restify.UnauthorizedError();
|
||||
new restify.PaymentRequiredError();
|
||||
new restify.ForbiddenError();
|
||||
new restify.NotFoundError();
|
||||
new restify.MethodNotAllowedError();
|
||||
new restify.NotAcceptableError();
|
||||
new restify.ProxyAuthenticationRequiredError();
|
||||
new restify.RequestTimeoutError();
|
||||
new restify.ConflictError();
|
||||
new restify.GoneError();
|
||||
new restify.LengthRequiredError();
|
||||
new restify.RequestEntityTooLargeError();
|
||||
new restify.RequesturiTooLargeError();
|
||||
new restify.UnsupportedMediaTypeError();
|
||||
new restify.RequestedRangeNotSatisfiableError();
|
||||
new restify.ExpectationFailedError();
|
||||
new restify.ImATeapotError();
|
||||
new restify.UnprocessableEntityError();
|
||||
new restify.LockedError();
|
||||
new restify.FailedDependencyError();
|
||||
new restify.UnorderedCollectionError();
|
||||
new restify.UpgradeRequiredError();
|
||||
new restify.PreconditionRequiredError();
|
||||
new restify.TooManyRequestsError();
|
||||
new restify.RequestHeaderFieldsTooLargeError();
|
||||
new restify.InternalServerError();
|
||||
new restify.NotImplementedError();
|
||||
new restify.BadGatewayError();
|
||||
new restify.ServiceUnavailableError();
|
||||
new restify.GatewayTimeoutError();
|
||||
new restify.HttpVersionNotSupportedError();
|
||||
new restify.VariantAlsoNegotiatesError();
|
||||
new restify.InsufficientStorageError();
|
||||
new restify.BandwidthLimitExceededError();
|
||||
new restify.NotExtendedError();
|
||||
new restify.NetworkAuthenticationRequiredError();
|
||||
new restify.RestError();
|
||||
|
||||
new restify.BadRequestError(new Error(), 'foo');
|
||||
new restify.UnauthorizedError(new Error(), 'foo');
|
||||
new restify.PaymentRequiredError(new Error(), 'foo');
|
||||
new restify.ForbiddenError(new Error(), 'foo');
|
||||
new restify.NotFoundError(new Error(), 'foo');
|
||||
new restify.MethodNotAllowedError(new Error(), 'foo');
|
||||
new restify.NotAcceptableError(new Error(), 'foo');
|
||||
new restify.ProxyAuthenticationRequiredError(new Error(), 'foo');
|
||||
new restify.RequestTimeoutError(new Error(), 'foo');
|
||||
new restify.ConflictError(new Error(), 'foo');
|
||||
new restify.GoneError(new Error(), 'foo');
|
||||
new restify.LengthRequiredError(new Error(), 'foo');
|
||||
new restify.RequestEntityTooLargeError(new Error(), 'foo');
|
||||
new restify.RequesturiTooLargeError(new Error(), 'foo');
|
||||
new restify.UnsupportedMediaTypeError(new Error(), 'foo');
|
||||
new restify.RequestedRangeNotSatisfiableError(new Error(), 'foo');
|
||||
new restify.ExpectationFailedError(new Error(), 'foo');
|
||||
new restify.ImATeapotError(new Error(), 'foo');
|
||||
new restify.UnprocessableEntityError(new Error(), 'foo');
|
||||
new restify.LockedError(new Error(), 'foo');
|
||||
new restify.FailedDependencyError(new Error(), 'foo');
|
||||
new restify.UnorderedCollectionError(new Error(), 'foo');
|
||||
new restify.UpgradeRequiredError(new Error(), 'foo');
|
||||
new restify.PreconditionRequiredError(new Error(), 'foo');
|
||||
new restify.TooManyRequestsError(new Error(), 'foo');
|
||||
new restify.RequestHeaderFieldsTooLargeError(new Error(), 'foo');
|
||||
new restify.InternalServerError(new Error(), 'foo');
|
||||
new restify.NotImplementedError(new Error(), 'foo');
|
||||
new restify.BadGatewayError(new Error(), 'foo');
|
||||
new restify.ServiceUnavailableError(new Error(), 'foo');
|
||||
new restify.GatewayTimeoutError(new Error(), 'foo');
|
||||
new restify.HttpVersionNotSupportedError(new Error(), 'foo');
|
||||
new restify.VariantAlsoNegotiatesError(new Error(), 'foo');
|
||||
new restify.InsufficientStorageError(new Error(), 'foo');
|
||||
new restify.BandwidthLimitExceededError(new Error(), 'foo');
|
||||
new restify.NotExtendedError(new Error(), 'foo');
|
||||
new restify.NetworkAuthenticationRequiredError(new Error(), 'foo');
|
||||
new restify.RestError(new Error(), 'foo');
|
||||
|
||||
new restify.PreconditionFailedError(new Error(), 'foo');
|
||||
new restify.BadDigestError(new Error(), 'foo');
|
||||
new restify.BadMethodError(new Error(), 'foo');
|
||||
new restify.InternalError(new Error(), 'foo');
|
||||
new restify.InvalidArgumentError(new Error(), 'foo');
|
||||
new restify.InvalidContentError(new Error(), 'foo');
|
||||
new restify.InvalidCredentialsError(new Error(), 'foo');
|
||||
new restify.InvalidHeaderError(new Error(), 'foo');
|
||||
new restify.InvalidVersionError(new Error(), 'foo');
|
||||
new restify.MissingParameterError(new Error(), 'foo');
|
||||
new restify.NotAuthorizedError(new Error(), 'foo');
|
||||
new restify.RequestExpiredError(new Error(), 'foo');
|
||||
new restify.RequestThrottledError(new Error(), 'foo');
|
||||
new restify.ResourceNotFoundError(new Error(), 'foo');
|
||||
new restify.WrongAcceptError(new Error(), 'foo');
|
||||
|
||||
new restify.PreconditionFailedError();
|
||||
new restify.BadDigestError();
|
||||
new restify.BadMethodError();
|
||||
new restify.InternalError();
|
||||
new restify.InvalidArgumentError();
|
||||
new restify.InvalidContentError();
|
||||
new restify.InvalidCredentialsError();
|
||||
new restify.InvalidHeaderError();
|
||||
new restify.InvalidVersionError();
|
||||
new restify.MissingParameterError();
|
||||
new restify.NotAuthorizedError();
|
||||
new restify.RequestExpiredError();
|
||||
new restify.RequestThrottledError();
|
||||
new restify.ResourceNotFoundError();
|
||||
new restify.WrongAcceptError();
|
||||
|
||||
|
||||
server.name = "";
|
||||
server.version = "";
|
||||
|
||||
Vendored
+62
-19
@@ -179,25 +179,68 @@ declare module "restify" {
|
||||
export function createStringClient(options?: ClientOptions): Client;
|
||||
export function createClient(options?: ClientOptions): HttpClient;
|
||||
|
||||
export class ConflictError { constructor(message?: any); }
|
||||
export class InvalidArgumentError { constructor(message?: any); }
|
||||
export class RestError { constructor(message?: any); }
|
||||
export class BadDigestError { constructor(message: any); }
|
||||
export class BadMethodError { constructor(message: any); }
|
||||
export class BadRequestError { constructor(message: any); }
|
||||
export class InternalError { constructor(message: any); }
|
||||
export class InvalidContentError { constructor(message: any); }
|
||||
export class InvalidCredentialsError { constructor(message: any); }
|
||||
export class InvalidHeaderError { constructor(message: any); }
|
||||
export class InvalidVersionError { constructor(message: any); }
|
||||
export class MissingParameterError { constructor(message: any); }
|
||||
export class NotAuthorizedError { constructor(message: any); }
|
||||
export class RequestExpiredError { constructor(message: any); }
|
||||
export class RequestThrottledError { constructor(message: any); }
|
||||
export class ResourceNotFoundError { constructor(message: any); }
|
||||
export class WrongAcceptError { constructor(message: any); }
|
||||
export class UnsupportedMediaTypeError { constructor(message: any); }
|
||||
export class RequestTimeoutError { constructor(message: any); }
|
||||
export class HttpError { constructor(cause: any, message?: any); }
|
||||
|
||||
class DefiniteHttpError {
|
||||
constructor(message?: any);
|
||||
constructor(cause: any, message?: any);
|
||||
}
|
||||
|
||||
export class BadRequestError extends DefiniteHttpError {}
|
||||
export class UnauthorizedError extends DefiniteHttpError {}
|
||||
export class PaymentRequiredError extends DefiniteHttpError {}
|
||||
export class ForbiddenError extends DefiniteHttpError {}
|
||||
export class NotFoundError extends DefiniteHttpError {}
|
||||
export class MethodNotAllowedError extends DefiniteHttpError {}
|
||||
export class NotAcceptableError extends DefiniteHttpError {}
|
||||
export class ProxyAuthenticationRequiredError extends DefiniteHttpError {}
|
||||
export class RequestTimeoutError extends DefiniteHttpError {}
|
||||
export class ConflictError extends DefiniteHttpError {}
|
||||
export class GoneError extends DefiniteHttpError {}
|
||||
export class LengthRequiredError extends DefiniteHttpError {}
|
||||
export class RequestEntityTooLargeError extends DefiniteHttpError {}
|
||||
export class RequesturiTooLargeError extends DefiniteHttpError {}
|
||||
export class UnsupportedMediaTypeError extends DefiniteHttpError {}
|
||||
export class RequestedRangeNotSatisfiableError extends DefiniteHttpError {}
|
||||
export class ExpectationFailedError extends DefiniteHttpError {}
|
||||
export class ImATeapotError extends DefiniteHttpError {}
|
||||
export class UnprocessableEntityError extends DefiniteHttpError {}
|
||||
export class LockedError extends DefiniteHttpError {}
|
||||
export class FailedDependencyError extends DefiniteHttpError {}
|
||||
export class UnorderedCollectionError extends DefiniteHttpError {}
|
||||
export class UpgradeRequiredError extends DefiniteHttpError {}
|
||||
export class PreconditionRequiredError extends DefiniteHttpError {}
|
||||
export class TooManyRequestsError extends DefiniteHttpError {}
|
||||
export class RequestHeaderFieldsTooLargeError extends DefiniteHttpError {}
|
||||
export class InternalServerError extends DefiniteHttpError {}
|
||||
export class NotImplementedError extends DefiniteHttpError {}
|
||||
export class BadGatewayError extends DefiniteHttpError {}
|
||||
export class ServiceUnavailableError extends DefiniteHttpError {}
|
||||
export class GatewayTimeoutError extends DefiniteHttpError {}
|
||||
export class HttpVersionNotSupportedError extends DefiniteHttpError {}
|
||||
export class VariantAlsoNegotiatesError extends DefiniteHttpError {}
|
||||
export class InsufficientStorageError extends DefiniteHttpError {}
|
||||
export class BandwidthLimitExceededError extends DefiniteHttpError {}
|
||||
export class NotExtendedError extends DefiniteHttpError {}
|
||||
export class NetworkAuthenticationRequiredError extends DefiniteHttpError {}
|
||||
export class RestError extends DefiniteHttpError {}
|
||||
|
||||
export class PreconditionFailedError extends RestError {}
|
||||
export class BadDigestError extends RestError {}
|
||||
export class BadMethodError extends RestError {}
|
||||
export class InternalError extends RestError {}
|
||||
export class InvalidArgumentError extends RestError {}
|
||||
export class InvalidContentError extends RestError {}
|
||||
export class InvalidCredentialsError extends RestError {}
|
||||
export class InvalidHeaderError extends RestError {}
|
||||
export class InvalidVersionError extends RestError {}
|
||||
export class MissingParameterError extends RestError {}
|
||||
export class NotAuthorizedError extends RestError {}
|
||||
export class RequestExpiredError extends RestError {}
|
||||
export class RequestThrottledError extends RestError {}
|
||||
export class ResourceNotFoundError extends RestError {}
|
||||
export class WrongAcceptError extends RestError {}
|
||||
|
||||
|
||||
export function acceptParser(parser: any): RequestHandler;
|
||||
export function authorizationParser(): RequestHandler;
|
||||
|
||||
@@ -101,6 +101,8 @@ model.belongsTo<modelInst, modelPojo>(model);
|
||||
model.belongsTo<modelInst, modelPojo>(model, assocOpts);
|
||||
model.hasMany<modelInst, modelPojo>(model);
|
||||
model.hasMany<modelInst, modelPojo>(model, assocOpts);
|
||||
model.belongsToMany<modelInst, modelPojo>(model);
|
||||
model.belongsToMany<modelInst, modelPojo>(model, assocOpts);
|
||||
|
||||
promiseMe = model.sync();
|
||||
promiseMe = model.drop(dropOpts);
|
||||
|
||||
Vendored
+8
@@ -909,6 +909,14 @@ declare module "sequelize"
|
||||
*/
|
||||
belongsTo<TInstance, TPojo>(target: Model<TInstance, TPojo>, options?: AssociationOptions): void;
|
||||
|
||||
/**
|
||||
* Creates an association to connect sources with multiple targets. Furthermore the targets can also have connections to multiple sources.
|
||||
*
|
||||
* @param target
|
||||
* @param options
|
||||
*/
|
||||
belongsToMany<TInstance, TPojo>(target: Model<TInstance, TPojo>, options?: AssociationOptions): void;
|
||||
|
||||
/**
|
||||
* Create an association that is either 1:m or n:m.
|
||||
*
|
||||
|
||||
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
// Type definitions for sprintf-js
|
||||
// Project: https://www.npmjs.com/package/sprintf-js
|
||||
// Definitions by: Jason Swearingen <https://jasonswearingen.github.io>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
/** sprintf.js is a complete open source JavaScript sprintf implementation for the browser and node.js.
|
||||
|
||||
Its prototype is simple:
|
||||
|
||||
string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]])
|
||||
*/
|
||||
declare module "sprintf-js" {
|
||||
/** sprintf.js is a complete open source JavaScript sprintf implementation for the browser and node.js.
|
||||
Its prototype is simple:
|
||||
string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]])
|
||||
|
||||
==Placeholders==
|
||||
The placeholders in the format string are marked by % and are followed by one or more of these elements. see "fmt" arg for more docs on placeholders.
|
||||
|
||||
==Argument swapping==
|
||||
You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to:
|
||||
sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")
|
||||
And, of course, you can repeat the placeholders without having to increase the number of arguments.
|
||||
|
||||
==Named arguments==
|
||||
Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - ( and ) - and begin with a keyword that refers to a key:
|
||||
var user = {name: "Dolly"}
|
||||
sprintf("Hello %(name)s", user) // Hello Dolly
|
||||
Keywords in replacement fields can be optionally followed by any number of keywords or indexes:
|
||||
var users = [{name: "Dolly"},{name: "Molly"},{name: "Polly"}]
|
||||
sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly
|
||||
Note: mixing positional and named placeholders is not (yet) supported
|
||||
|
||||
==Computed values==
|
||||
You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly.
|
||||
sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890
|
||||
sprintf("Current date and time: %s", function() { return new Date().toString() })
|
||||
*/
|
||||
export function sprintf(
|
||||
/** The placeholders in the format string are marked by % and are followed by one or more of these elements, in this order:
|
||||
|
||||
An optional number followed by a $ sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string.
|
||||
An optional + sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the - sign is used on negative numbers.
|
||||
An optional padding specifier that says what character to use for padding (if specified). Possible values are 0 or any other character precedeed by a ' (single quote). The default is to pad with spaces.
|
||||
An optional - sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result.
|
||||
An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded.
|
||||
An optional precision modifier, consisting of a . (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used on a string, it causes the result to be truncated.
|
||||
A type specifier that can be any of:
|
||||
% - yields a literal % character
|
||||
b - yields an integer as a binary number
|
||||
c - yields an integer as the character with that ASCII value
|
||||
d or i - yields an integer as a signed decimal number
|
||||
e - yields a float using scientific notation
|
||||
u - yields an integer as an unsigned decimal number
|
||||
f - yields a float as is
|
||||
o - yields an integer as an octal number
|
||||
s - yields a string as is
|
||||
x - yields an integer as a hexadecimal number (lower-case)
|
||||
X - yields an integer as a hexadecimal number (upper-case)
|
||||
*/
|
||||
fmt: string,
|
||||
/** */
|
||||
...args: any[]
|
||||
): string;
|
||||
/** vsprintf is the same as sprintf except that it accepts an array of arguments, rather than a variable number of arguments:
|
||||
|
||||
vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"])
|
||||
*/
|
||||
export function vsprintf(fmt: string, args: any[]): string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path="sprintf-js.d.ts" />
|
||||
|
||||
import sprintf = require('sprintf-js');
|
||||
|
||||
var str: string;
|
||||
var num: number;
|
||||
|
||||
sprintf.sprintf(str, str);
|
||||
sprintf.sprintf(str, str, num);
|
||||
sprintf.sprintf(str, num, str);
|
||||
|
||||
sprintf.vsprintf(str, [str]);
|
||||
sprintf.vsprintf(str, [str, num]);
|
||||
sprintf.vsprintf(str, [num, str]);
|
||||
Vendored
+8
-7
@@ -4151,13 +4151,13 @@ declare module THREE {
|
||||
}
|
||||
|
||||
export class SkinnedMesh extends Mesh {
|
||||
constructor(geometry?: Geometry, material?: MeshBasicMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry, material?: MeshDepthMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry, material?: MeshFaceMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry, material?: MeshLambertMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry, material?: MeshNormalMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry, material?: MeshPhongMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry, material?: ShaderMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry|BufferGeometry, material?: MeshBasicMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry|BufferGeometry, material?: MeshDepthMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry|BufferGeometry, material?: MeshFaceMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry|BufferGeometry, material?: MeshLambertMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry|BufferGeometry, material?: MeshNormalMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry|BufferGeometry, material?: MeshPhongMaterial, useVertexTexture?: boolean);
|
||||
constructor(geometry?: Geometry|BufferGeometry, material?: ShaderMaterial, useVertexTexture?: boolean);
|
||||
|
||||
bindMode: string;
|
||||
bindMatrix: Matrix4;
|
||||
@@ -4517,6 +4517,7 @@ declare module THREE {
|
||||
generateMipmaps: boolean;
|
||||
shareDepthFrom: any;
|
||||
|
||||
setSize(width: number, height: number): void;
|
||||
clone(): WebGLRenderTarget;
|
||||
dispose(): void;
|
||||
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
/// <reference path="twix.d.ts" />
|
||||
|
||||
var someMoment = moment("20111031", "YYYYMMDD");
|
||||
var otherMoment = moment("20120620", "YYYYMMDD");
|
||||
var startTime = moment('20120701');
|
||||
var endTime = moment('20120801');
|
||||
|
||||
someMoment.twix(otherMoment);
|
||||
someMoment.twix('2012-05-25');
|
||||
someMoment.twix({ year: 2012, month: 5, day: 25 });
|
||||
someMoment.twix("05/25/1982", "MM/DD/YYYY", { parseStrict: true });
|
||||
|
||||
someMoment.twix(otherMoment, "MM/DD/YYYY", { parseStrict: true });
|
||||
|
||||
var range = moment(someMoment).twix(otherMoment);
|
||||
var range2 = moment.twix(someMoment, otherMoment);
|
||||
var range3 = someMoment.twix(otherMoment);
|
||||
|
||||
moment('1982-05-25').twix('1982-05-26', { allDay: true });
|
||||
|
||||
moment('1982-05-25').twix('1982-05-26', true);
|
||||
|
||||
moment().twix(moment()).isValid(); //=> true
|
||||
moment().twix(moment().add(1, "day")).isValid(); //=> true
|
||||
moment().twix(moment().subtract(1, "day")).isValid(); //=> false
|
||||
|
||||
moment("1982-05-25T05:00").twix("1982-05-26T06:00").isSame("day"); //=> false
|
||||
moment("1982-05-25T05:00").twix("1982-05-25T06:00").isSame("day"); //=> true
|
||||
moment("1982-05-25T05:00").twix("1982-05-25T06:00").isSame("year"); //=> true
|
||||
|
||||
moment("1982-05-25").twix("1982-05-26").isPast(); //=> true
|
||||
|
||||
moment("2054-05-25").twix("2054-05-26").isFuture(); //=> true
|
||||
|
||||
moment("2054-05-25").twix(moment().add(1, "hour")).isCurrent(); //=> true
|
||||
|
||||
moment("1982-05-25").twix("1982-05-28").contains("1982-05-26"); //=> true
|
||||
|
||||
moment("1982-05-25T5:30").twix("1982-05-25T6:30").length("hours") //=> 1
|
||||
moment("1982-05-25T5:00").twix("1982-05-30T6:00").length("days") //=> 6
|
||||
|
||||
moment("1982-05-25T5:00").twix("1982-05-25T6:00").count("days") //=> 1
|
||||
moment("1982-05-25T5:00").twix("1982-05-26T6:00").count("days") //=> 2
|
||||
|
||||
moment("1982-05-25T5:00").twix("1982-05-25T6:00").countInner("days") //=> 0
|
||||
moment("1982-05-24T5:00").twix("1982-05-26T6:00").countInner("days") //=> 1
|
||||
|
||||
var iter = moment("1982-05-25T5:00").twix("1982-05-26T6:00").iterate("days");
|
||||
iter.hasNext(); //=> true
|
||||
iter.next(); //=> moment("1982-05-25")
|
||||
iter.next(); //=> moment("1982-05-26")
|
||||
iter.hasNext(); //=> false
|
||||
iter.next(); //=> null
|
||||
|
||||
var iter = moment("16", "hh").twix("1982-05-26T6:00").iterate(2, 'hours');
|
||||
iter.next().format('LT'); //=> '4:00 PM'
|
||||
iter.next().format('LT'); //=> '6:00 PM'
|
||||
|
||||
var duration = moment.duration({ hours: 2, minutes: 30, seconds: 20 });
|
||||
var iter = moment("16", "hh").twix(someMoment).iterate(duration);
|
||||
iter.next().format('LT'); //=> '4:00 PM'
|
||||
iter.next().format('LT'); //=> '6:30 PM'
|
||||
iter.next().format('LT'); //=> '9:00 PM'
|
||||
|
||||
var iter2 = moment("1982-05-24T5:00").twix("1982-05-27T6:00").iterateInner("days");
|
||||
iter.hasNext(); //=> true
|
||||
iter.next(); //=> moment("1982-05-25")
|
||||
iter.next(); //=> moment("1982-05-26")
|
||||
iter.hasNext(); //=> false
|
||||
iter.next(); //=> null
|
||||
|
||||
var range1 = moment("1982-05-25").twix("1982-05-30");
|
||||
var range2 = moment("1982-05-27").twix("1982-06-13");
|
||||
|
||||
range1.overlaps(range2); //=> true
|
||||
|
||||
var range1 = moment("1982-05-25").twix("1982-08-30");
|
||||
var range2 = moment("1982-05-27").twix("1982-06-13");
|
||||
|
||||
range1.engulfs(range2); //=> true
|
||||
range2.engulfs(range1); //=> false
|
||||
|
||||
var range1 = moment("1982-05-25").twix("1982-08-30");
|
||||
var range2 = moment("1982-05-25").twix("1982-08-30");
|
||||
|
||||
range1.equals(range2); //=> true
|
||||
range2.equals(range1); //=> true
|
||||
|
||||
var range1 = moment("1982-05-25").twix("1982-05-30");
|
||||
var range2 = moment("1982-05-27").twix("1982-06-13");
|
||||
|
||||
range1.union(range2); //=> 5/25/82 - 6/13/1982
|
||||
|
||||
var range1 = moment("1982-05-25").twix("1982-05-30");
|
||||
var range2 = moment("1982-05-27").twix("1982-06-13");
|
||||
|
||||
range1.intersection(range2); //=> 5/27/82 - 5/30/1982
|
||||
|
||||
var range1 = moment("1982-05-24").twix("1982-05-28", true);
|
||||
var range2 = moment("1982-05-22").twix("1982-05-26", true);
|
||||
var xorred = range1.xor(range2);
|
||||
|
||||
xorred[0].format() //=> 'May 22 - 23, 1982'
|
||||
xorred[1].format() //=> 'May 27 - 28, 1982'
|
||||
|
||||
var range1 = moment("1982-05-23").twix("1982-05-28", true);
|
||||
var range2 = moment("1982-05-25").twix("1982-05-26", true);
|
||||
var diff = range1.difference(range2);
|
||||
|
||||
diff[0].format(); //=> 'May 23 - 24, 1982'
|
||||
diff[1].format(); //=> 'May 27 - 28, 1982'
|
||||
|
||||
var range = moment("1982-05-25T05:01").twix("1982-05-25T07:30");
|
||||
|
||||
var splits = range.split(1, "hour");
|
||||
splits[0].format({ showDate: false }); //=> '5:01 - 6:01 AM'
|
||||
splits[1].format({ showDate: false }); //=> '6:01 - 7:01 AM'
|
||||
splits[2].format({ showDate: false }); //=> '7:01 - 7:30 AM'
|
||||
|
||||
//other signatures
|
||||
range.split(moment.duration({ "h": 1 })).length; //=> 3
|
||||
range.split(moment("1982-05-25T06:00")).length; //=> 2
|
||||
range.split(moment("1982-05-25T06:00"), moment("1982-05-25T07:00")).length; //=> 3
|
||||
|
||||
var d = moment.duration(2, "days");
|
||||
var range4 = d.afterMoment("1982-05-25"); //=> 5/25/1982 - 5/27/1982
|
||||
|
||||
var d = moment.duration(2, "days");
|
||||
d.beforeMoment("1982-05-25"); //=> 5/23/1982 - 5/25/1982
|
||||
|
||||
var range = moment("1982-05-25").twix("1982-05-28");
|
||||
range.asDuration("days"); //=> duration object with {days: 3}
|
||||
|
||||
var range = moment("1982-05-25T8:00").twix("1982-05-25T10:00");
|
||||
range.humanizeLength(); //=> "2 hours"
|
||||
|
||||
range = moment("1982-05-25").twix("2013-01-01");
|
||||
range.humanizeLength(); //=> 31 years
|
||||
|
||||
var range = moment("1982-05-25T9:00").twix("1982-05-25T12:00");
|
||||
|
||||
range.simpleFormat(); //=> '1982-05-25T09:00:00-04:00 - 1982-05-25T12:00:00-04:00'
|
||||
|
||||
range.simpleFormat("ddd, hA"); //=> 'Tue, 9AM - Tue, 12PM'
|
||||
|
||||
var range = moment("1982-05-25").twix("1982-05-26", { allDay: true });
|
||||
|
||||
range.simpleFormat(); //=> '1982-05-25T00:00:00-04:00 - 1982-05-26T00:00:00-04:00 (all day)'
|
||||
range.simpleFormat("YYYY - MM - DD"); //=> '1982-05-25 - 1982-05-26 (all day)'
|
||||
|
||||
range.simpleFormat(null, { allDay: "-- all day! --" }); //=> '1982-05-25T00:00:00-04:00 - 1982-05-26T00:00:00-04:00 -- all day! --'
|
||||
|
||||
range.simpleFormat(null, { allDay: null }); //=> '1982-05-25T00:00:00-04:00 - 1982-05-26T00:00:00-04:00'
|
||||
|
||||
range.simpleFormat("HH:mm", { template: function (left, right) { return left + " | " + right; } }); //=> '16:21 | 17:21'
|
||||
|
||||
moment.twixClass.formatTemplate = function (left, right) { return left + " | " + right; };
|
||||
range.simpleFormat("HH:mm"); //=> '16:29 | 17:29'
|
||||
|
||||
moment("1982-01-25T09:00").twix("1982-01-25T11:00").format(); //=> 'Jan 25, 1982, 9 - 11 AM'
|
||||
moment("1982-01-25T9:00").twix("1982-01-26T13:00").format(); //=> 'Jan 25, 9 AM - Jan 26, 1 PM, 1982'
|
||||
|
||||
moment("2012-01-25").twix("2012-01-25", { allDay: true }).format(); //=> Jan 25
|
||||
moment("1982-01-25").twix("1982-01-25", { allDay: true }).format(); //=> Jan 25, 1982
|
||||
moment("2012-01-25").twix("2012-01-26", { allDay: true }).format(); //=> Jan 25 - 26
|
||||
moment("1982-01-25").twix("1982-02-25", { allDay: true }).format(); //=> Jan 25 - Feb 25, 1982
|
||||
moment("1982-01-25").twix(new Date(), { allDay: true }).format(); //=> Jan 25, 1982 - Jan 9, 2012
|
||||
|
||||
moment("1982-01-25T9:30").twix("1/25/1982 1:30 PM").format(); //=> Jan 25, 1982, 9:30 AM - 1:30 PM
|
||||
moment("1982-01-25T9:30").twix(new Date()).format(); //=> Jan 25, 1982, 9:30 AM - Jan 9, 2012, 3:05 AM
|
||||
moment("1982-01-25").twix("1982-01-27").format(); //=> Jan 25, 12 AM - Jan 27, 12 AM, 1982
|
||||
|
||||
var twix = moment("2012-05-25T9:00").twix("2012-05-25T10:00");
|
||||
|
||||
twix.format(); //=> May 25, 9 - 10 AM
|
||||
twix.format({ implicitMinutes: false, groupMeridiems: false }); //=> May 25, 9:00 AM - 10:00 AM
|
||||
|
||||
var twix = moment().twix(moment().add('days', 1));
|
||||
twix.format({ implicitYear: false }); //=> Mar 28, 1:13 AM - Mar 29, 1:13 AM, 2013
|
||||
|
||||
moment("2012-05-25T16:00").twix("2012-05-25T17:00").format({ twentyFourHour: true }); //=> May 25, 16:00 - 17:00
|
||||
|
||||
moment("2012-01-25T8:00").twix("2012-01-25T17:00").format({
|
||||
monthFormat: "MMMM",
|
||||
dayFormat: "Do"
|
||||
});
|
||||
|
||||
moment("2012-05-25T8:00").twix("2012-05-25T17:00").format({ spaceBeforeMeridiem: false }); //=> May 25, 8AM - 5PM
|
||||
|
||||
moment("2012-05-25T8:00").twix("2012-05-25T17:00").format({ showDate: false }); //=> 8 AM - 5 PM
|
||||
|
||||
moment("2012-01-25").twix("2012-01-25", { allDay: true }).format({ showDate: false }); //=> All day
|
||||
|
||||
moment.lang("fr");
|
||||
moment().twix(moment().add(3, "month")).simpleFormat("MMMM"); //=> 'juillet - octobre'
|
||||
|
||||
moment("1982-05-25").twix(moment("1982-05-27")).format(); //=> '25 mai, 0:00 - 27 mai, 0:00, 1982'
|
||||
|
||||
moment("1982-05-25").twix(moment("1982-05-27")).format({
|
||||
groupMeridiems: true,
|
||||
spaceBeforeMeridiem: true,
|
||||
showDate: true,
|
||||
showDayOfWeek: false,
|
||||
twentyFourHour: false,
|
||||
implicitMinutes: true,
|
||||
implicitYear: true,
|
||||
yearFormat: "YYYY",
|
||||
monthFormat: "MMM",
|
||||
weekdayFormat: "ddd",
|
||||
dayFormat: "D",
|
||||
meridiemFormat: "A",
|
||||
hourFormat: "h",
|
||||
minuteFormat: "mm",
|
||||
allDay: "all day",
|
||||
explicitAllDay: false,
|
||||
lastNightEndsAt: 0
|
||||
}); //=> '25 mai, 0:00 - 27 mai, 0:00, 1982'
|
||||
|
||||
var t = moment("1982-01-25T09:30").twix("1982-01-25T13:30");
|
||||
|
||||
t.format(); //=> Jan 25, 1982, 9:30 AM - 1:30 PM
|
||||
|
||||
t.isSame("day"); //=> true
|
||||
t.humanizeLength(); //=> "4 hours"
|
||||
t.count("days"); //=> 1
|
||||
Vendored
+134
@@ -0,0 +1,134 @@
|
||||
// Type definitions for twix.js 0.6.3
|
||||
// Project: https://github.com/icambron/twix.js
|
||||
// Definitions by: j3ko <https://github.com/j3ko>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../moment/moment.d.ts" />
|
||||
|
||||
declare module moment {
|
||||
interface Moment {
|
||||
twix(date: Date): Twix;
|
||||
twix(date: Date, allDay: boolean): Twix;
|
||||
twix(date: Date, options: TwixFormatOptions): Twix;
|
||||
twix(date: Date, format: string, options: TwixFormatOptions): Twix;
|
||||
|
||||
twix(date: Moment): Twix;
|
||||
twix(date: Moment, allDay: boolean): Twix;
|
||||
twix(date: Moment, options: TwixFormatOptions): Twix;
|
||||
twix(date: Moment, format: string, options: TwixFormatOptions): Twix;
|
||||
|
||||
twix(date: MomentInput): Twix;
|
||||
twix(date: MomentInput, allDay: boolean): Twix;
|
||||
twix(date: MomentInput, options: TwixFormatOptions): Twix;
|
||||
twix(date: MomentInput, format: string, options: TwixFormatOptions): Twix;
|
||||
|
||||
twix(date: number): Twix;
|
||||
twix(date: number, allDay: boolean): Twix;
|
||||
twix(date: number, options: TwixFormatOptions): Twix;
|
||||
twix(date: number, format: string, options: TwixFormatOptions): Twix;
|
||||
|
||||
twix(date: number[]): Twix;
|
||||
twix(date: number[], allDay: boolean): Twix;
|
||||
twix(date: number[], options: TwixFormatOptions): Twix;
|
||||
twix(date: number[], format: string, options: TwixFormatOptions): Twix;
|
||||
|
||||
twix(date: string): Twix;
|
||||
twix(date: string, allDay: boolean): Twix;
|
||||
twix(date: string, options: TwixFormatOptions): Twix;
|
||||
twix(date: string, format: string, options: TwixFormatOptions): Twix;
|
||||
}
|
||||
|
||||
interface MomentStatic {
|
||||
twix(start: Moment, end: Moment): Twix;
|
||||
twixClass: TwixStatic;
|
||||
}
|
||||
|
||||
interface TwixFormatOptions {
|
||||
groupMeridiems?: boolean;
|
||||
spaceBeforeMeridiem?: boolean;
|
||||
showDate?: boolean;
|
||||
showDayOfWeek?: boolean;
|
||||
twentyFourHour?: boolean;
|
||||
implicitMinutes?: boolean;
|
||||
implicitYear?: boolean;
|
||||
yearFormat?: string;
|
||||
monthFormat?: string;
|
||||
weekdayFormat?: string;
|
||||
dayFormat?: string;
|
||||
meridiemFormat?: string;
|
||||
hourFormat?: string;
|
||||
minuteFormat?: string;
|
||||
allDay?: any; // boolean | string
|
||||
explicitAllDay?: boolean;
|
||||
lastNightEndsAt?: number;
|
||||
}
|
||||
|
||||
interface TwixSimpleFormatOptions {
|
||||
allDay?: string;
|
||||
template?: (left: any, right: any) => any;
|
||||
}
|
||||
|
||||
interface TwixIter {
|
||||
hasNext(): boolean;
|
||||
next(): Twix;
|
||||
}
|
||||
|
||||
interface Duration {
|
||||
afterMoment(date: string): string;
|
||||
beforeMoment(date: string): string;
|
||||
}
|
||||
|
||||
interface Twix {
|
||||
isPast(): boolean;
|
||||
isFuture(): boolean;
|
||||
isCurrent(): boolean;
|
||||
isSame(period: string): boolean;
|
||||
contains(date: string): boolean;
|
||||
contains(date: Date): boolean;
|
||||
contains(date: Moment): boolean;
|
||||
length(period: string): number;
|
||||
count(period: string): number;
|
||||
countInner(period: string): number;
|
||||
|
||||
iterate(period: string): TwixIter;
|
||||
iterate(num: number, period: string): TwixIter;
|
||||
iterate(duration: Duration): TwixIter;
|
||||
|
||||
iterateInner(period: string): TwixIter;
|
||||
iterateInner(num: number, period: string): TwixIter;
|
||||
|
||||
overlaps(other: Twix): boolean;
|
||||
engulfs(other: Twix): boolean;
|
||||
equals(other: Twix): boolean;
|
||||
union(other: Twix): string;
|
||||
intersection(other: Twix): string;
|
||||
|
||||
xor(other: Twix): Twix[];
|
||||
difference(other: Twix): Twix[];
|
||||
split(num: number, period: string): Twix[];
|
||||
split(other: Moment): Twix[];
|
||||
split(start: Moment, end: Moment): Twix[];
|
||||
split(duration: Duration): Twix[];
|
||||
|
||||
humanizeLength(): string;
|
||||
simpleFormat(): string;
|
||||
simpleFormat(format: string): string;
|
||||
simpleFormat(format: string, options: TwixSimpleFormatOptions): string;
|
||||
|
||||
format(): string;
|
||||
format(options: TwixFormatOptions): string;
|
||||
|
||||
asDuration(period: string): Duration;
|
||||
isValid(): boolean;
|
||||
}
|
||||
|
||||
interface TwixStatic {
|
||||
formatTemplate?: (left: any, right: any) => any;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'twix' {
|
||||
var _tmp: moment.MomentStatic;
|
||||
|
||||
export = _tmp;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/// <reference path="./type-name.d.ts" />
|
||||
|
||||
import typeName = require("type-name");
|
||||
console.log(typeName('foo') === 'string');
|
||||
console.log(typeName([1, 2]) === 'Array');
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// Type definitions for type-name v1.0.1
|
||||
// Project: https://github.com/twada/type-name/
|
||||
// Definitions by: OKUNOKENTARO <https://github.com/armorik83>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare function typeName(anyVar: any): string;
|
||||
declare module typeName {}
|
||||
|
||||
declare module "type-name" {
|
||||
export = typeName;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import unique = require("uniq");
|
||||
var data = [1, 2, 2, 3, 4, 5, 5, 5, 6];
|
||||
var datastr = ["1", "2", "2", "3", "4", "5", "5", "5", "6"];
|
||||
var dataMix = ["1", 2,"2", {"2":2}, "3", "4", "5", "5", "5", "6"];
|
||||
console.log(unique(data));
|
||||
console.log(unique(datastr));
|
||||
console.log(unique(dataMix));
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for uniq
|
||||
// Project: https://www.npmjs.com/package/uniq
|
||||
// Definitions by: Hans Windhoff <https://github.com/hansrwindhoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
interface Uniq{
|
||||
<T>(ip:Array<T>): Array<T>;
|
||||
}
|
||||
|
||||
declare var uniq :Uniq;
|
||||
|
||||
declare module "uniq" {
|
||||
export = uniq;
|
||||
}
|
||||
Reference in New Issue
Block a user