mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-28 12:43:06 +08:00
Merge branch 'master' into tsc-1.5.0-alpha
This commit is contained in:
@@ -29,6 +29,9 @@ _infrastructure/tests/build
|
||||
*.iml
|
||||
*.js.map
|
||||
|
||||
#decimal.js
|
||||
!decimal.js
|
||||
|
||||
#rx.js
|
||||
!rx.js
|
||||
|
||||
|
||||
+58
-13
@@ -22,11 +22,12 @@ 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)
|
||||
@@ -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,20 +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.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](nodemailer/nodemailer-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-direct-transport/nodemailer-direct-transport.d.ts) [nodemailer-direct-transport](https://github.com/andris9/nodemailer-direct-transport) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](nodemailer-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)
|
||||
@@ -658,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)
|
||||
@@ -728,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)
|
||||
@@ -771,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)
|
||||
@@ -783,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)
|
||||
@@ -792,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)
|
||||
@@ -839,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)
|
||||
@@ -847,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)
|
||||
@@ -877,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)
|
||||
@@ -893,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)
|
||||
|
||||
@@ -13,7 +13,7 @@ interface TestScope extends ng.IScope {
|
||||
}
|
||||
|
||||
export class TestController {
|
||||
constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService<string>) {
|
||||
constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService) {
|
||||
// isSupported
|
||||
if (localStorageService.isSupported) {
|
||||
// do something
|
||||
@@ -29,7 +29,7 @@ export class TestController {
|
||||
|
||||
// get
|
||||
$scope.getItem = (key) => {
|
||||
return localStorageService.get(key);
|
||||
return localStorageService.get<string>(key);
|
||||
};
|
||||
|
||||
// remove
|
||||
|
||||
+3
-3
@@ -75,7 +75,7 @@ declare module angular.local.storage {
|
||||
|
||||
}
|
||||
|
||||
interface ILocalStorageService<T> {
|
||||
interface ILocalStorageService {
|
||||
/**
|
||||
* Checks if the browser support the current storage type(e.g: localStorage, sessionStorage).
|
||||
* Returns: Boolean
|
||||
@@ -92,14 +92,14 @@ declare module angular.local.storage {
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
set(key: string, value: T): boolean;
|
||||
set<T>(key: string, value: T): boolean;
|
||||
/**
|
||||
* Directly get a value from local storage.
|
||||
* If local storage is not supported, use cookies instead.
|
||||
* Returns: value from local storage
|
||||
* @param key
|
||||
*/
|
||||
get(key: string): T;
|
||||
get<T>(key: string): T;
|
||||
/**
|
||||
* Return array of keys for local storage, ignore keys that not owned.
|
||||
* Returns: value from local storage
|
||||
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
// Type definitions for Angular Material 0.8.3+ (angular.material module)
|
||||
// Project: https://github.com/angular/material
|
||||
// Definitions by: Matt Traynham <https://github.com/mtraynham>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
declare module angular.material {
|
||||
|
||||
interface MDBottomSheetOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
controller?: any;
|
||||
locals?: {[index: string]: any};
|
||||
targetEvent?: any;
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
disableParentScroll?: boolean;
|
||||
}
|
||||
|
||||
interface MDBottomSheetService {
|
||||
show(options: MDBottomSheetOptions): angular.IPromise<any>;
|
||||
hide(response?: any): void;
|
||||
cancel(response?: any): void;
|
||||
}
|
||||
|
||||
interface MDPresetDialog<T> {
|
||||
title(title: string): T;
|
||||
content(content: string): T;
|
||||
ok(content: string): T;
|
||||
theme(theme: string): T;
|
||||
}
|
||||
|
||||
interface MDAlertDialog extends MDPresetDialog<MDAlertDialog> {
|
||||
}
|
||||
|
||||
interface MDConfirmDialog extends MDPresetDialog<MDConfirmDialog> {
|
||||
cancel(reason?: string): MDConfirmDialog;
|
||||
}
|
||||
|
||||
interface MDDialogOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
domClickEvent?: any;
|
||||
disableParentScroll?: boolean;
|
||||
clickOutsideToClose?: boolean;
|
||||
hasBackdrop?: boolean;
|
||||
escapeToClose?: boolean;
|
||||
controller?: any;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean;
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
onComplete?: Function;
|
||||
}
|
||||
|
||||
interface MDDialogService {
|
||||
show(dialog: MDDialogOptions|MDPresetDialog<any>): angular.IPromise<any>;
|
||||
confirm(): MDConfirmDialog;
|
||||
alert(): MDAlertDialog;
|
||||
hide(response?: any): void;
|
||||
cancel(response?: any): void;
|
||||
}
|
||||
|
||||
interface MDIcon {
|
||||
(path: string): angular.IPromise<Element>;
|
||||
}
|
||||
|
||||
interface MDIconProvider {
|
||||
icon(id: string, url: string, iconSize?: string): MDIconProvider;
|
||||
iconSet(id: string, url: string, iconSize?: string): MDIconProvider;
|
||||
defaultIconSet(url: string, iconSize?: string): MDIconProvider;
|
||||
defaultIconSize(iconSize: string): MDIconProvider;
|
||||
}
|
||||
|
||||
interface MDMedia {
|
||||
(media: string): boolean;
|
||||
}
|
||||
|
||||
interface MDSidenavObject {
|
||||
toggle(): void;
|
||||
open(): void;
|
||||
close(): void;
|
||||
isOpen(): boolean;
|
||||
isLockedOpen(): boolean;
|
||||
}
|
||||
|
||||
interface MDSidenavService {
|
||||
(component: string): MDSidenavObject;
|
||||
}
|
||||
|
||||
interface MDToastPreset<T> {
|
||||
content(content: string): T;
|
||||
action(action: string): T;
|
||||
highlightAction(highlightAction: boolean): T;
|
||||
capsule(capsule: boolean): T;
|
||||
theme(theme: string): T;
|
||||
hideDelay(delay: number): T;
|
||||
}
|
||||
|
||||
interface MDSimpleToastPreset extends MDToastPreset<MDSimpleToastPreset> {
|
||||
}
|
||||
|
||||
interface MDToastOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
hideDelay?: number;
|
||||
position?: string;
|
||||
controller?: any;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean;
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
}
|
||||
|
||||
interface MDToastService {
|
||||
show(optionsOrPreset: MDToastOptions|MDToastPreset<any>): angular.IPromise<any>;
|
||||
showSimple(): angular.IPromise<any>;
|
||||
simple(): MDSimpleToastPreset;
|
||||
build(): MDToastPreset<any>;
|
||||
updateContent(): void;
|
||||
hide(response?: any): void;
|
||||
cancel(response?: any): void;
|
||||
}
|
||||
|
||||
interface MDPalette {
|
||||
0?: string;
|
||||
50?: string;
|
||||
100?: string;
|
||||
200?: string;
|
||||
300?: string;
|
||||
400?: string;
|
||||
500?: string;
|
||||
600?: string;
|
||||
700?: string;
|
||||
800?: string;
|
||||
900?: string;
|
||||
A100?: string;
|
||||
A200?: string;
|
||||
A400?: string;
|
||||
A700?: string;
|
||||
contrastDefaultColor?: string;
|
||||
contrastDarkColors?: string;
|
||||
contrastStrongLightColors?: string;
|
||||
}
|
||||
|
||||
interface MDThemeHues {
|
||||
default?: string;
|
||||
'hue-1'?: string;
|
||||
'hue-2'?: string;
|
||||
'hue-3'?: string;
|
||||
}
|
||||
|
||||
interface MDThemePalette {
|
||||
name: string;
|
||||
hues: MDThemeHues;
|
||||
}
|
||||
|
||||
interface MDThemeColors {
|
||||
accent: MDThemePalette;
|
||||
background: MDThemePalette;
|
||||
primary: MDThemePalette;
|
||||
warn: MDThemePalette;
|
||||
}
|
||||
|
||||
interface MDThemeGrayScalePalette {
|
||||
1: string;
|
||||
2: string;
|
||||
3: string;
|
||||
4: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface MDTheme {
|
||||
name: string;
|
||||
colors: MDThemeColors;
|
||||
foregroundPalette: MDThemeGrayScalePalette;
|
||||
foregroundShadow: string;
|
||||
accentPalette(name: string, hues?: MDThemeHues): MDTheme;
|
||||
primaryPalette(name: string, hues?: MDThemeHues): MDTheme;
|
||||
warnPalette(name: string, hues?: MDThemeHues): MDTheme;
|
||||
backgroundPalette(name: string, hues?: MDThemeHues): MDTheme;
|
||||
dark(isDark?: boolean): MDTheme;
|
||||
}
|
||||
|
||||
interface MDThemingProvider {
|
||||
theme(name: string, inheritFrom?: string): MDTheme;
|
||||
definePalette(name: string, palette: MDPalette): MDThemingProvider;
|
||||
extendPalette(name: string, palette: MDPalette): MDPalette;
|
||||
setDefaultTheme(theme: string): void;
|
||||
alwaysWatchTheme(alwaysWatch: boolean): void;
|
||||
}
|
||||
}
|
||||
+37
-29
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular Material 0.8.3+ (angular.material module)
|
||||
// Type definitions for Angular Material 0.9.0-rc1+ (angular.material module)
|
||||
// Project: https://github.com/angular/material
|
||||
// Definitions by: Matt Traynham <https://github.com/mtraynham>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -9,13 +9,15 @@ declare module angular.material {
|
||||
interface MDBottomSheetOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
controller?: any;
|
||||
scope?: angular.IScope; // default: new child scope
|
||||
preserveScope?: boolean; // default: false
|
||||
controller?: string|Function;
|
||||
locals?: {[index: string]: any};
|
||||
targetEvent?: any;
|
||||
targetEvent?: MouseEvent;
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
disableParentScroll?: boolean;
|
||||
parent?: string|Element|JQuery; // default: root node
|
||||
disableParentScroll?: boolean; // default: true
|
||||
}
|
||||
|
||||
interface MDBottomSheetService {
|
||||
@@ -27,7 +29,7 @@ declare module angular.material {
|
||||
interface MDPresetDialog<T> {
|
||||
title(title: string): T;
|
||||
content(content: string): T;
|
||||
ok(content: string): T;
|
||||
ok(ok: string): T;
|
||||
theme(theme: string): T;
|
||||
}
|
||||
|
||||
@@ -35,28 +37,31 @@ declare module angular.material {
|
||||
}
|
||||
|
||||
interface MDConfirmDialog extends MDPresetDialog<MDConfirmDialog> {
|
||||
cancel(reason?: string): MDConfirmDialog;
|
||||
cancel(cancel: string): MDConfirmDialog;
|
||||
}
|
||||
|
||||
interface MDDialogOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
domClickEvent?: any;
|
||||
disableParentScroll?: boolean;
|
||||
clickOutsideToClose?: boolean;
|
||||
hasBackdrop?: boolean;
|
||||
escapeToClose?: boolean;
|
||||
controller?: any;
|
||||
targetEvent?: MouseEvent;
|
||||
scope?: angular.IScope; // default: new child scope
|
||||
preserveScope?: boolean; // default: false
|
||||
disableParentScroll?: boolean; // default: true
|
||||
hasBackdrop?: boolean // default: true
|
||||
clickOutsideToClose?: boolean; // default: false
|
||||
escapeToClose?: boolean; // default: true
|
||||
focusOnOpen?: boolean; // default: true
|
||||
controller?: string|Function;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean;
|
||||
bindToController?: boolean; // default: false
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
parent?: string|Element|JQuery; // default: root node
|
||||
onComplete?: Function;
|
||||
}
|
||||
|
||||
interface MDDialogService {
|
||||
show(dialog: MDDialogOptions|MDPresetDialog<any>): angular.IPromise<any>;
|
||||
show(dialog: MDDialogOptions|MDAlertDialog|MDConfirmDialog): angular.IPromise<any>;
|
||||
confirm(): MDConfirmDialog;
|
||||
alert(): MDAlertDialog;
|
||||
hide(response?: any): void;
|
||||
@@ -64,14 +69,14 @@ declare module angular.material {
|
||||
}
|
||||
|
||||
interface MDIcon {
|
||||
(path: string): angular.IPromise<Element>;
|
||||
(id: string): angular.IPromise<Element>; // id is a unique ID or URL
|
||||
}
|
||||
|
||||
interface MDIconProvider {
|
||||
icon(id: string, url: string, iconSize?: string): MDIconProvider;
|
||||
iconSet(id: string, url: string, iconSize?: string): MDIconProvider;
|
||||
defaultIconSet(url: string, iconSize?: string): MDIconProvider;
|
||||
defaultIconSize(iconSize: string): MDIconProvider;
|
||||
icon(id: string, url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px'
|
||||
iconSet(id: string, url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px'
|
||||
defaultIconSet(url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px'
|
||||
defaultIconSize(iconSize: string): MDIconProvider; // default: '24px'
|
||||
}
|
||||
|
||||
interface MDMedia {
|
||||
@@ -79,9 +84,9 @@ declare module angular.material {
|
||||
}
|
||||
|
||||
interface MDSidenavObject {
|
||||
toggle(): void;
|
||||
open(): void;
|
||||
close(): void;
|
||||
toggle(): angular.IPromise<void>;
|
||||
open(): angular.IPromise<void>;
|
||||
close(): angular.IPromise<void>;
|
||||
isOpen(): boolean;
|
||||
isLockedOpen(): boolean;
|
||||
}
|
||||
@@ -105,14 +110,16 @@ declare module angular.material {
|
||||
interface MDToastOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
hideDelay?: number;
|
||||
position?: string;
|
||||
controller?: any;
|
||||
scope?: angular.IScope; // default: new child scope
|
||||
preserveScope?: boolean; // default: false
|
||||
hideDelay?: number; // default (ms): 3000
|
||||
position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left'
|
||||
controller?: string|Function;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean;
|
||||
bindToController?: boolean; // default: false
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
parent?: string|Element|JQuery; // default: root node
|
||||
}
|
||||
|
||||
interface MDToastService {
|
||||
@@ -175,6 +182,7 @@ declare module angular.material {
|
||||
|
||||
interface MDTheme {
|
||||
name: string;
|
||||
isDark: boolean;
|
||||
colors: MDThemeColors;
|
||||
foregroundPalette: MDThemeGrayScalePalette;
|
||||
foregroundShadow: string;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
var app = angular.module('at', ['pascalprecht.translate']);
|
||||
|
||||
app.config(($translateProvider: ng.translate.ITranslateProvider) => {
|
||||
app.config(($translateProvider: angular.translate.ITranslateProvider) => {
|
||||
$translateProvider.translations('en', {
|
||||
TITLE: 'Hello',
|
||||
FOO: 'This is a paragraph.',
|
||||
@@ -22,7 +22,7 @@ interface Scope extends ng.IScope {
|
||||
changeLanguage(key: any): void;
|
||||
}
|
||||
|
||||
app.controller('Ctrl', ($scope: Scope, $translate: ng.translate.ITranslateService) => {
|
||||
app.controller('Ctrl', ($scope: Scope, $translate: angular.translate.ITranslateService) => {
|
||||
$scope['changeLanguage'] = function (key: any) {
|
||||
$translate.use(key);
|
||||
};
|
||||
|
||||
+5
-5
@@ -33,8 +33,8 @@ declare module angular.translate {
|
||||
}
|
||||
|
||||
interface ITranslateService {
|
||||
(translationId: string, interpolateParams?: any, interpolationId?: string): ng.IPromise<string>;
|
||||
(translationId: string[], interpolateParams?: any, interpolationId?: string): ng.IPromise<{ [key: string]: string }>;
|
||||
(translationId: string, interpolateParams?: any, interpolationId?: string): angular.IPromise<string>;
|
||||
(translationId: string[], interpolateParams?: any, interpolationId?: string): angular.IPromise<{ [key: string]: string }>;
|
||||
cloakClassName(): string;
|
||||
cloakClassName(name: string): ITranslateProvider;
|
||||
fallbackLanguage(langKey?: string): string;
|
||||
@@ -44,17 +44,17 @@ declare module angular.translate {
|
||||
isPostCompilingEnabled(): boolean;
|
||||
preferredLanguage(langKey?: string): string;
|
||||
proposedLanguage(): string;
|
||||
refresh(langKey?: string): ng.IPromise<void>;
|
||||
refresh(langKey?: string): angular.IPromise<void>;
|
||||
storage(): IStorage;
|
||||
storageKey(): string;
|
||||
use(): string;
|
||||
use(key: string): ng.IPromise<string>;
|
||||
use(key: string): angular.IPromise<string>;
|
||||
useFallbackLanguage(langKey?: string): void;
|
||||
versionInfo(): string;
|
||||
loaderCache(): any;
|
||||
}
|
||||
|
||||
interface ITranslateProvider extends ng.IServiceProvider {
|
||||
interface ITranslateProvider extends angular.IServiceProvider {
|
||||
translations(): ITranslationTable;
|
||||
translations(key: string, translationTable: ITranslationTable): ITranslateProvider;
|
||||
cloakClassName(): string;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
+5
-3
@@ -45,13 +45,15 @@ declare module angular.ui {
|
||||
views?: {};
|
||||
abstract?: boolean;
|
||||
/**
|
||||
* Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog.
|
||||
* Callback function for when a state is entered. Good way to trigger an action or dispatch an event, such as opening a dialog.
|
||||
* If minifying your scripts, make sure to explictly annotate this function, because it won't be automatically annotated by your build tools.
|
||||
*/
|
||||
onEnter?: Function;
|
||||
onEnter?: Function|(string|Function)[];
|
||||
/**
|
||||
* Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog.
|
||||
* If minifying your scripts, make sure to explictly annotate this function, because it won't be automatically annotated by your build tools.
|
||||
*/
|
||||
onExit?: Function;
|
||||
onExit?: Function|(string|Function)[];
|
||||
/**
|
||||
* Arbitrary data object, useful for custom configuration.
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/// <reference path="angular-resource.d.ts" />
|
||||
|
||||
interface IMyResource extends ng.resource.IResource<IMyResource> { };
|
||||
interface IMyResourceClass extends ng.resource.IResourceClass<IMyResource> { };
|
||||
interface IMyResource extends angular.resource.IResource<IMyResource> { };
|
||||
interface IMyResourceClass extends angular.resource.IResourceClass<IMyResource> { };
|
||||
|
||||
///////////////////////////////////////
|
||||
// IActionDescriptor
|
||||
///////////////////////////////////////
|
||||
var actionDescriptor: ng.resource.IActionDescriptor;
|
||||
var actionDescriptor: angular.resource.IActionDescriptor;
|
||||
|
||||
actionDescriptor.headers = { header: 'value' };
|
||||
actionDescriptor.isArray = true;
|
||||
@@ -19,7 +19,7 @@ actionDescriptor.params = { key: 'value' };
|
||||
///////////////////////////////////////
|
||||
var resourceClass: IMyResourceClass;
|
||||
var resource: IMyResource;
|
||||
var resourceArray: ng.resource.IResourceArray<IMyResource>;
|
||||
var resourceArray: angular.resource.IResourceArray<IMyResource>;
|
||||
|
||||
resource = resourceClass.delete();
|
||||
resource = resourceClass.delete({ key: 'value' });
|
||||
@@ -49,7 +49,7 @@ resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' });
|
||||
resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { });
|
||||
resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { }, function () { });
|
||||
resourceArray.push(resource);
|
||||
resourceArray.$promise.then(function(data: ng.resource.IResourceArray<IMyResource>) {});
|
||||
resourceArray.$promise.then(function(data: angular.resource.IResourceArray<IMyResource>) {});
|
||||
|
||||
resource = resourceClass.remove();
|
||||
resource = resourceClass.remove({ key: 'value' });
|
||||
@@ -73,8 +73,8 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () {
|
||||
// IResource
|
||||
///////////////////////////////////////
|
||||
|
||||
var promise : ng.IPromise<IMyResource>;
|
||||
var arrayPromise : ng.IPromise<IMyResource[]>;
|
||||
var promise : angular.IPromise<IMyResource>;
|
||||
var arrayPromise : angular.IPromise<IMyResource[]>;
|
||||
|
||||
promise = resource.$delete();
|
||||
promise = resource.$delete({ key: 'value' });
|
||||
@@ -97,7 +97,7 @@ arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { });
|
||||
arrayPromise = resourceArray[0].$query(function () { });
|
||||
arrayPromise = resourceArray[0].$query(function () { }, function () { });
|
||||
arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { }, function () { });
|
||||
arrayPromise.then(function(data: ng.resource.IResourceArray<IMyResource>) {});
|
||||
arrayPromise.then(function(data: angular.resource.IResourceArray<IMyResource>) {});
|
||||
|
||||
promise = resource.$remove();
|
||||
promise = resource.$remove({ key: 'value' });
|
||||
@@ -116,7 +116,7 @@ promise = resource.$save({ key: 'value' }, function () { }, function () { });
|
||||
///////////////////////////////////////
|
||||
// IResourceService
|
||||
///////////////////////////////////////
|
||||
var resourceService: ng.resource.IResourceService;
|
||||
var resourceService: angular.resource.IResourceService;
|
||||
resourceClass = resourceService<IMyResource, IMyResourceClass>('test');
|
||||
resourceClass = resourceService<IMyResource>('test');
|
||||
resourceClass = resourceService('test');
|
||||
@@ -125,12 +125,12 @@ resourceClass = resourceService('test');
|
||||
// IModule
|
||||
///////////////////////////////////////
|
||||
var mod: ng.IModule;
|
||||
var resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction<IMyResource>;
|
||||
var resourceService: ng.resource.IResourceService;
|
||||
var resourceServiceFactoryFunction: angular.resource.IResourceServiceFactoryFunction<IMyResource>;
|
||||
var resourceService: angular.resource.IResourceService;
|
||||
|
||||
resourceClass = resourceServiceFactoryFunction<IMyResourceClass>(resourceService);
|
||||
|
||||
resourceServiceFactoryFunction = function (resourceService: ng.resource.IResourceService) { return <any>resourceClass; };
|
||||
resourceServiceFactoryFunction = function (resourceService: angular.resource.IResourceService) { return <any>resourceClass; };
|
||||
mod = mod.factory('factory name', resourceServiceFactoryFunction);
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
Vendored
+21
-21
@@ -104,28 +104,28 @@ declare module angular.resource {
|
||||
// Instance calls always return the the promise of the request which retrieved the object
|
||||
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L546
|
||||
interface IResource<T> {
|
||||
$get(): ng.IPromise<T>;
|
||||
$get(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
|
||||
$get(success: Function, error?: Function): ng.IPromise<T>;
|
||||
$get(): angular.IPromise<T>;
|
||||
$get(params?: Object, success?: Function, error?: Function): angular.IPromise<T>;
|
||||
$get(success: Function, error?: Function): angular.IPromise<T>;
|
||||
|
||||
$query(): ng.IPromise<IResourceArray<T>>;
|
||||
$query(params?: Object, success?: Function, error?: Function): ng.IPromise<IResourceArray<T>>;
|
||||
$query(success: Function, error?: Function): ng.IPromise<IResourceArray<T>>;
|
||||
$query(): angular.IPromise<IResourceArray<T>>;
|
||||
$query(params?: Object, success?: Function, error?: Function): angular.IPromise<IResourceArray<T>>;
|
||||
$query(success: Function, error?: Function): angular.IPromise<IResourceArray<T>>;
|
||||
|
||||
$save(): ng.IPromise<T>;
|
||||
$save(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
|
||||
$save(success: Function, error?: Function): ng.IPromise<T>;
|
||||
$save(): angular.IPromise<T>;
|
||||
$save(params?: Object, success?: Function, error?: Function): angular.IPromise<T>;
|
||||
$save(success: Function, error?: Function): angular.IPromise<T>;
|
||||
|
||||
$remove(): ng.IPromise<T>;
|
||||
$remove(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
|
||||
$remove(success: Function, error?: Function): ng.IPromise<T>;
|
||||
$remove(): angular.IPromise<T>;
|
||||
$remove(params?: Object, success?: Function, error?: Function): angular.IPromise<T>;
|
||||
$remove(success: Function, error?: Function): angular.IPromise<T>;
|
||||
|
||||
$delete(): ng.IPromise<T>;
|
||||
$delete(params?: Object, success?: Function, error?: Function): ng.IPromise<T>;
|
||||
$delete(success: Function, error?: Function): ng.IPromise<T>;
|
||||
$delete(): angular.IPromise<T>;
|
||||
$delete(params?: Object, success?: Function, error?: Function): angular.IPromise<T>;
|
||||
$delete(success: Function, error?: Function): angular.IPromise<T>;
|
||||
|
||||
/** the promise of the original server interaction that created this instance. **/
|
||||
$promise : ng.IPromise<T>;
|
||||
$promise : angular.IPromise<T>;
|
||||
$resolved : boolean;
|
||||
}
|
||||
|
||||
@@ -134,14 +134,14 @@ declare module angular.resource {
|
||||
*/
|
||||
interface IResourceArray<T> extends Array<T> {
|
||||
/** the promise of the original server interaction that created this collection. **/
|
||||
$promise : ng.IPromise<IResourceArray<T>>;
|
||||
$promise : angular.IPromise<IResourceArray<T>>;
|
||||
$resolved : boolean;
|
||||
}
|
||||
|
||||
/** when creating a resource factory via IModule.factory */
|
||||
interface IResourceServiceFactoryFunction<T> {
|
||||
($resource: ng.resource.IResourceService): IResourceClass<T>;
|
||||
<U extends IResourceClass<T>>($resource: ng.resource.IResourceService): U;
|
||||
($resource: angular.resource.IResourceService): IResourceClass<T>;
|
||||
<U extends IResourceClass<T>>($resource: angular.resource.IResourceService): U;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,13 +150,13 @@ declare module angular {
|
||||
|
||||
interface IModule {
|
||||
/** creating a resource service factory */
|
||||
factory(name: string, resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction<any>): IModule;
|
||||
factory(name: string, resourceServiceFactoryFunction: angular.resource.IResourceServiceFactoryFunction<any>): IModule;
|
||||
}
|
||||
}
|
||||
|
||||
interface Array<T>
|
||||
{
|
||||
/** the promise of the original server interaction that created this collection. **/
|
||||
$promise : ng.IPromise<Array<T>>;
|
||||
$promise : angular.IPromise<Array<T>>;
|
||||
$resolved : boolean;
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -63,7 +63,7 @@ declare module angular.route {
|
||||
*
|
||||
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
|
||||
*/
|
||||
template?: string|{($routeParams?: ng.route.IRouteParamsService) : string;}
|
||||
template?: string|{($routeParams?: angular.route.IRouteParamsService) : string;}
|
||||
/**
|
||||
* {string=|function()=}
|
||||
* Path or function that returns a path to an html template that should be used by ngView.
|
||||
@@ -72,7 +72,7 @@ declare module angular.route {
|
||||
*
|
||||
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
|
||||
*/
|
||||
templateUrl?: string|{ ($routeParams?: ng.route.IRouteParamsService): string; }
|
||||
templateUrl?: string|{ ($routeParams?: angular.route.IRouteParamsService): string; }
|
||||
/**
|
||||
* {Object.<string, function>=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is:
|
||||
*
|
||||
@@ -91,7 +91,7 @@ declare module angular.route {
|
||||
* - {Object} - current $location.search()
|
||||
* - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search().
|
||||
*/
|
||||
redirectTo?: string|{($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) : string};
|
||||
redirectTo?: string|{($routeParams?: angular.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) : string};
|
||||
/**
|
||||
* Reload route when only $location.search() or $location.hash() changes.
|
||||
*
|
||||
|
||||
Vendored
+2
-2
@@ -665,7 +665,7 @@ declare module angular {
|
||||
// TODO undocumented, so we need to get it from the source code
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IBrowserService {
|
||||
defer: ng.ITimeoutService;
|
||||
defer: angular.ITimeoutService;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@@ -1278,7 +1278,7 @@ declare module angular {
|
||||
interface IHttpPromiseCallbackArg<T> {
|
||||
data?: T;
|
||||
status?: number;
|
||||
headers?: (headerName: string) => string;
|
||||
headers?: IHttpHeadersGetter;
|
||||
config?: IRequestConfig;
|
||||
statusText?: string;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -106,6 +106,17 @@ async.series<number>({
|
||||
},
|
||||
function (err, results) { });
|
||||
|
||||
async.times(5, function(n, next) {
|
||||
next(null, n)
|
||||
}, function(err, results) {
|
||||
console.log(results)
|
||||
})
|
||||
|
||||
async.timesSeries(5, function(n, next) {
|
||||
next(null, n)
|
||||
}, function(err, results) {
|
||||
console.log(results)
|
||||
})
|
||||
|
||||
async.parallel([
|
||||
function (callback) {
|
||||
|
||||
Vendored
+3
-4
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Async 0.1.23
|
||||
// Type definitions for Async 0.9.2
|
||||
// Project: https://github.com/caolan/async
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -9,7 +9,6 @@ interface ErrorCallback { (err?: Error): void; }
|
||||
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
|
||||
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
|
||||
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
|
||||
interface AsyncTimesCallback<T> { (n: number, callback: AsyncResultArrayCallback<T>): void; }
|
||||
|
||||
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
|
||||
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
|
||||
@@ -105,8 +104,8 @@ interface Async {
|
||||
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
|
||||
nextTick(callback: Function): void;
|
||||
|
||||
times<T> (n: number, callback: AsyncTimesCallback<T>): void;
|
||||
timesSeries<T> (n: number, callback: AsyncTimesCallback<T>): void;
|
||||
times<R> (n: number, iterator: AsyncResultIterator<number, R>, callback: AsyncResultArrayCallback<R>): void;
|
||||
timesSeries<R> (n: number, iterator: AsyncResultIterator<number, R>, callback: AsyncResultArrayCallback<R>): void;
|
||||
|
||||
// Utils
|
||||
memoize(fn: Function, hasher?: Function): Function;
|
||||
|
||||
Vendored
+107
@@ -0,0 +1,107 @@
|
||||
// Type definitions for Atom API docs
|
||||
// Project: https://github.com/atom/atom/blob/master/build/tasks/docs-task.coffee
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/*
|
||||
How to generate.
|
||||
$ git clone git@github.com:atom/atom.git
|
||||
$ cd atom
|
||||
$ npm install
|
||||
$ cd build
|
||||
$ npm install
|
||||
$ grunt build-docs
|
||||
$ cd ../
|
||||
$ ls -la la docs/output/api.json
|
||||
api.json example https://gist.github.com/vvakame/10f8d2f3884affc32476
|
||||
*/
|
||||
|
||||
declare module AtomDocTypes {
|
||||
interface Metadata {
|
||||
classes: { [className: string]: ClassInfo; };
|
||||
}
|
||||
|
||||
interface ClassInfo {
|
||||
name: string;
|
||||
superClass: string;
|
||||
visibility: string;
|
||||
|
||||
filename: string;
|
||||
srcUrl: string;
|
||||
summary: string;
|
||||
description: string;
|
||||
examples: Example[];
|
||||
sections: Section[];
|
||||
|
||||
classMethods: ClassMethod[];
|
||||
classProperties: ClassProperty[];
|
||||
instanceMethods: InstanceMethod[];
|
||||
instanceProperties: InstanceProperty[];
|
||||
}
|
||||
|
||||
interface Example {
|
||||
description: string;
|
||||
lang: string;
|
||||
code: string;
|
||||
raw: string;
|
||||
}
|
||||
|
||||
interface Section {
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
interface ClassMethod {
|
||||
name: string;
|
||||
sectionName: string;
|
||||
srcUrl: string;
|
||||
visibility: string;
|
||||
summary: string;
|
||||
description: string;
|
||||
arguments: Argument[];
|
||||
returnValues: ReturnValue[];
|
||||
}
|
||||
|
||||
interface ClassProperty {
|
||||
}
|
||||
|
||||
interface InstanceMethod {
|
||||
name: string;
|
||||
sectionName: string;
|
||||
srcUrl: string;
|
||||
visibility: string;
|
||||
summary: string;
|
||||
description: string;
|
||||
arguments: Argument[];
|
||||
returnValues: ReturnValue[];
|
||||
titledArguments: TitledArgument[];
|
||||
}
|
||||
|
||||
interface InstanceProperty {
|
||||
name: string;
|
||||
sectionName: string;
|
||||
srcUrl: string;
|
||||
visibility: string;
|
||||
summary: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
interface Argument {
|
||||
name: string;
|
||||
description: string;
|
||||
type: string;
|
||||
isOptional: boolean;
|
||||
children: Argument[];
|
||||
}
|
||||
|
||||
interface TitledArgument {
|
||||
title: string;
|
||||
description: string;
|
||||
arguments: Argument[];
|
||||
}
|
||||
|
||||
interface ReturnValue {
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
||||
}
|
||||
Vendored
+16
@@ -1145,6 +1145,18 @@ declare module AtomCore {
|
||||
new(state:IAtomState):IAtom;
|
||||
}
|
||||
|
||||
class Disposable {
|
||||
constructor(disposalAction:any)
|
||||
dispose():void
|
||||
}
|
||||
|
||||
class CommandRegistry {
|
||||
add(target:string, commandName:string, callback:Function):Disposable
|
||||
findCommands(params:Object):Object[]
|
||||
dispatch(target:any,commandName:string):void
|
||||
}
|
||||
|
||||
|
||||
// https://atom.io/docs/api/v0.106.0/api/classes/Atom.html
|
||||
/* Global Atom class : instance members */
|
||||
interface IAtom {
|
||||
@@ -1175,6 +1187,8 @@ declare module AtomCore {
|
||||
workspace: IWorkspace;
|
||||
// really exists? end
|
||||
|
||||
commands: CommandRegistry;
|
||||
|
||||
initialize:Function;
|
||||
// registerRepresentationClass:Function;
|
||||
// registerRepresentationClasses:Function;
|
||||
@@ -1754,6 +1768,8 @@ declare module "atom" {
|
||||
cancel():any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var WorkspaceView:AtomCore.IWorkspaceViewStatic;
|
||||
|
||||
var Task:AtomCore.ITaskStatic;
|
||||
|
||||
@@ -7,6 +7,13 @@ browserSync({
|
||||
}
|
||||
});
|
||||
|
||||
// multiple base directory
|
||||
browserSync({
|
||||
server: {
|
||||
baseDir: ["app", "dist"]
|
||||
}
|
||||
});
|
||||
|
||||
browserSync({
|
||||
proxy: "yourlocal.dev"
|
||||
});
|
||||
@@ -62,4 +69,4 @@ evt.on("init", function () {
|
||||
console.log("BrowserSync is running!");
|
||||
});
|
||||
|
||||
browserSync(config);
|
||||
browserSync(config);
|
||||
|
||||
Vendored
+2
-2
@@ -65,7 +65,7 @@ declare module "browser-sync" {
|
||||
}
|
||||
|
||||
interface ServerOptions {
|
||||
baseDir?: string;
|
||||
baseDir?: string | string[];
|
||||
directory?: boolean;
|
||||
index?: string;
|
||||
routes?: {[path: string]: string};
|
||||
@@ -95,4 +95,4 @@ declare module "browser-sync" {
|
||||
}
|
||||
|
||||
export = BrowserSync;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -174,3 +174,26 @@ function catBlock () {
|
||||
// extraInfoSpec
|
||||
["blocking"]);
|
||||
}
|
||||
|
||||
// contrived settings example
|
||||
function proxySettings() {
|
||||
chrome.proxy.settings.get({ incognito: false }, (details) => {
|
||||
var val = details.value;
|
||||
var level: string = details.levelOfControl;
|
||||
var incognito: boolean = details.incognitoSpecific;
|
||||
});
|
||||
|
||||
// bare minimum set call
|
||||
chrome.proxy.settings.set({ value: 'something' });
|
||||
|
||||
// add a scope and callback
|
||||
chrome.proxy.settings.set({
|
||||
value: 'something',
|
||||
scope: 'regular'
|
||||
}, () => {});
|
||||
|
||||
chrome.proxy.settings.clear({});
|
||||
|
||||
// clear with a scope set
|
||||
chrome.proxy.settings.clear({ scope: 'regular' });
|
||||
}
|
||||
|
||||
Vendored
+9
-3
@@ -2061,8 +2061,11 @@ declare module chrome.ttsEngine {
|
||||
// Types
|
||||
////////////////////
|
||||
declare module chrome.types {
|
||||
interface ChromeSettingSetDetails {
|
||||
interface ChromeSettingClearDetails {
|
||||
scope?: string;
|
||||
}
|
||||
|
||||
interface ChromeSettingSetDetails extends ChromeSettingClearDetails {
|
||||
value: any;
|
||||
}
|
||||
|
||||
@@ -2070,6 +2073,8 @@ declare module chrome.types {
|
||||
incognito?: boolean;
|
||||
}
|
||||
|
||||
type DetailsCallback = (details: ChromeSettingGetResultDetails) => void;
|
||||
|
||||
interface ChromeSettingGetResultDetails {
|
||||
levelOfControl: string;
|
||||
value: any;
|
||||
@@ -2077,7 +2082,7 @@ declare module chrome.types {
|
||||
}
|
||||
|
||||
interface ChromeSettingChangedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: ChromeSettingGetResultDetails) => void): void;
|
||||
addListener(callback: DetailsCallback): void;
|
||||
}
|
||||
|
||||
interface ChromeSetting {
|
||||
@@ -2086,7 +2091,8 @@ declare module chrome.types {
|
||||
callback?: Function;
|
||||
};
|
||||
set(details: ChromeSettingSetDetails, callback?: Function): void;
|
||||
get(details: ChromeSettingGetDetails, callback?: ChromeSettingGetResultDetails): void;
|
||||
get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void;
|
||||
clear(details: ChromeSettingClearDetails, callback?: Function): void;
|
||||
onChange: ChromeSettingChangedEvent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/// <reference path="./connect-flash.d.ts" />
|
||||
|
||||
import express = require('express');
|
||||
import flash = require('connect-flash');
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(flash());
|
||||
app.use(flash({
|
||||
unsafe: false
|
||||
}));
|
||||
|
||||
app.use(function(req: Express.Request, res: Express.Response, next: Function) {
|
||||
req.flash('Message');
|
||||
req.flash('info', 'Message');
|
||||
});
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for connect-flash
|
||||
// Project: https://github.com/jaredhanson/connect-flash
|
||||
// Definitions by: Andreas Gassmann <https://github.com/AndreasGassmann/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module Express {
|
||||
export interface Request {
|
||||
flash(message: string): any;
|
||||
flash(event: string, message: string): any;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "connect-flash" {
|
||||
import express = require('express');
|
||||
interface IConnectFlashOptions {
|
||||
unsafe?: boolean;
|
||||
}
|
||||
function e(options?: IConnectFlashOptions): express.RequestHandler;
|
||||
export = e;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/// <reference path="../express/express.d.ts"/>
|
||||
|
||||
import express = require('express');
|
||||
import slashes = require('connect-slashes');
|
||||
|
||||
var app = express();
|
||||
|
||||
// Using default settings...
|
||||
app.use(slashes());
|
||||
|
||||
|
||||
// Remove slashes instead of adding them...
|
||||
app.use(slashes(false));
|
||||
|
||||
|
||||
// With additional options defined inline...
|
||||
app.use(slashes(true, {
|
||||
base: '/blog',
|
||||
code: 302,
|
||||
headers: {
|
||||
'Cache-Control': 'public',
|
||||
'Accpet': 'application/json'
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
// Defining an options object and referencing
|
||||
// it in the constructor...
|
||||
var options: slashes.Options = {
|
||||
base: '/blog',
|
||||
code: 302,
|
||||
headers: {
|
||||
'Cache-Control': 'public',
|
||||
'Accpet': 'application/json'
|
||||
}
|
||||
};
|
||||
app.use(slashes(true, options));
|
||||
|
||||
|
||||
// Defining an options object with only
|
||||
// some properties...
|
||||
var options: slashes.Options = {
|
||||
base: '/blog'
|
||||
}
|
||||
var options: slashes.Options = {
|
||||
code: 302
|
||||
}
|
||||
var options: slashes.Options = {
|
||||
headers: {
|
||||
'Cache-Control': 'public',
|
||||
'Accpet': 'application/json'
|
||||
}
|
||||
}
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
// Type definitions for connect-slashes
|
||||
// Project: https://github.com/avinoamr/connect-slashes
|
||||
// Definitions by: Sam Herrmann <https://github.com/samherrmann>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/* =================== USAGE ===================
|
||||
|
||||
import express = require('express');
|
||||
import slashes = require('connect-slashes');
|
||||
|
||||
var app = express();
|
||||
app.use(slashes());
|
||||
=============================================== */
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
|
||||
declare module "connect-slashes" {
|
||||
import express = require('express');
|
||||
|
||||
/**
|
||||
* @see https://github.com/avinoamr/connect-slashes#usage
|
||||
*/
|
||||
function slashes (addTrailingSlashes?: boolean, options?: slashes.Options): express.RequestHandler;
|
||||
|
||||
module slashes {
|
||||
|
||||
/**
|
||||
* Additional settings
|
||||
* @see https://github.com/avinoamr/connect-slashes#additional-settings
|
||||
*/
|
||||
interface Options {
|
||||
base?: string;
|
||||
code?: number;
|
||||
headers?: {[field: string]: string};
|
||||
}
|
||||
}
|
||||
|
||||
export = slashes;
|
||||
}
|
||||
+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,66 @@
|
||||
/// <reference path="cron.d.ts" />
|
||||
|
||||
import cron = require('cron');
|
||||
var CronJob = cron.CronJob;
|
||||
var CronTime = cron.CronTime;
|
||||
|
||||
var timeZone = 'America/Los_Angeles';
|
||||
|
||||
// Usage (basic cron usage):
|
||||
new CronJob('* * * * * *', () => {
|
||||
console.log('You will see this message every second');
|
||||
}, null, true, 'America/Los_Angeles');
|
||||
|
||||
// Another cron example
|
||||
var job = new CronJob('00 30 11 * * 1-5', () => {
|
||||
/*
|
||||
* Runs every weekday (Monday through Friday)
|
||||
* at 11:30:00 AM. It does not run on Saturday
|
||||
* or Sunday.
|
||||
*/
|
||||
}, () => {
|
||||
/* This function is executed when the job stops */
|
||||
},
|
||||
true, /* Start the job right now */
|
||||
timeZone /* Time zone of this job. */
|
||||
);
|
||||
|
||||
// Another example with Date
|
||||
var job = new CronJob(new Date(), () => {
|
||||
/* runs once at the specified date. */
|
||||
}, () => {
|
||||
/* This function is executed when the job stops */
|
||||
},
|
||||
true, /* Start the job right now */
|
||||
timeZone /* Time zone of this job. */
|
||||
);
|
||||
|
||||
// For good measure
|
||||
var job = new CronJob({
|
||||
cronTime: '00 30 11 * * 1-5',
|
||||
onTick: () => {
|
||||
/*
|
||||
* Runs every weekday (Monday through Friday)
|
||||
* at 11:30:00 AM. It does not run on Saturday
|
||||
* or Sunday.
|
||||
*/
|
||||
},
|
||||
start: false,
|
||||
timeZone: 'America/Los_Angeles'
|
||||
});
|
||||
job.start();
|
||||
|
||||
// How to check if a cron pattern is valid:
|
||||
try {
|
||||
new CronJob('invalid cron pattern', () => {
|
||||
console.log('this should not be printed');
|
||||
})
|
||||
} catch(ex) {
|
||||
console.log("cron pattern not valid");
|
||||
}
|
||||
|
||||
|
||||
// Check cronTime fomat
|
||||
new CronTime('* * * * * *');
|
||||
new CronTime(new Date());
|
||||
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// Type definitions for cron 1.0.9
|
||||
// Project: https://www.npmjs.com/package/cron
|
||||
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "cron" {
|
||||
|
||||
interface CronJobStatic {
|
||||
new(cronTime: string|Date, onTick: () => void, onComplete?: () => void, start?: boolean, timezone?: string, context?: any): CronJob;
|
||||
new(options: {
|
||||
cronTime: string|Date; onTick: () => void; onComplete?: () => void; start?: boolean; timezone?: string; context?: any
|
||||
}): CronJob;
|
||||
}
|
||||
interface CronJob {
|
||||
start(): void;
|
||||
stop(): void;
|
||||
}
|
||||
export var CronJob: CronJobStatic;
|
||||
|
||||
interface CronTimeStatic {
|
||||
new(time: string|Date): CronTime;
|
||||
}
|
||||
interface CronTime {}
|
||||
export var CronTime: CronTimeStatic;
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
+17
-20
@@ -2,19 +2,16 @@
|
||||
/// <reference path="sugarpak.d.ts" />
|
||||
|
||||
function tests() {
|
||||
// TypeScript alias
|
||||
var DateJS: IDateJSStatic = <any>Date;
|
||||
|
||||
// What date is next thursday?
|
||||
DateJS.today().next().thursday();
|
||||
// What date is next thursday?
|
||||
Date.today().next().thursday();
|
||||
|
||||
// Add 3 days to Today
|
||||
DateJS.today().add(3).days();
|
||||
Date.today().add(3).days();
|
||||
|
||||
// Is today Friday?
|
||||
DateJS.today().is().friday();
|
||||
Date.today().is().friday();
|
||||
|
||||
var is = DateJS.today().is();
|
||||
var is = Date.today().is();
|
||||
|
||||
// Number fun
|
||||
(3).days().ago();
|
||||
@@ -24,22 +21,22 @@ function tests() {
|
||||
n.months().fromNow();
|
||||
|
||||
// Set to 8:30 AM on the 15th day of the month
|
||||
DateJS.today().set(<any>{ day: 15, hour: 8, minute: 30 });
|
||||
Date.today().set(<any>{ day: 15, hour: 8, minute: 30 });
|
||||
|
||||
DateJS.today().is().january();
|
||||
DateJS.today().is().november();
|
||||
DateJS.today().add(1).day().is().saturday();
|
||||
Date.today().is().january();
|
||||
Date.today().is().november();
|
||||
Date.today().add(1).day().is().saturday();
|
||||
|
||||
// Convert text into Date
|
||||
DateJS.parse('today');
|
||||
DateJS.parse('t + 5 d'); // today + 5 days
|
||||
DateJS.parse('next thursday');
|
||||
DateJS.parse('February 20th 1973');
|
||||
DateJS.parse('Thu, 1 July 2004 22:30:00');
|
||||
Date.parse('today');
|
||||
Date.parse('t + 5 d'); // today + 5 days
|
||||
Date.parse('next thursday');
|
||||
Date.parse('February 20th 1973');
|
||||
Date.parse('Thu, 1 July 2004 22:30:00');
|
||||
|
||||
var future: IDateJS = DateJS.today().add(2).months();
|
||||
var someDate: IDateJS = DateJS.today().next().april().add(2).days();
|
||||
var future: IDateJS = Date.today().add(2).months();
|
||||
var someDate: IDateJS = Date.today().next().april().add(2).days();
|
||||
someDate.same().week(future); // true|false;
|
||||
someDate.same().day(); // true|false;
|
||||
DateJS.today().toObject().day;
|
||||
Date.today().toObject().day;
|
||||
}
|
||||
Vendored
+46
-38
@@ -1,8 +1,11 @@
|
||||
// Type definitions for DateJS
|
||||
// Type definitions for DateJS
|
||||
// Project: http://www.datejs.com/
|
||||
// Definitions by: David Khristepher Santos <http://github.com/rupertavery>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
//NOTE: This definition file is for the library located at http://datejs.googlecode.com/svn/ and documented at https://code.google.com/p/datejs/wiki/APIDocumentation
|
||||
//That version of the library is more recent than the one provided at https://code.google.com/p/datejs/downloads/list, which has a slightly different API
|
||||
|
||||
/** Defines a structure to be used in the add and set instance methods */
|
||||
interface IDateJSLiteral {
|
||||
milliseconds: number;
|
||||
@@ -15,13 +18,13 @@ interface IDateJSLiteral {
|
||||
}
|
||||
|
||||
/** DateJS Public Static Methods */
|
||||
interface IDateJSStatic extends IDateJS {
|
||||
interface DateConstructor {
|
||||
/** Gets a date that is set to the current date. The time is set to the start of the day (00:00 or 12:00 AM) */
|
||||
today(): IDateJS;
|
||||
today(): Date;
|
||||
/** Compares the first date to the second date and returns an number indication of their relative values. -1 = this is lessthan date. 0 = values are equal. 1 = this is greaterthan date. */
|
||||
compare(date1: IDateJS, date2: IDateJS): number;
|
||||
compare(date1: Date, date2: Date): number;
|
||||
/** Compares the first Date object to the second Date object and returns true if they are equal. */
|
||||
equals(date1: IDateJS, date2?: IDateJS): boolean;
|
||||
equals(date1: Date, date2?: Date): boolean;
|
||||
/** Gets the day number (0-6) if given a culture-specific string which is a valid full or abbreviated day name. */
|
||||
getDayNumberFromName(dayName: string): number;
|
||||
/** Gets the month number (0-11) if given a culture-specific string which is a valid full or abbreviated month name. */
|
||||
@@ -35,11 +38,11 @@ interface IDateJSStatic extends IDateJS {
|
||||
/** Gets the timezone offset if given a culture-specific string which is a valid full or abbreviated timezone name and a boolean indicating whether daylight savings time is in effect. */
|
||||
getTimezoneOffset(timezoneAbbreviation?: string, isDayLightSavingsTime?: boolean): number;
|
||||
/** Converts the specified string value into its JavaScript Date equivalent using culture-specific format information. */
|
||||
parse(dateString: string): IDateJS;
|
||||
parse(dateString: string): Date;
|
||||
/** Converts the specified string value into its JavaScript Date equivalent using the specified format. The format of the string value must match one of the supplied formats exactly. */
|
||||
parseExact(dateString: string, formatString: string): IDateJS;
|
||||
parseExact(dateString: string, formatString: string): Date;
|
||||
/** Converts the specified string value into its JavaScript Date equivalent using the specified formats (array). The format of the string value must match one of the supplied formats exactly. */
|
||||
parseExact(dateString: string, formatArray: string[]): IDateJS;
|
||||
parseExact(dateString: string, formatArray: string[]): Date;
|
||||
/** Validates the number is within an acceptable range for the days in a month [0-MaxDaysInMonth]. */
|
||||
validateDay(day: number, fullYear: number, monthNumber: number): boolean;
|
||||
/** Validates the number is within an acceptable range for hours[0 - 23].Returns true if within range, otherwise false. */
|
||||
@@ -57,45 +60,45 @@ interface IDateJSStatic extends IDateJS {
|
||||
}
|
||||
|
||||
/** DateJS Public Instance Methods */
|
||||
interface IDateJS extends Date {
|
||||
interface Date {
|
||||
/** Adds(or subtracts) to the value of the year, month, day, hour, minute, second, millisecond of the date instance using given configuration object. Positive and Negative values allowed. */
|
||||
add(config?: IDateJSLiteral): IDateJS;
|
||||
add(config?: IDateJSLiteral): Date;
|
||||
/** Adds the specified number of milliseconds to this instance. */
|
||||
addMilliseconds(milliseconds: number): IDateJS;
|
||||
addMilliseconds(milliseconds: number): Date;
|
||||
/** Adds the specified number of seconds to this instance given the number of seconds to add.The number can be positive or negative. */
|
||||
addSeconds(seconds: number): IDateJS;
|
||||
addSeconds(seconds: number): Date;
|
||||
/** Adds the specified number of minutes to this instance given the number of minutes to add.The number can be positive or negative. */
|
||||
addMinutes(minutes: number): IDateJS;
|
||||
addMinutes(minutes: number): Date;
|
||||
/** Adds the specified number of hours to this instance given the number of hours to add.The number can be positive or negative. */
|
||||
addHours(hours: number): IDateJS;
|
||||
addHours(hours: number): Date;
|
||||
/** Adds the specified number of days to this instance.The number can be positive or negative. */
|
||||
addDays(days: number): IDateJS;
|
||||
addDays(days: number): Date;
|
||||
/** Adds the specified number of weeks to this instance given the number of weeks to add.The number can be positive or negative. */
|
||||
addWeeks(weeks: number): IDateJS;
|
||||
addWeeks(weeks: number): Date;
|
||||
/** Adds the specified number of months to this instance given the number of months to add.The number can be positive or negative. */
|
||||
addMonths(months: number): IDateJS;
|
||||
addMonths(months: number): Date;
|
||||
/** Adds the specified number of years to this instance given the number of years to add.The number can be positive or negative. */
|
||||
addYears(years: number): IDateJS;
|
||||
addYears(years: number): Date;
|
||||
/** Resets the time of this Date object to 12:00 AM(00:00), which is the start of the day. */
|
||||
clearTime(): IDateJS;
|
||||
clearTime(): Date;
|
||||
/** Resets the time of this Date object to the current time('now'). */
|
||||
setTimeToNow(): IDateJS;
|
||||
setTimeToNow(): Date;
|
||||
/** Returns a new Date object that is an exact date and time copy of the original instance. */
|
||||
clone(): IDateJS;
|
||||
clone(): Date;
|
||||
/** Determines if this instance is between a range of two dates or equal to either the start or end dates. */
|
||||
between(startDate: IDateJS, endDate: IDateJS): boolean;
|
||||
between(startDate: Date, endDate: Date): boolean;
|
||||
/** Compares this instance to a Date object and returns an number indication of their relative values. -1 = this is lessthan date. 0 = values are equal. 1 = this is greaterthan date. */
|
||||
compareTo(date: IDateJS): number;
|
||||
compareTo(date: Date): number;
|
||||
/** Compares this instance to another Date object and returns true if they are equal, otherwise false. */
|
||||
equals(date: IDateJS): boolean;
|
||||
equals(date: Date): boolean;
|
||||
/** Determines if this date occurs after the date to compare to. */
|
||||
isAfter(date: IDateJS): boolean;
|
||||
isAfter(date: Date): boolean;
|
||||
/** Determines if this date occurs before the date to compare to. */
|
||||
isBefore(date: IDateJS): boolean;
|
||||
isBefore(date: Date): boolean;
|
||||
/** Determines if the current Date instance occurs on the same Date as the supplied 'date'. */
|
||||
isToday(date: IDateJS): boolean;
|
||||
isToday(date: Date): boolean;
|
||||
/** Returns the number of milliseconds between this date and date. */
|
||||
getElapsed(date: IDateJS): number;
|
||||
getElapsed(date: Date): number;
|
||||
/** Get the Ordinal day (numeric day number) of the year, adjusted for leap year. Returns 1 through 365 (366 in leap years) */
|
||||
getOrdinalNumber(): number;
|
||||
/** Get the timezone abbreviation of the current date. */
|
||||
@@ -107,30 +110,35 @@ interface IDateJS extends Date {
|
||||
/** Get the ISO 8601 week number. Week one ("01") is the week which contains the first Thursday of the year. Monday is considered the first day of the week. */
|
||||
getISOWeek(): string;
|
||||
/** Moves the date to Monday of the week set. Week one (1) is the week which contains the first Thursday of the year. */
|
||||
setWeek(week: number): IDateJS;
|
||||
setWeek(week: number): Date;
|
||||
/** Indicates whether Daylight Saving Time is observed in the current time zone. */
|
||||
hasDaylightSavingTime(): boolean;
|
||||
/** Indicates whether this Date instance is within the Daylight Saving Time range for the current time zone. */
|
||||
isDaylightSavingTime(): boolean;
|
||||
/** Move to the next or previous dayOfWeek. Whether to move into the future (+1) or past(-1) is controlled by the optional direction parameter. */
|
||||
moveToDayOfWeek(dayOfWeek: number, direction: number): IDateJS;
|
||||
/** Move to the next or previous dayOfWeek. Whether to move into the future (+1) or past(-1) is controlled by the optional direction parameter. */
|
||||
moveToDayOfWeek(dayOfWeek: number, direction: number): Date;
|
||||
/** Moves the date to the first day of the month. */
|
||||
moveToFirstDayOfMonth(): IDateJS;
|
||||
moveToFirstDayOfMonth(): Date;
|
||||
/** Moves the date to the last day of the month. */
|
||||
moveToLastDayOfMonth(): IDateJS;
|
||||
moveToLastDayOfMonth(): Date;
|
||||
/** Move to the next or previous month.Whether to move into the future(+1) or past(-1) is controlled by the optional direction parameter. */
|
||||
moveToMonth(month: number, direction: number): IDateJS;
|
||||
moveToMonth(month: number, direction: number): Date;
|
||||
/** Moves the date to the next nth occurrence of the dayOfWeek starting from the beginning of the month. The number (-1) is a magic number and will return the last occurrence of the dayOfWeek in the month. */
|
||||
moveToNthOccurrence(dayOfWeek: number, occurrence: number): IDateJS;
|
||||
moveToNthOccurrence(dayOfWeek: number, occurrence: number): Date;
|
||||
/** Set the value of year, month, day, hour, minute, second, millisecond of date instance using given configuration object. */
|
||||
set(config: IDateJSLiteral): IDateJS;
|
||||
set(config: IDateJSLiteral): Date;
|
||||
/** Set the timezone for the current date using a culture - specific timezone abbreviation("PST").Note that in most JavaScript implementations, this will appear to change the time since the timezone is always based on the locale. */
|
||||
setTimezone(timezoneAbbreviation: string): IDateJS;
|
||||
setTimezone(timezoneAbbreviation: string): Date;
|
||||
/** Set the timezone for the current date using an offset(-0700).Note that in most JavaScript implementations, this will appear to change the time since the timezone is always based on the locale. */
|
||||
setTimezoneOffset(timezoneOffset: number): IDateJS;
|
||||
setTimezoneOffset(timezoneOffset: number): Date;
|
||||
/** Converts the current date instance into a string with an ISO 8601 format.The date is converted to it's UTC value. As per the ISO 8601 specification, the string will be wrapped with double quotation marks ("). */
|
||||
toISOString(): string;
|
||||
/** Converts the value of the current Date object to its equivalent string representation.Use format argument to specify format(optional).See FormatSpecifiers for more info. */
|
||||
toString(format?: string): string;
|
||||
}
|
||||
|
||||
|
||||
//NOTE: IDateJSStatic and IDateJS are provided here solely for backwards compatability with previous versions of this particular definition file (datejs.d.ts.)
|
||||
//DO NOT use them in new code (and it is strongly suggested you remove their use in any existing code); simply use the Javascript Date class instead.
|
||||
interface IDateJS extends Date { }
|
||||
interface IDateJSStatic extends DateConstructor { }
|
||||
Vendored
+113
-113
@@ -1,4 +1,4 @@
|
||||
// Type definitions for DateJS - SugarPak Extensions
|
||||
// Type definitions for DateJS - SugarPak Extensions
|
||||
// Project: http://www.datejs.com/
|
||||
// Definitions by: David Khristepher Santos <http://github.com/rupertavery>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -7,67 +7,67 @@
|
||||
declare module sugarpak {
|
||||
|
||||
export interface IAddOrientation {
|
||||
millisecond(): IDateJS;
|
||||
second(): IDateJS;
|
||||
minute(): IDateJS;
|
||||
hour(): IDateJS;
|
||||
day(): IDateJS;
|
||||
week(): IDateJS;
|
||||
month(): IDateJS;
|
||||
year(): IDateJS;
|
||||
millisecond(): Date;
|
||||
second(): Date;
|
||||
minute(): Date;
|
||||
hour(): Date;
|
||||
day(): Date;
|
||||
week(): Date;
|
||||
month(): Date;
|
||||
year(): Date;
|
||||
|
||||
milliseconds(): IDateJS;
|
||||
seconds(): IDateJS;
|
||||
minutes(): IDateJS;
|
||||
hours(): IDateJS;
|
||||
days(): IDateJS;
|
||||
weeks(): IDateJS;
|
||||
months(): IDateJS;
|
||||
years(): IDateJS;
|
||||
milliseconds(): Date;
|
||||
seconds(): Date;
|
||||
minutes(): Date;
|
||||
hours(): Date;
|
||||
days(): Date;
|
||||
weeks(): Date;
|
||||
months(): Date;
|
||||
years(): Date;
|
||||
}
|
||||
|
||||
export interface IOrientation extends IAddOrientation {
|
||||
monday(): IDateJS;
|
||||
tuesday(): IDateJS;
|
||||
wednesday(): IDateJS;
|
||||
thursday(): IDateJS;
|
||||
friday(): IDateJS;
|
||||
saturday(): IDateJS;
|
||||
sunday(): IDateJS;
|
||||
monday(): Date;
|
||||
tuesday(): Date;
|
||||
wednesday(): Date;
|
||||
thursday(): Date;
|
||||
friday(): Date;
|
||||
saturday(): Date;
|
||||
sunday(): Date;
|
||||
|
||||
mon(): IDateJS;
|
||||
tue(): IDateJS;
|
||||
wed(): IDateJS;
|
||||
thu(): IDateJS;
|
||||
fri(): IDateJS;
|
||||
sat(): IDateJS;
|
||||
sun(): IDateJS;
|
||||
mon(): Date;
|
||||
tue(): Date;
|
||||
wed(): Date;
|
||||
thu(): Date;
|
||||
fri(): Date;
|
||||
sat(): Date;
|
||||
sun(): Date;
|
||||
|
||||
january(): IDateJS;
|
||||
february(): IDateJS;
|
||||
march(): IDateJS;
|
||||
april(): IDateJS;
|
||||
may(): IDateJS;
|
||||
june(): IDateJS;
|
||||
july(): IDateJS;
|
||||
august(): IDateJS;
|
||||
september(): IDateJS;
|
||||
october(): IDateJS;
|
||||
november(): IDateJS;
|
||||
december(): IDateJS;
|
||||
january(): Date;
|
||||
february(): Date;
|
||||
march(): Date;
|
||||
april(): Date;
|
||||
may(): Date;
|
||||
june(): Date;
|
||||
july(): Date;
|
||||
august(): Date;
|
||||
september(): Date;
|
||||
october(): Date;
|
||||
november(): Date;
|
||||
december(): Date;
|
||||
|
||||
jan(): IDateJS;
|
||||
feb(): IDateJS;
|
||||
mar(): IDateJS;
|
||||
apr(): IDateJS;
|
||||
jan(): Date;
|
||||
feb(): Date;
|
||||
mar(): Date;
|
||||
apr(): Date;
|
||||
// may
|
||||
jun(): IDateJS;
|
||||
jul(): IDateJS;
|
||||
aug(): IDateJS;
|
||||
sep(): IDateJS;
|
||||
oct(): IDateJS;
|
||||
nov(): IDateJS;
|
||||
dec(): IDateJS;
|
||||
jun(): Date;
|
||||
jul(): Date;
|
||||
aug(): Date;
|
||||
sep(): Date;
|
||||
oct(): Date;
|
||||
nov(): Date;
|
||||
dec(): Date;
|
||||
}
|
||||
|
||||
export interface IPredicate {
|
||||
@@ -116,30 +116,30 @@ declare module sugarpak {
|
||||
|
||||
weekday(): boolean;
|
||||
|
||||
day(date?: IDateJS): boolean;
|
||||
week(date?: IDateJS): boolean;
|
||||
month(date?: IDateJS): boolean;
|
||||
year(date?: IDateJS): boolean;
|
||||
day(date?: Date): boolean;
|
||||
week(date?: Date): boolean;
|
||||
month(date?: Date): boolean;
|
||||
year(date?: Date): boolean;
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface IDatePartComparer {
|
||||
millisecond(date?: IDateJS): boolean;
|
||||
second(date?: IDateJS): boolean;
|
||||
minute(date?: IDateJS): boolean;
|
||||
hour(date?: IDateJS): boolean;
|
||||
day(date?: IDateJS): boolean;
|
||||
week(date?: IDateJS): boolean;
|
||||
month(date?: IDateJS): boolean;
|
||||
year(date?: IDateJS): boolean;
|
||||
millisecond(date?: Date): boolean;
|
||||
second(date?: Date): boolean;
|
||||
minute(date?: Date): boolean;
|
||||
hour(date?: Date): boolean;
|
||||
day(date?: Date): boolean;
|
||||
week(date?: Date): boolean;
|
||||
month(date?: Date): boolean;
|
||||
year(date?: Date): boolean;
|
||||
}
|
||||
|
||||
export interface IDateElementEvaluator {
|
||||
ago(): IDateJS;
|
||||
before(): IDateJS;
|
||||
fromNow(): IDateJS;
|
||||
after(): IDateJS;
|
||||
ago(): Date;
|
||||
before(): Date;
|
||||
fromNow(): Date;
|
||||
after(): Date;
|
||||
}
|
||||
|
||||
export interface IDateElement {
|
||||
@@ -178,10 +178,10 @@ declare module sugarpak {
|
||||
|
||||
}
|
||||
|
||||
interface IDateJS {
|
||||
interface Date {
|
||||
add(n: number): sugarpak.IAddOrientation;
|
||||
at(time: string): IDateJS;
|
||||
at(time: sugarpak.ITimeLiteral): IDateJS;
|
||||
at(time: string): Date;
|
||||
at(time: sugarpak.ITimeLiteral): Date;
|
||||
is(): sugarpak.IPredicate;
|
||||
next(): sugarpak.IOrientation;
|
||||
last(): sugarpak.IOrientation;
|
||||
@@ -199,7 +199,7 @@ interface IDateJS {
|
||||
toObject(): sugarpak.IDateLiteral;
|
||||
}
|
||||
|
||||
interface IDateJSStatic {
|
||||
interface DateConstructor {
|
||||
/** Contains the day-of-week value for Monday */
|
||||
MONDAY: number;
|
||||
/** Contains the day-of-week value for Tuesday */
|
||||
@@ -215,57 +215,57 @@ interface IDateJSStatic {
|
||||
/** Contains the day-of-week value for Sunday */
|
||||
SUNDAY: number;
|
||||
/** Instantiates a DateJS object from a literal */
|
||||
fromObject(date: sugarpak.IDateLiteral): IDateJS;
|
||||
fromObject(date: sugarpak.IDateLiteral): Date;
|
||||
|
||||
next(): sugarpak.IOrientation;
|
||||
last(): sugarpak.IOrientation;
|
||||
prev(): sugarpak.IOrientation;
|
||||
previous(): sugarpak.IOrientation;
|
||||
|
||||
january(): IDateJS;
|
||||
february(): IDateJS;
|
||||
march(): IDateJS;
|
||||
april(): IDateJS;
|
||||
may(): IDateJS;
|
||||
june(): IDateJS;
|
||||
july(): IDateJS;
|
||||
august(): IDateJS;
|
||||
september(): IDateJS;
|
||||
october(): IDateJS;
|
||||
november(): IDateJS;
|
||||
december(): IDateJS;
|
||||
january(): Date;
|
||||
february(): Date;
|
||||
march(): Date;
|
||||
april(): Date;
|
||||
may(): Date;
|
||||
june(): Date;
|
||||
july(): Date;
|
||||
august(): Date;
|
||||
september(): Date;
|
||||
october(): Date;
|
||||
november(): Date;
|
||||
december(): Date;
|
||||
|
||||
monday(): IDateJS;
|
||||
tuesday(): IDateJS;
|
||||
wednesday(): IDateJS;
|
||||
thursday(): IDateJS;
|
||||
friday(): IDateJS;
|
||||
saturday(): IDateJS;
|
||||
sunday(): IDateJS;
|
||||
monday(): Date;
|
||||
tuesday(): Date;
|
||||
wednesday(): Date;
|
||||
thursday(): Date;
|
||||
friday(): Date;
|
||||
saturday(): Date;
|
||||
sunday(): Date;
|
||||
|
||||
mon(): IDateJS;
|
||||
tue(): IDateJS;
|
||||
wed(): IDateJS;
|
||||
thu(): IDateJS;
|
||||
fri(): IDateJS;
|
||||
sat(): IDateJS;
|
||||
sun(): IDateJS;
|
||||
mon(): Date;
|
||||
tue(): Date;
|
||||
wed(): Date;
|
||||
thu(): Date;
|
||||
fri(): Date;
|
||||
sat(): Date;
|
||||
sun(): Date;
|
||||
|
||||
jan(): IDateJS;
|
||||
feb(): IDateJS;
|
||||
mar(): IDateJS;
|
||||
apr(): IDateJS;
|
||||
jan(): Date;
|
||||
feb(): Date;
|
||||
mar(): Date;
|
||||
apr(): Date;
|
||||
// may
|
||||
jun(): IDateJS;
|
||||
jul(): IDateJS;
|
||||
aug(): IDateJS;
|
||||
sep(): IDateJS;
|
||||
oct(): IDateJS;
|
||||
nov(): IDateJS;
|
||||
dec(): IDateJS;
|
||||
jun(): Date;
|
||||
jul(): Date;
|
||||
aug(): Date;
|
||||
sep(): Date;
|
||||
oct(): Date;
|
||||
nov(): Date;
|
||||
dec(): Date;
|
||||
|
||||
}
|
||||
|
||||
interface Number extends sugarpak.IDateElement {
|
||||
// extend the Number type with all the IDateJS goodness
|
||||
// extend the Number type with all the Date goodness
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/// <reference path="./donna.d.ts" />
|
||||
|
||||
import donna = require("donna");
|
||||
var metadata = donna.generateMetadata(['/path/to/my-module', '/path/to/another-module']);
|
||||
|
||||
metadata = {
|
||||
"files": {
|
||||
"spec/metadata_templates/classes/class_with_prototype_properties.coffee": {
|
||||
"objects": {
|
||||
"3": {
|
||||
"0": {
|
||||
"type": "class",
|
||||
"name": "TextBuffer",
|
||||
"bindingType": null,
|
||||
"classProperties": [],
|
||||
"prototypeProperties": [
|
||||
[
|
||||
4,
|
||||
9
|
||||
],
|
||||
[
|
||||
11,
|
||||
11
|
||||
]
|
||||
],
|
||||
"doc": " Public: A mutable text container with undo/redo support and the ability to\nannotate logical regions in the text.\n\n ",
|
||||
"range": [
|
||||
[
|
||||
3,
|
||||
0
|
||||
],
|
||||
[
|
||||
11,
|
||||
17
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"4": {
|
||||
"9": {
|
||||
"name": "prop2",
|
||||
"type": "primitive",
|
||||
"range": [
|
||||
[
|
||||
4,
|
||||
9
|
||||
],
|
||||
[
|
||||
4,
|
||||
13
|
||||
]
|
||||
],
|
||||
"bindingType": "prototypeProperty"
|
||||
}
|
||||
},
|
||||
"11": {
|
||||
"11": {
|
||||
"name": "method2",
|
||||
"bindingType": "prototypeProperty",
|
||||
"type": "function",
|
||||
"paramNames": [
|
||||
"a"
|
||||
],
|
||||
"range": [
|
||||
[
|
||||
11,
|
||||
11
|
||||
],
|
||||
[
|
||||
11,
|
||||
16
|
||||
]
|
||||
],
|
||||
"doc": " Public: Takes an argument and does some stuff.\n\na - A {String}\n\nReturns {Boolean}. "
|
||||
}
|
||||
}
|
||||
},
|
||||
"exports": {}
|
||||
}
|
||||
}
|
||||
};
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for donna
|
||||
// Project: https://github.com/atom/donna
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "donna" {
|
||||
function generateMetadata(modules: string[]): DonnaTypes.Metadata;
|
||||
}
|
||||
|
||||
declare module DonnaTypes {
|
||||
interface Metadata {
|
||||
files: { [filePath: string]: File; };
|
||||
}
|
||||
|
||||
interface File {
|
||||
objects: { [line: number]: Line; };
|
||||
exports: any;
|
||||
}
|
||||
|
||||
interface Line {
|
||||
[row: number]: Object;
|
||||
}
|
||||
|
||||
interface Object {
|
||||
type: string;
|
||||
name: string;
|
||||
bindingType: string;
|
||||
classProperties?: any[];
|
||||
prototypeProperties?: number[][];
|
||||
doc?: string;
|
||||
range: number[][];
|
||||
|
||||
}
|
||||
}
|
||||
+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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/// <reference path="./easy-session.d.ts" />
|
||||
/// <reference path="../express-session/express-session.d.ts" />
|
||||
/// <reference path="../cookie-parser/cookie-parser.d.ts" />
|
||||
|
||||
import express = require('express');
|
||||
import session = require('express-session');
|
||||
import cookieParser = require('cookie-parser');
|
||||
import easySession = require('easy-session'); // Require the module : line 1
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(cookieParser('secreet'));
|
||||
app.use(session({
|
||||
secret: 'keyboard cat',
|
||||
resave: false,
|
||||
saveUninitialized: true
|
||||
}));
|
||||
app.use(easySession.main(session));
|
||||
|
||||
app.get('/login', function (req, res, next) {
|
||||
req.session.login('user', {email: 'email'}, function (err) {
|
||||
if(err) {
|
||||
res.send(500);
|
||||
return;
|
||||
}
|
||||
res.send(200);
|
||||
});
|
||||
});
|
||||
|
||||
app.post('/logout', function (req, res, next) {
|
||||
req.session.logout(function (err) {
|
||||
if(err) {
|
||||
res.send(500);
|
||||
return;
|
||||
}
|
||||
res.send(200);
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/isloggedin', function (req, res, next) {
|
||||
res.send(req.session.isLoggedIn('user'));
|
||||
});
|
||||
|
||||
app.get('/isfresh', function (req, res, next) {
|
||||
res.send(req.session.isFresh());
|
||||
});
|
||||
|
||||
app.get('/hasrole', function (req, res, next) {
|
||||
res.send(req.session.hasRole('user'));
|
||||
});
|
||||
|
||||
app.post('/setrole', function (req, res, next) {
|
||||
req.session.setRole(req.query.role);
|
||||
res.send(200);
|
||||
});
|
||||
|
||||
app.get('/getrole', function (req, res, next) {
|
||||
res.send(req.session.getRole());
|
||||
});
|
||||
|
||||
app.use(easySession.isLoggedIn());
|
||||
app.use(easySession.isFresh());
|
||||
app.use(easySession.checkRole('user'));
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
// Type definitions for easy-session
|
||||
// Project: https://github.com/DeadAlready/node-easy-session
|
||||
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module Express {
|
||||
interface ErrorCallback {
|
||||
(err?: any): void;
|
||||
}
|
||||
export interface Session {
|
||||
login(callback: Function): void;
|
||||
login(extend: Object, callback: ErrorCallback): void;
|
||||
login(role: string, callback: ErrorCallback): void;
|
||||
login(role: string, extend: Object, callback: ErrorCallback): void;
|
||||
logout(callback: ErrorCallback): void;
|
||||
isLoggedIn(role?: string): boolean;
|
||||
isGuest(): boolean;
|
||||
isFresh(): boolean;
|
||||
setRole(role: string): Session;
|
||||
getRole(): string;
|
||||
hasRole(role: string): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "easy-session" {
|
||||
import express = require('express');
|
||||
|
||||
interface SessionOptions {
|
||||
ipCheck?: boolean;
|
||||
uaCheck?: boolean;
|
||||
freshTimeout?: number;
|
||||
maxFreshTimeout?: number;
|
||||
}
|
||||
|
||||
export function main(session: any, options?: SessionOptions): express.RequestHandler;
|
||||
export function isLoggedIn(errorCallback?: Function): express.RequestHandler;
|
||||
export function isFresh(errorCallback?: Function): express.RequestHandler;
|
||||
export function checkRole(role: string, errorCallback?: Function): express.RequestHandler;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -537,19 +537,19 @@ declare module "express" {
|
||||
sendFile(path: string, options: any, fn: Errback): void;
|
||||
|
||||
/**
|
||||
* deprecated, use sendFile instead.
|
||||
* @deprecated Use sendFile instead.
|
||||
*/
|
||||
sendfile(path: string): void;
|
||||
/**
|
||||
* deprecated, use sendFile instead.
|
||||
* @deprecated Use sendFile instead.
|
||||
*/
|
||||
sendfile(path: string, options: any): void;
|
||||
/**
|
||||
* deprecated, use sendFile instead.
|
||||
* @deprecated Use sendFile instead.
|
||||
*/
|
||||
sendfile(path: string, fn: Errback): void;
|
||||
/**
|
||||
* deprecated, use sendFile instead.
|
||||
* @deprecated Use sendFile instead.
|
||||
*/
|
||||
sendfile(path: string, options: any, fn: Errback): void;
|
||||
|
||||
|
||||
@@ -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,22 +36,28 @@ gradient = {
|
||||
|
||||
var color = "#fcfcff";
|
||||
|
||||
var backgound: HighchartsColorOrGradient;
|
||||
|
||||
backgound = gradient;
|
||||
backgound = color;
|
||||
|
||||
var chart1 = new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: "container"
|
||||
},
|
||||
xAxis: [{
|
||||
}],
|
||||
series: [{
|
||||
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
|
||||
series: [<HighchartsLineChartSeriesOptions>{
|
||||
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
|
||||
type: "line",
|
||||
allowPointSelect: true
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
chart1.addSeries<HighchartsBarChartSeriesOptions>({
|
||||
enableMouseTracking: true,
|
||||
data: [1, 2, 3, 4, 5]
|
||||
});
|
||||
|
||||
|
||||
console.log((<HighchartsLineChartSeriesOptions>chart1.series[0].options).dashStyle);
|
||||
|
||||
var chart2 = new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'container',
|
||||
@@ -63,7 +87,7 @@ var chart2 = new Highcharts.Chart({
|
||||
legend: {
|
||||
enabled: false
|
||||
},
|
||||
series: [{
|
||||
series: [<HighchartsScatterChartSeriesOptions>{
|
||||
data: [
|
||||
[550, 870], [738, 362], [719, 711], [547, 665], [595, 197], [332, 144],
|
||||
[581, 555], [196, 862], [6, 837], [400, 924], [888, 148], [785, 730],
|
||||
@@ -105,15 +129,11 @@ var highChartSettings: HighchartsOptions = {
|
||||
},
|
||||
xAxis: [{
|
||||
}],
|
||||
series: [{
|
||||
series: [<HighchartsPieChartSeriesOptions>{
|
||||
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
|
||||
}]
|
||||
};
|
||||
|
||||
var container = $("#container").highcharts(highChartSettings, function (chart) {
|
||||
var container = $("#container").highcharts(highChartSettings, (chart) => {
|
||||
chart.series[0].setVisible(true, true);
|
||||
});
|
||||
|
||||
var options = Highcharts.getOptions();
|
||||
|
||||
var options2 = Highcharts.setOptions(options);
|
||||
});
|
||||
Vendored
+437
-234
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
/// <reference path="highstock.d.ts" />
|
||||
|
||||
var someData = [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||
|
||||
$(function () {
|
||||
$('#container').highcharts('StockChart', {
|
||||
|
||||
chart: {
|
||||
type: "arearange"
|
||||
},
|
||||
|
||||
navigator: {
|
||||
height: 80,
|
||||
maskFill: 'rgba(255, 198, 220, 0.75)',
|
||||
handles: {
|
||||
backgroundColor: 'yellow',
|
||||
borderColor: 'red'
|
||||
}
|
||||
},
|
||||
|
||||
rangeSelector: {
|
||||
allButtonsEnabled: true,
|
||||
selected: 1,
|
||||
buttonTheme: { // styles for the buttons
|
||||
fill: 'none',
|
||||
stroke: 'none',
|
||||
'stroke-width': 0,
|
||||
r: 8,
|
||||
style: {
|
||||
color: '#039',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
},
|
||||
select: {
|
||||
fill: '#039',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputBoxBorderColor: 'gray',
|
||||
inputBoxWidth: 120,
|
||||
inputBoxHeight: 18,
|
||||
inputStyle: {
|
||||
color: '#039',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
|
||||
series: [<HighchartsAreaRangeChartSeriesOptions>{
|
||||
name: 'USD to EUR',
|
||||
data: someData,
|
||||
lineColor: "blue"
|
||||
}]
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+120
@@ -0,0 +1,120 @@
|
||||
// Type definitions for Highstock 2.1.5
|
||||
// Project: http://www.highcharts.com/
|
||||
// Definitions by: David Deutsch <http://github.com/DavidKDeutsch>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="highcharts.d.ts" />
|
||||
|
||||
interface HighstockChartObject extends HighchartsChartObject {
|
||||
options: HighstockOptions;
|
||||
}
|
||||
|
||||
interface HighstockNavigatorOptions {
|
||||
adaptToUpdatedData?: boolean;
|
||||
baseSeries?: string | number;
|
||||
enabled?: boolean;
|
||||
handles?: {
|
||||
backgoundColor?: string;
|
||||
borderColor?: string;
|
||||
};
|
||||
height?: number;
|
||||
margin?: number;
|
||||
maskFill?: string;
|
||||
maskInside?: boolean;
|
||||
outlineColor?: string;
|
||||
outlineWidth?: number;
|
||||
series?: HighchartsIndividualSeriesOptions;
|
||||
xAxis?: HighchartsAxisOptions;
|
||||
yAxis?: HighchartsAxisOptions;
|
||||
}
|
||||
|
||||
interface RangeSelectorButton {
|
||||
type: string; //Defines the timespan, can be one of 'millisecond', 'second', 'minute', 'day', 'week', 'month', 'ytd' (year to date), 'year' and 'all'.
|
||||
count: number;
|
||||
text: string;
|
||||
dataGrouping?: any; //not sure how this works
|
||||
}
|
||||
|
||||
interface HighstockRangeSelectorOptions {
|
||||
allButtonsEnabled?: boolean;
|
||||
buttonSpacing?: number;
|
||||
buttonTheme?: any;
|
||||
buttons?: RangeSelectorButton[];
|
||||
enabled?: boolean;
|
||||
inputBoxBorderColor?: string;
|
||||
inputBoxHeight?: number;
|
||||
inputBoxWidth?: number;
|
||||
inputDateFormat?: string;
|
||||
inputDateParser?: (date: string) => number;
|
||||
inputEditDateFormat?: string;
|
||||
inputEnabled?: boolean;
|
||||
inputPosition?: {
|
||||
align?: string;
|
||||
verticalAlign?: string;
|
||||
x?: number;
|
||||
y?: number;
|
||||
};
|
||||
inputStyle?: HighchartsCSSObject;
|
||||
labelStyle?: HighchartsCSSObject;
|
||||
selected?: number;
|
||||
}
|
||||
|
||||
interface HighstockScrollbarOptions {
|
||||
barBackgroundColor?: string;
|
||||
barBorderColor?: string;
|
||||
barBorderRadius?: number;
|
||||
barBorderWidth?: number;
|
||||
buttonArrowColor?: string;
|
||||
buttonBackgroundColor?: string;
|
||||
buttonBorderColor?: string;
|
||||
buttonBorderRadius?: number;
|
||||
buttonBorderWidth?: number;
|
||||
enabled?: boolean;
|
||||
height?: number;
|
||||
liveRedraw?: boolean;
|
||||
minWidth?: number;
|
||||
rifleColor?: string;
|
||||
trackBackgroundColor?: string;
|
||||
trackBorderColor?: string;
|
||||
trackBorderRadius?: number;
|
||||
trackBorderWidth?: number;
|
||||
}
|
||||
|
||||
interface HighstockOptions extends HighchartsOptions {
|
||||
navigator?: HighstockNavigatorOptions;
|
||||
rangeSelector?: HighstockRangeSelectorOptions;
|
||||
scrollbar?: HighstockScrollbarOptions;
|
||||
}
|
||||
|
||||
interface HighstockChart {
|
||||
new (options: HighstockOptions): HighstockChartObject;
|
||||
new (options: HighstockOptions, callback: (chart: HighstockChartObject) => void): HighstockChartObject;
|
||||
}
|
||||
|
||||
interface HighchartsStatic {
|
||||
StockChart: HighstockChart;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
highcharts(type: "StockChart"): HighstockChartObject;
|
||||
/**
|
||||
* Creates a new Highcharts.Chart for the current JQuery selector; usually
|
||||
* a div selected by $('#container')
|
||||
* @param {HighchartsOptions} options Options for this chart
|
||||
* @return current {JQuery} selector the current JQuery selector
|
||||
**/
|
||||
highcharts(type: "StockChart", options: HighstockOptions): JQuery;
|
||||
/**
|
||||
* Creates a new Highcharts.Chart for the current JQuery selector; usually
|
||||
* a div selected by $('#container')
|
||||
* @param {HighchartsOptions} options Options for this chart
|
||||
* @param callback Callback function used to manipulate the constructed chart instance
|
||||
* @return current {JQuery} selector the current JQuery selector
|
||||
**/
|
||||
highcharts(type: "StockChart", options: HighstockOptions, callback: (chart: HighstockChartObject) => void): JQuery;
|
||||
|
||||
|
||||
highcharts(type: string): HighchartsChartObject;
|
||||
highcharts(type: string, options: HighchartsOptions): JQuery;
|
||||
highcharts(type: string, options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): JQuery;
|
||||
}
|
||||
@@ -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,75 @@
|
||||
/// <reference path="inversify.d.ts" />
|
||||
|
||||
interface FooInterface {
|
||||
name : string;
|
||||
greet() : string;
|
||||
}
|
||||
|
||||
interface BarInterface {
|
||||
name : string;
|
||||
greet() : string;
|
||||
}
|
||||
|
||||
interface FooBarInterface {
|
||||
foo : FooInterface;
|
||||
bar : BarInterface;
|
||||
greet() : string;
|
||||
}
|
||||
|
||||
class Foo implements FooInterface {
|
||||
public name : string;
|
||||
constructor() {
|
||||
this.name = "foo";
|
||||
}
|
||||
public greet() : string {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar implements BarInterface {
|
||||
public name : string;
|
||||
constructor() {
|
||||
this.name = "bar";
|
||||
}
|
||||
public greet() : string {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
class FooBar implements FooBarInterface {
|
||||
public foo : FooInterface;
|
||||
public bar : BarInterface;
|
||||
constructor(FooInterface : FooInterface, BarInterface : BarInterface) {
|
||||
this.foo = FooInterface;
|
||||
this.bar = BarInterface;
|
||||
}
|
||||
public greet() : string{
|
||||
return this.foo.greet() + this.bar.greet();
|
||||
}
|
||||
}
|
||||
|
||||
// Kernel
|
||||
var kernel = new inversify.Kernel();
|
||||
|
||||
// Identifiers
|
||||
var fooRuntimeIdentifier = "FooInterface";
|
||||
var barRuntimeIdentifier = "BarInterface";
|
||||
var fooBarRuntimeIdentifier = "FooBarInterface";
|
||||
|
||||
// Bindings
|
||||
var fooBinding = new inversify.TypeBinding<FooInterface>(fooRuntimeIdentifier, Foo);
|
||||
var barBinding = new inversify.TypeBinding<BarInterface>(barRuntimeIdentifier, Bar);
|
||||
var fooBarBinding = new inversify.TypeBinding<FooBarInterface>(fooBarRuntimeIdentifier, FooBar);
|
||||
|
||||
kernel.bind(fooBinding);
|
||||
kernel.bind(barBinding);
|
||||
kernel.bind(fooBarBinding);
|
||||
|
||||
// Resolve
|
||||
var foo = kernel.resolve<Foo>(fooRuntimeIdentifier);
|
||||
var bar = kernel.resolve<Bar>(barRuntimeIdentifier);
|
||||
var fooBar = kernel.resolve<FooBar>(fooBarRuntimeIdentifier);
|
||||
|
||||
// Unbind
|
||||
kernel.unbind(fooRuntimeIdentifier);
|
||||
kernel.unbindAll();
|
||||
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
// Type definitions for inversify 1.0.0
|
||||
// Project: https://github.com/inversify/InversifyJS
|
||||
// Definitions by: inversify <https://github.com/inversify>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module inversify {
|
||||
|
||||
interface TypeBindingInterface<TServiceType> {
|
||||
runtimeIdentifier : string;
|
||||
implementationType : { new(): TServiceType ;};
|
||||
cache : TServiceType;
|
||||
scope : number; // TypeBindingScopeEnum
|
||||
}
|
||||
|
||||
interface KernelInterface {
|
||||
bind(typeBinding : TypeBindingInterface<any>) : void;
|
||||
unbind(runtimeIdentifier : string) : void;
|
||||
unbindAll() : void;
|
||||
resolve<TImplementationType>(runtimeIdentifier : string) : TImplementationType;
|
||||
}
|
||||
|
||||
enum TypeBindingScopeEnum {
|
||||
Transient = 0,
|
||||
Singleton = 1,
|
||||
}
|
||||
|
||||
class TypeBinding<TServiceType> implements TypeBindingInterface<TServiceType> {
|
||||
runtimeIdentifier: string;
|
||||
implementationType: {
|
||||
new (): TServiceType;
|
||||
};
|
||||
cache: TServiceType;
|
||||
scope: TypeBindingScopeEnum;
|
||||
constructor(runtimeIdentifier: string, implementationType: {
|
||||
new (...args: any[]): TServiceType;
|
||||
}, scopeType?: TypeBindingScopeEnum);
|
||||
}
|
||||
|
||||
class Kernel implements KernelInterface {
|
||||
private _bindings;
|
||||
bind(typeBinding: TypeBindingInterface<any>): void;
|
||||
unbind(runtimeIdentifier: string): void;
|
||||
unbindAll(): void;
|
||||
resolve<TImplementationType>(runtimeIdentifier: string): TImplementationType;
|
||||
private _validateBinding(typeBinding);
|
||||
private _getConstructorArguments(func);
|
||||
private _injectDependencies<TImplementationType>(func);
|
||||
private _construct<TImplementationType>(constr, args);
|
||||
constructor();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference path="jasmine.d.ts" />
|
||||
|
||||
// tests based on http://jasmine.github.io/2.0/introduction.html
|
||||
// tests based on http://jasmine.github.io/2.2/introduction.html
|
||||
|
||||
describe("A suite", function () {
|
||||
it("contains spec with an expectation", function () {
|
||||
@@ -248,7 +248,8 @@ describe("Pending specs", function () {
|
||||
|
||||
it("can be declared by calling 'pending' in the spec body", function () {
|
||||
expect(true).toBe(false);
|
||||
pending();
|
||||
pending(); // without reason
|
||||
pending('this is why it is pending');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Jasmine 2.1
|
||||
// Type definitions for Jasmine 2.2
|
||||
// Project: http://jasmine.github.io/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>, David Pärsson <https://github.com/davidparsson/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -18,7 +18,7 @@ declare function xit(expectation: string, assertion?: () => void, timeout?: numb
|
||||
declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
|
||||
|
||||
/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */
|
||||
declare function pending(): void;
|
||||
declare function pending(reason?: string): void;
|
||||
|
||||
declare function beforeEach(action: () => void, timeout?: number): void;
|
||||
declare function beforeEach(action: (done: () => void) => void, timeout?: number): void;
|
||||
|
||||
@@ -2511,10 +2511,10 @@ function test_jQuery() {
|
||||
$foo.triggerHandler('eventName');
|
||||
$("div > p").css("border", "1px solid gray");
|
||||
$("input:radio", document.forms[0]);
|
||||
var xml: any;
|
||||
var xml: any;
|
||||
$("div", xml.responseXML);
|
||||
$(document.body).css("background", "black");
|
||||
var myForm: any;
|
||||
var myForm: any;
|
||||
$(myForm.elements).hide();
|
||||
$('<p id="test">My <em>new</em> text</p>').appendTo('body');
|
||||
$('<img />');
|
||||
@@ -2537,6 +2537,10 @@ function test_jQuery() {
|
||||
}
|
||||
}).appendTo("body");
|
||||
jQuery(function ($) {
|
||||
// Your code using failsafe $ alias here...
|
||||
});
|
||||
jQuery(document).ready(function ($) {
|
||||
// Your code using failsafe $ alias here...
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+14
-8
@@ -725,30 +725,42 @@ interface JQueryStatic {
|
||||
* @param context A DOM Element, Document, or jQuery to use as context
|
||||
*/
|
||||
(selector: string, context?: Element|JQuery): JQuery;
|
||||
|
||||
/**
|
||||
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
||||
*
|
||||
* @param element A DOM element to wrap in a jQuery object.
|
||||
*/
|
||||
(element: Element): JQuery;
|
||||
|
||||
/**
|
||||
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
||||
*
|
||||
* @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
|
||||
*/
|
||||
(elementArray: Element[]): JQuery;
|
||||
|
||||
/**
|
||||
* Binds a function to be executed when the DOM has finished loading.
|
||||
*
|
||||
* @param callback A function to execute after the DOM is ready.
|
||||
*/
|
||||
(callback: (jQueryAlias?: JQueryStatic) => any): JQuery;
|
||||
|
||||
/**
|
||||
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
||||
*
|
||||
* @param object A plain object to wrap in a jQuery object.
|
||||
*/
|
||||
(object: {}): JQuery;
|
||||
|
||||
/**
|
||||
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
||||
*
|
||||
* @param object An existing jQuery object to clone.
|
||||
*/
|
||||
(object: JQuery): JQuery;
|
||||
|
||||
/**
|
||||
* Specify a function to execute when the DOM is fully loaded.
|
||||
*/
|
||||
@@ -761,6 +773,7 @@ interface JQueryStatic {
|
||||
* @param ownerDocument A document in which the new elements will be created.
|
||||
*/
|
||||
(html: string, ownerDocument?: Document): JQuery;
|
||||
|
||||
/**
|
||||
* Creates DOM elements on the fly from the provided string of raw HTML.
|
||||
*
|
||||
@@ -769,13 +782,6 @@ interface JQueryStatic {
|
||||
*/
|
||||
(html: string, attributes: Object): JQuery;
|
||||
|
||||
/**
|
||||
* Binds a function to be executed when the DOM has finished loading.
|
||||
*
|
||||
* @param callback A function to execute after the DOM is ready.
|
||||
*/
|
||||
(callback: Function): JQuery;
|
||||
|
||||
/**
|
||||
* Relinquish jQuery's control of the $ variable.
|
||||
*
|
||||
@@ -2352,7 +2358,7 @@ interface JQuery {
|
||||
*
|
||||
* @param handler A function to execute after the DOM is ready.
|
||||
*/
|
||||
ready(handler: Function): JQuery;
|
||||
ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery;
|
||||
|
||||
/**
|
||||
* Trigger the "resize" event on an element.
|
||||
|
||||
@@ -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.
|
||||
|
||||
+2
-2
@@ -8,6 +8,6 @@ less.render(".class { width: (1 + 1) }").then((output) => {
|
||||
|
||||
less.render("fail").then((output) => {
|
||||
throw new Error("promise should have been rejected");
|
||||
}, () => {
|
||||
console.log("rejected as expected");
|
||||
}, (error: Less.RenderError) => {
|
||||
console.log("rejected as expected on line number " + error.line);
|
||||
});
|
||||
|
||||
Vendored
+12
-2
@@ -51,6 +51,16 @@ declare module Less {
|
||||
rootFileInfo?: RootFileInfo;
|
||||
}
|
||||
|
||||
interface RenderError {
|
||||
column: number;
|
||||
extract: string[];
|
||||
filename: string;
|
||||
index: number;
|
||||
line: number;
|
||||
message: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface RenderOutput {
|
||||
css: string;
|
||||
map: string;
|
||||
@@ -59,8 +69,8 @@ declare module Less {
|
||||
}
|
||||
|
||||
interface LessStatic {
|
||||
render(input: string, callback: (output: Less.RenderOutput) => void): void;
|
||||
render(input: string, options: Less.Options, callback: (output: Less.RenderOutput) => void): void;
|
||||
render(input: string, callback: (error: Less.RenderError, output: Less.RenderOutput) => void): void;
|
||||
render(input: string, options: Less.Options, callback: (error: Less.RenderError, output: Less.RenderOutput) => void): void;
|
||||
|
||||
render(input: string): Less.Promise<Less.RenderOutput>;
|
||||
render(input: string, options: Less.Options): Less.Promise<Less.RenderOutput>;
|
||||
|
||||
@@ -139,6 +139,15 @@ result = <_.Dictionary<string>>_(<{ [index: string]: string; }>{ 'key1': 'test1'
|
||||
// /*************
|
||||
// * Arrays *
|
||||
// *************/
|
||||
result = <any[][]>_.chunk([1, '2', '3', false]);
|
||||
result = <_.LoDashArrayWrapper<any>>_([1, '2', '3', false]).chunk();
|
||||
result = <any[][]>_.chunk([1, '2', '3', false], 2);
|
||||
result = <_.LoDashArrayWrapper<any>>_([1, '2', '3', false]).chunk(2);
|
||||
result = <number[][]>_.chunk([1, 2, 3, 4]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).chunk();
|
||||
result = <number[][]>_.chunk([1, 2, 3, 4], 2);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).chunk(2);
|
||||
|
||||
result = <any[]>_.compact([0, 1, false, 2, '', 3]);
|
||||
result = <_.LoDashArrayWrapper<any>>_([0, 1, false, 2, '', 3]).compact();
|
||||
|
||||
|
||||
Vendored
+25
-1
@@ -17,7 +17,7 @@ declare module _ {
|
||||
* explicitly included in the build.
|
||||
*
|
||||
* The chainable wrapper functions are:
|
||||
* after, assign, bind, bindAll, bindKey, chain, compact, compose, concat, countBy,
|
||||
* after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy,
|
||||
* createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten,
|
||||
* forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
|
||||
* indexBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
|
||||
@@ -254,6 +254,30 @@ declare module _ {
|
||||
/*********
|
||||
* Arrays *
|
||||
**********/
|
||||
|
||||
//_.chunk
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array of elements split into groups the length of size. If collection can’t be
|
||||
* split evenly, the final chunk will be the remaining elements.
|
||||
* @param array The array to process.
|
||||
* @param size The length of each chunk.
|
||||
* @return Returns the new array containing chunks.
|
||||
**/
|
||||
chunk<T>(array: Array<T>, size?: number): T[][];
|
||||
|
||||
/**
|
||||
* @see _.chunk
|
||||
**/
|
||||
chunk<T>(array: List<T>, size?: number): T[][];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.chunk
|
||||
**/
|
||||
chunk(size?: number): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.compact
|
||||
interface LoDashStatic {
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/// <reference path="./lory.js.d.ts" />
|
||||
|
||||
(function() {
|
||||
var elm = document.querySelector('.js-foo');
|
||||
var elm2 = document.querySelector('.js-bar');
|
||||
var elm3 = document.querySelector('.js-baz');
|
||||
var elm4 = document.querySelector('.js-foobar');
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Init
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
lory(elm);
|
||||
|
||||
// with options
|
||||
lory(elm2, {
|
||||
slidesToScroll: 1,
|
||||
slideSpeed: 300,
|
||||
rewindSpeed: 600,
|
||||
snapBackSpeed: 200,
|
||||
ease: 'ease',
|
||||
rewind: true,
|
||||
infinite: false
|
||||
});
|
||||
|
||||
// with callbacks
|
||||
lory(elm3, {
|
||||
beforeInit: () => { },
|
||||
afterInit: () => { },
|
||||
beforePrev: () => { return 1; },
|
||||
beforeNext: () => { return false; },
|
||||
beforeTouch: () => { return ''; },
|
||||
beforeResize: () => { }
|
||||
});
|
||||
|
||||
// with options & callbacks
|
||||
lory(elm4, {
|
||||
slidesToScroll: 1,
|
||||
slideSpeed: 300,
|
||||
rewindSpeed: 600,
|
||||
snapBackSpeed: 200,
|
||||
ease: 'ease',
|
||||
rewind: true,
|
||||
infinite: 4,
|
||||
beforeInit: () => { return function() { console.log('foo') }; },
|
||||
afterInit: () => { return [0, 1]; },
|
||||
beforePrev: () => { },
|
||||
beforeNext: () => { },
|
||||
beforeTouch: () => { },
|
||||
beforeResize: () => { return {}; }
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Public API
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
lory.setup();
|
||||
lory.prev();
|
||||
lory.next();
|
||||
lory.reset();
|
||||
lory.slideTo(1);
|
||||
}());
|
||||
Vendored
+110
@@ -0,0 +1,110 @@
|
||||
// Type definitions for lory 0.4.3
|
||||
// Project: https://github.com/meandmax/lory/
|
||||
// Definitions by: kubosho <https://github.com/kubosho/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var lory: LoryStatic;
|
||||
|
||||
interface LoryStatic {
|
||||
(element: Element, options?: LoryOptions): LoryStatic;
|
||||
|
||||
/**
|
||||
* slides to the previous slide.
|
||||
*/
|
||||
prev(): void;
|
||||
|
||||
/**
|
||||
* slides to the next slide.
|
||||
*/
|
||||
next(): void;
|
||||
|
||||
/**
|
||||
* slides to the index given as an argument.
|
||||
*/
|
||||
slideTo(index: number): void;
|
||||
|
||||
/**
|
||||
* binds eventlisteners, merging default and user options, setup the slides based on DOM (called once during initialisation). Call setup if DOM or user options have changed or eventlisteners needs to be rebinded.
|
||||
*/
|
||||
setup(): void;
|
||||
|
||||
/**
|
||||
* sets the slider back to the starting position and resets the current index (called on resize event).
|
||||
*/
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
interface LoryOptions {
|
||||
//////////////////////////////////////////////////
|
||||
// Options
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* slides scrolled at once (default: 1).
|
||||
*/
|
||||
slidesToScroll?: number;
|
||||
|
||||
/**
|
||||
* time in milliseconds for the animation of a valid slide attempt (default: 300).
|
||||
*/
|
||||
slideSpeed?: number;
|
||||
|
||||
/**
|
||||
* time in milliseconds for the animation of the rewind after the last slide (default: 600).
|
||||
*/
|
||||
rewindSpeed?: number;
|
||||
|
||||
/**
|
||||
* time for the snapBack of the slider if the slide attempt was not valid (default: 200).
|
||||
*/
|
||||
snapBackSpeed?: number;
|
||||
|
||||
/**
|
||||
* cubic bezier easing functions: http://easings.net/de (default: 'cubic-bezier(0.455, 0.03, 0.515, 0.955)').
|
||||
*/
|
||||
ease?: string;
|
||||
|
||||
/**
|
||||
* if slider reached the last slide, with next click the slider goes back to the startindex (default: false).
|
||||
*/
|
||||
rewind?: boolean;
|
||||
|
||||
/**
|
||||
* like carousel, works with multiple slides (default: false). (do not combine with rewind)
|
||||
*/
|
||||
infinite?: boolean | number;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Callbacks
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* executed before initialisation (first in setup function)
|
||||
*/
|
||||
beforeInit?: <T>() => T;
|
||||
|
||||
/**
|
||||
* executed after initialisation (end of setup function)
|
||||
*/
|
||||
afterInit?: <T>() => T;
|
||||
|
||||
/**
|
||||
* executed on click of prev controls (prev function)
|
||||
*/
|
||||
beforePrev?: <T>() => T;
|
||||
|
||||
/**
|
||||
* executed on click of next controls (next function)
|
||||
*/
|
||||
beforeNext?: <T>() => T;
|
||||
|
||||
/**
|
||||
* executed on touch attempt (touchstart)
|
||||
*/
|
||||
beforeTouch?: <T>() => T;
|
||||
|
||||
/**
|
||||
* executed on every resize event
|
||||
*/
|
||||
beforeResize?: <T>() => T;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="mailcheck.d.ts"/>
|
||||
|
||||
import MC = require('mailcheck');
|
||||
|
||||
var domains = ['gmail.com', 'aol.com'];
|
||||
var secondLevelDomains = ['hotmail']
|
||||
var topLevelDomains = ["com", "net", "org"];
|
||||
|
||||
var superStringDistance = function(string1: string, string2: string): number {
|
||||
// a string distance algorithm of your choosing
|
||||
return 0;
|
||||
};
|
||||
|
||||
$('#email').on('blur', function() {
|
||||
$(this).mailcheck({
|
||||
domains: domains, // optional
|
||||
secondLevelDomains: secondLevelDomains, // optional
|
||||
topLevelDomains: topLevelDomains, // optional
|
||||
distanceFunction: superStringDistance, // optional
|
||||
suggested: function(element: JQuery, suggestion: MailcheckModule.ISuggestion) {
|
||||
// callback code
|
||||
},
|
||||
empty: function(element: JQuery) {
|
||||
// callback code
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Mailcheck.run({
|
||||
domains: domains, // optional
|
||||
secondLevelDomains: secondLevelDomains, // optional
|
||||
topLevelDomains: topLevelDomains, // optional
|
||||
distanceFunction: superStringDistance, // optional
|
||||
suggested: function(suggestion: MailcheckModule.ISuggestion) {
|
||||
// callback code
|
||||
},
|
||||
empty: function() {
|
||||
// callback code
|
||||
}
|
||||
});
|
||||
|
||||
MC.run({
|
||||
domains: domains, // optional
|
||||
secondLevelDomains: secondLevelDomains, // optional
|
||||
topLevelDomains: topLevelDomains, // optional
|
||||
distanceFunction: superStringDistance, // optional
|
||||
suggested: function(suggested: MailcheckModule.ISuggestion) {
|
||||
// callback code
|
||||
suggested.address === '' && suggested.full === '' && suggested.domain === '';
|
||||
},
|
||||
empty: function() {
|
||||
// callback code
|
||||
}
|
||||
});
|
||||
Vendored
+78
@@ -0,0 +1,78 @@
|
||||
// Type definitions for Mailcheck 1.1+
|
||||
// Project: https://github.com/mailcheck/mailcheck
|
||||
// Definitions by: Paulo Cesar <http://github.com/pocesar>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare var Mailcheck: MailcheckModule.Static;
|
||||
|
||||
declare module MailcheckModule {
|
||||
|
||||
export interface IDistanceFunction {
|
||||
(s1: string, s2: string): number;
|
||||
}
|
||||
|
||||
export interface ISuggestFunction {
|
||||
(email: string, domains?: string[], topLevelDomains?: string[], distanceFunction?: IDistanceFunction):void;
|
||||
}
|
||||
|
||||
export interface IJQuerySuggested {
|
||||
(element: JQuery, suggested: ISuggestion): void;
|
||||
}
|
||||
|
||||
export interface IJQueryEmpty {
|
||||
(element: JQuery): void;
|
||||
}
|
||||
|
||||
export interface IEmpty {
|
||||
(): void;
|
||||
}
|
||||
|
||||
export interface ISuggested {
|
||||
(suggested: ISuggestion): void;
|
||||
}
|
||||
|
||||
export interface ISplitEmail {
|
||||
topLevelDomain?: string;
|
||||
domain?: string;
|
||||
address?: string;
|
||||
}
|
||||
|
||||
export interface ISuggestion {
|
||||
address: string;
|
||||
domain: string;
|
||||
full: string;
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
domains?: string[];
|
||||
topLevelDomains?: string[];
|
||||
distanceFunction?: IDistanceFunction;
|
||||
suggested?: ISuggested | IJQuerySuggested;
|
||||
empty?: IEmpty | IJQueryEmpty;
|
||||
}
|
||||
|
||||
export interface Static {
|
||||
defaultDomains: string[];
|
||||
defaultSecondLevelDomains: string[];
|
||||
defaultTopLevelDomains: string[];
|
||||
domainThreshold: number;
|
||||
topLevelThreshold: number;
|
||||
run(opts: IOptions):void;
|
||||
suggest: ISuggestFunction;
|
||||
encodeEmail(email: string): string;
|
||||
splitEmail(email: string): ISplitEmail;
|
||||
sift3Distance(s1: string, s2: string): number;
|
||||
findClosestDomain(domain: string, domains: string[], distanceFunction?: IDistanceFunction, threshold?: number): boolean|string;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
mailcheck(opts: MailcheckModule.IOptions): void;
|
||||
}
|
||||
|
||||
declare module 'mailcheck' {
|
||||
export = Mailcheck;
|
||||
}
|
||||
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
+67
-3
@@ -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;
|
||||
@@ -679,8 +743,8 @@ declare module "child_process" {
|
||||
timeout?: number;
|
||||
maxBuffer?: number;
|
||||
killSignal?: string;
|
||||
}, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||
export function exec(command: string, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||
export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||
export function execFile(file: string,
|
||||
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||
export function execFile(file: string, args?: string[],
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user