mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Merge branch 'master' of github.com:borisyankov/DefinitelyTyped
Conflicts: d3/d3.d.ts
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{*.json,*.yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
+2
-6
@@ -28,13 +28,9 @@ _infrastructure/tests/build
|
||||
.idea
|
||||
*.iml
|
||||
*.js.map
|
||||
|
||||
#rx.js
|
||||
!rx.js
|
||||
|
||||
#zip.js
|
||||
!zip.js
|
||||
!*.js/
|
||||
|
||||
node_modules
|
||||
|
||||
.sublimets
|
||||
.settings/launch.json
|
||||
|
||||
+75
-16
@@ -16,17 +16,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](angular-growl-v2/angular-growl-v2.d.ts) [Angular Growl 2 v.0.7.3](http://janstevens.github.io/angular-growl-2) by [Tadeusz Hucal](https://github.com/mkp05)
|
||||
* [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
|
||||
* [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya), [Raphael Schweizer](https://github.com/rasch)
|
||||
* [:link:](angularjs/angular-cookies.d.ts) [Angular JS (ngCookies module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
|
||||
* [:link:](angularjs/angular-cookies.d.ts) [Angular JS (ngCookies module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Anthony Ciccarello](http://github.com/aciccarello)
|
||||
* [:link:](angularjs/angular-mocks.d.ts) [Angular JS (ngMock, ngMockE2E module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
|
||||
* [:link:](angularjs/angular-resource.d.ts) [Angular JS (ngResource module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Michael Jess](http://github.com/miffels)
|
||||
* [: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)
|
||||
@@ -39,6 +40,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](angularfire/angularfire.d.ts) [AngularFire](http://angularfire.com) by [Dénes Harmath](http://github.com/thSoft)
|
||||
* [:link:](angularLocalStorage/angularLocalStorage.d.ts) [AngularLocalStorage](https://github.com/agrublev/angularLocalStorage) by [Horiuchi_H](https://github.com/horiuchi)
|
||||
* [:link:](animation-frame/animation-frame.d.ts) [animation-frame](https://github.com/kof/animation-frame) by [Qinfeng Chen](https://github.com/qinfchen)
|
||||
* [:link:](ansi-styles/ansi-styles.d.ts) [ansi-styles](https://github.com/sindresorhus/ansi-styles) by [bryn austin bellomy](https://github.com/brynbellomy)
|
||||
* [:link:](ansicolors/ansicolors.d.ts) [ansicolors](https://github.com/thlorenz/ansicolors) by [rogierschouten](https://github.com/rogierschouten)
|
||||
* [:link:](any-db/any-db.d.ts) [any-db](https://github.com/grncdr/node-any-db) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](any-db-transaction/any-db-transaction.d.ts) [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
@@ -57,10 +59,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 +88,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,14 +101,16 @@ 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)
|
||||
* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Hunsaker](https://github.com/jedhunsaker), [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](chai-as-promised/chai-as-promised.d.ts) [chai-as-promised](https://github.com/domenic/chai-as-promised) by [jt000](https://github.com/jt000)
|
||||
* [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger)
|
||||
* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
@@ -121,15 +127,19 @@ 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)
|
||||
* [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik)
|
||||
* [:link:](colorbrewer/colorbrewer.d.ts) [colorbrewer](https://github.com/jeanlauliac/colorbrewer) by [Matt Traynham](https://github.com/mtraynham)
|
||||
* [:link:](colors/colors.d.ts) [Colors.js 0.6.0-1](https://github.com/Marak/colors.js) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](cometd/cometd.d.ts) [CometD](http://cometd.org) by [Derek Cicerone](https://github.com/derekcicerone)
|
||||
* [: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 +150,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 +158,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,12 +169,14 @@ 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)
|
||||
* [:link:](deployJava/deployJava.d.ts) [deployJava.js](https://www.java.com/js/deployJava.txt) by [Cyril Schumacher](https://github.com/cyrilschumacher)
|
||||
* [:link:](detect-indent/detect-indent.d.ts) [detect-indent](https://github.com/sindresorhus/detect-indent) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](devextreme/dx.devextreme.d.ts) [DevExtreme](http://js.devexpress.com) by [DevExpress Inc.](http://devexpress.com)
|
||||
* [:link:](dexie/dexie.d.ts) [Dexie](https://github.com/dfahlander/Dexie.js) by [David Fahlander](http://github.com/dfahlander)
|
||||
* [:link:](dhtmlxgantt/dhtmlxgantt.d.ts) [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) by [Maksim Kozhukh](http://github.com/mkozhukh)
|
||||
* [:link:](dhtmlxscheduler/dhtmlxscheduler.d.ts) [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) by [Maksim Kozhukh](http://github.com/mkozhukh)
|
||||
* [:link:](di-lite/di-lite.d.ts) [di-lite](https://github.com/NickQiZhu/di.js) by [Timothy Morris](https://github.com/dcrusader)
|
||||
@@ -171,19 +185,24 @@ 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:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii)
|
||||
* [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000)
|
||||
* [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan)
|
||||
* [:link:](element-resize-event/element-resize-event.d.ts) [element-resize-event](https://github.com/KyleAMathews/element-resize-event) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
@@ -205,6 +224,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)
|
||||
@@ -213,6 +233,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](express-validator/express-validator.d.ts) [express-validator](https://github.com/ctavan/express-validator) by [Nathan Ridley](https://github.com/axefrog), [Jonathan Häberle](http://dreampulse.de)
|
||||
* [:link:](extend/extend.d.ts) [extend](https://www.npmjs.com/package/extend) by [Stefan Steinhart](https://github.com/reppners)
|
||||
* [:link:](extjs/ExtJS.d.ts) [ExtJS](http://www.sencha.com/products/extjs) by [Brian Kotek](https://github.com/brian428)
|
||||
* [:link:](eyes/eyes.d.ts) [eyes](https://github.com/cloudhead/eyes.js) by [bryn austin bellomy](https://github.com/brynbellomy)
|
||||
* [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic)
|
||||
* [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl)
|
||||
* [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov)
|
||||
@@ -255,6 +276,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](gently/gently.d.ts) [gently](https://www.npmjs.org/package/gently) by [bonnici](https://github.com/bonnici)
|
||||
* [:link:](geojson/geojson.d.ts) [GeoJSON Format Specification](http://geojson.org) by [Jacob Bruun](https://github.com/cobster)
|
||||
* [:link:](giraffe/giraffe.d.ts) [Giraffe](https://github.com/barc/backbone.giraffe) by [Matt McCray](https://github.com/darthapo)
|
||||
* [:link:](gl-matrix/gl-matrix.d.ts) [gl-matrix](https://github.com/toji/gl-matrix) by [Tat](https://github.com/tatchx)
|
||||
* [:link:](gldatepicker/gldatepicker.d.ts) [glDatePicker](http://glad.github.com/glDatePicker) by [Dániel Tar](https://github.com/qcz)
|
||||
* [:link:](glidejs/glidejs.d.ts) [Glide.js](http://glide.jedrzejchalubek.com) by [Milan Jaros](https://github.com/milanjaros)
|
||||
* [:link:](glob/glob.d.ts) [Glob](https://github.com/isaacs/node-glob) by [vvakame](https://github.com/vvakame)
|
||||
@@ -265,11 +287,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 +302,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 +337,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,7 +346,9 @@ 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:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher)
|
||||
* [: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)
|
||||
* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz)
|
||||
@@ -335,6 +361,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 +378,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 +435,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 +471,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)
|
||||
@@ -451,6 +483,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jssha/jssha.d.ts) [jsSHA](https://github.com/Caligatio/jsSHA) by [David Li](https://github.com/randombk)
|
||||
* [:link:](jstorage/jstorage.d.ts) [jStorage](http://www.jstorage.info) by [Danil Flores](https://github.com/dflor003)
|
||||
* [:link:](jstree/jstree.d.ts) [jsTree](http://www.jstree.com) by [Adam Pluciński](https://github.com/adaskothebeast)
|
||||
* [:link:](jsuri/jsuri.d.ts) [jsUri](https://github.com/derek-watson/jsUri) by [Chris Charabaruk](http://github.com/coldacid)
|
||||
* [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher)
|
||||
* [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc)
|
||||
* [:link:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev)
|
||||
@@ -475,6 +508,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](knockout-transformations/knockout-transformations.d.ts) [knockout-transformations](https://github.com/One-com/knockout-transformations) by [John Reilly](https://github.com/johnnyreilly), [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](knockout.mapper/knockout.mapper.d.ts) [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) by [Brandon Meyer](https://github.com/BMeyerKC)
|
||||
* [:link:](knockout.mapping/knockout.mapping.d.ts) [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](knockout.punches/knockout.punches.d.ts) [knockout.punches](https://github.com/mbest/knockout.punches) by [Stephen Lautier](https://github.com/johnnyreilly)
|
||||
* [:link:](knockout.rx/knockout.rx.d.ts) [knockout.rx](https://github.com/Igorbek/knockout.rx) by [Igor Oleinikov](https://github.com/Igorbek)
|
||||
* [:link:](knockstrap/knockstrap.d.ts) [Knockstrap](http://faulknercs.github.io/Knockstrap) by [Adam Pluciński](https://github.com/adaskothebeast)
|
||||
* [:link:](knockout.kogrid/ko-grid.d.ts) [ko-grid](http://knockout-contrib.github.io/KoGrid) by [huer12](https://github.com/huer12)
|
||||
@@ -488,7 +522,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 +539,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)
|
||||
@@ -516,6 +554,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr)
|
||||
* [:link:](maskedinput/maskedinput.d.ts) [Masked Input plugin for jQuery](http://digitalbush.com/projects/masked-input-plugin) by [Lokesh Peta](https://github.com/lokeshpeta)
|
||||
* [:link:](mathjax/mathjax.d.ts) [MathJax](https://github.com/mathjax/MathJax) by [Roland Zwaga](https://github.com/rolandzwaga)
|
||||
* [:link:](matter-js/matter-js.d.ts) [Matter.js](https://github.com/liabru/matter-js) by [Ivane Gegia](https://twitter.com/ivanegegia)
|
||||
* [:link:](mCustomScrollbar/mCustomScrollbar.d.ts) [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) by [Sarah Williams](https://github.com/flurg)
|
||||
* [:link:](memory-cache/memory-cache.d.ts) [memory-cache](http://github.com/ptarjan/node-cache) by [Jeff Goddard](https://github.com/jedigo)
|
||||
* [:link:](merge-stream/merge-stream.d.ts) [merge-stream](https://github.com/grncdr/merge-stream) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
|
||||
@@ -524,7 +563,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 +600,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 +640,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 +704,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)
|
||||
@@ -680,6 +726,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](q-io/Q-io.d.ts) [Q-io](https://github.com/kriskowal/q-io) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic)
|
||||
* [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade)
|
||||
* [:link:](qtip2/qtip2.d.ts) [qtip2](http://qtip2.com) by [Nathan Pitman](https://github.com/Seltzer)
|
||||
* [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei)
|
||||
* [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [:link:](ractive/ractive.d.ts) [Ractive](http://ractivejs.org) by [Han Lin Yap](http://yap.nu)
|
||||
@@ -692,6 +739,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](react/react-addons.d.ts) [ReactWithAddons (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com)
|
||||
* [:link:](react/react-addons-global.d.ts) [ReactWithAddons (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com)
|
||||
* [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](recursive-readdir/recursive-readdir.d.ts) [recursive-readdir](https://github.com/jergason/recursive-readdir) by [Elisée Maurer](https://github.com/elisee)
|
||||
* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal)
|
||||
* [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd)
|
||||
* [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd)
|
||||
@@ -728,6 +776,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)
|
||||
@@ -751,7 +800,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](simple-cw-node/simple-cw-node.d.ts) [simple-cw-node](https://github.com/astronaughts/simple-cw-node) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](jquery.simplemodal/jquery.simplemodal.d.ts) [SimpleModal](http://www.ericmmartin.com/projects/simplemodal) by [Friedrich von Never](https://github.com/ForNeVeR)
|
||||
* [:link:](sinon/sinon.d.ts) [Sinon](http://sinonjs.org) by [William Sears](https://github.com/mrbigdog2u)
|
||||
* [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid)
|
||||
* [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [Jed Mao](https://github.com/jedmao)
|
||||
* [:link:](sipml/sipml.d.ts) [SIPml5](http://sipml5.org) by [A. Groenenboom](https://github.com/chookies)
|
||||
* [:link:](sjcl/sjcl.d.ts) [sjcl](http://crypto.stanford.edu/sjcl) by [Eugene Chernyshov](https://github.com/Evgenus)
|
||||
* [:link:](slickgrid/SlickGrid.d.ts) [SlickGrid](https://github.com/mleibman/SlickGrid) by [Josh Baldwin](https://github.com/jbaldwin)
|
||||
@@ -771,6 +820,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 +833,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 +844,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)
|
||||
@@ -838,7 +891,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](twig/twig.d.ts) [twig](https://github.com/justjohn/twig.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [: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:](twix/twix.d.ts) [twix.js](https://github.com/icambron/twix.js) by [j3ko](https://github.com/j3ko)
|
||||
* [: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 +902,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)
|
||||
@@ -859,6 +915,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](vega/vega.d.ts) [Vega](http://trifacta.github.io/vega) by [Tom Crockett](http://github.com/pelotom)
|
||||
* [:link:](velocity-animate/velocity-animate.d.ts) [Velocity](http://velocityjs.org) by [Greg Smith](https://github.com/smrq)
|
||||
* [:link:](vex-js/vex-js.d.ts) [Vex](https://github.com/HubSpot/vex) by [Greg Cohan](https://github.com/gdcohan)
|
||||
* [:link:](victor/victor.d.ts) [Victor.js](http://victorjs.org) by [Ivane Gegia](https://twitter.com/ivanegegia)
|
||||
* [:link:](videojs/videojs.d.ts) [Video.js](https://github.com/zencoder/video-js) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](vimeo/froogaloop.d.ts) [Vimeo](http://developer.vimeo.com/player/js-api) by [Daz Wilkin](https://github.com/DazWilkin)
|
||||
* [:link:](vinyl/vinyl.d.ts) [vinyl](https://github.com/wearefractal/vinyl) by [vvakame](https://github.com/vvakame), [jedmao](https://github.com/jedmao)
|
||||
@@ -877,6 +934,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 +951,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)
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
/// <reference path="DataStream.js.d.ts" />
|
||||
|
||||
var buf = new ArrayBuffer(100);
|
||||
var ds = new DataStream(buf);
|
||||
ds = new DataStream(buf, 10);
|
||||
ds = new DataStream(buf, 10, DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.save('somefile.ext');
|
||||
ds.dynamicSize = true;
|
||||
|
||||
for (var i=0; i<ds.byteLength; i++) {
|
||||
}
|
||||
|
||||
ds.buffer = buf;
|
||||
ds.byteOffset = 10;
|
||||
ds.seek(0);
|
||||
ds.isEof();
|
||||
|
||||
var int32arr: Int32Array;
|
||||
var int16arr: Int16Array;
|
||||
var int8arr: Int8Array;
|
||||
|
||||
var uint32arr: Uint32Array;
|
||||
var uint16arr: Uint16Array;
|
||||
var uint8arr: Uint8Array;
|
||||
|
||||
var float64arr: Float64Array;
|
||||
var float32arr: Float32Array;
|
||||
|
||||
var val: number;
|
||||
var str: string;
|
||||
|
||||
int32arr = ds.mapInt32Array(2);
|
||||
int32arr = ds.mapInt32Array(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
int16arr = ds.mapInt16Array(2);
|
||||
int16arr = ds.mapInt16Array(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
int8arr = ds.mapInt8Array(2);
|
||||
|
||||
uint32arr = ds.mapUint32Array(2);
|
||||
uint32arr = ds.mapUint32Array(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
uint16arr = ds.mapUint16Array(2);
|
||||
uint16arr = ds.mapUint16Array(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
uint8arr = ds.mapUint8Array(2);
|
||||
|
||||
float64arr = ds.mapFloat64Array(2);
|
||||
float64arr = ds.mapFloat64Array(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
float32arr = ds.mapFloat32Array(2);
|
||||
float32arr = ds.mapFloat32Array(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
int32arr = ds.readInt32Array(2);
|
||||
int32arr = ds.readInt32Array(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
int16arr = ds.readInt16Array(2);
|
||||
int16arr = ds.readInt16Array(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
int8arr = ds.readInt8Array(2);
|
||||
|
||||
uint32arr = ds.readUint32Array(2);
|
||||
uint32arr = ds.readUint32Array(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
uint16arr = ds.readUint16Array(2);
|
||||
uint16arr = ds.readUint16Array(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
uint8arr = ds.readUint8Array(2);
|
||||
|
||||
float64arr = ds.readFloat64Array(2);
|
||||
float64arr = ds.readFloat64Array(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
float32arr = ds.readFloat32Array(2);
|
||||
float32arr = ds.readFloat32Array(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeInt32Array(new Int32Array([1,2,3]));
|
||||
ds.writeInt32Array(new Int32Array([1,2,3]), DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeInt16Array(new Int16Array([1,2,3]));
|
||||
ds.writeInt16Array(new Int16Array([1,2,3]), DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeInt8Array(new Int8Array([1,2,3]));
|
||||
|
||||
ds.writeUint32Array(new Uint32Array([1,2,3]));
|
||||
ds.writeUint32Array(new Uint32Array([1,2,3]), DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeUint16Array(new Uint16Array([1,2,3]));
|
||||
ds.writeUint16Array(new Uint16Array([1,2,3]), DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeUint8Array(new Uint8Array([1,2,3]));
|
||||
|
||||
ds.writeFloat64Array(new Float64Array([1,2,3]));
|
||||
ds.writeFloat64Array(new Float64Array([1,2,3]), DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeFloat32Array(new Float32Array([1,2,3]));
|
||||
ds.writeFloat32Array(new Float32Array([1,2,3]), DataStream.BIG_ENDIAN);
|
||||
|
||||
val = ds.readInt32();
|
||||
val = ds.readInt32(DataStream.LITTLE_ENDIAN);
|
||||
|
||||
val = ds.readInt16();
|
||||
val = ds.readInt16(DataStream.BIG_ENDIAN);
|
||||
|
||||
val = ds.readInt8();
|
||||
|
||||
val = ds.readUint32();
|
||||
val = ds.readUint32(DataStream.LITTLE_ENDIAN);
|
||||
|
||||
val = ds.readUint16();
|
||||
val = ds.readUint16(DataStream.BIG_ENDIAN);
|
||||
|
||||
val = ds.readUint8();
|
||||
|
||||
val = ds.readFloat64();
|
||||
val = ds.readFloat64(DataStream.LITTLE_ENDIAN);
|
||||
|
||||
val = ds.readFloat32();
|
||||
val = ds.readFloat32(DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeInt32(1);
|
||||
ds.writeInt32(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeInt16(1);
|
||||
ds.writeInt16(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
ds.writeInt8(1);
|
||||
|
||||
ds.writeUint32(1);
|
||||
ds.writeUint32(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeUint16(1);
|
||||
ds.writeUint16(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
ds.writeUint8(1);
|
||||
|
||||
ds.writeFloat32(1);
|
||||
ds.writeFloat32(2, DataStream.BIG_ENDIAN);
|
||||
|
||||
ds.writeFloat64(1);
|
||||
ds.writeFloat64(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
var embed = [
|
||||
'tag', 'uint32be',
|
||||
'code', 'uint32le',
|
||||
'greet', 'cstring'
|
||||
];
|
||||
|
||||
var def = [
|
||||
'tag', 'cstring:4',
|
||||
'code', 'uint32le',
|
||||
'embed', embed,
|
||||
'length', 'uint16be',
|
||||
'data', ['[]', 'float32be', 'length'],
|
||||
'greet', 'cstring:20',
|
||||
'endNote', 'uint8'
|
||||
];
|
||||
|
||||
var obj = ds.readStruct(def);
|
||||
ds.writeStruct(def, obj);
|
||||
|
||||
str = ds.readUCS2String(2);
|
||||
str = ds.readUCS2String(2, DataStream.LITTLE_ENDIAN);
|
||||
|
||||
ds.writeUCS2String("str");
|
||||
ds.writeUCS2String("str", DataStream.LITTLE_ENDIAN);
|
||||
ds.writeUCS2String("str", DataStream.LITTLE_ENDIAN, 1);
|
||||
|
||||
str = ds.readString(2);
|
||||
str = ds.readString(2, "ASCII");
|
||||
|
||||
ds.writeString("str");
|
||||
ds.writeString("str", "ASCII");
|
||||
ds.writeString("str", "ASCII", 1);
|
||||
|
||||
str = ds.readCString();
|
||||
str = ds.readCString(2);
|
||||
|
||||
ds.writeCString("str");
|
||||
ds.writeCString("str", 1);
|
||||
Vendored
+937
@@ -0,0 +1,937 @@
|
||||
// Type definitions for DataStream.js
|
||||
// Project: https://github.com/kig/DataStream.js
|
||||
// Definitions by: Tat <https://github.com/tatchx/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare class DataStream {
|
||||
|
||||
/**
|
||||
Big-endian const to use as default endianness.
|
||||
*/
|
||||
static BIG_ENDIAN: boolean;
|
||||
|
||||
/**
|
||||
Little-endian const to use as default endianness.
|
||||
*/
|
||||
static LITTLE_ENDIAN: boolean;
|
||||
|
||||
/**
|
||||
DataStream reads scalars, arrays and structs of data from an ArrayBuffer.
|
||||
It's like a file-like DataView on steroids.
|
||||
|
||||
@param {ArrayBuffer} arrayBuffer ArrayBuffer to read from.
|
||||
*/
|
||||
constructor(arrayBuffer: ArrayBuffer);
|
||||
|
||||
/**
|
||||
DataStream reads scalars, arrays and structs of data from an ArrayBuffer.
|
||||
It's like a file-like DataView on steroids.
|
||||
|
||||
@param arrayBuffer ArrayBuffer to read from.
|
||||
@param byteOffset Offset from arrayBuffer beginning for the DataStream.
|
||||
*/
|
||||
constructor(arrayBuffer: ArrayBuffer, byteOffset: number);
|
||||
|
||||
/**
|
||||
DataStream reads scalars, arrays and structs of data from an ArrayBuffer.
|
||||
It's like a file-like DataView on steroids.
|
||||
|
||||
@param arrayBuffer ArrayBuffer to read from.
|
||||
@param byteOffset Offset from arrayBuffer beginning for the DataStream.
|
||||
@param endianness DataStream.BIG_ENDIAN or DataStream.LITTLE_ENDIAN (the default).
|
||||
*/
|
||||
constructor(arrayBuffer: ArrayBuffer, byteOffset: number, endianness: boolean);
|
||||
|
||||
/**
|
||||
Saves the DataStream contents to the given filename.
|
||||
Uses Chrome's anchor download property to initiate download.
|
||||
*
|
||||
@param filename Filename to save as.
|
||||
@return nothing
|
||||
*/
|
||||
save(filename: string): void;
|
||||
|
||||
/**
|
||||
Whether to extend DataStream buffer when trying to write beyond its size.
|
||||
If set, the buffer is reallocated to twice its current size until the
|
||||
requested write fits the buffer.
|
||||
*/
|
||||
dynamicSize: boolean;
|
||||
|
||||
/**
|
||||
Returns the byte length of the DataStream object.
|
||||
*/
|
||||
byteLength: number;
|
||||
|
||||
/**
|
||||
Set/get the backing ArrayBuffer of the DataStream object.
|
||||
The setter updates the DataView to point to the new buffer.
|
||||
*/
|
||||
buffer: ArrayBuffer;
|
||||
|
||||
/**
|
||||
Set/get the byteOffset of the DataStream object.
|
||||
The setter updates the DataView to point to the new byteOffset.
|
||||
*/
|
||||
byteOffset: number;
|
||||
|
||||
/**
|
||||
Set/get the backing DataView of the DataStream object.
|
||||
The setter updates the buffer and byteOffset to point to the DataView values.
|
||||
*/
|
||||
dataView: Object;
|
||||
|
||||
/**
|
||||
Sets the DataStream read/write position to given position.
|
||||
Clamps between 0 and DataStream length.
|
||||
*
|
||||
@param pos Position to seek to.
|
||||
@return nothing
|
||||
*/
|
||||
seek(pos: number): void;
|
||||
|
||||
/**
|
||||
Returns true if the DataStream seek pointer is at the end of buffer and
|
||||
there's no more data to read.
|
||||
*
|
||||
@return true if the seek pointer is at the end of the buffer.
|
||||
*/
|
||||
isEof(): boolean;
|
||||
|
||||
/**
|
||||
Maps an Int32Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Int32Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapInt32Array(length: number): Int32Array;
|
||||
|
||||
/**
|
||||
Maps an Int32Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return Int32Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapInt32Array(length: number, e: boolean): Int32Array;
|
||||
|
||||
/**
|
||||
Maps an Int16Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Int16Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapInt16Array(length: number): Int16Array;
|
||||
|
||||
/**
|
||||
Maps an Int16Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return Int16Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapInt16Array(length: number, e: boolean): Int16Array;
|
||||
|
||||
/**
|
||||
Maps an Int8Array into the DataStream buffer.
|
||||
*
|
||||
Nice for quickly reading in data.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Int8Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapInt8Array(length: number): Int8Array;
|
||||
|
||||
/**
|
||||
Maps a Uint32Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Uint32Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapUint32Array(length: number): Uint32Array;
|
||||
|
||||
/**
|
||||
Maps a Uint32Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return Uint32Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapUint32Array(length: number, e: boolean): Uint32Array;
|
||||
|
||||
/**
|
||||
Maps a Uint16Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Uint16Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapUint16Array(length: number): Uint16Array;
|
||||
|
||||
/**
|
||||
Maps a Uint16Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return Uint16Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapUint16Array(length: number, e: boolean): Uint16Array;
|
||||
|
||||
/**
|
||||
Maps a Uint8Array into the DataStream buffer.
|
||||
*
|
||||
Nice for quickly reading in data.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Uint8Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapUint8Array(length: number): Uint8Array;
|
||||
|
||||
/**
|
||||
Maps a Float64Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Float64Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapFloat64Array(length: number): Float64Array;
|
||||
|
||||
/**
|
||||
Maps a Float64Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return Float64Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapFloat64Array(length: number, e: boolean): Float64Array;
|
||||
|
||||
/**
|
||||
Maps a Float32Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return Float32Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapFloat32Array(length: number): Float32Array;
|
||||
|
||||
/**
|
||||
Maps a Float32Array into the DataStream buffer, swizzling it to native
|
||||
endianness in-place. The current offset from the start of the buffer needs to
|
||||
be a multiple of element size, just like with typed array views.
|
||||
*
|
||||
Nice for quickly reading in data. Warning: potentially modifies the buffer
|
||||
contents.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return Float32Array to the DataStream backing buffer.
|
||||
*/
|
||||
mapFloat32Array(length: number, e: boolean): Float32Array;
|
||||
|
||||
/**
|
||||
Reads an Int32Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Int32Array.
|
||||
*/
|
||||
readInt32Array(length: number): Int32Array;
|
||||
|
||||
/**
|
||||
Reads an Int32Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return The read Int32Array.
|
||||
*/
|
||||
readInt32Array(length: number, e: boolean): Int32Array;
|
||||
|
||||
/**
|
||||
Reads an Int16Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Int16Array.
|
||||
*/
|
||||
readInt16Array(length: number): Int16Array;
|
||||
|
||||
/**
|
||||
Reads an Int16Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return The read Int16Array.
|
||||
*/
|
||||
readInt16Array(length: number, e: boolean): Int16Array;
|
||||
|
||||
/**
|
||||
Reads an Int8Array of desired length from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Int8Array.
|
||||
*/
|
||||
readInt8Array(length: number): Int8Array;
|
||||
|
||||
/**
|
||||
Reads an Uint32Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Uint32Array.
|
||||
*/
|
||||
readUint32Array(length: number): Uint32Array;
|
||||
|
||||
/**
|
||||
Reads an Uint32Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return The read Uint32Array.
|
||||
*/
|
||||
readUint32Array(length: number, e: boolean): Uint32Array;
|
||||
|
||||
/**
|
||||
Reads an Uint16Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Uint16Array.
|
||||
*/
|
||||
readUint16Array(length: number): Uint16Array;
|
||||
|
||||
/**
|
||||
Reads an Uint16Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return The read Uint16Array.
|
||||
*/
|
||||
readUint16Array(length: number, e: boolean): Uint16Array;
|
||||
|
||||
/**
|
||||
Reads an Uint8Array of desired length from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Uint8Array.
|
||||
*/
|
||||
readUint8Array(length: number): Uint8Array;
|
||||
|
||||
/**
|
||||
Reads a Float64Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return The read Float64Array.
|
||||
*/
|
||||
readFloat64Array(length: number, e: boolean): Float64Array;
|
||||
|
||||
/**
|
||||
Reads a Float64Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Float64Array.
|
||||
*/
|
||||
readFloat64Array(length: number): Float64Array;
|
||||
|
||||
/**
|
||||
Reads a Float32Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@param e Endianness of the data to read.
|
||||
@return The read Float32Array.
|
||||
*/
|
||||
readFloat32Array(length: number, e: boolean): Float32Array;
|
||||
|
||||
/**
|
||||
Reads a Float32Array of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length Number of elements to map.
|
||||
@return The read Float32Array.
|
||||
*/
|
||||
readFloat32Array(length: number): Float32Array;
|
||||
|
||||
/**
|
||||
Writes an Int32Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
@param e Endianness of the data to write.
|
||||
*/
|
||||
writeInt32Array(arr: Int32Array, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes an Int32Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeInt32Array(arr: Int32Array): void;
|
||||
|
||||
/**
|
||||
Writes an Int16Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
@param e Endianness of the data to write.
|
||||
*/
|
||||
writeInt16Array(arr: Int16Array, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes an Int16Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeInt16Array(arr: Int16Array): void;
|
||||
|
||||
/**
|
||||
Writes an Int8Array to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeInt8Array(arr: Int8Array): void;
|
||||
|
||||
/**
|
||||
Writes an Uint32Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
@param e Endianness of the data to write.
|
||||
*/
|
||||
writeUint32Array(arr: Uint32Array, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes an Uint32Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeUint32Array(arr: Uint32Array): void;
|
||||
|
||||
/**
|
||||
Writes an Uint16Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
@param e Endianness of the data to write.
|
||||
*/
|
||||
writeUint16Array(arr: Uint16Array, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes an Uint16Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeUint16Array(arr: Uint16Array): void;
|
||||
|
||||
/**
|
||||
Writes an Uint8Array to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeUint8Array(arr: Uint8Array): void;
|
||||
|
||||
/**
|
||||
Writes a Float64Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeFloat64Array(arr: Float64Array): void;
|
||||
|
||||
/**
|
||||
Writes a Float64Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
@param e Endianness of the data to write.
|
||||
*/
|
||||
writeFloat64Array(arr: Float64Array, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes a Float32Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
*/
|
||||
writeFloat32Array(arr: Float32Array): void;
|
||||
|
||||
/**
|
||||
Writes a Float32Array of specified endianness to the DataStream.
|
||||
*
|
||||
@param arr The array to write.
|
||||
@param e Endianness of the data to write.
|
||||
*/
|
||||
writeFloat32Array(arr: Float32Array, e: boolean): void;
|
||||
|
||||
/**
|
||||
Reads a 32-bit int from the DataStream with the desired endianness.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readInt32(): number;
|
||||
|
||||
/**
|
||||
Reads a 32-bit int from the DataStream with the desired endianness.
|
||||
*
|
||||
@param e Endianness of the number.
|
||||
@return The read number.
|
||||
*/
|
||||
readInt32(e: boolean): number;
|
||||
|
||||
/**
|
||||
Reads a 16-bit int from the DataStream with the desired endianness.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readInt16(): number;
|
||||
|
||||
/**
|
||||
Reads a 16-bit int from the DataStream with the desired endianness.
|
||||
*
|
||||
@param e Endianness of the number.
|
||||
@return The read number.
|
||||
*/
|
||||
readInt16(e: boolean): number;
|
||||
|
||||
/**
|
||||
Reads an 8-bit int from the DataStream.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readInt8(): number;
|
||||
|
||||
/**
|
||||
Reads a 32-bit unsigned int from the DataStream with the desired endianness.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readUint32(): number;
|
||||
|
||||
/**
|
||||
Reads a 32-bit unsigned int from the DataStream with the desired endianness.
|
||||
*
|
||||
@param e Endianness of the number.
|
||||
@return The read number.
|
||||
*/
|
||||
readUint32(e: boolean): number;
|
||||
|
||||
/**
|
||||
Reads a 16-bit unsigned int from the DataStream with the desired endianness.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readUint16(): number;
|
||||
|
||||
/**
|
||||
Reads a 16-bit unsigned int from the DataStream with the desired endianness.
|
||||
*
|
||||
@param e Endianness of the number.
|
||||
@return The read number.
|
||||
*/
|
||||
readUint16(e: boolean): number;
|
||||
|
||||
/**
|
||||
Reads an 8-bit unsigned intfrom the DataStream.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readUint8(): number;
|
||||
|
||||
/**
|
||||
Reads a 32-bit float from the DataStream with the desired endianness.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readFloat32(): number;
|
||||
|
||||
/**
|
||||
Reads a 32-bit float from the DataStream with the desired endianness.
|
||||
*
|
||||
@param e Endianness of the number.
|
||||
@return The read number.
|
||||
*/
|
||||
readFloat32(e: boolean): number;
|
||||
|
||||
/**
|
||||
Reads a 64-bit float from the DataStream with the desired endianness.
|
||||
*
|
||||
@return The read number.
|
||||
*/
|
||||
readFloat64(): number;
|
||||
|
||||
/**
|
||||
Reads a 64-bit float from the DataStream with the desired endianness.
|
||||
*
|
||||
@param e Endianness of the number.
|
||||
@return The read number.
|
||||
*/
|
||||
readFloat64(e: boolean): number;
|
||||
|
||||
/**
|
||||
Writes a 32-bit int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeInt32(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 32-bit int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
@param e Endianness of the number.
|
||||
*/
|
||||
writeInt32(v: number, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes a 16-bit int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeInt16(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 16-bit int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
@param e Endianness of the number.
|
||||
*/
|
||||
writeInt16(v: number, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes an 8-bit int to the DataStream.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeInt8(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 32-bit undigned int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeUint32(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 32-bit undigned int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
@param e Endianness of the number.
|
||||
*/
|
||||
writeUint32(v: number, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes a 16-bit undigned int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeUint16(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 16-bit undigned int to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
@param e Endianness of the number.
|
||||
*/
|
||||
writeUint16(v: number, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes an 8-bit undigned int to the DataStream.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeUint8(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 32-bit float to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeFloat32(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 32-bit float to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
@param e Endianness of the number.
|
||||
*/
|
||||
writeFloat32(v: number, e: boolean): void;
|
||||
|
||||
/**
|
||||
Writes a 64-bit float to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
*/
|
||||
writeFloat64(v: number): void;
|
||||
|
||||
/**
|
||||
Writes a 64-bit float to the DataStream with the desired endianness.
|
||||
*
|
||||
@param v Number to write.
|
||||
@param e Endianness of the number.
|
||||
*/
|
||||
writeFloat64(v: number, e: boolean): void;
|
||||
|
||||
/**
|
||||
Reads a struct of data from the DataStream. The struct is defined as
|
||||
a flat array of [name, type]-pairs. See the example below:
|
||||
*
|
||||
ds.readStruct([
|
||||
'headerTag', 'uint32', // Uint32 in DataStream endianness.
|
||||
'headerTag2', 'uint32be', // Big-endian Uint32.
|
||||
'headerTag3', 'uint32le', // Little-endian Uint32.
|
||||
'array', ['[]', 'uint32', 16], // Uint32Array of length 16.
|
||||
'array2Length', 'uint32',
|
||||
'array2', ['[]', 'uint32', 'array2Length'] // Uint32Array of length array2Length
|
||||
]);
|
||||
*
|
||||
The possible values for the type are as follows:
|
||||
*
|
||||
// Number types
|
||||
// Unsuffixed number types use DataStream endianness.
|
||||
// To explicitly specify endianness, suffix the type with
|
||||
// 'le' for little-endian or 'be' for big-endian,
|
||||
// e.g. 'int32be' for big-endian int32.
|
||||
'uint8' -- 8-bit unsigned int
|
||||
'uint16' -- 16-bit unsigned int
|
||||
'uint32' -- 32-bit unsigned int
|
||||
'int8' -- 8-bit int
|
||||
'int16' -- 16-bit int
|
||||
'int32' -- 32-bit int
|
||||
'float32' -- 32-bit float
|
||||
'float64' -- 64-bit float
|
||||
*
|
||||
// String types
|
||||
'cstring' -- ASCII string terminated by a zero byte.
|
||||
'string:N' -- ASCII string of length N, where N is a literal integer.
|
||||
'string:variableName' -- ASCII string of length $variableName,
|
||||
where 'variableName' is a previously parsed number in the current struct.
|
||||
'string,CHARSET:N' -- String of byteLength N encoded with given CHARSET.
|
||||
'u16string:N' -- UCS-2 string of length N in DataStream endianness.
|
||||
'u16stringle:N' -- UCS-2 string of length N in little-endian.
|
||||
'u16stringbe:N' -- UCS-2 string of length N in big-endian.
|
||||
*
|
||||
// Complex types
|
||||
[name, type, name_2, type_2, ..., name_N, type_N] -- Struct
|
||||
function(dataStream, struct) {} -- Callback function to read and return data.
|
||||
{get: function(dataStream, struct) {},
|
||||
set: function(dataStream, struct) {}}
|
||||
-- Getter/setter functions to read and return data, handy for using the same
|
||||
struct definition for reading and writing structs.
|
||||
['[]', type, length] -- Array of given type and length. The length can be either
|
||||
a number, a string that references a previously-read
|
||||
field, or a callback function(struct, dataStream, type){}.
|
||||
If length is '*', reads in as many elements as it can.
|
||||
*
|
||||
@param structDefinition Struct definition object.
|
||||
@return The read struct. Null if failed to read struct.
|
||||
*/
|
||||
readStruct(structDefinition: any[]): Object;
|
||||
|
||||
/**
|
||||
Writes a struct to the DataStream. Takes a structDefinition that gives the
|
||||
types and a struct object that gives the values. Refer to readStruct for the
|
||||
structure of structDefinition.
|
||||
*
|
||||
@param structDefinition Type definition of the struct.
|
||||
@param struct The struct data object.
|
||||
*/
|
||||
writeStruct(structDefinition: Object, struct: Object): void;
|
||||
|
||||
/**
|
||||
Read UCS-2 string of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length The length of the string to read.
|
||||
@return The read string.
|
||||
*/
|
||||
readUCS2String(length: number): string;
|
||||
|
||||
/**
|
||||
Read UCS-2 string of desired length and endianness from the DataStream.
|
||||
*
|
||||
@param length The length of the string to read.
|
||||
@param endianness The endianness of the string data in the DataStream.
|
||||
@return The read string.
|
||||
*/
|
||||
readUCS2String(length: number, endianness: boolean): string;
|
||||
|
||||
/**
|
||||
Write a UCS-2 string of desired endianness to the DataStream. The
|
||||
lengthOverride argument lets you define the number of characters to write.
|
||||
If the string is shorter than lengthOverride, the extra space is padded with
|
||||
zeroes.
|
||||
*
|
||||
@param str The string to write.
|
||||
*/
|
||||
writeUCS2String(str: string): void;
|
||||
|
||||
/**
|
||||
Write a UCS-2 string of desired endianness to the DataStream. The
|
||||
lengthOverride argument lets you define the number of characters to write.
|
||||
If the string is shorter than lengthOverride, the extra space is padded with
|
||||
zeroes.
|
||||
*
|
||||
@param str The string to write.
|
||||
@param endianness The endianness to use for the written string data.
|
||||
*/
|
||||
writeUCS2String(str: string, endianness: boolean): void;
|
||||
|
||||
/**
|
||||
Write a UCS-2 string of desired endianness to the DataStream. The
|
||||
lengthOverride argument lets you define the number of characters to write.
|
||||
If the string is shorter than lengthOverride, the extra space is padded with
|
||||
zeroes.
|
||||
*
|
||||
@param str The string to write.
|
||||
@param endianness The endianness to use for the written string data.
|
||||
@param lengthOverride The number of characters to write.
|
||||
*/
|
||||
writeUCS2String(str: string, endianness: boolean, lengthOverride: number): void;
|
||||
|
||||
/**
|
||||
Read a string of desired length and encoding from the DataStream.
|
||||
*
|
||||
@param length The length of the string to read in bytes.
|
||||
@return The read string.
|
||||
*/
|
||||
readString(length: number): string;
|
||||
|
||||
/**
|
||||
Read a string of desired length and encoding from the DataStream.
|
||||
*
|
||||
@param length The length of the string to read in bytes.
|
||||
@param encoding The encoding of the string data in the DataStream. Defaults to ASCII.
|
||||
@return The read string.
|
||||
*/
|
||||
readString(length: number, encoding: string): string;
|
||||
|
||||
/**
|
||||
Writes a string of desired length and encoding to the DataStream.
|
||||
*
|
||||
@param s The string to write.
|
||||
*/
|
||||
writeString(s: string): void;
|
||||
|
||||
/**
|
||||
Writes a string of desired length and encoding to the DataStream.
|
||||
*
|
||||
@param s The string to write.
|
||||
@param encoding The encoding for the written string data. Defaults to ASCII.
|
||||
*/
|
||||
writeString(s: string, encoding: string): void;
|
||||
|
||||
/**
|
||||
Writes a string of desired length and encoding to the DataStream.
|
||||
*
|
||||
@param s The string to write.
|
||||
@param encoding The encoding for the written string data. Defaults to ASCII.
|
||||
@param length The number of characters to write.
|
||||
*/
|
||||
writeString(s: string, encoding: string, length: number): void;
|
||||
|
||||
/**
|
||||
Read null-terminated string of desired length from the DataStream. Truncates
|
||||
the returned string so that the null byte is not a part of it.
|
||||
*
|
||||
@return The read string.
|
||||
*/
|
||||
readCString(): string;
|
||||
|
||||
/**
|
||||
Read null-terminated string of desired length from the DataStream. Truncates
|
||||
the returned string so that the null byte is not a part of it.
|
||||
*
|
||||
@param length The length of the string to read.
|
||||
@return The read string.
|
||||
*/
|
||||
readCString(length: number): string;
|
||||
|
||||
/**
|
||||
Writes a null-terminated string to DataStream and zero-pads it to length
|
||||
bytes. If length is not given, writes the string followed by a zero.
|
||||
If string is longer than length, the written part of the string does not have
|
||||
a trailing zero.
|
||||
*
|
||||
@param s The string to write.
|
||||
*/
|
||||
writeCString(s: string): void;
|
||||
|
||||
/**
|
||||
Writes a null-terminated string to DataStream and zero-pads it to length
|
||||
bytes. If length is not given, writes the string followed by a zero.
|
||||
If string is longer than length, the written part of the string does not have
|
||||
a trailing zero.
|
||||
*
|
||||
@param s The string to write.
|
||||
@param length The number of characters to write.
|
||||
*/
|
||||
writeCString(s: string, length: number): void;
|
||||
|
||||
/**
|
||||
Reads an object of type t from the DataStream, passing struct as the thus-far
|
||||
read struct to possible callbacks that refer to it. Used by readStruct for
|
||||
reading in the values, so the type is one of the readStruct types.
|
||||
*
|
||||
@param t Type of the object to read.
|
||||
@return Returns the object on successful read, null on unsuccessful.
|
||||
*/
|
||||
readType(t: Object): Object;
|
||||
|
||||
/**
|
||||
Reads an object of type t from the DataStream, passing struct as the thus-far
|
||||
read struct to possible callbacks that refer to it. Used by readStruct for
|
||||
reading in the values, so the type is one of the readStruct types.
|
||||
*
|
||||
@param t Type of the object to read.
|
||||
@param struct Struct to refer to when resolving length references and for calling callbacks.
|
||||
@return Returns the object on successful read, null on unsuccessful.
|
||||
*/
|
||||
readType(t: Object, struct: Object): Object;
|
||||
|
||||
/**
|
||||
Writes object v of type t to the DataStream.
|
||||
*
|
||||
@param t Type of data to write.
|
||||
@param v Value of data to write.
|
||||
@param struct Struct to pass to write callback functions.
|
||||
*/
|
||||
writeType(t: Object, v: Object, struct: Object): void;
|
||||
}
|
||||
Vendored
+11
-1
@@ -576,7 +576,7 @@ declare module AceAjax {
|
||||
/**
|
||||
* Returns the current tab size.
|
||||
**/
|
||||
getTabSize(): string;
|
||||
getTabSize(): number;
|
||||
|
||||
/**
|
||||
* Returns `true` if the character at the position is a soft tab.
|
||||
@@ -1034,6 +1034,9 @@ declare module AceAjax {
|
||||
* Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them.
|
||||
**/
|
||||
export interface Editor {
|
||||
|
||||
addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any);
|
||||
addEventListener(ev: string, callback: Function);
|
||||
|
||||
inMultiSelectMode: boolean;
|
||||
|
||||
@@ -1710,6 +1713,13 @@ declare module AceAjax {
|
||||
**/
|
||||
new(renderer: VirtualRenderer, session?: IEditSession): Editor;
|
||||
}
|
||||
|
||||
interface EditorChangeEvent {
|
||||
start: Position;
|
||||
end: Position;
|
||||
action: string; // insert, remove
|
||||
lines: any[];
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
/// PlaceHolder
|
||||
|
||||
@@ -10,35 +10,41 @@ module controllers {
|
||||
|
||||
static $inject = ["$upload"];
|
||||
constructor(
|
||||
private $upload: ng.angularFileUpload.IUploadService
|
||||
private $upload: angular.angularFileUpload.IUploadService
|
||||
) {
|
||||
}
|
||||
|
||||
onFileSelect($files: File[]) {
|
||||
//$files: an array of files selected, each file has name, size, and type.
|
||||
var uploads: ng.IPromise<any>[] = [];
|
||||
// $files: an array of files selected, each file has name, size, and type.
|
||||
for (var i = 0; i < $files.length; i++) {
|
||||
var file = $files[i];
|
||||
uploads.push(this.$upload.upload<any>({
|
||||
url: "/api/upload",
|
||||
method: "POST",
|
||||
data: {
|
||||
extraData: {
|
||||
fileName: file.name, test: "anything"
|
||||
}
|
||||
},
|
||||
file: file
|
||||
this.$upload.upload({
|
||||
url: "/api/upload",
|
||||
method: "POST",
|
||||
data: {
|
||||
extraData: {
|
||||
fileName: file.name,
|
||||
test: "anything"
|
||||
}
|
||||
},
|
||||
file: file
|
||||
})
|
||||
.abort()
|
||||
.xhr((evt: any) => {
|
||||
console.log('xhr');
|
||||
})
|
||||
.progress((evt: any) => {
|
||||
console.log('progress');
|
||||
})
|
||||
.then(success => {
|
||||
// file is uploaded successfully
|
||||
console.log(success.data);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
}));
|
||||
.progress((evt: angular.angularFileUpload.IFileProgressEvent) => {
|
||||
var percent = parseInt((100.0 * evt.loaded / evt.total).toString(), 10);
|
||||
console.log("upload progress: " + percent + "% for " + evt.config.file.name);
|
||||
})
|
||||
.error((data: any, status: number, response: any, headers: any) => {
|
||||
console.error(data, status, response, headers);
|
||||
})
|
||||
.success((data: any, status: number, headers: any, config: angular.angularFileUpload.IFileUploadConfig) => {
|
||||
// file is uploaded successfully
|
||||
console.log("Success!", data, status, headers, config);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-6
@@ -1,5 +1,5 @@
|
||||
// Type definitions for Angular File Upload 1.6.7
|
||||
// Project: https://github.com/danialfarid/angular-file-upload
|
||||
// Type definitions for Angular File Upload 4.2.1
|
||||
// Project: https://github.com/danialfarid/ng-file-upload
|
||||
// Definitions by: John Reilly <https://github.com/johnnyreilly>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
@@ -9,18 +9,24 @@ declare module angular.angularFileUpload {
|
||||
|
||||
interface IUploadService {
|
||||
|
||||
http<T>(config: ng.IRequestConfig): IUploadPromise<T>;
|
||||
http<T>(config: IRequestConfig): IUploadPromise<T>;
|
||||
upload<T>(config: IFileUploadConfig): IUploadPromise<T>;
|
||||
}
|
||||
|
||||
interface IUploadPromise<T> extends IHttpPromise<T> {
|
||||
|
||||
abort(): IUploadPromise<T>;
|
||||
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
|
||||
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
|
||||
}
|
||||
|
||||
interface IFileUploadConfig extends ng.IRequestConfig {
|
||||
interface IFileUploadConfig extends IRequestConfig {
|
||||
|
||||
file: File;
|
||||
fileName?: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface IFileProgressEvent extends ProgressEvent {
|
||||
|
||||
config: IFileUploadConfig;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
/// <reference path="angular-jwt.d.ts" />
|
||||
|
||||
var app = angular.module("angular-jwt-tests", ["angular-jwt"]);
|
||||
|
||||
var $jwtHelper: angular.jwt.IJwtHelper;
|
||||
|
||||
var expToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NhbXBsZXMuYXV0aDAuY29tLyIsInN1YiI6ImZhY2Vib29rfDEwMTU0Mjg3MDI3NTEwMzAyIiwiYXVkIjoiQlVJSlNXOXg2MHNJSEJ3OEtkOUVtQ2JqOGVESUZ4REMiLCJleHAiOjE0MTIyMzQ3MzAsImlhdCI6MTQxMjE5ODczMH0.7M5sAV50fF1-_h9qVbdSgqAnXVF7mz3I6RjS6JiH0H8';
|
||||
var tokenPayload = $jwtHelper.decodeToken(expToken);
|
||||
var date = $jwtHelper.getTokenExpirationDate(expToken);
|
||||
var bool = $jwtHelper.isTokenExpired(expToken);
|
||||
|
||||
var $jwtInterceptor: angular.jwt.IJwtInterceptor;
|
||||
|
||||
$jwtInterceptor.tokenGetter = () => {
|
||||
return expToken;
|
||||
}
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for angular-jwt 0.0.8
|
||||
// Project: https://github.com/auth0/angular-jwt
|
||||
// Definitions by: Reto Rezzonico <https://github.com/rerezz>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module angular.jwt {
|
||||
|
||||
interface JwtToken {
|
||||
iss: string;
|
||||
sub: string;
|
||||
aud: string;
|
||||
exp: number;
|
||||
nbf: number;
|
||||
iat: number;
|
||||
jti: string;
|
||||
unique_name: string;
|
||||
}
|
||||
|
||||
interface IJwtHelper {
|
||||
decodeToken(token: string): JwtToken;
|
||||
getTokenExpirationDate(token: any): Date;
|
||||
isTokenExpired(token: any, offsetSeconds?: number): boolean;
|
||||
}
|
||||
|
||||
interface IJwtInterceptor {
|
||||
tokenGetter(): string;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
+4
-4
@@ -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
|
||||
@@ -129,7 +129,7 @@ declare module angular.local.storage {
|
||||
* @param value optional
|
||||
* @param key The corresponding key used in local storage
|
||||
*/
|
||||
bind(scope:ng.IScope, property: string, value?: any, key?: string): Function;
|
||||
bind(scope: angular.IScope, property: string, value?: any, key?: string): Function;
|
||||
/**
|
||||
* Return the derive key
|
||||
* Returns String
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
/// <reference path='../angularjs/angular.d.ts' />
|
||||
/// <reference path='angular-localForage.d.ts' />
|
||||
|
||||
var app = angular.module('angular-localForage-tests', ['LocalForageModule']);
|
||||
app.config(function (localStorageServiceProvider:angular.localForage.ILocalForageProvider) {
|
||||
|
||||
//TODO
|
||||
});
|
||||
|
||||
var $rootScope:angular.IRootScopeService,
|
||||
$localForage:angular.localForage.ILocalForageService,
|
||||
instanceVersion = 0;
|
||||
|
||||
// create a fresh instance
|
||||
$localForage.clear().then(function () {
|
||||
$localForage = $localForage.createInstance({
|
||||
name: ++instanceVersion
|
||||
});
|
||||
});
|
||||
|
||||
$localForage.getItem('this key is unknown').then(function (value) {
|
||||
|
||||
});
|
||||
|
||||
|
||||
$localForage.setItem('myName', 'Olivier Combe').then(function (data) {
|
||||
|
||||
$localForage.getItem('myName').then(function (data) {
|
||||
});
|
||||
});
|
||||
|
||||
var values = ['Olivier Combe', 'AngularJs', 'Open Source'];
|
||||
|
||||
$localForage.setItem(['myName', 'myPassion', 'myHobbie'], values).then(function (data) {
|
||||
|
||||
$localForage.getItem(['myHobbie', 'myName']).then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$localForage.removeItem('myName').then(function () {
|
||||
|
||||
$localForage.getItem('myName').then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$localForage.removeItem(['myName', 'myPassion']).then(function () {
|
||||
|
||||
$localForage.getItem(['myName', 'myPassion', 'myHobbie']).then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$localForage.pull('myName').then(function (data) {
|
||||
|
||||
$localForage.getItem('myName').then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
$localForage.pull(['myName', 'myPassion']).then(function (data) {
|
||||
|
||||
$localForage.getItem(['myName', 'myPassion', 'myHobbie']).then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$localForage.setItem('myName', 'Olivier Combe').then(function (d) {
|
||||
|
||||
$localForage.getItem('myName').then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$localForage.setDriver('localStorageWrapper').then(function () {
|
||||
$localForage.setItem('myName', 'Olivier Combe').then(function (d) {
|
||||
$localForage.getItem('myName').then(function (data) {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$localForage.setItem('myArray', [{
|
||||
$$hashKey: '00A',
|
||||
name: 'Olivier Combe'
|
||||
}]).then(function (d) {
|
||||
|
||||
$localForage.getItem('myArray').then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$localForage.setDriver('localStorageWrapper').then(function () {
|
||||
$localForage.setItem('myArray', [{
|
||||
$$hashKey: '00A',
|
||||
name: 'Olivier Combe'
|
||||
}]).then(function (d) {
|
||||
|
||||
$localForage.getItem('myArray').then(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
var aFileParts = ["<a id=\"a\"><b id=\"b\">hey!<\/b><\/a>"];
|
||||
var oMyBlob = new Blob(aFileParts, {"type": "text\/xml"}); // the blob
|
||||
|
||||
$localForage.setItem('myBlob', oMyBlob).then(function (data) {
|
||||
});
|
||||
|
||||
// $localForage.setItem(['myName', 'myPassion', 'myHobbie'], 'value');
|
||||
|
||||
// $localForage.setItem();
|
||||
|
||||
|
||||
$localForage.iterate(function (value, key) {
|
||||
}).then(function (data) {
|
||||
});
|
||||
|
||||
$localForage.iterate(function (value, key) {
|
||||
if (key == 'myPassion') {
|
||||
return value;
|
||||
}
|
||||
}).then(function (data) {
|
||||
});
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
// Type definitions for angular-localForage 1.2.2
|
||||
// Project: https://github.com/ocombe/angular-localForage
|
||||
// Definitions by: Stefan Steinhart <https://github.com/reppners>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../localForage/localForage.d.ts" />
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module angular.localForage {
|
||||
|
||||
interface LocalForageConfig {
|
||||
driver?:string;
|
||||
name?:string | number;
|
||||
version?:number;
|
||||
storeName?:string;
|
||||
description?:string;
|
||||
}
|
||||
|
||||
interface ILocalForageProvider {
|
||||
config(config:LocalForageConfig):void;
|
||||
setNotify(onItemSet:boolean, onItemRemove:boolean):void;
|
||||
}
|
||||
|
||||
interface ILocalForageService {
|
||||
setDriver(driver:string):angular.IPromise<void>;
|
||||
driver<T>():lf.ILocalForage<T>;
|
||||
|
||||
setItem(key:string, value:any):angular.IPromise<void>;
|
||||
setItem(keys:Array<string>, values:Array<any>):angular.IPromise<void>;
|
||||
|
||||
getItem(key:string):angular.IPromise<any>;
|
||||
getItem(keys:Array<string>):angular.IPromise<Array<any>>;
|
||||
|
||||
removeItem(key:string | Array<string>):angular.IPromise<void>;
|
||||
|
||||
pull(key:string):angular.IPromise<any>;
|
||||
pull(keys:Array<string>):angular.IPromise<Array<any>>;
|
||||
|
||||
clear():angular.IPromise<void>;
|
||||
|
||||
key(n:number):angular.IPromise<string>;
|
||||
|
||||
keys():angular.IPromise<string>;
|
||||
|
||||
length():angular.IPromise<number>;
|
||||
|
||||
iterate<T>(iteratorCallback:(value:string | number, key:string)=>T):angular.IPromise<T>;
|
||||
|
||||
bind($scope:ng.IScope, key:string):void;
|
||||
|
||||
bind($scope:ng.IScope, config:{
|
||||
key:string;
|
||||
defaultValue:any;
|
||||
scopeKey:string;
|
||||
name:string;
|
||||
}):void;
|
||||
|
||||
unbind($scope:ng.IScope, key:string, scopeKey?:string):void;
|
||||
|
||||
createInstance(config:LocalForageConfig):ILocalForageService;
|
||||
instance(name:string):ILocalForageService;
|
||||
}
|
||||
}
|
||||
+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;
|
||||
}
|
||||
}
|
||||
+38
-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;
|
||||
}
|
||||
@@ -97,6 +102,7 @@ declare module angular.material {
|
||||
capsule(capsule: boolean): T;
|
||||
theme(theme: string): T;
|
||||
hideDelay(delay: number): T;
|
||||
position(position: string): T;
|
||||
}
|
||||
|
||||
interface MDSimpleToastPreset extends MDToastPreset<MDSimpleToastPreset> {
|
||||
@@ -105,14 +111,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 +183,7 @@ declare module angular.material {
|
||||
|
||||
interface MDTheme {
|
||||
name: string;
|
||||
isDark: boolean;
|
||||
colors: MDThemeColors;
|
||||
foregroundPalette: MDThemeGrayScalePalette;
|
||||
foregroundShadow: string;
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
/// <reference path="angular-meteor.d.ts" />
|
||||
|
||||
interface ITodo {
|
||||
_id?: string;
|
||||
name: string;
|
||||
public?: boolean;
|
||||
sticky?: boolean;
|
||||
}
|
||||
|
||||
interface TodoAngularMeteorObject extends ITodo, angular.meteor.AngularMeteorObject<ITodo> {}
|
||||
|
||||
interface CustomScope extends angular.meteor.IScope {
|
||||
sticky: boolean;
|
||||
|
||||
todos: angular.meteor.AngularMeteorCollection<ITodo>;
|
||||
stickyTodos: angular.meteor.AngularMeteorCollection<ITodo>;
|
||||
notAutoTodos: angular.meteor.AngularMeteorCollection<ITodo>;
|
||||
|
||||
todo: ITodo;
|
||||
todoNotAuto: TodoAngularMeteorObject;
|
||||
todoSubscribed: TodoAngularMeteorObject;
|
||||
|
||||
save: (todo: ITodo) => void;
|
||||
saveAll: () =>void;
|
||||
autoSave: (todo: ITodo) => void;
|
||||
remove: (todoId: string) => void;
|
||||
removeAll: () => void;
|
||||
removeAuto: (todo: ITodo) => void;
|
||||
toSticky: (todo: ITodo) => void;
|
||||
}
|
||||
|
||||
var Todos = new Mongo.Collection<ITodo>('todos');
|
||||
|
||||
var app = angular.module('angularMeteorTestApp');
|
||||
|
||||
app.controller("mainCtrl", ['$scope', '$meteor', ($scope: CustomScope, $meteor: angular.meteor.IMeteorService) => {
|
||||
// Bind all the todos to $scope.todos
|
||||
$scope.todos = $meteor.collection(Todos);
|
||||
|
||||
$scope.sticky = true;
|
||||
// Bind all sticky todos to $scope.stickyTodos
|
||||
// Binds the query to $scope.sticky so that if it changes, Meteor will re-run the query and bind it
|
||||
// to $scope.stickyTodos
|
||||
$scope.stickyTodos = $meteor.collection<ITodo>(function(){
|
||||
return Todos.find({sticky: $scope.getReactively('sticky')});
|
||||
});
|
||||
|
||||
// Bind without auto-save all todos to $scope.notAutoTodos
|
||||
$scope.notAutoTodos = $meteor.collection(Todos, false).subscribe("publicTodos");
|
||||
|
||||
$scope.todoNotAuto = <TodoAngularMeteorObject>$meteor.object(Todos, 'TodoID', false);
|
||||
$scope.todoSubscribed = <TodoAngularMeteorObject>$meteor.object(Todos, 'TodoID').subscribe('todos');
|
||||
$scope.todo = $scope.todoNotAuto.getRawObject();
|
||||
$scope.todoNotAuto.reset();
|
||||
$scope.todoNotAuto.save($scope.todo).then((data) => { return data == 1; });;
|
||||
|
||||
// todo might be an object like this {text: "Learn Angular", sticky: false}
|
||||
// or an array like this:
|
||||
// [{text: "Learn Angular", sticky: false}, {text: "Hello World", sticky: true}]
|
||||
|
||||
$scope.save = function(todo) {
|
||||
$scope.notAutoTodos.save(todo);
|
||||
};
|
||||
|
||||
$scope.saveAll = function() {
|
||||
$scope.notAutoTodos.save();
|
||||
};
|
||||
|
||||
$scope.autoSave = function(todo) {
|
||||
$scope.todos.push(todo);
|
||||
};
|
||||
|
||||
// todoId might be an string like this "WhrnEez5yBRgo4yEm"
|
||||
// or an array like this ["WhrnEez5yBRgo4yEm","gH6Fa4DXA3XxQjXNS"]
|
||||
$scope.remove = function(todoId) {
|
||||
$scope.notAutoTodos.remove(todoId);
|
||||
};
|
||||
|
||||
$scope.removeAll = function() {
|
||||
$scope.notAutoTodos.remove();
|
||||
};
|
||||
|
||||
$scope.removeAuto = function(todo) {
|
||||
$scope.todos.splice( $scope.todos.indexOf(todo), 1 );
|
||||
}
|
||||
|
||||
$scope.toSticky = function(todo) {
|
||||
if (angular.isArray(todo)){
|
||||
angular.forEach(todo, function(object) {
|
||||
object.sticky = true;
|
||||
});
|
||||
} else {
|
||||
todo.sticky = true;
|
||||
}
|
||||
|
||||
$scope.stickyTodos.save(todo);
|
||||
};
|
||||
|
||||
var todoObject = {name:'first todo'};
|
||||
var todosArray = [{name:'second todo'}, {name:'third todo'}];
|
||||
var todoSecondObject = {name:'forth todo'};
|
||||
|
||||
$scope.todos.save(todoObject); // todos equals [{name:'first todo'}]
|
||||
|
||||
$scope.todos.save(todosArray); // todos equals [{name:'first todo'}, {name:'second todo'}, {name:'third todo'}]
|
||||
|
||||
$scope.todos.push(todoSecondObject); // The scope variable equals to [{name:'first todo'}, {name:'second todo'}, {name:'third todo'}, {name:'forth todo'}]
|
||||
// but the collection still equals to [{name:'first todo'}, {name:'second todo'}, {name:'third todo'}]
|
||||
|
||||
$scope.todos.save(); // Now the collection also equals to [{name:'first todo'}, {name:'second todo'}, {name:'third todo'}, {name:'forth todo'}]
|
||||
|
||||
$scope.todos.remove('firstTodoId'); // scope and collection equals to [{name:'second todo'}, {name:'third todo'}, {name:'forth todo'}]
|
||||
|
||||
var todoIdsArray = ['secondTodoId', 'thirdTodoId'];
|
||||
$scope.todos.remove(todoIdsArray); // removes everything matches the array of IDs both in scope and in collection
|
||||
|
||||
$scope.todos.pop(); // removes only in scope
|
||||
|
||||
$scope.todos.remove(); // syncs also in Meteor collection
|
||||
|
||||
// Subscribe ->
|
||||
|
||||
$meteor.subscribe('todos').then((subscriptionHandle) => {
|
||||
// Bind all the todos to $scope.todos
|
||||
$scope.todos = $meteor.collection(Todos);
|
||||
|
||||
console.log($scope.todos + ' is ready');
|
||||
|
||||
// You can use the subscription handle to stop the subscription if you want
|
||||
subscriptionHandle.stop();
|
||||
});
|
||||
|
||||
$scope.subscribe('todos').then((subscriptionHandle) => {
|
||||
// Bind all the todos to $scope.books
|
||||
$scope.todos = $meteor.collection(Todos);
|
||||
|
||||
console.log($scope.todos + ' is ready');
|
||||
|
||||
// No need to stop the subscription, it will automatically close on scope destroy
|
||||
});
|
||||
|
||||
$meteor.call<ITodo>('subscribe', $scope.todo._id, $scope.currentUser._id).then((data) => {
|
||||
// Handle success
|
||||
console.log('success subscribing', data.name);
|
||||
}, (err) => {
|
||||
// Handle error
|
||||
console.log('failed', err);
|
||||
});
|
||||
|
||||
if (!$scope.loggingIn) {
|
||||
$meteor.waitForUser();
|
||||
|
||||
$meteor.requireUser();
|
||||
|
||||
$meteor.requireValidUser(user => {
|
||||
return user.username == 'admin';
|
||||
});
|
||||
|
||||
$meteor.loginWithPassword('user', 'password').then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
|
||||
$meteor.createUser({
|
||||
username:'moma',
|
||||
email:'example@gmail.com',
|
||||
password: 'Bksd@asdf',
|
||||
profile: {expertize: 'Developer'}
|
||||
}).then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
|
||||
$meteor.changePassword('old', 'new232f3').then(() => {
|
||||
console.log('Change password success');
|
||||
}, err => {
|
||||
console.log('Error changing password - ', err);
|
||||
});
|
||||
|
||||
$meteor.forgotPassword({email: 'sample@gmail.com'}).then(() => {
|
||||
console.log('Success sending forgot password email');
|
||||
}, err => {
|
||||
console.log('Error sending forgot password email - ', err);
|
||||
});
|
||||
|
||||
$meteor.resetPassword('tokenID', 'new232f3').then(() => {
|
||||
console.log('Reset password success');
|
||||
}, err => {
|
||||
console.log('Error resetting password - ', err);
|
||||
});
|
||||
|
||||
$meteor.verifyEmail('tokenID').then(() => {
|
||||
console.log('Success verifying password ');
|
||||
}, err => {
|
||||
console.log('Error verifying password - ', err);
|
||||
});
|
||||
|
||||
$meteor.logout().then(() => {
|
||||
console.log('Logout success');
|
||||
}, err => {
|
||||
console.log('logout error - ', err);
|
||||
});
|
||||
|
||||
$meteor.logoutOtherClients().then(() => {
|
||||
console.log('Logout success');
|
||||
}, err => {
|
||||
console.log('logout error - ', err);
|
||||
});
|
||||
|
||||
var loginWithOptions = {requestPermissions: ['email']};
|
||||
|
||||
$meteor.loginWithFacebook({requestPermissions: ['email']}).then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
$meteor.loginWithGithub({requestPermissions: ['email']}).then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
$meteor.loginWithGoogle({requestPermissions: ['email']}).then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
$meteor.loginWithMeetup({requestPermissions: ['email']}).then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
$meteor.loginWithTwitter({requestPermissions: ['email']}).then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
$meteor.loginWithWeibo({requestPermissions: ['email']}).then(() => {
|
||||
console.log('Login success');
|
||||
}, err => {
|
||||
console.log('Login error - ', err);
|
||||
});
|
||||
}
|
||||
|
||||
$meteor.autorun($scope, () => { console.log("Aurorun triggered."); });
|
||||
$meteor.getCollectionByName('collectionName');
|
||||
|
||||
// requires meteor add mdg:camera
|
||||
$meteor.getPicture().then(function(data){
|
||||
$scope['picture'] = data;
|
||||
});
|
||||
|
||||
$meteor.session('counter').bind($scope, 'counter');
|
||||
}]);
|
||||
Vendored
+330
@@ -0,0 +1,330 @@
|
||||
// Type definitions for Angular JS Meteor v0.8.8 (angular.meteor module)
|
||||
// Project: https://github.com/Urigo/angular-meteor
|
||||
// Definitions by: Peter Grman <https://github.com/pgrm>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../meteor/meteor.d.ts" />
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module angular.meteor {
|
||||
interface IRootScopeService extends angular.IRootScopeService {
|
||||
/**
|
||||
* The current logged in user and it's data. it is null if the user is not logged in. A reactive data source.
|
||||
*/
|
||||
currentUser: Meteor.User;
|
||||
|
||||
/**
|
||||
* True if a login method (such as Meteor.loginWithPassword, Meteor.loginWithFacebook, or Accounts.createUser) is currently in progress.
|
||||
* A reactive data source. Can be use to display animation while user is logging in.
|
||||
*/
|
||||
loggingIn: boolean;
|
||||
}
|
||||
|
||||
interface IScope extends angular.IScope, IRootScopeService {
|
||||
/**
|
||||
* A method to get a $scope variable and watch it reactivly
|
||||
*
|
||||
* @param scopeVariableName - The name of the scope's variable to bind to
|
||||
* @param [objectEquality=false] - Watch the object equality using angular.equals instead of comparing for reference equality, deeper watch but also slower
|
||||
*/
|
||||
getReactively(scopeVariableName: string, objectEquality?: boolean): ReactiveResult;
|
||||
|
||||
/**
|
||||
* A service which is a wrapper for Meteor.subscribe. It subscribes to a Meteor.publish method in the client and returns a AngularJS promise when ready.
|
||||
* Calling $scope.subscribe will automatically stop the subscription when the scope is destroyed.
|
||||
*
|
||||
* @param name - Name of the subscription. Matches the name of the server's publish() call.
|
||||
* @param publisherArguments - Optional arguments passed to publisher function on server.
|
||||
*
|
||||
* @return The promise solved successfully when subscription is ready. The success promise holds the subscription handle.
|
||||
*/
|
||||
subscribe(name: string, ...publisherArguments: any[]): angular.IPromise<Meteor.SubscriptionHandle>;
|
||||
}
|
||||
|
||||
/**
|
||||
* $meteor in angularjs
|
||||
*/
|
||||
interface IMeteorService {
|
||||
/**
|
||||
* A service that wraps the Meteor collections to enable reactivity within AngularJS.
|
||||
*
|
||||
* @param collection - A Meteor Collection or a reactive function to bind to.
|
||||
* - Reactive function can be used with $scope.getReactively to add $scope variable as reactive variable to the cursor.
|
||||
* @param [autoClientSave=true] - By default, changes in the Angular collection will automatically update the Meteor collection.
|
||||
* - However if set to false, changes in the client won't be automatically propagated back to the Meteor collection.
|
||||
*/
|
||||
collection<T>(collection: Mongo.Collection<T>|ReactiveResult|Function|(()=>T), autoClientSave?: boolean): AngularMeteorCollection<T>;
|
||||
|
||||
/**
|
||||
* A service that wraps the Meteor collections to enable reactivity within AngularJS.
|
||||
*
|
||||
* @param collection - A Meteor Collection or a reactive function to bind to.
|
||||
* - Reactive function can be used with $scope.getReactively to add $scope variable as reactive variable to the cursor.
|
||||
* @param [autoClientSave=true] - By default, changes in the Angular collection will automatically update the Meteor collection.
|
||||
* - However if set to false, changes in the client won't be automatically propagated back to the Meteor collection.
|
||||
* @param [updateCollection] - A collection object which will be used for updates (insert, update, delete).
|
||||
*/
|
||||
collection<T, U>(collection: Mongo.Collection<T>|ReactiveResult|Function|(()=>T), autoClientSave: boolean, updateCollection: Mongo.Collection<U>): AngularMeteorCollection2<T, U>;
|
||||
|
||||
/**
|
||||
* A service that wraps a Meteor object to enable reactivity within AngularJS.
|
||||
* Finds the first document that matches the selector, as ordered by sort and skip options. Wraps collection.findOne
|
||||
*
|
||||
* @param collection - A Meteor Collection to bind to.
|
||||
* @param selector - A query describing the documents to find or just the ID of the document.
|
||||
* - $meteor.object will find the first document that matches the selector,
|
||||
* - as ordered by sort and skip options, exactly like Meteor's collection.findOne
|
||||
* @param [autoClientSave=true] - By default, changes in the Angular object will automatically update the Meteor object.
|
||||
* - However if set to false, changes in the client won't be automatically propagated back to the Meteor object.
|
||||
*/
|
||||
object<T>(collection: Mongo.Collection<T>, selector: Mongo.Selector|Mongo.ObjectID|string, autoClientSave?: boolean): AngularMeteorObject<T>;
|
||||
|
||||
/**
|
||||
* A service which is a wrapper for Meteor.subscribe. It subscribes to a Meteor.publish method in the client and returns a AngularJS promise when ready.
|
||||
*
|
||||
* @param name - Name of the subscription. Matches the name of the server's publish() call.
|
||||
* @param publisherArguments - Optional arguments passed to publisher function on server.
|
||||
*
|
||||
* @return The promise solved successfully when subscription is ready. The success promise holds the subscription handle.
|
||||
*/
|
||||
subscribe(name: string, ...publisherArguments: any[]): angular.IPromise<Meteor.SubscriptionHandle>;
|
||||
|
||||
/**
|
||||
* A service service which wraps up Meteor.methods with AngularJS promises.
|
||||
*
|
||||
* @param name - Name of method to invoke
|
||||
* @param methodArguments - Optional method arguments
|
||||
*
|
||||
* @return The promise solves successfully with the return value of the method or return reject with the error from the method.
|
||||
*/
|
||||
call<T>(name: string, ...methodArguments: any[]): angular.IPromise<T>;
|
||||
|
||||
// User Authentication BEGIN ->
|
||||
|
||||
/**
|
||||
* Returns a promise fulfilled with the currentUser when the user subscription is ready.
|
||||
* This is useful when you want to grab the current user before the route is rendered.
|
||||
* If there is no logged in user, it will return null.
|
||||
* See the “Authentication with Routers” section of our tutorial for more information and a full example.
|
||||
*/
|
||||
waitForUser(): angular.IPromise<Meteor.User>;
|
||||
|
||||
/**
|
||||
* Resolves the promise successfully if a user is authenticated and rejects otherwise.
|
||||
* This is useful in cases where you want to require a route to have an authenticated user.
|
||||
* You can catch the rejected promise and redirect the unauthenticated user to a different page, such as the login page.
|
||||
* See the “Authentication with Routers” section of our tutorial for more information and a full example.
|
||||
*/
|
||||
requireUser(): angular.IPromise<Meteor.User>;
|
||||
|
||||
/**
|
||||
* Resolves the promise successfully if a user is authenticated and the validatorFn returns true; rejects otherwise.
|
||||
* This is useful in cases where you want to require a route to have an authenticated user and do extra validation like the user's role or group.
|
||||
* You can catch the rejected promise and redirect the unauthenticated user to a different page, such as the login page.
|
||||
* See the “Authentication with Routers” section of our tutorial for more information and a full example.
|
||||
*
|
||||
* The mandatory validator function will be called with the authenticated user as the single param and it's expected to return true in order to resolve.
|
||||
* If it returns a string, the promise will be rejected using said string as the reason.
|
||||
* Any other return (false, null, undefined) will be rejected with the default "FORBIDDEN" reason.
|
||||
*/
|
||||
requireValidUser(validatorFn: (user: Meteor.User) => boolean|string): angular.IPromise<Meteor.User>;
|
||||
|
||||
/**
|
||||
* Log the user in with a password.
|
||||
*
|
||||
* @param user - Either a string interpreted as a username or an email; or an object with a single key: email, username or id.
|
||||
* @param password - The user's password.
|
||||
*/
|
||||
loginWithPassword(user: string|{email: string}|{username: string}|{id: string}, password: string): angular.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Create a new user. More information: http://docs.meteor.com/#/full/accounts_createuser
|
||||
*
|
||||
* @param options.username - A unique name for this user. Either this, or email is required.
|
||||
* @param options.email - The user's email address. Either this, or username is required.
|
||||
* @param options.password - The user's password. This is not sent in plain text over the wire.
|
||||
* @param options.profile - The user's profile, typically including the name field.
|
||||
*/
|
||||
createUser(options: {username?: string; email?: string; password: string; profile?: Object}): angular.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Change the current user's password. Must be logged in.
|
||||
*
|
||||
* @param oldPassword - The user's current password. This is not sent in plain text over the wire.
|
||||
* @param newPassword - A new password for the user. This is not sent in plain text over the wire.
|
||||
*/
|
||||
changePassword(oldPassword: string, newPassword: string): angular.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Request a forgot password email.
|
||||
*
|
||||
* @param options.email - The email address to send a password reset link.
|
||||
*/
|
||||
forgotPassword(options: {email: string}): angular.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Reset the password for a user using a token received in email. Logs the user in afterwards.
|
||||
*
|
||||
* @param token - The token retrieved from the reset password URL.
|
||||
* @param newPassword - A new password for the user. This is not sent in plain text over the wire.
|
||||
*/
|
||||
resetPassword(token: string, newPassword: string): angular.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Marks the user's email address as verified. Logs the user in afterwards.
|
||||
*
|
||||
* @param token - The token retrieved from the reset password URL.
|
||||
*/
|
||||
verifyEmail(token: string): angular.IPromise<void>;
|
||||
|
||||
loginWithFacebook: ILoginWithExternalService;
|
||||
loginWithTwitter: ILoginWithExternalService;
|
||||
loginWithGoogle: ILoginWithExternalService;
|
||||
loginWithGithub: ILoginWithExternalService;
|
||||
loginWithMeetup: ILoginWithExternalService;
|
||||
loginWithWeibo: ILoginWithExternalService;
|
||||
|
||||
/**
|
||||
* Log the user out.
|
||||
*
|
||||
* @return Resolves with no arguments on success, or reject with a Error argument on failure.
|
||||
*/
|
||||
logout(): angular.IPromise<void>;
|
||||
|
||||
/**
|
||||
* Log out other clients logged in as the current user, but does not log out the client that calls this function.
|
||||
* For example, when called in a user's browser, connections in that browser remain logged in,
|
||||
* but any other browsers or DDP clients logged in as that user will be logged out.
|
||||
*
|
||||
* @return Resolves with no arguments on success, or reject with a Error argument on failure.
|
||||
*/
|
||||
logoutOtherClients(): angular.IPromise<void>;
|
||||
|
||||
// <- User Authentication END
|
||||
// $meteorUtils BEGIN ->
|
||||
|
||||
/**
|
||||
* @param scope - The AngularJS scope you use the autorun on.
|
||||
* @param fn - The function that will re-run every time a reactive variable changes inside it.
|
||||
*/
|
||||
autorun(scope: angular.IScope, fn: Function): void;
|
||||
|
||||
/**
|
||||
* @param collectionName - The name of the collection you want to get back
|
||||
*/
|
||||
getCollectionByName<T>(collectionName: string): Mongo.Collection<T>;
|
||||
|
||||
// <- $meteorUtils END
|
||||
// $meteorCamera BEGIN ->
|
||||
|
||||
/**
|
||||
* A helper service for taking pictures across platforms.
|
||||
* Must add mdg:camera package to use! (meteor add mdg:camera)
|
||||
*
|
||||
* @param [options] - options is an optional argument that is an Object with the following possible keys:
|
||||
* @param options.width - An integer that specifies the minimum width of the returned photo.
|
||||
* @param options.height - An integer that specifies the minimum height of the returned photo.
|
||||
* @param options.quality - A number from 0 to 100 specifying the desired quality of JPEG encoding.
|
||||
*
|
||||
* @return The promise solved successfully when the picture is taken with the data as a parameter or rejected with an error as a parameter in case of error.
|
||||
*/
|
||||
getPicture(options?: {width?: number; height?: number; quality?: number}): angular.IPromise<any>;
|
||||
|
||||
// <- $meteorCamera END
|
||||
|
||||
/**
|
||||
* A service that binds a scope variable to a Meteor Session variable.
|
||||
*
|
||||
* @param sessionKey - The name of the session variable
|
||||
* @return An object with a single function bind - to bind to that variable.
|
||||
*/
|
||||
session(sessionKey: string): {
|
||||
/**
|
||||
* @param scope - The scope the document will be bound to.
|
||||
* @param model - The name of the scope's model variable that the document will be bound to.
|
||||
*/
|
||||
bind: (scope: IScope, model: string) => void;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* An object that connects a Meteor Object to an AngularJS scope variable.
|
||||
*
|
||||
* The object contains also all the properties from the generic type T,
|
||||
* unfortunately TypeScript doesn't at the moment allow to extend a generic type (see https://github.com/Microsoft/TypeScript/issues/2225 for details and updates).
|
||||
* For a workaround, you'll need to implement an interface which will merge AngularMeteorObject<T> together with T and cast it, like this:
|
||||
*
|
||||
* interface TodoAngularMeteorObject extends ITodo, AngularMeteorObject<ITodo> { }
|
||||
* var todo = <TodoAngularMeteorObject>$meteor.object(TodoCollection, 'TodoID');
|
||||
*/
|
||||
interface AngularMeteorObject<T> {
|
||||
/**
|
||||
* @param [doc] - The doc to save to the Meteor Object. If nothing is passed, the method saves everything in the AngularMeteorObject as is.
|
||||
* - Unchanged properties will be overridden with their existing values, which may trigger hooks.
|
||||
* - If doc is passed, the method only updates the Meteor Object with the properties passed, and no other changes will be saved.
|
||||
*
|
||||
* @return Returns a promise with an error in case for an error or a number of successful docs changed in case of success.
|
||||
*/
|
||||
save(doc?: T): angular.IPromise<number>;
|
||||
|
||||
/**
|
||||
* Reset the current value of the object to the one in the server.
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
/**
|
||||
* Returns a copy of the AngularMeteorObject with all the AngularMeteor-specific internal properties removed.
|
||||
* The returned object is then safe to use as a parameter for method calls, or anywhere else where the data needs to be converted to JSON.
|
||||
*/
|
||||
getRawObject(): T;
|
||||
|
||||
/**
|
||||
* A shorten (Syntactic sugar) function for the $meteor.subscribe function.
|
||||
* Takes only one parameter and not returns a promise like $meteor.subscribe does.
|
||||
*
|
||||
* @param subscriptionName - The subscription name to subscribe to. Exactly like the first parameter in $meteor.subscribe service.
|
||||
*/
|
||||
subscribe(subscriptionName:string): AngularMeteorObject<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object that connects a Meteor Collection to an AngularJS scope variable
|
||||
*/
|
||||
interface AngularMeteorCollection<T> extends AngularMeteorCollection2<T, T> { }
|
||||
|
||||
/**
|
||||
* An object that connects a Meteor Collection to an AngularJS scope variable,
|
||||
* but can use a differen type for updates.
|
||||
*/
|
||||
interface AngularMeteorCollection2<T, U> extends Array<T> {
|
||||
/**
|
||||
* @param [docs] - The docs to save to the Meteor Collection.
|
||||
* - If the docs parameter is empty, the method saves everything in the AngularMeteorCollection as is.
|
||||
* - If an object is passed, the method pushes that object into the AngularMeteorCollection.
|
||||
* - If an array is passed, the method pushes all objects in the array into the AngularMeteorCollection.
|
||||
*/
|
||||
save(docs?: U|U[]): void;
|
||||
|
||||
/**
|
||||
* @param [keys] - The keys of the object to remove from the Meteor Collection.
|
||||
* - If nothing is passed, the method removes all the documents from the AngularMeteorCollection.
|
||||
* - If an object is passed, the method removes the object with that key from the AngularMeteorCollection.
|
||||
* - If an array is passed, the method removes all objects that matches the keys in the array from the AngularMeteorCollection.
|
||||
*/
|
||||
remove(keys?: U|string|number|string[]|number[]): void;
|
||||
|
||||
/**
|
||||
* A shorten (Syntactic sugar) function for the $meteor.subscribe function.
|
||||
* Takes only one parameter and not returns a promise like $meteor.subscribe does.
|
||||
*
|
||||
* @param subscriptionName - The subscription name to subscribe to. Exactly like the first parameter in $meteor.subscribe service.
|
||||
*/
|
||||
subscribe(subscriptionName:string): AngularMeteorCollection2<T, U>;
|
||||
}
|
||||
|
||||
interface ILoginWithExternalService {
|
||||
(options: Meteor.LoginWithExternalServiceOptions): angular.IPromise<void>;
|
||||
}
|
||||
|
||||
interface ReactiveResult { }
|
||||
}
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
+23
-14
@@ -6,13 +6,7 @@
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module angular.translate {
|
||||
|
||||
interface ITranslatePartialLoaderService {
|
||||
addPart(name: string): ITranslatePartialLoaderService;
|
||||
deletePart(name: string, removeData?: boolean): ITranslatePartialLoaderService;
|
||||
isPartAvailable(name: string): boolean;
|
||||
}
|
||||
|
||||
|
||||
interface ITranslationTable {
|
||||
[key: string]: string;
|
||||
}
|
||||
@@ -26,15 +20,30 @@ declare module angular.translate {
|
||||
set(name: string, value: string): void;
|
||||
}
|
||||
|
||||
interface ISTaticFilesLoaderOptions {
|
||||
interface IStaticFilesLoaderOptions {
|
||||
prefix: string;
|
||||
suffix: string;
|
||||
key?: string;
|
||||
}
|
||||
|
||||
interface IPartialLoader<T> {
|
||||
addPart(name : string, priority? : number) : T;
|
||||
deletePart(name : string) : T;
|
||||
isPartAvailable(name : string) : boolean;
|
||||
}
|
||||
|
||||
interface ITranslatePartialLoaderService extends IPartialLoader<ITranslatePartialLoaderService> {
|
||||
getRegisteredParts() : Array<string>;
|
||||
isPartLoaded(name : string, lang : string) : boolean;
|
||||
}
|
||||
|
||||
interface ITranslatePartialLoaderProvider extends angular.IServiceProvider, IPartialLoader<ITranslatePartialLoaderProvider> {
|
||||
setPart(lang : string, part : string, table : ITranslationTable) : ITranslatePartialLoaderProvider;
|
||||
}
|
||||
|
||||
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 +53,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;
|
||||
@@ -78,7 +87,7 @@ declare module angular.translate {
|
||||
storageKey(): string;
|
||||
storageKey(key: string): void; // JeroMiya - the library should probably return ITranslateProvider but it doesn't here
|
||||
useUrlLoader(url: string): ITranslateProvider;
|
||||
useStaticFilesLoader(options: ISTaticFilesLoaderOptions): ITranslateProvider;
|
||||
useStaticFilesLoader(options: IStaticFilesLoaderOptions): ITranslateProvider;
|
||||
useLoader(loaderFactory: string, options: any): ITranslateProvider;
|
||||
useLocalStorage(): ITranslateProvider;
|
||||
useCookieStorage(): ITranslateProvider;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
+8
-6
@@ -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.
|
||||
*/
|
||||
@@ -62,7 +64,7 @@ declare module angular.ui {
|
||||
reloadOnSearch?: boolean;
|
||||
}
|
||||
|
||||
interface IStateProvider extends ng.IServiceProvider {
|
||||
interface IStateProvider extends angular.IServiceProvider {
|
||||
state(name:string, config:IState): IStateProvider;
|
||||
state(config:IState): IStateProvider;
|
||||
decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any;
|
||||
@@ -81,7 +83,7 @@ declare module angular.ui {
|
||||
type(name: string, definition: any, definitionFn?: any): any;
|
||||
}
|
||||
|
||||
interface IUrlRouterProvider extends ng.IServiceProvider {
|
||||
interface IUrlRouterProvider extends angular.IServiceProvider {
|
||||
when(whenPath: RegExp, handler: Function): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, toPath: string): IUrlRouterProvider;
|
||||
@@ -143,7 +145,7 @@ declare module angular.ui {
|
||||
*
|
||||
* @param options Options object.
|
||||
*/
|
||||
go(to: string, params?: {}, options?: IStateOptions): ng.IPromise<any>;
|
||||
go(to: string, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
transitionTo(state: string, params?: {}, updateLocation?: boolean): void;
|
||||
transitionTo(state: string, params?: {}, options?: IStateOptions): void;
|
||||
includes(state: string, params?: {}): boolean;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/// <reference path="angular2.d.ts"/>
|
||||
|
||||
// Use Typescript 1.4 style imports
|
||||
import ng = require("angular2/angular2");
|
||||
import di = require("angular2/di");
|
||||
|
||||
class Service {
|
||||
|
||||
}
|
||||
class Service2 {
|
||||
|
||||
}
|
||||
|
||||
class Cmp {
|
||||
static annotations: any[];
|
||||
}
|
||||
Cmp.annotations = [
|
||||
ng.Component({
|
||||
selector: 'cmp',
|
||||
injectables: [Service, di.bind(Service2).toValue(null)]
|
||||
}),
|
||||
ng.View({
|
||||
template: '{{greeting}} world!',
|
||||
directives: [ng.For, ng.If]
|
||||
})
|
||||
];
|
||||
|
||||
ng.bootstrap(Cmp);
|
||||
Vendored
+622
@@ -0,0 +1,622 @@
|
||||
// Type definitions for Angular v2.0.0-alpha.22
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/******************
|
||||
* This is a minimal type definition for the Angular2 quickstart.
|
||||
* We plan to publish a complete definition soon.
|
||||
******************/
|
||||
|
||||
interface List<T> extends Array<T> {}
|
||||
interface Type {}
|
||||
|
||||
interface _ComponentArg {
|
||||
/**
|
||||
* The CSS selector that triggers the instantiation of a directive.
|
||||
*
|
||||
* Angular only allows directives to trigger on CSS selectors that do not cross element boundaries.
|
||||
*
|
||||
* `selector` may be declared as one of the following:
|
||||
*
|
||||
* - `element-name`: select by element name.
|
||||
* - `.class`: select by class name.
|
||||
* - `[attribute]`: select by attribute name.
|
||||
* - `[attribute=value]`: select by attribute name and value.
|
||||
* - `:not(sub_selector)`: select only if the element does not match the `sub_selector`.
|
||||
* - `selector1, selector2`: select if either `selector1` or `selector2` matches.
|
||||
*
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Suppose we have a directive with an `input[type=text]` selector.
|
||||
*
|
||||
* And the following HTML:
|
||||
*
|
||||
* ```html
|
||||
* <form>
|
||||
* <input type="text">
|
||||
* <input type="radio">
|
||||
* <form>
|
||||
* ```
|
||||
*
|
||||
* The directive would only be instantiated on the `<input type="text">` element.
|
||||
*
|
||||
*/
|
||||
selector: string;
|
||||
|
||||
/**
|
||||
* Enumerates the set of properties that accept data binding for a directive.
|
||||
*
|
||||
* The `properties` property defines a set of `directiveProperty` to `bindingProperty`
|
||||
* key-value pairs:
|
||||
*
|
||||
* - `directiveProperty` specifies the component property where the value is written.
|
||||
* - `bindingProperty` specifies the DOM property where the value is read from.
|
||||
*
|
||||
* You can include a {@link Pipe} when specifying a `bindingProperty` to allow for data transformation and structural
|
||||
* change detection of the value. These pipes will be evaluated in the context of this component.
|
||||
*
|
||||
*
|
||||
* ## Syntax
|
||||
*
|
||||
* ```
|
||||
* @Directive({
|
||||
* properties: {
|
||||
* 'directiveProperty1': 'bindingProperty1',
|
||||
* 'directiveProperty2': 'bindingProperty2 | pipe1 | ...',
|
||||
* ...
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* ## Basic Property Binding
|
||||
*
|
||||
* We can easily build a simple `Tooltip` directive that exposes a `tooltip` property, which can be used in templates
|
||||
* with standard Angular syntax. For example:
|
||||
*
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: '[tooltip]',
|
||||
* properties: {
|
||||
* 'text': 'tooltip'
|
||||
* }
|
||||
* })
|
||||
* class Tooltip {
|
||||
* set text(text) {
|
||||
* // This will get called every time the 'tooltip' binding changes with the new value.
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* We can then bind to the `tooltip' property as either an expression (`someExpression`) or as a string literal, as
|
||||
* shown in the HTML template below:
|
||||
*
|
||||
* ```html
|
||||
* <div [tooltip]="someExpression">...</div>
|
||||
* <div tooltip="Some Text">...</div>
|
||||
* ```
|
||||
*
|
||||
* Whenever the `someExpression` expression changes, the `properties` declaration instructs
|
||||
* Angular to update the `Tooltip`'s `text` property.
|
||||
*
|
||||
*
|
||||
*
|
||||
* ## Bindings With Pipes
|
||||
*
|
||||
* You can also use pipes when writing binding definitions for a directive.
|
||||
*
|
||||
* For example, we could write a binding that updates the directive on structural changes, rather than on reference
|
||||
* changes, as normally occurs in change detection.
|
||||
*
|
||||
* See {@link Pipe} and {@link keyValDiff} documentation for more details.
|
||||
*
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: '[class-set]',
|
||||
* properties: {
|
||||
* 'classChanges': 'classSet | keyValDiff'
|
||||
* }
|
||||
* })
|
||||
* class ClassSet {
|
||||
* set classChanges(changes:KeyValueChanges) {
|
||||
* // This will get called every time the `class-set` expressions changes its structure.
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* The template that this directive is used in may also contain its own pipes. For example:
|
||||
*
|
||||
* ```html
|
||||
* <div [class-set]="someExpression | somePipe">
|
||||
* ```
|
||||
*
|
||||
* In this case, the two pipes compose as if they were inlined: `someExpression | somePipe | keyValDiff`.
|
||||
*
|
||||
*/
|
||||
properties?: Object;
|
||||
|
||||
/**
|
||||
* Specifies which DOM hostListeners a directive listens to.
|
||||
*
|
||||
* The `hostListeners` property defines a set of `event` to `method` key-value pairs:
|
||||
*
|
||||
* - `event1`: the DOM event that the directive listens to.
|
||||
* - `statement`: the statement to execute when the event occurs.
|
||||
* If the evalutation of the statement returns `false`, then `preventDefault`is applied on the DOM event.
|
||||
*
|
||||
* To listen to global events, a target must be added to the event name.
|
||||
* The target can be `window`, `document` or `body`.
|
||||
*
|
||||
* When writing a directive event binding, you can also refer to the following local variables:
|
||||
* - `$event`: Current event object which triggered the event.
|
||||
* - `$target`: The source of the event. This will be either a DOM element or an Angular directive.
|
||||
* (will be implemented in later release)
|
||||
*
|
||||
*
|
||||
* ## Syntax
|
||||
*
|
||||
* ```
|
||||
* @Directive({
|
||||
* hostListeners: {
|
||||
* 'event1': 'onMethod1(arguments)',
|
||||
* 'target:event2': 'onMethod2(arguments)',
|
||||
* ...
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ## Basic Event Binding:
|
||||
*
|
||||
* Suppose you want to write a directive that triggers on `change` events in the DOM and on `resize` events in window.
|
||||
* You would define the event binding as follows:
|
||||
*
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'input',
|
||||
* hostListeners: {
|
||||
* 'change': 'onChange($event)',
|
||||
* 'window:resize': 'onResize($event)'
|
||||
* }
|
||||
* })
|
||||
* class InputDirective {
|
||||
* onChange(event:Event) {
|
||||
* }
|
||||
* onResize(event:Event) {
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Here the `onChange` method of `InputDirective` is invoked whenever the DOM element fires the 'change' event.
|
||||
*
|
||||
*/
|
||||
hostListeners?: Object;
|
||||
|
||||
/**
|
||||
* Defines the set of injectable objects that are visible to a Component and its children.
|
||||
*
|
||||
* The `injectables` defined in the Component annotation allow you to configure a set of bindings for the component's
|
||||
* injector.
|
||||
*
|
||||
* When a component is instantiated, Angular creates a new child Injector, which is configured with the bindings in
|
||||
* the Component `injectables` annotation. The injectable objects then become available for injection to the component
|
||||
* itself and any of the directives in the component's template, i.e. they are not available to the directives which
|
||||
* are children in the component's light DOM.
|
||||
*
|
||||
*
|
||||
* The syntax for configuring the `injectables` injectable is identical to {@link Injector} injectable configuration.
|
||||
* See {@link Injector} for additional detail.
|
||||
*
|
||||
*
|
||||
* ## Simple Example
|
||||
*
|
||||
* Here is an example of a class that can be injected:
|
||||
*
|
||||
* ```
|
||||
* class Greeter {
|
||||
* greet(name:string) {
|
||||
* return 'Hello ' + name + '!';
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @Component({
|
||||
* selector: 'greet',
|
||||
* injectables: [
|
||||
* Greeter
|
||||
* ]
|
||||
* })
|
||||
* @View({
|
||||
* template: `{{greeter.greet('world')}}!`,
|
||||
* directives: Child
|
||||
* })
|
||||
* class HelloWorld {
|
||||
* greeter:Greeter;
|
||||
*
|
||||
* constructor(greeter:Greeter) {
|
||||
* this.greeter = greeter;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
injectables?: List<any>;
|
||||
|
||||
/**
|
||||
* Specifies a set of lifecycle hostListeners in which the directive participates.
|
||||
*
|
||||
* See {@link onChange}, {@link onDestroy}, {@link onAllChangesDone} for details.
|
||||
*/
|
||||
lifecycle?: List<any>;
|
||||
|
||||
/**
|
||||
* Defines the used change detection strategy.
|
||||
*
|
||||
* When a component is instantiated, Angular creates a change detector, which is responsible for propagating
|
||||
* the component's bindings.
|
||||
*
|
||||
* The `changeDetection` property defines, whether the change detection will be checked every time or only when the component
|
||||
* tells it to do so.
|
||||
*/
|
||||
changeDetection?: string;
|
||||
}
|
||||
|
||||
interface _ViewArg {
|
||||
/**
|
||||
* Specifies a template URL for an angular component.
|
||||
*
|
||||
* NOTE: either `templateUrl` or `template` should be used, but not both.
|
||||
*/
|
||||
templateUrl?: string;
|
||||
|
||||
/**
|
||||
* Specifies an inline template for an angular component.
|
||||
*
|
||||
* NOTE: either `templateUrl` or `template` should be used, but not both.
|
||||
*/
|
||||
template?: string;
|
||||
|
||||
/**
|
||||
* Specifies a list of directives that can be used within a template.
|
||||
*
|
||||
* Directives must be listed explicitly to provide proper component encapsulation.
|
||||
*/
|
||||
directives?: List<Type>;
|
||||
}
|
||||
|
||||
declare module "angular2/angular2" {
|
||||
/**
|
||||
* Bootstrapping for Angular applications.
|
||||
*
|
||||
* You instantiate an Angular application by explicitly specifying a component to use as the root component for your
|
||||
* application via the `bootstrap()` method.
|
||||
*
|
||||
* ## Simple Example
|
||||
*
|
||||
* Assuming this `index.html`:
|
||||
*
|
||||
* ```html
|
||||
* <html>
|
||||
* <!-- load Angular script tags here. -->
|
||||
* <body>
|
||||
* <my-app>loading...</my-app>
|
||||
* </body>
|
||||
* </html>
|
||||
* ```
|
||||
*
|
||||
* An application is bootstrapped inside an existing browser DOM, typically `index.html`. Unlike Angular 1, Angular 2
|
||||
* does not compile/process bindings in `index.html`. This is mainly for security reasons, as well as architectural
|
||||
* changes in Angular 2. This means that `index.html` can safely be processed using server-side technologies such as
|
||||
* bindings. Bindings can thus use double-curly `{{ syntax }}` without collision from Angular 2 component double-curly
|
||||
* `{{ syntax }}`.
|
||||
*
|
||||
* We can use this script code:
|
||||
*
|
||||
* ```
|
||||
* @Component({
|
||||
* selector: 'my-app'
|
||||
* })
|
||||
* @View({
|
||||
* template: 'Hello {{ name }}!'
|
||||
* })
|
||||
* class MyApp {
|
||||
* name:string;
|
||||
*
|
||||
* constructor() {
|
||||
* this.name = 'World';
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* main() {
|
||||
* return bootstrap(MyApp);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* When the app developer invokes `bootstrap()` with the root component `MyApp` as its argument, Angular performs the
|
||||
* following tasks:
|
||||
*
|
||||
* 1. It uses the component's `selector` property to locate the DOM element which needs to be upgraded into
|
||||
* the angular component.
|
||||
* 2. It creates a new child injector (from the platform injector) and configures the injector with the component's
|
||||
* `injectables`. Optionally, you can also override the injector configuration for an app by invoking
|
||||
* `bootstrap` with the `componentInjectableBindings` argument.
|
||||
* 3. It creates a new `Zone` and connects it to the angular application's change detection domain instance.
|
||||
* 4. It creates a shadow DOM on the selected component's host element and loads the template into it.
|
||||
* 5. It instantiates the specified component.
|
||||
* 6. Finally, Angular performs change detection to apply the initial data bindings for the application.
|
||||
*
|
||||
*
|
||||
* ## Instantiating Multiple Applications on a Single Page
|
||||
*
|
||||
* There are two ways to do this.
|
||||
*
|
||||
*
|
||||
* ### Isolated Applications
|
||||
*
|
||||
* Angular creates a new application each time that the `bootstrap()` method is invoked. When multiple applications
|
||||
* are created for a page, Angular treats each application as independent within an isolated change detection and
|
||||
* `Zone` domain. If you need to share data between applications, use the strategy described in the next
|
||||
* section, "Applications That Share Change Detection."
|
||||
*
|
||||
*
|
||||
* ### Applications That Share Change Detection
|
||||
*
|
||||
* If you need to bootstrap multiple applications that share common data, the applications must share a common
|
||||
* change detection and zone. To do that, create a meta-component that lists the application components in its template.
|
||||
* By only invoking the `bootstrap()` method once, with the meta-component as its argument, you ensure that only a
|
||||
* single change detection zone is created and therefore data can be shared across the applications.
|
||||
*
|
||||
*
|
||||
* ## Platform Injector
|
||||
*
|
||||
* When working within a browser window, there are many singleton resources: cookies, title, location, and others.
|
||||
* Angular services that represent these resources must likewise be shared across all Angular applications that
|
||||
* occupy the same browser window. For this reason, Angular creates exactly one global platform injector which stores
|
||||
* all shared services, and each angular application injector has the platform injector as its parent.
|
||||
*
|
||||
* Each application has its own private injector as well. When there are multiple applications on a page, Angular treats
|
||||
* each application injector's services as private to that application.
|
||||
*
|
||||
*
|
||||
* # API
|
||||
* - `appComponentType`: The root component which should act as the application. This is a reference to a `Type`
|
||||
* which is annotated with `@Component(...)`.
|
||||
* - `componentInjectableBindings`: An additional set of bindings that can be added to `injectables` for the
|
||||
* {@link Component} to override default injection behavior.
|
||||
* - `errorReporter`: `function(exception:any, stackTrace:string)` a default error reporter for unhandled exceptions.
|
||||
*
|
||||
* Returns a `Promise` with the application`s private {@link Injector}.
|
||||
*
|
||||
*/
|
||||
function bootstrap(appComponentType: any): void;
|
||||
|
||||
/**
|
||||
* Declare reusable UI building blocks for an application.
|
||||
*
|
||||
* Each Angular component requires a single `@Component` and at least one `@View` annotation. The `@Component`
|
||||
* annotation specifies when a component is instantiated, and which properties and hostListeners it binds to.
|
||||
*
|
||||
* When a component is instantiated, Angular
|
||||
* - creates a shadow DOM for the component.
|
||||
* - loads the selected template into the shadow DOM.
|
||||
* - creates a child {@link Injector} which is configured with the `injectables` for the {@link Component}.
|
||||
*
|
||||
* All template expressions and statements are then evaluated against the component instance.
|
||||
*
|
||||
* For details on the `@View` annotation, see {@link View}.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* ```
|
||||
* @Component({
|
||||
* selector: 'greet'
|
||||
* })
|
||||
* @View({
|
||||
* template: 'Hello {{name}}!'
|
||||
* })
|
||||
* class Greet {
|
||||
* name: string;
|
||||
*
|
||||
* constructor() {
|
||||
* this.name = 'World';
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Dynamically loading a component at runtime:
|
||||
*
|
||||
* Regular Angular components are statically resolved. Dynamic components allows to resolve a component at runtime
|
||||
* instead by providing a placeholder into which a regular Angular component can be dynamically loaded. Once loaded,
|
||||
* the dynamically-loaded component becomes permanent and cannot be changed.
|
||||
* Dynamic components are declared just like components, but without a `@View` annotation.
|
||||
*
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Here we have `DynamicComp` which acts as the placeholder for `HelloCmp`. At runtime, the dynamic component
|
||||
* `DynamicComp` requests loading of the `HelloCmp` component.
|
||||
*
|
||||
* There is nothing special about `HelloCmp`, which is a regular Angular component. It can also be used in other static
|
||||
* locations.
|
||||
*
|
||||
* ```
|
||||
* @Component({
|
||||
* selector: 'dynamic-comp'
|
||||
* })
|
||||
* class DynamicComp {
|
||||
* helloCmp:HelloCmp;
|
||||
* constructor(loader:DynamicComponentLoader, location:ElementRef) {
|
||||
* loader.load(HelloCmp, location).then((helloCmp) => {
|
||||
* this.helloCmp = helloCmp;
|
||||
* });
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @Component({
|
||||
* selector: 'hello-cmp'
|
||||
* })
|
||||
* @View({
|
||||
* template: "{{greeting}}"
|
||||
* })
|
||||
* class HelloCmp {
|
||||
* greeting:string;
|
||||
* constructor() {
|
||||
* this.greeting = "hello";
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
function Component(arg: _ComponentArg): (target: any) => any;
|
||||
|
||||
/**
|
||||
* Declares the available HTML templates for an application.
|
||||
*
|
||||
* Each angular component requires a single `@Component` and at least one `@View` annotation. The @View
|
||||
* annotation specifies the HTML template to use, and lists the directives that are active within the template.
|
||||
*
|
||||
* When a component is instantiated, the template is loaded into the component's shadow root, and the
|
||||
* expressions and statements in the template are evaluated against the component.
|
||||
*
|
||||
* For details on the `@Component` annotation, see {@link Component}.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* ```
|
||||
* @Component({
|
||||
* selector: 'greet'
|
||||
* })
|
||||
* @View({
|
||||
* template: 'Hello {{name}}!',
|
||||
* directives: [GreetUser, Bold]
|
||||
* })
|
||||
* class Greet {
|
||||
* name: string;
|
||||
*
|
||||
* constructor() {
|
||||
* this.name = 'World';
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
function View(arg: _ViewArg): (target: any) => any;
|
||||
|
||||
/**
|
||||
* The `For` directive instantiates a template once per item from an iterable. The context for each
|
||||
* instantiated template inherits from the outer context with the given loop variable set to the
|
||||
* current item from the iterable.
|
||||
*
|
||||
* It is possible to alias the `index` to a local variable that will be set to the current loop
|
||||
* iteration in the template context.
|
||||
*
|
||||
* When the contents of the iterator changes, `For` makes the corresponding changes to the DOM:
|
||||
*
|
||||
* * When an item is added, a new instance of the template is added to the DOM.
|
||||
* * When an item is removed, its template instance is removed from the DOM.
|
||||
* * When items are reordered, their respective templates are reordered in the DOM.
|
||||
*
|
||||
* # Example
|
||||
*
|
||||
* ```
|
||||
* <ul>
|
||||
* <li *for="#error of errors; #i = index">
|
||||
* Error {{i}} of {{errors.length}}: {{error.message}}
|
||||
* </li>
|
||||
* </ul>
|
||||
* ```
|
||||
*
|
||||
* # Syntax
|
||||
*
|
||||
* - `<li *for="#item of items; #i = index">...</li>`
|
||||
* - `<li template="for #item of items; #i=index">...</li>`
|
||||
* - `<template [for]="#item" [of]="items" #i="index"><li>...</li></template>`
|
||||
*
|
||||
*/
|
||||
function For(): void;
|
||||
|
||||
/**
|
||||
* Removes or recreates a portion of the DOM tree based on an {expression}.
|
||||
*
|
||||
* If the expression assigned to `if` evaluates to a false value then the element is removed from the
|
||||
* DOM, otherwise a clone of the element is reinserted into the DOM.
|
||||
*
|
||||
* # Example:
|
||||
*
|
||||
* ```
|
||||
* <div *if="errorCount > 0" class="error">
|
||||
* <!-- Error message displayed when the errorCount property on the current context is greater than 0. -->
|
||||
* {{errorCount}} errors detected
|
||||
* </div>
|
||||
* ```
|
||||
*
|
||||
* # Syntax
|
||||
*
|
||||
* - `<div *if="condition">...</div>`
|
||||
* - `<div template="if condition">...</div>`
|
||||
* - `<template [if]="condition"><div>...</div></template>`
|
||||
*
|
||||
*/
|
||||
function If(): void;
|
||||
|
||||
/**
|
||||
* The `NonBindable` directive tells Angular not to compile or bind the contents of the current
|
||||
* DOM element. This is useful if the element contains what appears to be Angular directives and
|
||||
* bindings but which should be ignored by Angular. This could be the case if you have a site that
|
||||
* displays snippets of code, for instance.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* <div>Normal: {{1 + 2}}</div> // output "Normal: 3"
|
||||
* <div non-bindable>Ignored: {{1 + 2}}</div> // output "Ignored: {{1 + 2}}"
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
function NonBindable(): void;
|
||||
|
||||
/**
|
||||
* The `Switch` directive is used to conditionally swap DOM structure on your template based on a
|
||||
* scope expression.
|
||||
* Elements within `Switch` but without `SwitchWhen` or `SwitchDefault` directives will be
|
||||
* preserved at the location as specified in the template.
|
||||
*
|
||||
* `Switch` simply chooses nested elements and makes them visible based on which element matches
|
||||
* the value obtained from the evaluated expression. In other words, you define a container element
|
||||
* (where you place the directive), place an expression on the **`[switch]="..."` attribute**),
|
||||
* define any inner elements inside of the directive and place a `[switch-when]` attribute per
|
||||
* element.
|
||||
* The when attribute is used to inform Switch which element to display when the expression is
|
||||
* evaluated. If a matching expression is not found via a when attribute then an element with the
|
||||
* default attribute is displayed.
|
||||
*
|
||||
* # Example:
|
||||
*
|
||||
* ```
|
||||
* <ANY [switch]="expression">
|
||||
* <template [switch-when]="whenExpression1">...</template>
|
||||
* <template [switch-when]="whenExpression1">...</template>
|
||||
* <template [switch-default]>...</template>
|
||||
* </ANY>
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
function Switch(): void;
|
||||
}
|
||||
|
||||
declare module "angular2/di" {
|
||||
/**
|
||||
* Provides an API for imperatively constructing {@link Binding}s.
|
||||
*
|
||||
* This is only relevant for JavaScript. See {@link BindingBuilder}.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* ```javascript
|
||||
* bind(MyInterface).toClass(MyClass)
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
function bind(token: any): any;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
|
||||
// AngularFireObject
|
||||
{
|
||||
var obj = sync.$asObject();
|
||||
var obj = $FirebaseObject(ref);
|
||||
|
||||
// $id
|
||||
if (obj.$id !== ref.name()) throw "error";
|
||||
@@ -62,8 +62,8 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
obj.$save();
|
||||
});
|
||||
|
||||
// $inst()
|
||||
if (obj.$inst() !== sync) throw "error";
|
||||
// $ref()
|
||||
if (obj.$ref() !== ref) throw "error";
|
||||
|
||||
// $bindTo()
|
||||
obj.$bindTo($scope, "data").then(function () {
|
||||
@@ -81,8 +81,8 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
// $destroy()
|
||||
obj.$destroy();
|
||||
|
||||
// $extendFactory()
|
||||
var NewFactory = $FirebaseObject.$extendFactory({
|
||||
// $extend()
|
||||
var NewFactory = $FirebaseObject.$extend({
|
||||
getMyFavoriteColor: function () {
|
||||
return this.favoriteColor + ", no green!"; // obscure Monty Python reference
|
||||
}
|
||||
@@ -92,10 +92,10 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
|
||||
// AngularFireArray
|
||||
{
|
||||
var list = sync.$asArray();
|
||||
var list = $FirebaseArray(ref);
|
||||
|
||||
// $inst()
|
||||
if (list.$inst() !== sync) throw "error";
|
||||
// $ref()
|
||||
if (list.$ref() !== ref) throw "error";
|
||||
|
||||
// $add()
|
||||
list.$add({ foo: "foo value" });
|
||||
@@ -145,8 +145,8 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
// $destroy()
|
||||
list.$destroy();
|
||||
|
||||
// $extendFactory()
|
||||
var ArrayWithSum = $FirebaseArray.$extendFactory({
|
||||
// $extend()
|
||||
var ArrayWithSum = $FirebaseArray.$extend({
|
||||
sum: function () {
|
||||
var total = 0;
|
||||
angular.forEach(this.$list, function (rec) {
|
||||
@@ -167,30 +167,43 @@ interface AngularFireAuthScope extends ng.IScope {
|
||||
loginObj: AngularFireAuth;
|
||||
}
|
||||
|
||||
myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin",
|
||||
function($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) {
|
||||
myapp.controller("MyAuthController", ["$scope", "$firebaseAuth",
|
||||
function($scope: AngularFireAuthScope, $firebaseAuth: AngularFireAuthService) {
|
||||
var dataRef = new Firebase(url);
|
||||
$scope.loginObj = $firebaseSimpleLogin(dataRef);
|
||||
$scope.loginObj.$getCurrentUser().then(_ => {
|
||||
});
|
||||
var email = 'my@email.com';
|
||||
var password = 'mypassword';
|
||||
$scope.loginObj.$login('password', {
|
||||
email: email,
|
||||
password: password
|
||||
}).then(function(user) {
|
||||
console.log('Logged in as: ', user.uid);
|
||||
}, function(error) {
|
||||
console.error('Login failed: ', error);
|
||||
});
|
||||
$scope.loginObj.$logout();
|
||||
$scope.loginObj.$createUser(email, password).then(_ => {
|
||||
});
|
||||
$scope.loginObj.$changePassword(email, password, password).then(_ => {
|
||||
});
|
||||
$scope.loginObj.$removeUser(email, password).then(_ => {
|
||||
});
|
||||
$scope.loginObj.$sendPasswordResetEmail(email).then(_ => {
|
||||
});
|
||||
$scope.loginObj = $firebaseAuth(dataRef);
|
||||
$scope.loginObj.$getAuth();
|
||||
var credentials = {
|
||||
email: 'my@email.com',
|
||||
password: 'mypassword'
|
||||
};
|
||||
var resetPasswordCredentials = {
|
||||
email: 'my@email.com'
|
||||
};
|
||||
var changePasswordCredentials = {
|
||||
email: 'my@email.com',
|
||||
oldPassword: 'mypassword',
|
||||
newPassword: 'mypassword'
|
||||
};
|
||||
var changeUserCredentials = {
|
||||
oldEmail: 'my@email.com',
|
||||
newEmail: 'my@email.com',
|
||||
password: 'mypassword'
|
||||
};
|
||||
$scope.loginObj.$authWithCustomToken("token").then(_ => {});
|
||||
$scope.loginObj.$authAnonymously().then(_ => {});
|
||||
$scope.loginObj.$authWithPassword(credentials).then(_ => {});
|
||||
$scope.loginObj.$authWithOAuthPopup("github").then(_ => {});
|
||||
$scope.loginObj.$authWithOAuthRedirect("google").then(_ => {});
|
||||
$scope.loginObj.$authWithOAuthToken("twitter", "token").then(_ => {});
|
||||
$scope.loginObj.$getAuth();
|
||||
$scope.loginObj.$onAuth(() => {});
|
||||
$scope.loginObj.$unauth();
|
||||
$scope.loginObj.$waitForAuth();
|
||||
$scope.loginObj.$requireAuth();
|
||||
$scope.loginObj.$createUser(credentials).then(_ => {});
|
||||
$scope.loginObj.$removeUser(credentials).then(_ => {});
|
||||
$scope.loginObj.$changeEmail(changeUserCredentials).then(_ => {});
|
||||
$scope.loginObj.$changePassword(changePasswordCredentials).then(_ => {});
|
||||
$scope.loginObj.$resetPassword(resetPasswordCredentials).then(_ => {});
|
||||
}
|
||||
]);
|
||||
]);
|
||||
|
||||
Vendored
+408
-11
@@ -10,6 +10,9 @@ interface AngularFireService {
|
||||
(firebase: Firebase, config?: any): AngularFire;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated. Not possible with AngularFire 1.0+
|
||||
*/
|
||||
interface AngularFire {
|
||||
$asArray(): AngularFireArray;
|
||||
$asObject(): AngularFireObject;
|
||||
@@ -24,39 +27,284 @@ interface AngularFire {
|
||||
$transaction(key:string, updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise<FirebaseDataSnapshot>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and maintains a synchronized object, with 2-way bindings between Angular and Firebase.
|
||||
*/
|
||||
interface AngularFireObject extends AngularFireSimpleObject {
|
||||
$id: string;
|
||||
$priority: number;
|
||||
$value: any;
|
||||
|
||||
/**
|
||||
* Removes all keys from the FirebaseObject and also removes
|
||||
* the remote data from the server.
|
||||
*
|
||||
* @returns a promise which will resolve after the op completes
|
||||
*/
|
||||
|
||||
$remove(): ng.IPromise<Firebase>;
|
||||
/**
|
||||
* Saves all data on the FirebaseObject back to Firebase.
|
||||
* @returns a promise which will resolve after the save is completed.
|
||||
*/
|
||||
$save(): ng.IPromise<Firebase>;
|
||||
|
||||
/**
|
||||
* The loaded method is invoked after the initial batch of data arrives from the server.
|
||||
* When this resolves, all data which existed prior to calling $asObject() is now cached
|
||||
* locally in the object.
|
||||
*
|
||||
* As a shortcut is also possible to pass resolve/reject methods directly into this
|
||||
* method just as they would be passed to .then()
|
||||
*
|
||||
* @param {Function} resolve
|
||||
* @param {Function} reject
|
||||
* @returns a promise which resolves after initial data is downloaded from Firebase
|
||||
*/
|
||||
$loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise<AngularFireObject>;
|
||||
|
||||
/**
|
||||
* The loaded method is invoked after the initial batch of data arrives from the server.
|
||||
* When this resolves, all data which existed prior to calling $asObject() is now cached
|
||||
* locally in the object.
|
||||
*
|
||||
* As a shortcut is also possible to pass resolve/reject methods directly into this
|
||||
* method just as they would be passed to .then()
|
||||
*
|
||||
* @param {Function} resolve
|
||||
* @param {Function} reject
|
||||
* @returns a promise which resolves after initial data is downloaded from Firebase
|
||||
*/
|
||||
$loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise<AngularFireObject>;
|
||||
|
||||
/**
|
||||
* The loaded method is invoked after the initial batch of data arrives from the server.
|
||||
* When this resolves, all data which existed prior to calling $asObject() is now cached
|
||||
* locally in the object.
|
||||
*
|
||||
* As a shortcut is also possible to pass resolve/reject methods directly into this
|
||||
* method just as they would be passed to .then()
|
||||
*
|
||||
* @param {Function} resolve
|
||||
* @param {Function} reject
|
||||
* @returns a promise which resolves after initial data is downloaded from Firebase
|
||||
*/
|
||||
$loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise<AngularFireObject>;
|
||||
$inst(): AngularFire;
|
||||
|
||||
/**
|
||||
* @returns {Firebase} the original Firebase instance used to create this object.
|
||||
*/
|
||||
$ref(): Firebase;
|
||||
|
||||
/**
|
||||
* Creates a 3-way data sync between this object, the Firebase server, and a
|
||||
* scope variable. This means that any changes made to the scope variable are
|
||||
* pushed to Firebase, and vice versa.
|
||||
*
|
||||
* If scope emits a $destroy event, the binding is automatically severed. Otherwise,
|
||||
* it is possible to unbind the scope variable by using the `unbind` function
|
||||
* passed into the resolve method.
|
||||
*
|
||||
* Can only be bound to one scope variable at a time. If a second is attempted,
|
||||
* the promise will be rejected with an error.
|
||||
*
|
||||
* @param {object} scope
|
||||
* @param {string} varName
|
||||
* @returns a promise which resolves to an unbind method after data is set in scope
|
||||
*/
|
||||
$bindTo(scope: ng.IScope, varName: string): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Listeners passed into this method are notified whenever a new change is received
|
||||
* from the server. Each invocation is sent an object containing
|
||||
* <code>{ type: 'value', key: 'my_firebase_id' }</code>
|
||||
*
|
||||
* This method returns an unbind function that can be used to detach the listener.
|
||||
*
|
||||
* @param {Function} cb
|
||||
* @param {Object} [context]
|
||||
* @returns {Function} invoke to stop observing events
|
||||
*/
|
||||
$watch(callback: Function, context?: any): Function;
|
||||
|
||||
/**
|
||||
* Informs $firebase to stop sending events and clears memory being used
|
||||
* by this object (delete's its local content).
|
||||
*/
|
||||
$destroy(): void;
|
||||
}
|
||||
interface AngularFireObjectService {
|
||||
$extendFactory(ChildClass: Object, methods?: Object): Object;
|
||||
/**
|
||||
* Creates a synchronized object with 2-way bindings between Angular and Firebase.
|
||||
*
|
||||
* @param {Firebase} ref
|
||||
* @returns {FirebaseObject}
|
||||
*/
|
||||
(firebase: Firebase): AngularFireObject;
|
||||
$extend(ChildClass: Object, methods?: Object): Object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and maintains a synchronized list of data. This is a pseudo-read-only array. One should
|
||||
* not call splice(), push(), pop(), et al directly on this array, but should instead use the
|
||||
* $remove and $add methods.
|
||||
*
|
||||
* It is acceptable to .sort() this array, but it is important to use this in conjunction with
|
||||
* $watch(), so that it will be re-sorted any time the server data changes. Examples of this are
|
||||
* included in the $watch documentation.
|
||||
*/
|
||||
interface AngularFireArray extends Array<AngularFireSimpleObject> {
|
||||
/**
|
||||
* Create a new record with a unique ID and add it to the end of the array.
|
||||
* This should be used instead of Array.prototype.push, since those changes will not be
|
||||
* synchronized with the server.
|
||||
*
|
||||
* Any value, including a primitive, can be added in this way. Note that when the record
|
||||
* is created, the primitive value would be stored in $value (records are always objects
|
||||
* by default).
|
||||
*
|
||||
* Returns a future which is resolved when the data has successfully saved to the server.
|
||||
* The resolve callback will be passed a Firebase ref representing the new data element.
|
||||
*
|
||||
* @param data
|
||||
* @returns a promise resolved after data is added
|
||||
*/
|
||||
$add(newData: any): ng.IPromise<Firebase>;
|
||||
|
||||
/**
|
||||
* Pass either an item in the array or the index of an item and it will be saved back
|
||||
* to Firebase. While the array is read-only and its structure should not be changed,
|
||||
* it is okay to modify properties on the objects it contains and then save those back
|
||||
* individually.
|
||||
*
|
||||
* Returns a future which is resolved when the data has successfully saved to the server.
|
||||
* The resolve callback will be passed a Firebase ref representing the saved element.
|
||||
* If passed an invalid index or an object which is not a record in this array,
|
||||
* the promise will be rejected.
|
||||
*
|
||||
* @param {int|object} indexOrItem
|
||||
* @returns a promise resolved after data is saved
|
||||
*/
|
||||
$save(recordOrIndex: any): ng.IPromise<Firebase>;
|
||||
|
||||
/**
|
||||
* Pass either an existing item in this array or the index of that item and it will
|
||||
* be removed both locally and in Firebase. This should be used in place of
|
||||
* Array.prototype.splice for removing items out of the array, as calling splice
|
||||
* will not update the value on the server.
|
||||
*
|
||||
* Returns a future which is resolved when the data has successfully removed from the
|
||||
* server. The resolve callback will be passed a Firebase ref representing the deleted
|
||||
* element. If passed an invalid index or an object which is not a record in this array,
|
||||
* the promise will be rejected.
|
||||
*
|
||||
* @param {int|object} indexOrItem
|
||||
* @returns a promise which resolves after data is removed
|
||||
*/
|
||||
$remove(recordOrIndex: any): ng.IPromise<Firebase>;
|
||||
|
||||
/**
|
||||
* Returns the record for a given Firebase key (record.$id). If the record is not found
|
||||
* then returns null.
|
||||
*
|
||||
* @param {string} key
|
||||
* @returns {Object|null} a record in this array
|
||||
*/
|
||||
$getRecord(key: string): AngularFireSimpleObject;
|
||||
|
||||
/**
|
||||
* Given an item in this array or the index of an item in the array, this returns the
|
||||
* Firebase key (record.$id) for that record. If passed an invalid key or an item which
|
||||
* does not exist in this array, it will return null.
|
||||
*
|
||||
* @param {int|object} indexOrItem
|
||||
* @returns {null|string}
|
||||
*/
|
||||
$keyAt(recordOrIndex: any): string;
|
||||
|
||||
/**
|
||||
* The inverse of $keyAt, this method takes a Firebase key (record.$id) and returns the
|
||||
* index in the array where that record is stored. If the record is not in the array,
|
||||
* this method returns -1.
|
||||
*
|
||||
* @param {String} key
|
||||
* @returns {int} -1 if not found
|
||||
*/
|
||||
$indexFor(key: string): number;
|
||||
|
||||
/**
|
||||
* The loaded method is invoked after the initial batch of data arrives from the server.
|
||||
* When this resolves, all data which existed prior to calling $asArray() is now cached
|
||||
* locally in the array.
|
||||
*
|
||||
* As a shortcut is also possible to pass resolve/reject methods directly into this
|
||||
* method just as they would be passed to .then()
|
||||
*
|
||||
* @param {Function} [resolve]
|
||||
* @param {Function} [reject]
|
||||
* @returns a promise
|
||||
*/
|
||||
$loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise<AngularFireArray>;
|
||||
|
||||
/**
|
||||
* The loaded method is invoked after the initial batch of data arrives from the server.
|
||||
* When this resolves, all data which existed prior to calling $asArray() is now cached
|
||||
* locally in the array.
|
||||
*
|
||||
* As a shortcut is also possible to pass resolve/reject methods directly into this
|
||||
* method just as they would be passed to .then()
|
||||
*
|
||||
* @param {Function} [resolve]
|
||||
* @param {Function} [reject]
|
||||
* @returns a promise
|
||||
*/
|
||||
$loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise<AngularFireArray>;
|
||||
|
||||
/**
|
||||
* The loaded method is invoked after the initial batch of data arrives from the server.
|
||||
* When this resolves, all data which existed prior to calling $asArray() is now cached
|
||||
* locally in the array.
|
||||
*
|
||||
* As a shortcut is also possible to pass resolve/reject methods directly into this
|
||||
* method just as they would be passed to .then()
|
||||
*
|
||||
* @param {Function} [resolve]
|
||||
* @param {Function} [reject]
|
||||
* @returns a promise
|
||||
*/
|
||||
$loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise<AngularFireArray>;
|
||||
$inst(): AngularFire;
|
||||
|
||||
/**
|
||||
* @returns {Firebase} the original Firebase ref used to create this object.
|
||||
*/
|
||||
$ref(): Firebase;
|
||||
|
||||
/**
|
||||
* Listeners passed into this method are notified whenever a new change (add, updated,
|
||||
* move, remove) is received from the server. Each invocation is sent an object
|
||||
* containing <code>{ type: 'child_added|child_updated|child_moved|child_removed',
|
||||
* key: 'key_of_item_affected'}</code>
|
||||
*
|
||||
* Additionally, added and moved events receive a prevChild parameter, containing the
|
||||
* key of the item before this one in the array.
|
||||
*
|
||||
* This method returns a function which can be invoked to stop observing events.
|
||||
*
|
||||
* @param {Function} cb
|
||||
* @param {Object} [context]
|
||||
* @returns {Function} used to stop observing
|
||||
*/
|
||||
$watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function;
|
||||
|
||||
/**
|
||||
* Informs $firebase to stop sending events and clears memory being used
|
||||
* by this array (delete's its local content).
|
||||
*/
|
||||
$destroy(): void;
|
||||
}
|
||||
interface AngularFireArrayService {
|
||||
$extendFactory(ChildClass: Object, methods?: Object): Object;
|
||||
(firebase: Firebase): AngularFireArray;
|
||||
$extend(ChildClass: Object, methods?: Object): Object;
|
||||
}
|
||||
|
||||
interface AngularFireSimpleObject {
|
||||
@@ -72,11 +320,160 @@ interface AngularFireAuthService {
|
||||
}
|
||||
|
||||
interface AngularFireAuth {
|
||||
$getCurrentUser(): ng.IPromise<any>;
|
||||
$login(provider: string, options?: Object): ng.IPromise<any>;
|
||||
$logout(): void;
|
||||
$createUser(email: string, password: string): ng.IPromise<any>;
|
||||
$changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise<any>;
|
||||
$removeUser(email: string, password: string): ng.IPromise<any>;
|
||||
$sendPasswordResetEmail(email: string): ng.IPromise<any>;
|
||||
/**
|
||||
* Authenticates the Firebase reference with a custom authentication token.
|
||||
*
|
||||
* @param {string} authToken An authentication token or a Firebase Secret. A Firebase Secret
|
||||
* should only be used for authenticating a server process and provides full read / write
|
||||
* access to the entire Firebase.
|
||||
* @param {Object} [options] An object containing optional client arguments, such as configuring
|
||||
* session persistence.
|
||||
* @return {Promise<Object>} A promise fulfilled with an object containing authentication data.
|
||||
*/
|
||||
$authWithCustomToken(authToken: string, options?: Object): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Authenticates the Firebase reference anonymously.
|
||||
*
|
||||
* @param {Object} [options] An object containing optional client arguments, such as configuring
|
||||
* session persistence.
|
||||
* @return {Promise<Object>} A promise fulfilled with an object containing authentication data.
|
||||
*/
|
||||
$authAnonymously(options?: Object): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Authenticates the Firebase reference with an email/password user.
|
||||
*
|
||||
* @param {Object} credentials An object containing email and password attributes corresponding
|
||||
* to the user account.
|
||||
* @param {Object} [options] An object containing optional client arguments, such as configuring
|
||||
* session persistence.
|
||||
* @return {Promise<Object>} A promise fulfilled with an object containing authentication data.
|
||||
*/
|
||||
$authWithPassword(credentials: FirebaseCredentials, options?: Object): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Authenticates the Firebase reference with the OAuth popup flow.
|
||||
*
|
||||
* @param {string} provider The unique string identifying the OAuth provider to authenticate
|
||||
* with, e.g. google.
|
||||
* @param {Object} [options] An object containing optional client arguments, such as configuring
|
||||
* session persistence.
|
||||
* @return {Promise<Object>} A promise fulfilled with an object containing authentication data.
|
||||
*/
|
||||
$authWithOAuthPopup(provider: string, options?: Object): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Authenticates the Firebase reference with the OAuth redirect flow.
|
||||
*
|
||||
* @param {string} provider The unique string identifying the OAuth provider to authenticate
|
||||
* with, e.g. google.
|
||||
* @param {Object} [options] An object containing optional client arguments, such as configuring
|
||||
* session persistence.
|
||||
* @return {Promise<Object>} A promise fulfilled with an object containing authentication data.
|
||||
*/
|
||||
$authWithOAuthRedirect(provider: string, options?: Object): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Authenticates the Firebase reference with an OAuth token.
|
||||
*
|
||||
* @param {string} provider The unique string identifying the OAuth provider to authenticate
|
||||
* with, e.g. google.
|
||||
* @param {string|Object} credentials Either a string, such as an OAuth 2.0 access token, or an
|
||||
* Object of key / value pairs, such as a set of OAuth 1.0a credentials.
|
||||
* @param {Object} [options] An object containing optional client arguments, such as configuring
|
||||
* session persistence.
|
||||
* @return {Promise<Object>} A promise fulfilled with an object containing authentication data.
|
||||
*/
|
||||
$authWithOAuthToken(provider: string, credentials: Object|string, options?: Object): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Synchronously retrieves the current authentication data.
|
||||
*
|
||||
* @return {Object} The client's authentication data.
|
||||
*/
|
||||
$getAuth(): FirebaseAuthData;
|
||||
|
||||
/**
|
||||
* Asynchronously fires the provided callback with the current authentication data every time
|
||||
* the authentication data changes. It also fires as soon as the authentication data is
|
||||
* retrieved from the server.
|
||||
*
|
||||
* @param {function} callback A callback that fires when the client's authenticate state
|
||||
* changes. If authenticated, the callback will be passed an object containing authentication
|
||||
* data according to the provider used to authenticate. Otherwise, it will be passed null.
|
||||
* @param {string} [context] If provided, this object will be used as this when calling your
|
||||
* callback.
|
||||
* @return {function} A function which can be used to deregister the provided callback.
|
||||
*/
|
||||
$onAuth(callback: Function, context?: any): Function;
|
||||
|
||||
/**
|
||||
* Unauthenticates the Firebase reference.
|
||||
*/
|
||||
$unauth(): void;
|
||||
|
||||
/**
|
||||
* Utility method which can be used in a route's resolve() method to grab the current
|
||||
* authentication data.
|
||||
*
|
||||
* @returns {Promise<Object|null>} A promise fulfilled with the client's current authentication
|
||||
* state, which will be null if the client is not authenticated.
|
||||
*/
|
||||
$waitForAuth(): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Utility method which can be used in a route's resolve() method to require that a route has
|
||||
* a logged in client.
|
||||
*
|
||||
* @returns {Promise<Object>} A promise fulfilled with the client's current authentication
|
||||
* state or rejected if the client is not authenticated.
|
||||
*/
|
||||
$requireAuth(): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Creates a new email/password user. Note that this function only creates the user, if you
|
||||
* wish to log in as the newly created user, call $authWithPassword() after the promise for
|
||||
* this method has been resolved.
|
||||
*
|
||||
* @param {Object} credentials An object containing the email and password of the user to create.
|
||||
* @return {Promise<Object>} A promise fulfilled with the user object, which contains the
|
||||
* uid of the created user.
|
||||
*/
|
||||
$createUser(credentials: FirebaseCredentials): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Removes an email/password user.
|
||||
*
|
||||
* @param {Object} credentials An object containing the email and password of the user to remove.
|
||||
* @return {Promise<>} An empty promise fulfilled once the user is removed.
|
||||
*/
|
||||
$removeUser(credentials: FirebaseCredentials): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Changes the email for an email/password user.
|
||||
*
|
||||
* @param {Object} credentials An object containing the old email, new email, and password of
|
||||
* the user whose email is to change.
|
||||
* @return {Promise<>} An empty promise fulfilled once the email change is complete.
|
||||
*/
|
||||
$changeEmail(credentials: FirebaseChangeEmailCredentials): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Changes the password for an email/password user.
|
||||
*
|
||||
* @param {Object} credentials An object containing the email, old password, and new password of
|
||||
* the user whose password is to change.
|
||||
* @return {Promise<>} An empty promise fulfilled once the password change is complete.
|
||||
*/
|
||||
$changePassword(credentials: FirebaseChangePasswordCredentials): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
* Sends a password reset email to an email/password user.
|
||||
*
|
||||
* @param {Object} credentials An object containing the email of the user to send a reset
|
||||
* password email to.
|
||||
* @return {Promise<>} An empty promise fulfilled once the reset password email is sent.
|
||||
*/
|
||||
$resetPassword(credentials: FirebaseResetPasswordCredentials): ng.IPromise<any>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/// <reference path="angularjs-toaster.d.ts" />
|
||||
class NgToasterTestController {
|
||||
constructor(public $scope: ng.IScope, public $window: ng.IWindowService, public toaster: ngtoaster.IToasterService) {
|
||||
this.bar = 'Hi';
|
||||
}
|
||||
bar: string;
|
||||
|
||||
pop(): void {
|
||||
this.toaster.success({ title: "title", body: "text1" });
|
||||
this.toaster.error("title", "text2");
|
||||
this.toaster.pop({ type: 'wait', title: "title", body: "text" });
|
||||
this.toaster.pop('success', "title", '<ul><li>Render html</li></ul>', 5000, 'trustedHtml');
|
||||
this.toaster.pop('error', "title", '<ul><li>Render html</li></ul>', null, 'trustedHtml');
|
||||
this.toaster.pop('wait', "title", null, null, 'template');
|
||||
this.toaster.pop('warning', "title", "myTemplate.html", null, 'template');
|
||||
this.toaster.pop('note', "title", "text");
|
||||
this.toaster.pop('success', "title", 'Its address is https://google.com.', 5000, 'trustedHtml', (toaster: ngtoaster.IToast): boolean => {
|
||||
var match = toaster.body.match(/http[s]?:\/\/[^\s]+/);
|
||||
if (match) {
|
||||
this.$window.open(match[0]);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
this.toaster.pop('warning', "Hi ", "{template: 'myTemplateWithData.html', data: 'MyData'}", 15000, 'templateWithData');
|
||||
}
|
||||
|
||||
goToLink(toaster: ngtoaster.IToast): boolean {
|
||||
var match = toaster.body.match(/http[s]?:\/\/[^\s]+/);
|
||||
if (match) {
|
||||
this.$window.open(match[0]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.toaster.clear();
|
||||
}
|
||||
}
|
||||
|
||||
angular
|
||||
.module('main', ['ngAnimate', 'toaster'])
|
||||
.controller('myController', NgToasterTestController);
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
// Type definitions for angularjs-toaster v0.4.13
|
||||
// Project: https://github.com/jirikavi/AngularJS-Toaster
|
||||
// Definitions by: Ben Tesser <https://github.com/btesser>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module ngtoaster {
|
||||
interface IToasterService {
|
||||
pop(params:IPopParams): void
|
||||
/**
|
||||
* @param {string} type Type of toaster -- 'error', 'info', 'wait', 'success', and 'warning'
|
||||
*/
|
||||
pop(type?:string, title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
|
||||
toasterId?:number, showCloseButton?:boolean): void
|
||||
error(params: IPopParams): void
|
||||
error(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
|
||||
toasterId?:number): void
|
||||
into(params: IPopParams): void
|
||||
info(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
|
||||
toasterId?:number): void
|
||||
wait(params: IPopParams): void
|
||||
wait(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
|
||||
toasterId?:number): void
|
||||
success(params: IPopParams): void
|
||||
success(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
|
||||
toasterId?:number): void
|
||||
warning(params: IPopParams): void
|
||||
warning(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
|
||||
toasterId?:number): void
|
||||
clear(): void
|
||||
toast:IToast;
|
||||
}
|
||||
|
||||
interface IToasterEventRegistry {
|
||||
setup(): void
|
||||
subscribeToNewToastEvent(onNewToast:IToastEventListener): void
|
||||
subscribeToClearToastsEvent(onClearToasts:IToastEventListener): void
|
||||
unsubscribeToNewToastEvent(onNewToast:IToastEventListener): void
|
||||
unsubscribeToClearToastsEvent(onClearToasts:IToastEventListener): void
|
||||
}
|
||||
|
||||
interface IPopParams extends IToast{
|
||||
toasterId?: number;
|
||||
}
|
||||
|
||||
interface IToastEventListener {
|
||||
(event:Event, toasterId: number): void;
|
||||
}
|
||||
|
||||
interface IToast {
|
||||
/**
|
||||
* Acceptable types are:
|
||||
* 'error', 'info', 'wait', 'success', and 'warning'
|
||||
*/
|
||||
type?: string;
|
||||
title?: string;
|
||||
body?: string;
|
||||
timeout?: number;
|
||||
bodyOutputType?: string;
|
||||
clickHandler?: EventListener;
|
||||
showCloseButton?: boolean;
|
||||
}
|
||||
|
||||
interface IToasterConfig {
|
||||
/**
|
||||
* limits max number of toasts
|
||||
*/
|
||||
limit?: number;
|
||||
'tap-to-dismiss'?: boolean;
|
||||
'close-button'?: boolean;
|
||||
'newest-on-top'?: boolean;
|
||||
'time-out'?: number;
|
||||
'icon-classes'?: IIconClasses;
|
||||
/**
|
||||
* Options include:
|
||||
* '', 'trustedHtml', 'template', 'templateWithData'
|
||||
*/
|
||||
'body-output-type'?: string;
|
||||
'body-template'?: string;
|
||||
'icon-class'?: string;
|
||||
/**
|
||||
* Options include:
|
||||
* 'toast-top-full-width', 'toast-bottom-full-width', 'toast-center',
|
||||
* 'toast-top-left', 'toast-top-center', 'toast-top-rigt',
|
||||
* 'toast-bottom-left', 'toast-bottom-center', 'toast-bottom-rigt',
|
||||
*/
|
||||
'position-class'?: string;
|
||||
'title-class'?: string;
|
||||
'message-class'?: string;
|
||||
'prevent-duplicates'?: boolean;
|
||||
/**
|
||||
* stop timeout on mouseover and restart timer on mouseout
|
||||
*/
|
||||
'mouseover-timer-stop'?: boolean;
|
||||
}
|
||||
|
||||
interface IIconClasses {
|
||||
error: string;
|
||||
info: string;
|
||||
wait: string;
|
||||
success: string;
|
||||
warning: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "ngtoaster" {
|
||||
export = ngtoaster
|
||||
}
|
||||
Vendored
+10
-10
@@ -19,7 +19,7 @@ declare module angular.animate {
|
||||
// AnimateService
|
||||
// see http://docs.angularjs.org/api/ngAnimate/service/$animate
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IAnimateService extends ng.IAnimateService {
|
||||
interface IAnimateService extends angular.IAnimateService {
|
||||
/**
|
||||
* Globally enables / disables animations.
|
||||
*
|
||||
@@ -39,7 +39,7 @@ declare module angular.animate {
|
||||
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): ng.IPromise<void>;
|
||||
animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Appends the element to the parentElement element that resides in the document and then runs the enter animation.
|
||||
@@ -50,7 +50,7 @@ declare module angular.animate {
|
||||
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): ng.IPromise<void>;
|
||||
enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Runs the leave animation operation and, upon completion, removes the element from the DOM.
|
||||
@@ -59,7 +59,7 @@ declare module angular.animate {
|
||||
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
leave(element: JQuery, options?: IAnimationOptions): ng.IPromise<void>;
|
||||
leave(element: JQuery, options?: IAnimationOptions): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Fires the move DOM operation. Just before the animation starts, the animate service will either append
|
||||
@@ -71,7 +71,7 @@ declare module angular.animate {
|
||||
* @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): ng.IPromise<void>;
|
||||
move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Triggers a custom animation event based off the className variable and then attaches the className
|
||||
@@ -82,7 +82,7 @@ declare module angular.animate {
|
||||
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
addClass(element: JQuery, className: string, options?: IAnimationOptions): ng.IPromise<void>;
|
||||
addClass(element: JQuery, className: string, options?: IAnimationOptions): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Triggers a custom animation event based off the className variable and then removes the CSS class
|
||||
@@ -93,7 +93,7 @@ declare module angular.animate {
|
||||
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
removeClass(element: JQuery, className: string, options?: IAnimationOptions): ng.IPromise<void>;
|
||||
removeClass(element: JQuery, className: string, options?: IAnimationOptions): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback
|
||||
@@ -105,12 +105,12 @@ declare module angular.animate {
|
||||
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
|
||||
* @returns the animation callback promise
|
||||
*/
|
||||
setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): ng.IPromise<void>;
|
||||
setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): IPromise<void>;
|
||||
|
||||
/**
|
||||
* Cancels the provided animation.
|
||||
*/
|
||||
cancel(animationPromise: ng.IPromise<void>): void;
|
||||
cancel(animationPromise: IPromise<void>): void;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -124,7 +124,7 @@ declare module angular.animate {
|
||||
* @param name The name of the animation.
|
||||
* @param factory The factory function that will be executed to return the animation object.
|
||||
*/
|
||||
register(name: string, factory: () => ng.IAnimateCallbackObject): void;
|
||||
register(name: string, factory: () => IAnimateCallbackObject): void;
|
||||
|
||||
/**
|
||||
* Gets and/or sets the CSS class expression that is checked when performing an animation.
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+5
-2
@@ -39,8 +39,11 @@ declare module angular {
|
||||
dump(obj: any): string;
|
||||
|
||||
// see http://docs.angularjs.org/api/angular.mock.inject
|
||||
inject(...fns: Function[]): any;
|
||||
inject(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
|
||||
inject: {
|
||||
(...fns: Function[]): any;
|
||||
(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
|
||||
strictDi(val?: boolean): void;
|
||||
}
|
||||
|
||||
// see http://docs.angularjs.org/api/angular.mock.module
|
||||
module(...modules: any[]): any;
|
||||
|
||||
@@ -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
+123
-20
@@ -474,6 +474,7 @@ declare module angular {
|
||||
// types do work and it's common to use them.
|
||||
$setViewValue(value: any, trigger?: string): void;
|
||||
$setPristine(): void;
|
||||
$setDirty(): void;
|
||||
$validate(): void;
|
||||
$setTouched(): void;
|
||||
$setUntouched(): void;
|
||||
@@ -539,9 +540,29 @@ declare module angular {
|
||||
$applyAsync(exp: string): any;
|
||||
$applyAsync(exp: (scope: IScope) => any): any;
|
||||
|
||||
/**
|
||||
* Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners.
|
||||
*
|
||||
* The event life cycle starts at the scope on which $broadcast was called. All listeners listening for name event on this scope get notified. Afterwards, the event propagates to all direct and indirect scopes of the current scope and calls all registered listeners along the way. The event cannot be canceled.
|
||||
*
|
||||
* Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
|
||||
*
|
||||
* @param name Event name to broadcast.
|
||||
* @param args Optional one or more arguments which will be passed onto the event listeners.
|
||||
*/
|
||||
$broadcast(name: string, ...args: any[]): IAngularEvent;
|
||||
$destroy(): void;
|
||||
$digest(): void;
|
||||
/**
|
||||
* Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners.
|
||||
*
|
||||
* The event life cycle starts at the scope on which $emit was called. All listeners listening for name event on this scope get notified. Afterwards, the event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it.
|
||||
*
|
||||
* Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
|
||||
*
|
||||
* @param name Event name to emit.
|
||||
* @param args Optional one or more arguments which will be passed onto the event listeners.
|
||||
*/
|
||||
$emit(name: string, ...args: any[]): IAngularEvent;
|
||||
|
||||
$eval(): any;
|
||||
@@ -665,6 +686,7 @@ declare module angular {
|
||||
// TODO undocumented, so we need to get it from the source code
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IBrowserService {
|
||||
defer: angular.ITimeoutService;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@@ -715,17 +737,37 @@ declare module angular {
|
||||
eventFn(element: Node, doneFn: () => void): Function;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// FilterService
|
||||
// see http://docs.angularjs.org/api/ng.$filter
|
||||
// see http://docs.angularjs.org/api/ng.$filterProvider
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* $filter - $filterProvider - service in module ng
|
||||
*
|
||||
* Filters are used for formatting data displayed to the user.
|
||||
*
|
||||
* see https://docs.angularjs.org/api/ng/service/$filter
|
||||
*/
|
||||
interface IFilterService {
|
||||
/**
|
||||
* Usage:
|
||||
* $filter(name);
|
||||
*
|
||||
* @param name Name of the filter function to retrieve
|
||||
*/
|
||||
(name: string): Function;
|
||||
}
|
||||
|
||||
/**
|
||||
* $filterProvider - $filter - provider in module ng
|
||||
*
|
||||
* Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To achieve this a filter definition consists of a factory function which is annotated with dependencies and is responsible for creating a filter function.
|
||||
*
|
||||
* see https://docs.angularjs.org/api/ng/provider/$filterProvider
|
||||
*/
|
||||
interface IFilterProvider extends IServiceProvider {
|
||||
register(name: string, filterFactory: Function): IServiceProvider;
|
||||
/**
|
||||
* register(name);
|
||||
*
|
||||
* @param name Name of the filter function, or an object map of filters where the keys are the filter names and the values are the filter factories. Note: Filter names must be valid angular Expressions identifiers, such as uppercase or orderBy. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (myappSubsectionFilterx) or underscores (myapp_subsection_filterx).
|
||||
*/
|
||||
register(name: string | {}): IServiceProvider;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -1011,37 +1053,98 @@ declare module angular {
|
||||
disableAutoScrolling(): void;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// CacheFactoryService
|
||||
// see http://docs.angularjs.org/api/ng.$cacheFactory
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* $cacheFactory - service in module ng
|
||||
*
|
||||
* Factory that constructs Cache objects and gives access to them.
|
||||
*
|
||||
* see https://docs.angularjs.org/api/ng/service/$cacheFactory
|
||||
*/
|
||||
interface ICacheFactoryService {
|
||||
// Lets not foce the optionsMap to have the capacity member. Even though
|
||||
// it's the ONLY option considered by the implementation today, a consumer
|
||||
// might find it useful to associate some other options to the cache object.
|
||||
//(cacheId: string, optionsMap?: { capacity: number; }): CacheObject;
|
||||
(cacheId: string, optionsMap?: { capacity: number; }): ICacheObject;
|
||||
/**
|
||||
* Factory that constructs Cache objects and gives access to them.
|
||||
*
|
||||
* @param cacheId Name or id of the newly created cache.
|
||||
* @param optionsMap Options object that specifies the cache behavior. Properties:
|
||||
*
|
||||
* capacity — turns the cache into LRU cache.
|
||||
*/
|
||||
(cacheId: string, optionsMap?: { capacity?: number; }): ICacheObject;
|
||||
|
||||
// Methods bellow are not documented
|
||||
/**
|
||||
* Get information about all the caches that have been created.
|
||||
* @returns key-value map of cacheId to the result of calling cache#info
|
||||
*/
|
||||
info(): any;
|
||||
|
||||
/**
|
||||
* Get access to a cache object by the cacheId used when it was created.
|
||||
*
|
||||
* @param cacheId Name or id of a cache to access.
|
||||
*/
|
||||
get(cacheId: string): ICacheObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* $cacheFactory.Cache - type in module ng
|
||||
*
|
||||
* A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data.
|
||||
*
|
||||
* see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache
|
||||
*/
|
||||
interface ICacheObject {
|
||||
/**
|
||||
* Retrieve information regarding a particular Cache.
|
||||
*/
|
||||
info(): {
|
||||
/**
|
||||
* the id of the cache instance
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* the number of entries kept in the cache instance
|
||||
*/
|
||||
size: number;
|
||||
|
||||
// Not garanteed to have, since it's a non-mandatory option
|
||||
//capacity: number;
|
||||
//...: any additional properties from the options object when creating the cache.
|
||||
};
|
||||
|
||||
/**
|
||||
* Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set.
|
||||
*
|
||||
* It will not insert undefined values into the cache.
|
||||
*
|
||||
* @param key the key under which the cached data is stored.
|
||||
* @param value the value to store alongside the key. If it is undefined, the key will not be stored.
|
||||
*/
|
||||
put<T>(key: string, value?: T): T;
|
||||
|
||||
/**
|
||||
* Retrieves named data stored in the Cache object.
|
||||
*
|
||||
* @param key the key of the data to be retrieved
|
||||
*/
|
||||
get(key: string): any;
|
||||
|
||||
/**
|
||||
* Removes an entry from the Cache object.
|
||||
*
|
||||
* @param key the key of the entry to be removed
|
||||
*/
|
||||
remove(key: string): void;
|
||||
|
||||
/**
|
||||
* Clears the cache object of any entries.
|
||||
*/
|
||||
removeAll(): void;
|
||||
|
||||
/**
|
||||
* Destroys the Cache object entirely, removing it from the $cacheFactory set.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// CompileService
|
||||
// see http://docs.angularjs.org/api/ng.$compile
|
||||
@@ -1277,7 +1380,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;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
///<reference path='applicationinsights.d.ts' />
|
||||
import appInsights = require("applicationinsights");
|
||||
|
||||
// basic use
|
||||
appInsights.setup("<instrumentation_key>").start();
|
||||
|
||||
// basic use with auto-collection configuration
|
||||
appInsights.setup("<instrumentation_key>")
|
||||
.setAutoCollectRequests(false)
|
||||
.setAutoCollectPerformance(false)
|
||||
.setAutoCollectExceptions(false)
|
||||
// no telemetry will be sent until .start() is called
|
||||
// this prevents any of the auto-collectors from initializing
|
||||
.enableVerboseLogging()
|
||||
.start();
|
||||
|
||||
appInsights.client.trackEvent("custom event", {customProperty: "custom property value"});
|
||||
appInsights.client.trackException(new Error("handled exceptions can be logged with this method"));
|
||||
appInsights.client.trackMetric("custom metric", 3);
|
||||
appInsights.client.trackTrace("trace message");
|
||||
|
||||
// assign common properties to all telemetry
|
||||
appInsights.client.commonProperties = {
|
||||
environment: "dev"
|
||||
};
|
||||
+429
@@ -0,0 +1,429 @@
|
||||
// Type definitions for Application Insights v0.15.1
|
||||
// Project: https://github.com/Microsoft/ApplicationInsights-node.js
|
||||
// Definitions by: Scott Southwood <https://github.com/scsouthw/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface AutoCollectConsole {
|
||||
enable(isEnabled: boolean): void;
|
||||
isInitialized(): boolean;
|
||||
}
|
||||
|
||||
interface AutoCollectExceptions {
|
||||
isInitialized(): boolean;
|
||||
enable(isEnabled:boolean): void;
|
||||
}
|
||||
|
||||
interface AutoCollectPerformance {
|
||||
enable(isEnabled: boolean): void;
|
||||
isInitialized(): boolean;
|
||||
}
|
||||
|
||||
interface AutoCollectRequests {
|
||||
enable(isEnabled: boolean): void;
|
||||
isInitialized(): boolean;
|
||||
}
|
||||
|
||||
|
||||
declare module ContractsModule {
|
||||
enum DataPointType {
|
||||
Measurement = 0,
|
||||
Aggregation = 1,
|
||||
}
|
||||
enum DependencyKind {
|
||||
SQL = 0,
|
||||
Http = 1,
|
||||
Other = 2,
|
||||
}
|
||||
enum DependencySourceType {
|
||||
Undefined = 0,
|
||||
Aic = 1,
|
||||
Apmc = 2,
|
||||
}
|
||||
enum SessionState {
|
||||
Start = 0,
|
||||
End = 1,
|
||||
}
|
||||
enum SeverityLevel {
|
||||
Verbose = 0,
|
||||
Information = 1,
|
||||
Warning = 2,
|
||||
Error = 3,
|
||||
Critical = 4,
|
||||
}
|
||||
interface ContextTagKeys {
|
||||
applicationVersion: string;
|
||||
applicationBuild: string;
|
||||
deviceId: string;
|
||||
deviceIp: string;
|
||||
deviceLanguage: string;
|
||||
deviceLocale: string;
|
||||
deviceModel: string;
|
||||
deviceNetwork: string;
|
||||
deviceOEMName: string;
|
||||
deviceOS: string;
|
||||
deviceOSVersion: string;
|
||||
deviceRoleInstance: string;
|
||||
deviceRoleName: string;
|
||||
deviceScreenResolution: string;
|
||||
deviceType: string;
|
||||
deviceMachineName: string;
|
||||
locationIp: string;
|
||||
operationId: string;
|
||||
operationName: string;
|
||||
operationParentId: string;
|
||||
operationRootId: string;
|
||||
operationSyntheticSource: string;
|
||||
operationIsSynthetic: string;
|
||||
sessionId: string;
|
||||
sessionIsFirst: string;
|
||||
sessionIsNew: string;
|
||||
userAccountAcquisitionDate: string;
|
||||
userAccountId: string;
|
||||
userAgent: string;
|
||||
userId: string;
|
||||
userStoreRegion: string;
|
||||
sampleRate: string;
|
||||
internalSdkVersion: string;
|
||||
internalAgentVersion: string;
|
||||
}
|
||||
interface Domain {
|
||||
ver: number;
|
||||
properties: any;
|
||||
}
|
||||
interface Data<TDomain extends ContractsModule.Domain> {
|
||||
baseType: string;
|
||||
baseData: TDomain;
|
||||
}
|
||||
interface Envelope {
|
||||
ver: number;
|
||||
name: string;
|
||||
time: string;
|
||||
sampleRate: number;
|
||||
seq: string;
|
||||
iKey: string;
|
||||
flags: number;
|
||||
deviceId: string;
|
||||
os: string;
|
||||
osVer: string;
|
||||
appId: string;
|
||||
appVer: string;
|
||||
userId: string;
|
||||
tags: {
|
||||
[key: string]: string;
|
||||
};
|
||||
data: Data<Domain>;
|
||||
}
|
||||
interface EventData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
name: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
}
|
||||
interface MessageData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
message: string;
|
||||
severityLevel: ContractsModule.SeverityLevel;
|
||||
properties: any;
|
||||
}
|
||||
interface ExceptionData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
handledAt: string;
|
||||
exceptions: ExceptionDetails[];
|
||||
severityLevel: ContractsModule.SeverityLevel;
|
||||
problemId: string;
|
||||
crashThreadId: number;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
}
|
||||
interface StackFrame {
|
||||
level: number;
|
||||
method: string;
|
||||
assembly: string;
|
||||
fileName: string;
|
||||
line: number;
|
||||
}
|
||||
interface ExceptionDetails {
|
||||
id: number;
|
||||
outerId: number;
|
||||
typeName: string;
|
||||
message: string;
|
||||
hasFullStack: boolean;
|
||||
stack: string;
|
||||
parsedStack: StackFrame[];
|
||||
}
|
||||
interface DataPoint {
|
||||
name: string;
|
||||
kind: ContractsModule.DataPointType;
|
||||
value: number;
|
||||
count: number;
|
||||
min: number;
|
||||
max: number;
|
||||
stdDev: number;
|
||||
}
|
||||
interface MetricData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
metrics: DataPoint[];
|
||||
properties: any;
|
||||
}
|
||||
interface PageViewData extends ContractsModule.EventData {
|
||||
ver: number;
|
||||
url: string;
|
||||
name: string;
|
||||
duration: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
}
|
||||
interface PageViewPerfData extends ContractsModule.PageViewData {
|
||||
ver: number;
|
||||
url: string;
|
||||
perfTotal: string;
|
||||
name: string;
|
||||
duration: string;
|
||||
networkConnect: string;
|
||||
sentRequest: string;
|
||||
receivedResponse: string;
|
||||
domProcessing: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
}
|
||||
interface RemoteDependencyData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
name: string;
|
||||
kind: ContractsModule.DataPointType;
|
||||
value: number;
|
||||
count: number;
|
||||
min: number;
|
||||
max: number;
|
||||
stdDev: number;
|
||||
dependencyKind: ContractsModule.DependencyKind;
|
||||
success: boolean;
|
||||
async: boolean;
|
||||
dependencySource: ContractsModule.DependencySourceType;
|
||||
commandName: string;
|
||||
dependencyTypeName: string;
|
||||
properties: any;
|
||||
}
|
||||
interface AjaxCallData extends ContractsModule.PageViewData {
|
||||
ver: number;
|
||||
url: string;
|
||||
ajaxUrl: string;
|
||||
name: string;
|
||||
duration: string;
|
||||
requestSize: number;
|
||||
responseSize: number;
|
||||
timeToFirstByte: string;
|
||||
timeToLastByte: string;
|
||||
callbackDuration: string;
|
||||
responseCode: string;
|
||||
success: boolean;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
}
|
||||
interface RequestData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
id: string;
|
||||
name: string;
|
||||
startTime: string;
|
||||
duration: string;
|
||||
responseCode: string;
|
||||
success: boolean;
|
||||
httpMethod: string;
|
||||
url: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
}
|
||||
interface SessionStateData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
state: ContractsModule.SessionState;
|
||||
}
|
||||
interface PerformanceCounterData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
categoryName: string;
|
||||
counterName: string;
|
||||
instanceName: string;
|
||||
kind: DataPointType;
|
||||
count: number;
|
||||
min: number;
|
||||
max: number;
|
||||
stdDev: number;
|
||||
value: number;
|
||||
properties: any;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface Channel {
|
||||
constructor(isDisabled: () => boolean, getBatchSize: () => number, getBatchIntervalMs: () => number, sender: Sender): Channel;
|
||||
/**
|
||||
* Add a telemetry item to the send buffer
|
||||
*/
|
||||
send(envelope: ContractsModule.Envelope): void;
|
||||
handleCrash(envelope: ContractsModule.Envelope): void;
|
||||
/**
|
||||
* Immediately send buffered data
|
||||
*/
|
||||
triggerSend(isNodeCrashing?: boolean): void;
|
||||
}
|
||||
|
||||
interface Client {
|
||||
config: Config;
|
||||
context: Context;
|
||||
commonProperties: {
|
||||
[key: string]: string;
|
||||
};
|
||||
channel: Channel;
|
||||
/**
|
||||
* Constructs a new client of the client
|
||||
* @param iKey the instrumentation key to use (read from environment variable if not specified)
|
||||
*/
|
||||
constructor(iKey?: string): Client;
|
||||
/**
|
||||
* Log a user action or other occurrence.
|
||||
* @param name A string to identify this event in the portal.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
trackEvent(name: string, properties?: {
|
||||
[key: string]: string;
|
||||
}, measurements?: {
|
||||
[key: string]: number;
|
||||
}): void;
|
||||
/**
|
||||
* Log a trace message
|
||||
* @param message A string to identify this event in the portal.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
*/
|
||||
trackTrace(message: string, severityLevel?: ContractsModule.SeverityLevel, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
/**
|
||||
* Log an exception you have caught.
|
||||
* @param exception An Error from a catch clause, or the string error message.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
trackException(exception: Error, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
/**
|
||||
* Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators.
|
||||
* To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the
|
||||
* telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals.
|
||||
* @param name A string that identifies the metric.
|
||||
* @param value The value of the metric
|
||||
*/
|
||||
trackMetric(name: string, value: number): void;
|
||||
trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
/**
|
||||
* Immediately send all queued telemetry.
|
||||
*/
|
||||
sendPendingData(): void;
|
||||
getEnvelope(data: ContractsModule.Data<ContractsModule.Domain>, tagOverrides?: {
|
||||
[key: string]: string;
|
||||
}): ContractsModule.Envelope;
|
||||
/**
|
||||
* Generic track method for all telemetry types
|
||||
* @param data the telemetry to send
|
||||
* @param tagOverrides the context tags to use for this telemetry which overwrite default context values
|
||||
*/
|
||||
track(data: ContractsModule.Data<ContractsModule.Domain>, tagOverrides?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
instrumentationKey: string;
|
||||
sessionRenewalMs: number;
|
||||
sessionExpirationMs: number;
|
||||
endpointUrl: string;
|
||||
maxBatchSize: number;
|
||||
maxBatchIntervalMs: number;
|
||||
disableAppInsights: boolean;
|
||||
constructor(instrumentationKey?: string): Config;
|
||||
}
|
||||
|
||||
interface Context {
|
||||
keys: ContractsModule.ContextTagKeys;
|
||||
tags: {
|
||||
[key: string]: string;
|
||||
};
|
||||
constructor(packageJsonPath?: string): Context;
|
||||
}
|
||||
|
||||
interface Sender {
|
||||
constructor(getUrl: () => string, onSuccess?: (response: string) => void, onError?: (error: Error) => void): Sender;
|
||||
send(payload: any/* Buffer */): void;
|
||||
saveOnCrash(payload: string): void;
|
||||
/**
|
||||
* enable caching events locally on error
|
||||
*/
|
||||
enableCacheOnError(): void;
|
||||
/**
|
||||
* disable caching events locally on error
|
||||
*/
|
||||
disableCacheOnError(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The singleton meta interface for the default client of the client. This interface is used to setup/start and configure
|
||||
* the auto-collection behavior of the application insights module.
|
||||
*/
|
||||
declare class ApplicationInsights {
|
||||
static client: Client;
|
||||
private static _isConsole;
|
||||
private static _isExceptions;
|
||||
private static _isPerformance;
|
||||
private static _isRequests;
|
||||
private static _console;
|
||||
private static _exceptions;
|
||||
private static _performance;
|
||||
private static _requests;
|
||||
private static _isStarted;
|
||||
/**
|
||||
* Initializes the default client of the client and sets the default configuration
|
||||
* @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be
|
||||
* read from the environment variable APPINSIGHTS_INSTRUMENTATION_KEY
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
static setup(instrumentationKey?: string): typeof ApplicationInsights;
|
||||
/**
|
||||
* Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
static start(): typeof ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of console tracking (enabled by default)
|
||||
* @param value if true console activity will be sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
static setAutoCollectConsole(value: boolean): typeof ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of exception tracking (enabled by default)
|
||||
* @param value if true uncaught exceptions will be sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
static setAutoCollectExceptions(value: boolean): typeof ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of performance tracking (enabled by default)
|
||||
* @param value if true performance counters will be collected every second and sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
static setAutoCollectPerformance(value: boolean): typeof ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of request tracking (enabled by default)
|
||||
* @param value if true requests will be sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
static setAutoCollectRequests(value: boolean): typeof ApplicationInsights;
|
||||
/**
|
||||
* Enables verbose debug logging
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
static enableVerboseLogging(): typeof ApplicationInsights;
|
||||
}
|
||||
|
||||
declare module "applicationinsights" {
|
||||
export = ApplicationInsights;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/// <reference path="autoprefixer-core.d.ts" />
|
||||
import autoprefixer = require("autoprefixer-core");
|
||||
|
||||
var css: string;
|
||||
|
||||
var prefixed = autoprefixer.process(css).css;
|
||||
|
||||
var processor = autoprefixer({ browsers: ['> 1%', 'IE 7'], cascade: false });
|
||||
console.log(processor.info());
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// Type definitions for Autoprefixer Core 5.1.11
|
||||
// Project: https://github.com/postcss/autoprefixer-core
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "autoprefixer-core" {
|
||||
interface Config {
|
||||
browsers?: string[];
|
||||
cascade?: boolean;
|
||||
remove?: boolean;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
from?: string;
|
||||
to?: string;
|
||||
safe?: boolean;
|
||||
map?: {
|
||||
inline?: boolean;
|
||||
prev?: string | Object;
|
||||
}
|
||||
}
|
||||
|
||||
interface Result {
|
||||
css: string;
|
||||
map: string;
|
||||
opts: Options;
|
||||
}
|
||||
|
||||
interface Processor {
|
||||
postcss: any;
|
||||
info(): string;
|
||||
process(css: string, opts?: Options): Result;
|
||||
}
|
||||
|
||||
interface Exports {
|
||||
(config: Config): Processor;
|
||||
postcss: any;
|
||||
info(): string;
|
||||
process(css: string, opts?: Options): Result;
|
||||
}
|
||||
|
||||
var exports: Exports;
|
||||
export = exports;
|
||||
}
|
||||
Vendored
+1
-3
@@ -169,9 +169,7 @@ declare module Backbone {
|
||||
**/
|
||||
private static extend(properties: any, classProperties?: any): any;
|
||||
|
||||
// TODO: this really has to be typeof TModel
|
||||
//model: typeof TModel;
|
||||
model: { new(): TModel; }; // workaround
|
||||
model: new (...args:any[]) => TModel;
|
||||
models: TModel[];
|
||||
length: number;
|
||||
|
||||
|
||||
Vendored
+87
-46
@@ -8,12 +8,12 @@
|
||||
declare module Backgrid {
|
||||
|
||||
interface GridOptions {
|
||||
columns: Column[];
|
||||
collection: Backbone.Collection<Backbone.Model>;
|
||||
header: Header;
|
||||
body: Body;
|
||||
row: Row;
|
||||
footer: Footer;
|
||||
columns: Column[];
|
||||
collection: Backbone.Collection<Backbone.Model>;
|
||||
header: Header;
|
||||
body: Body;
|
||||
row: Row;
|
||||
footer: Footer;
|
||||
}
|
||||
|
||||
class Header extends Backbone.View<Backbone.Model> {
|
||||
@@ -21,65 +21,106 @@ declare module Backgrid {
|
||||
|
||||
class Footer extends Backbone.View<Backbone.Model> {
|
||||
}
|
||||
|
||||
|
||||
class Row extends Backbone.View<Backbone.Model> {
|
||||
}
|
||||
|
||||
class Command {
|
||||
cancel();
|
||||
moveDown();
|
||||
moveLeft();
|
||||
moveRight();
|
||||
moveUp();
|
||||
passThru();
|
||||
save();
|
||||
moveUp(): boolean;
|
||||
moveDown(): boolean;
|
||||
moveLeft(): boolean;
|
||||
moveRight(): boolean;
|
||||
save(): boolean;
|
||||
cancel(): boolean;
|
||||
passThru(): boolean;
|
||||
}
|
||||
|
||||
class CellFormatter {
|
||||
fromRaw(rawData: any, model: Backbone.Model);
|
||||
toRaw(formattedData: any, model: Backbone.Model);
|
||||
}
|
||||
|
||||
class NumberFormatter extends CellFormatter {}
|
||||
|
||||
class PercentFormatter extends NumberFormatter {}
|
||||
|
||||
class DateTimeFormatter extends CellFormatter {}
|
||||
|
||||
class StringFormatter extends CellFormatter {}
|
||||
|
||||
class EmailFormatter extends CellFormatter {}
|
||||
|
||||
class SelectFormatter extends CellFormatter {}
|
||||
|
||||
class CellEditor extends Backbone.View<Backbone.Model>{
|
||||
initialize(options?: any);
|
||||
postRender(model: Backbone.Model, column: Backbone.Model);
|
||||
}
|
||||
|
||||
class InputCellEditor extends CellEditor {
|
||||
render();
|
||||
saveOrCancel(event: any);
|
||||
}
|
||||
|
||||
class Cell extends Backbone.View<Backbone.Model>{
|
||||
tagName: string;
|
||||
formatter: CellFormatter;
|
||||
editor: InputCellEditor;
|
||||
enterEditMode();
|
||||
renderError();
|
||||
exitEditMode();
|
||||
remove();
|
||||
}
|
||||
|
||||
class StringCell extends Cell {
|
||||
}
|
||||
|
||||
interface ColumnAttr {
|
||||
name: string;
|
||||
cell: string;
|
||||
headerCell: string;
|
||||
label: string;
|
||||
sortable: boolean;
|
||||
editable: boolean;
|
||||
renderable: boolean;
|
||||
formater: string;
|
||||
name: string;
|
||||
cell: string;
|
||||
headerCell: string;
|
||||
label: string;
|
||||
sortable: boolean;
|
||||
editable: boolean;
|
||||
renderable: boolean;
|
||||
formater: string;
|
||||
}
|
||||
|
||||
class Column extends Backbone.Model {
|
||||
initialize(options?: any);
|
||||
initialize(options?: any);
|
||||
}
|
||||
|
||||
class Body extends Backbone.View<Backbone.Model> {
|
||||
tagName: string;
|
||||
tagName: string;
|
||||
|
||||
initialize(options?: any);
|
||||
insertRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
moveToNextCell(model: Backbone.Model, cell: Column, command: Command);
|
||||
refresh(): Body;
|
||||
remove(): Body;
|
||||
removeRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
render(): Body;
|
||||
initialize(options?: any);
|
||||
insertRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
moveToNextCell(model: Backbone.Model, cell: Column, command: Command);
|
||||
refresh(): Body;
|
||||
remove(): Body;
|
||||
removeRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
render(): Body;
|
||||
}
|
||||
|
||||
class Grid extends Backbone.View<Backbone.Model> {
|
||||
body: Backgrid.Body;
|
||||
className: string;
|
||||
footer: any;
|
||||
header: any;
|
||||
tagName: string;
|
||||
body: Backgrid.Body;
|
||||
className: string;
|
||||
footer: any;
|
||||
header: any;
|
||||
tagName: string;
|
||||
|
||||
initialize(options: any);
|
||||
getSelectedModels(): Backbone.Model[];
|
||||
insertColumn(...options: any[]): Grid;
|
||||
insertRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
remove():Grid;
|
||||
removeColumn(...options: any[]): Grid;
|
||||
removeRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
render():Grid;
|
||||
initialize(options: any);
|
||||
getSelectedModels(): Backbone.Model[];
|
||||
insertColumn(...options: any[]): Grid;
|
||||
insertRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
remove(): Grid;
|
||||
removeColumn(...options: any[]): Grid;
|
||||
removeRow(model: Backbone.Model, collection: Backbone.Collection<Backbone.Model>, options: any);
|
||||
render(): Grid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
declare module "backgrid" {
|
||||
export = Backgrid;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
/// <reference path="blocks.d.ts" />
|
||||
|
||||
function test_blocks_methods() {
|
||||
var extended: Object;
|
||||
blocks.extend(extended, new Object());
|
||||
|
||||
blocks.each([3, 1, 4], function(value, index, collection) {
|
||||
// value is the current item (3, 1 and 4)
|
||||
// index is the current index (0, 1 and 2)
|
||||
// collection points to the array passed to the function - [3, 1, 4]
|
||||
});
|
||||
|
||||
blocks.eachRight([3, 1, 4], function(value, index, collection) {
|
||||
// value is the current item (4, 1 and 3)
|
||||
// index is the current index (2, 1 and 0)
|
||||
// collection points to the array passed to the function - [3, 1, 4]
|
||||
});
|
||||
|
||||
blocks.isArray([1, 2, 3]);
|
||||
// -> true
|
||||
|
||||
function calculate() {
|
||||
blocks.isArray(arguments);
|
||||
// -> false
|
||||
}
|
||||
|
||||
function max(collection: any, callback: any) {
|
||||
callback = callback || blocks.noop;
|
||||
}
|
||||
|
||||
blocks.type('a string');
|
||||
// -> string
|
||||
|
||||
blocks.type(314);
|
||||
// -> number
|
||||
|
||||
blocks.type([]);
|
||||
// -> array
|
||||
|
||||
blocks.type({});
|
||||
// -> object
|
||||
|
||||
blocks.type(blocks.noop);
|
||||
// -> function
|
||||
|
||||
blocks.type(new RegExp(''));
|
||||
// -> regexp
|
||||
|
||||
blocks.type(undefined);
|
||||
// -> undefined
|
||||
|
||||
blocks.type(null);
|
||||
// -> null
|
||||
|
||||
blocks.is([], 'array');
|
||||
// -> true
|
||||
|
||||
blocks.is(function() { }, 'object');
|
||||
// -> false
|
||||
|
||||
blocks.has({
|
||||
price: undefined
|
||||
}, 'price');
|
||||
// -> true
|
||||
|
||||
blocks.has({
|
||||
price: 314
|
||||
}, 'ratio');
|
||||
// -> false
|
||||
|
||||
blocks.unwrap(blocks.observable(314));
|
||||
// -> 314
|
||||
|
||||
blocks.unwrap(blocks([3, 1, 4]));
|
||||
// -> [3, 1, 4]
|
||||
|
||||
blocks.unwrap('a string or any other value will not be changed');
|
||||
// -> 'a string or any other value will not be changed'
|
||||
|
||||
blocks.toArray(3);
|
||||
// -> [3]
|
||||
|
||||
blocks.toArray([3, 1, 4]);
|
||||
// -> [3, 1, 4]
|
||||
|
||||
blocks.toUnit(230);
|
||||
// -> 230px
|
||||
|
||||
blocks.toUnit(230, '%');
|
||||
// -> 230%
|
||||
|
||||
blocks.toUnit('60px', '%');
|
||||
// -> 60%
|
||||
|
||||
var array = [3, 1, 4];
|
||||
var cloned = blocks.clone(array);
|
||||
// -> [3, 1, 4]
|
||||
var areEqual = array == cloned;
|
||||
// -> false
|
||||
|
||||
blocks.isElement(document.body);
|
||||
// -> true
|
||||
|
||||
blocks.isElement({});
|
||||
// -> false
|
||||
|
||||
blocks.isBoolean(true);
|
||||
// -> true
|
||||
|
||||
blocks.isBoolean(new Boolean(false));
|
||||
// -> true
|
||||
|
||||
blocks.isBoolean(1);
|
||||
// -> false
|
||||
|
||||
blocks.isPlainObject({ property: true });
|
||||
// -> true
|
||||
|
||||
blocks.isPlainObject(new Object());
|
||||
// -> true
|
||||
|
||||
var car = new Object();
|
||||
|
||||
blocks.isPlainObject(car);
|
||||
// -> false
|
||||
|
||||
var alert = blocks.bind(() => {
|
||||
alert(this);
|
||||
}, 'Hello bind method!');
|
||||
|
||||
alert();
|
||||
// -> alerts 'Hello bind method'
|
||||
|
||||
var alertAll = blocks.bind((firstName: string, lastName: string) => {
|
||||
alert('My name is ' + firstName + ' ' + lastName);
|
||||
}, null, 'John', 'Doe');
|
||||
|
||||
alertAll();
|
||||
// -> alerts 'My name is John Doe'
|
||||
|
||||
blocks.equals([3, 4], [3, 4]);
|
||||
// -> true
|
||||
|
||||
blocks.equals({ value: 7 }, { value: 7, result: 1 });
|
||||
// -> false
|
||||
|
||||
blocks.query({
|
||||
message: 'Hello World!'
|
||||
});
|
||||
|
||||
blocks.query({
|
||||
items: ['John', 'Alf', 'Mega'],
|
||||
alertIndex: (e: any) => {
|
||||
alert('Clicked an item with index:' + blocks.context(e.target).$index);
|
||||
}
|
||||
});
|
||||
|
||||
blocks.query({
|
||||
items: [1, 2, 3],
|
||||
alertValue: (e: any) => {
|
||||
alert('Clicked the value: ' + blocks.dataItem(e.target));
|
||||
}
|
||||
});
|
||||
|
||||
blocks.isObservable(blocks.observable(3));
|
||||
// -> true
|
||||
|
||||
blocks.isObservable(3);
|
||||
// -> false
|
||||
|
||||
blocks.unwrapObservable(blocks.observable(304));
|
||||
// -> 304
|
||||
|
||||
blocks.unwrapObservable(305);
|
||||
// -> 305
|
||||
}
|
||||
|
||||
function test_observable_array() {
|
||||
// creates an observable array with [1, 2, 3] as values
|
||||
var items = blocks.observable([1, 2, 3]);
|
||||
|
||||
// removes the previous values and fills the observable array with [5, 6, 7] values
|
||||
items.reset([5, 6, 7])
|
||||
|
||||
// results in observable array with [1, 2, 3, 4] values
|
||||
items.add(4);
|
||||
|
||||
// results in observable array with [1, 2, 3, 4, 5, 6] values
|
||||
items.addMany([4, 5, 6]);
|
||||
|
||||
var items = blocks.observable([4, 2, 3, 1]);
|
||||
|
||||
// results in observable array with [1, 2, 3, 4] values
|
||||
items.swap(0, 3);
|
||||
|
||||
var items = blocks.observable([1, 4, 2, 3, 5]);
|
||||
|
||||
// results in observable array with [1, 2, 3, 4, 5] values
|
||||
items.move(1, 4);
|
||||
}
|
||||
|
||||
function test_Property() {
|
||||
var App = blocks.Application();
|
||||
|
||||
var User = App.Model({
|
||||
username: App.Property({
|
||||
defaultValue: 'John Doe'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function test_Model() {
|
||||
var App = blocks.Application();
|
||||
|
||||
var User = App.Model({
|
||||
firstName: App.Property({
|
||||
required: true,
|
||||
validateOnChange: true
|
||||
}),
|
||||
|
||||
lastName: App.Property({
|
||||
required: true,
|
||||
validateOnChange: true
|
||||
}),
|
||||
|
||||
fullName: App.Property({
|
||||
value: function() {
|
||||
return this.firstName() + ' ' + this.lastName();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
App.View('Profile', {
|
||||
user: User({
|
||||
firstName: 'John',
|
||||
lastName: 'Doe'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function test_Collection() {
|
||||
var App = blocks.Application();
|
||||
|
||||
var User = App.Model({
|
||||
firstName: App.Property({
|
||||
required: true,
|
||||
validateOnChange: true
|
||||
}),
|
||||
|
||||
lastName: App.Property({
|
||||
required: true,
|
||||
validateOnChange: true
|
||||
}),
|
||||
|
||||
fullName: App.Property({
|
||||
value: function() {
|
||||
return this.firstName() + ' ' + this.lastName();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var Users = App.Collection(User, {
|
||||
count: App.Property({
|
||||
value: () => {
|
||||
return this().length;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
App.View('Profiles', {
|
||||
users: Users([{
|
||||
firstName: 'John',
|
||||
lastName: 'Doe'
|
||||
}, {
|
||||
firstName: 'Johna',
|
||||
lastName: 'Doa'
|
||||
}])
|
||||
});
|
||||
}
|
||||
|
||||
function test_View() {
|
||||
var App = blocks.Application();
|
||||
|
||||
App.View('Clicker', {
|
||||
handleClick: () => {
|
||||
alert('Clicky! Click!');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
App.View('Statistics', {
|
||||
init: () => {
|
||||
this.loadRemoteData();
|
||||
},
|
||||
|
||||
loadRemoteData: () => {
|
||||
// ...stuff...
|
||||
}
|
||||
});
|
||||
|
||||
App.View('ContactUs', {
|
||||
options: {
|
||||
route: 'contactus'
|
||||
},
|
||||
|
||||
routed: () => {
|
||||
alert('Navigated to ContactUs page!')
|
||||
}
|
||||
});
|
||||
|
||||
App.View('ContactUs', {
|
||||
options: {
|
||||
route: 'contactus'
|
||||
}
|
||||
});
|
||||
|
||||
App.View('Navigation', {
|
||||
navigateToContactUs: () => {
|
||||
this.route('contactus')
|
||||
}
|
||||
});
|
||||
}
|
||||
Vendored
+731
@@ -0,0 +1,731 @@
|
||||
// Type definitions for jsblocks v0.3.0
|
||||
// Project: http://jsblocks.com/
|
||||
// Definitions by: Krzysztof Śmigiel <https://github.com/ksmigiel>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/////////////////////////////////////////
|
||||
// blocks methods
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface BlocksStatic {
|
||||
(obj: any): any;
|
||||
|
||||
/**
|
||||
* Performs a query operation on the DOM. Executes all data-query attributes
|
||||
* and renders the html result to the specified HTMLElement if not specified
|
||||
* uses document.body by default.
|
||||
*
|
||||
* @param model The model that will be used to query the DOM.
|
||||
*/
|
||||
query(model: any): void;
|
||||
/**
|
||||
* @param model The model that will be used to query the DOM.
|
||||
* @param element Optional element on which to execute the query.
|
||||
*/
|
||||
query(model: any, element: HTMLElement): void;
|
||||
|
||||
/**
|
||||
* Copies properties from all provided objects into the first object parameter
|
||||
*/
|
||||
extend(obj: Object, ...objects: any[]): void;
|
||||
|
||||
/**
|
||||
* Iterates over the collection
|
||||
*
|
||||
* @param collection The array or object to iterate over
|
||||
* @param callback The callback that will be executed for each element in the collection
|
||||
* @param thisArg Optional this context for the callback
|
||||
*/
|
||||
each(collection: any, callback: (value: any, index: any, collection: any) => void, thisArg?: any): void;
|
||||
|
||||
/**
|
||||
* Iterates over the collection from end to start
|
||||
*
|
||||
* @param collection The array or object to iterate over
|
||||
* @param callback The callback that will be executed for each element in the collection
|
||||
* @param thisArg Optional this context for the callback
|
||||
*/
|
||||
eachRight(collection: any, callback: (value: any, index: any, collection: any) => void, thisArg?: any): void;
|
||||
|
||||
/**
|
||||
* Determines if a value is an array.
|
||||
* Returns false for array like objects (for example arguments object).
|
||||
*
|
||||
* @param value The value to check if it is an array
|
||||
*/
|
||||
isArray(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Represents a dummy empty function
|
||||
*/
|
||||
noop(): Function;
|
||||
|
||||
/**
|
||||
* Determines the true type of an object.
|
||||
* Returns the type of the value as a string.
|
||||
*
|
||||
* @param value The value for which to determine its type
|
||||
*/
|
||||
type(value: any): string;
|
||||
|
||||
/**
|
||||
* Determines if a specific value is the specified type
|
||||
*
|
||||
* @param value The value
|
||||
* @param type The type
|
||||
*/
|
||||
is(value: any, type: string): boolean;
|
||||
|
||||
/**
|
||||
* Checks if a variable has the specified property. Uses hasOwnProperty internally
|
||||
*
|
||||
* @param obj The object to call hasOwnPrototype for
|
||||
* @param key The key to check if exists in the object
|
||||
*/
|
||||
has(obj: any, key: string): boolean;
|
||||
|
||||
/**
|
||||
* Unwraps a jsblocks value to its raw representation.
|
||||
* Unwraps blocks.observable() and blocks() values
|
||||
*
|
||||
* @param value The value that will be unwrapped
|
||||
*/
|
||||
unwrap(value: any): any;
|
||||
|
||||
/**
|
||||
* Converts a value to an array. Arguments object is converted to array and primitive values
|
||||
* are wrapped in an array.
|
||||
* Does nothing when value is already an array
|
||||
*
|
||||
* @param value The value to be converted to an array
|
||||
*/
|
||||
toArray(value: any): any[];
|
||||
|
||||
/**
|
||||
* Converts an integer or string to a unit. If the value could not be parsed to a number it is not converted
|
||||
*
|
||||
* @param value The value to be converted to the specified unit
|
||||
*/
|
||||
toUnit(value: any): any;
|
||||
/**
|
||||
* @param value The value to be converted to the specified unit
|
||||
* @param unit Optionally provide a unit to convert to. Default value is 'px'
|
||||
*/
|
||||
toUnit(value: any, unit: string): any;
|
||||
|
||||
/**
|
||||
* Clones value. If deepClone is set to true the value will be cloned recursively
|
||||
*
|
||||
* @param value Value/object to be cloned
|
||||
*/
|
||||
clone(value: any): any;
|
||||
/**
|
||||
* @param value Value/object to be cloned
|
||||
* @param deepClone By default false
|
||||
*/
|
||||
clone(value: any, deepClone: boolean): any;
|
||||
|
||||
/**
|
||||
* Determines if the specified value is a HTML elements collection.
|
||||
* Returns whether the value is elements collection.
|
||||
*
|
||||
* @param value The value to check if it is elements collection
|
||||
*/
|
||||
isElements(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Determines if the specified value is a HTML element.
|
||||
* Returns whether the value is a HTML element.
|
||||
*
|
||||
* @param value The value to check if it is a HTML element
|
||||
*/
|
||||
isElement(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Determines if a the specified value is a boolean.
|
||||
* Whether the value is a boolean or not.
|
||||
*
|
||||
* @param value The value to be checked if it is a boolean
|
||||
*/
|
||||
isBoolean(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Determines if the specified value is an object.
|
||||
* Returns whether the value is an object.
|
||||
*
|
||||
* @param obj The value to check for if it is an object
|
||||
*/
|
||||
isObject(obj: any): boolean;
|
||||
|
||||
/**
|
||||
* Determines if a value is a object created using {} or new Object.
|
||||
* Whether the value is a plain object or not.
|
||||
*
|
||||
* @param obj The value that will be checked
|
||||
*/
|
||||
isPlainObject(obj: any): boolean;
|
||||
|
||||
/**
|
||||
* Changes the this binding to a function and optionally passes additional parameters to the function.
|
||||
* Returns the newly created function having the new this binding and optional arguments.
|
||||
*
|
||||
* @param func The function for which to change the this binding and optionally add arguments
|
||||
* @param thisArg The new this binding context value
|
||||
* @param args Optional arguments that will be passed to the function
|
||||
*/
|
||||
bind(func: Function, thisArg: any, ...args: any[]): Function;
|
||||
|
||||
/**
|
||||
* Determines if two values are deeply equal. Set deepEqual to false to stop recusively equality checking
|
||||
*
|
||||
* @param a The first object to be campared
|
||||
* @param b The second object to be compared
|
||||
*/
|
||||
equals(a: any, b: any): boolean;
|
||||
/**
|
||||
* @param a The first object to be campared
|
||||
* @param b The second object to be compared
|
||||
* @param deepEqual Determines if the equality check will recursively check all child properties
|
||||
*/
|
||||
equals(a: any, b: any, deepEqual: boolean): boolean;
|
||||
|
||||
/**
|
||||
* Gets the context for a particular element. Searches all parents until it finds the context.
|
||||
*
|
||||
* @param element The element from which to search for a context
|
||||
*
|
||||
*/
|
||||
context(element: any): any;
|
||||
|
||||
/**
|
||||
* Gets the associated dataItem for a particlar element. Searches all parents until it finds the context
|
||||
*
|
||||
* @param element The element from which to search for a dataItem
|
||||
*/
|
||||
dataItem(element: any): any;
|
||||
|
||||
/**
|
||||
* Determines if particular value is an blocks.observable
|
||||
*
|
||||
* @param value The value to check if the value is observable
|
||||
*/
|
||||
isObservable(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Gets the raw value of an observable or returns the value if the specified object is not an observable
|
||||
*
|
||||
* @param value The value that could be any object observable or not
|
||||
*/
|
||||
unwrapObservable(value: any): any;
|
||||
|
||||
route(route: string): BlocksStatic;
|
||||
|
||||
optional(param: string): BlocksStatic;
|
||||
optional(param: string, defaultValue: any): BlocksStatic;
|
||||
|
||||
range(start: number, end: number): BlocksStatic;
|
||||
|
||||
/**
|
||||
* Creates the server which will automatically handle server-side rendering.
|
||||
*/
|
||||
server(): { express(): any };
|
||||
/**
|
||||
* @param options Overrides default jsblocks options
|
||||
*/
|
||||
server(options: Server): { express(): any };
|
||||
|
||||
/**
|
||||
* Make observable property. You can specify initial value in parentheses.
|
||||
*/
|
||||
observable(): BlocksObservable;
|
||||
observable(value: any[]): BlocksArray;
|
||||
observable(value: any): BlocksObservable;
|
||||
|
||||
/**
|
||||
* Use blocks.Application and its MVC(Model-View-Collection) structure to create better architecture and maintainability for your application.
|
||||
*/
|
||||
Application(): App;
|
||||
Application(options: { history: string }): App;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
// blocks observable
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface BlocksObservable extends Extendable<BlocksObservable> {
|
||||
(arg: any): BlocksObservable;
|
||||
|
||||
/**
|
||||
* Updates all elements, expressions and dependencies where the observable is used
|
||||
*/
|
||||
update(): BlocksObservable;
|
||||
|
||||
/**
|
||||
* If event in prototype is not defined use this function instead.
|
||||
*
|
||||
* @param event Name of the event to raise
|
||||
* @param trigger Function to be called when event is fired
|
||||
*/
|
||||
on(event: string, trigger: Function): BlocksObservable;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
// blocks array
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface BlocksArray extends BlocksObservable {
|
||||
|
||||
/**
|
||||
* Updates all elements, expressions and dependencies where the observable is used
|
||||
*/
|
||||
update(): BlocksArray;
|
||||
|
||||
/**
|
||||
* Extends the current observable with particular functionality depending on the parameters specified.
|
||||
* If the method is called without arguments and jsvalue framework is included the observable will be
|
||||
* extended with the methods available in jsvalue for the current type.
|
||||
*
|
||||
* @param options Optional options
|
||||
*/
|
||||
extend(...options: any[]): BlocksArray;
|
||||
/**
|
||||
* @param name Name of the extender
|
||||
* @param options Optional options
|
||||
*/
|
||||
extend(name: string, ...options: any[]): BlocksArray;
|
||||
|
||||
/**
|
||||
* Removes all items from the collection and replaces them with the new value provided.
|
||||
* The value could be Array, observable array or jsvalue.Array
|
||||
*
|
||||
* @param value The new value that will be populated
|
||||
*/
|
||||
reset(value: any[]): BlocksArray;
|
||||
|
||||
/**
|
||||
* Adds values to the end of the observable array
|
||||
*
|
||||
* @param value The values that will be added to the end of the array
|
||||
*/
|
||||
add(value: any): BlocksArray;
|
||||
/**
|
||||
* @param value The values that will be added to the end of the array
|
||||
* @param index Optional index specifying where to insert the value
|
||||
*/
|
||||
add(value: any, index: number): BlocksArray;
|
||||
|
||||
/**
|
||||
* Adds the values from the provided array(s) to the end of the collection
|
||||
*
|
||||
* @param value The array that will be added to the end of the array
|
||||
*/
|
||||
addMany(value: any[]): BlocksArray;
|
||||
/**
|
||||
* @param value The array that will be added to the end of the array
|
||||
* @param index Optional position where the array of values to be inserted
|
||||
*/
|
||||
addMany(value: any[], index: number): BlocksArray;
|
||||
|
||||
/**
|
||||
* Swaps two values in the observable array. Note: Faster than removing the items and adding them at the locations
|
||||
*
|
||||
* @param indexA The first index that points to the index in the array that will be swapped
|
||||
* @param indexB The second index that points to the index in the array that will be swapped
|
||||
*/
|
||||
swap(indexA: number, indexB: number): BlocksArray;
|
||||
|
||||
/**
|
||||
* Moves an item from one location to another in the array. Note: Faster than removing the item and adding it at the location
|
||||
*
|
||||
* @param sourceIndex The index pointing to the item that will be moved
|
||||
* @param targetIndex The index where the item will be moved to
|
||||
*/
|
||||
move(sourceIndex: number, targetIndex: number): BlocksArray;
|
||||
|
||||
/**
|
||||
* Removes an item from the observable array
|
||||
*
|
||||
* @param value The value that will be removed or a callback function which returns true or false to determine if the value should be removed
|
||||
*/
|
||||
remove(value: any): BlocksArray;
|
||||
/**
|
||||
* @param value The value that will be removed or a callback function which returns true or false to determine if the value should be removed
|
||||
* @param thisArg Optional this context for the callback
|
||||
*/
|
||||
remove(value: any, thisArg: Function): BlocksArray;
|
||||
|
||||
/**
|
||||
* Removes an item at the specified index
|
||||
*
|
||||
* @param index The index location of the item that will be removed
|
||||
*/
|
||||
removeAt(index: number): BlocksArray;
|
||||
/**
|
||||
* @param index The index location of the item that will be removed
|
||||
* @param count Optional parameter that if specified will remove the next items starting from the specified index
|
||||
*/
|
||||
removeAt(index: number, count: number): BlocksArray;
|
||||
|
||||
/**
|
||||
* Removes all items from the observable array and optionally filter which items to be removed by providing a callback
|
||||
*/
|
||||
removeAll(): BlocksArray;
|
||||
/**
|
||||
* @param callback Optional callback function which filters which items to be removed. Returning a truthy value will remove the item and vice versa
|
||||
*/
|
||||
removeAll(callback: Function): BlocksArray;
|
||||
/**
|
||||
* @param callback Optional callback function which filters which items to be removed. Returning a truthy value will remove the item and vice versa
|
||||
* @param thisArg Optional this context for the callback function
|
||||
*/
|
||||
removeAll(callback: Function, thisArg: any): BlocksArray;
|
||||
|
||||
/**
|
||||
* The concat() method is used to join two or more arrays
|
||||
*
|
||||
* @param arrays The arrays to be joined
|
||||
*/
|
||||
concat(...arrays: any[]): any[]
|
||||
|
||||
/**
|
||||
* The slice() method returns the selected elements in an array, as a new array object
|
||||
*
|
||||
* @param start An integer that specifies where to start the selection (The first element has an index of 0)
|
||||
*/
|
||||
slice(start: number): any[];
|
||||
/**
|
||||
* @param start An integer that specifies where to start the selection (The first element has an index of 0)
|
||||
* @param end An integer that specifies where to end the selection. If omitted, all elements from the start position and to the end of the array will be selected.
|
||||
* Use negative numbers to select from the end of an array
|
||||
*/
|
||||
slice(start: number, end: number): any[];
|
||||
|
||||
/**
|
||||
* The join() method joins the elements of an array into a string, and returns the string
|
||||
*/
|
||||
join(): string;
|
||||
/**
|
||||
* @param separator The separator to be used. If omitted, the elements are separated with a comma
|
||||
*/
|
||||
join(seperator: string): string;
|
||||
|
||||
/**
|
||||
* The pop() method removes the last element of a observable array, and returns that element
|
||||
*/
|
||||
pop(): any;
|
||||
|
||||
/**
|
||||
* The push() method adds new items to the end of the observable array, and returns the new length
|
||||
*
|
||||
* @param values The item(s) to add to the observable array
|
||||
*/
|
||||
push(...values: any[]): number;
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the observable array
|
||||
*/
|
||||
reverse(): any[];
|
||||
|
||||
/**
|
||||
* Removes the first element of a observable array, and returns that element
|
||||
*/
|
||||
shift(): any
|
||||
|
||||
/**
|
||||
* Sorts the elements of an array
|
||||
*/
|
||||
sort(): any[];
|
||||
/**
|
||||
* @param sortfunction A function that defines the sort order
|
||||
*/
|
||||
sort(sortfunction: Function): any[];
|
||||
|
||||
/**
|
||||
* Adds and/or removes elements from the observable array
|
||||
* Returns A new array containing the removed items, if any.
|
||||
*
|
||||
* @param index An integer that specifies at what position to add/remove items. Use negative values to specify the position from the end of the array.
|
||||
* @param howMany The number of items to be removed. If set to 0, no items will be removed.
|
||||
* @param items The new item(s) to be added to the array.
|
||||
*/
|
||||
splice(index: number, howMany: number, ...items: any[]): any[];
|
||||
|
||||
/**
|
||||
* The unshift() method adds new items to the beginning of an array, and returns the new length.
|
||||
*
|
||||
* @param items
|
||||
*/
|
||||
unshift(...items: any[]): number;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
// blocks MVC App
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface App extends Extendable<App> {
|
||||
|
||||
/**
|
||||
* Creates an application property for a Model.
|
||||
*/
|
||||
Property(): any;
|
||||
/**
|
||||
* @param options Configuration options for property
|
||||
*/
|
||||
Property(options: PropertyPrototype): any;
|
||||
|
||||
/**
|
||||
* Defines a view that will be part of the Application.
|
||||
*
|
||||
* @param name The name of the View you are creating
|
||||
* @param prototype The object that will represent the View
|
||||
*/
|
||||
View(name: string, prototype: ViewPrototype): any;
|
||||
/**
|
||||
* Defines a view that will be part of the Application.
|
||||
*
|
||||
* @param parentViewName Provide this parameter only if you are creating nested views. This is the name of the parent View
|
||||
* @param name The name of the View you are creating
|
||||
* @param prototype The object that will represent the View
|
||||
*/
|
||||
View(parentViewName: string, name: string, prototype: ViewPrototype): any;
|
||||
|
||||
/**
|
||||
* Creates a new Model
|
||||
*
|
||||
* @param prototype The Model object properties that will be created
|
||||
*/
|
||||
Model(prototype: ModelPrototype): Model;
|
||||
|
||||
/**
|
||||
* Creates a new Collection
|
||||
*
|
||||
* @param prototype The Collection object properties that will be created.
|
||||
*/
|
||||
Collection(prototype: CollectionPrototype): Collection;
|
||||
Collection(model: Model, prototype: CollectionPrototype): Collection;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
// App.Property
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface PropertyPrototype {
|
||||
defaultValue?: any;
|
||||
isObservable?: boolean;
|
||||
field?: string;
|
||||
value?: any;
|
||||
validateOnChange?: boolean;
|
||||
maxErrors?: number;
|
||||
validateInitially?: boolean
|
||||
|
||||
// Validators
|
||||
required?: Validator;
|
||||
minlength?: Validator;
|
||||
maxlength?: Validator;
|
||||
min?: Validator;
|
||||
max?: Validator;
|
||||
email?: Validator;
|
||||
url?: Validator;
|
||||
date?: Validator;
|
||||
creditcard?: Validator;
|
||||
regexp?: Validator;
|
||||
number?: Validator;
|
||||
digits?: Validator;
|
||||
letters?: Validator;
|
||||
equals?: Validator;
|
||||
}
|
||||
|
||||
interface Validator { }
|
||||
|
||||
/////////////////////////////////////////
|
||||
// App.View
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface ViewPrototype {
|
||||
parentView?: any;
|
||||
|
||||
/**
|
||||
* Routes to a specific URL and actives the appropriate views associated with the URL
|
||||
*
|
||||
* @param name Name of the route
|
||||
*/
|
||||
route?(name: string): ViewPrototype;
|
||||
|
||||
|
||||
/**
|
||||
* Determines if the view is visible
|
||||
*/
|
||||
isActive?(): boolean;
|
||||
|
||||
/**
|
||||
* Override the init method to perform actions when the View is first created and shown on the page
|
||||
*/
|
||||
init?: Function;
|
||||
|
||||
/**
|
||||
* Override the routed method to perform actions when the View have routing and routing mechanism actives it.
|
||||
*/
|
||||
routed?: Function;
|
||||
|
||||
navigateTo?: Function;
|
||||
|
||||
/**
|
||||
* Override the ready method to perform actions when the DOM is ready and
|
||||
* all data-query have been executed.
|
||||
*/
|
||||
ready?: Function;
|
||||
|
||||
options?: {
|
||||
route?: any;
|
||||
url?: string
|
||||
};
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
// App.Model
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface Model {
|
||||
(): Model;
|
||||
(props: Object): Model;
|
||||
|
||||
/**
|
||||
* Fires a request to the server to populate the Model based on the read URL specified
|
||||
*/
|
||||
read(): Model;
|
||||
/**
|
||||
* @param params The parameters Object that will be used to populate the Model from the specified options.read URL. If the URL does not contain parameters
|
||||
*/
|
||||
read(params: Object): Model;
|
||||
|
||||
/**
|
||||
* Synchronizes the changes with the server by sending requests to the provided URL's
|
||||
*/
|
||||
sync(): Model;
|
||||
}
|
||||
|
||||
interface ModelPrototype {
|
||||
|
||||
/**
|
||||
* Override the init method to perform actions on creation for each Model instance
|
||||
*/
|
||||
init?: Function;
|
||||
|
||||
/**
|
||||
* Validates all observable properties that have validation and returns true if all values are valid otherwise returns false
|
||||
*/
|
||||
validate?(): boolean;
|
||||
|
||||
/**
|
||||
* Extracts the raw(non observable) dataItem object values from the Model
|
||||
*/
|
||||
dataItem?(): Object;
|
||||
|
||||
/**
|
||||
* Applies new properties to the Model by providing an Object
|
||||
*
|
||||
* @param dataItem The object from which the new values will be applied
|
||||
*/
|
||||
reset?(dataItem: ModelPrototype): ModelPrototype;
|
||||
|
||||
/**
|
||||
* Determines whether the instance is new. If true when syncing the item will send for insertion instead of updating it.
|
||||
* The check is determined by the idAttr value specified in the options. If idAttr is not specified the item will always be considered new.
|
||||
*
|
||||
*/
|
||||
isNew?(): boolean;
|
||||
|
||||
options?: {
|
||||
idAttr?: string;
|
||||
baseUrl?: string;
|
||||
read?: { url?: string };
|
||||
create?: { url?: string };
|
||||
destroy?: { url?: string };
|
||||
update?: { url?: string };
|
||||
};
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
// App.Collection
|
||||
/////////////////////////////////////////
|
||||
|
||||
interface Collection extends Extendable<Collection> {
|
||||
(): Collection;
|
||||
(props: Object[]): Collection;
|
||||
|
||||
/**
|
||||
* Fires a request to the server to populate the Model based on the read URL specified
|
||||
*/
|
||||
read(): Collection;
|
||||
/**
|
||||
* @param params The parameters Object that will be used to populate the Collection from the specified options.read URL. If the URL does not contain parameters
|
||||
*/
|
||||
read(params: Object): Collection;
|
||||
|
||||
/**
|
||||
* Clear all changes made to the collection
|
||||
*/
|
||||
clearChanges(): Collection;
|
||||
|
||||
/**
|
||||
* Performs an ajax request for all create, update and delete operations in order to sync them with a database.
|
||||
*/
|
||||
sync(): Collection;
|
||||
|
||||
update(id: number, newValues: Object): Collection;
|
||||
}
|
||||
|
||||
interface CollectionPrototype {
|
||||
options?: {
|
||||
read?: { url?: string };
|
||||
create?: { url?: string };
|
||||
destroy?: { url?: string };
|
||||
update?: { url?: string };
|
||||
};
|
||||
}
|
||||
|
||||
interface Extendable<T> {
|
||||
|
||||
/**
|
||||
* Extends the current observable with particular functionality depending on the parameters specified.
|
||||
* If the method is called without arguments and jsvalue framework is included the observable will be
|
||||
* extended with the methods available in jsvalue for the current type.
|
||||
*
|
||||
* @param name Name of the extender
|
||||
* @param options Optional options
|
||||
*/
|
||||
extend(name?: string, ...options: any[]): T;
|
||||
extend(arg: any): T;
|
||||
}
|
||||
|
||||
interface Server {
|
||||
|
||||
/**
|
||||
* The port at which your application will be run
|
||||
*/
|
||||
port?: number;
|
||||
|
||||
/**
|
||||
* The folder where your application files like .html; .js and .css are going to be.
|
||||
* The value is passed to express.static() middleware.
|
||||
*/
|
||||
static?: string;
|
||||
|
||||
/**
|
||||
* Caches pages result instead of executing them each time.
|
||||
* Disabling cache could impact performance.
|
||||
*/
|
||||
cache?: boolean;
|
||||
|
||||
/**
|
||||
* Provide an express middleware function or an array of middleware functions.
|
||||
* Use: [compression(); bodyParser()]
|
||||
*/
|
||||
use?: any;
|
||||
}
|
||||
|
||||
declare var blocks: BlocksStatic;
|
||||
|
||||
declare module "blocks" {
|
||||
export = blocks;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="bootstrap-slider.d.ts" />
|
||||
|
||||
$(function() {
|
||||
// examples from http://seiyria.github.io/bootstrap-slider/
|
||||
|
||||
$('#ex1').slider({
|
||||
formatter: function(value) {
|
||||
return 'Current value: ' + value;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex2").slider({});
|
||||
|
||||
var RGBChange = function() {
|
||||
$('#RGB').css('background', 'rgb('+r.getValue()+','+g.getValue()+','+b.getValue()+')')
|
||||
};
|
||||
|
||||
var r = $('#R').slider()
|
||||
.on('slide', RGBChange)
|
||||
.data('slider');
|
||||
var g = $('#G').slider()
|
||||
.on('slide', RGBChange)
|
||||
.data('slider');
|
||||
var b = $('#B').slider()
|
||||
.on('slide', RGBChange)
|
||||
.data('slider');
|
||||
|
||||
|
||||
|
||||
$("#ex4").slider({
|
||||
reversed : true
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex5").slider();
|
||||
|
||||
$("#destroyEx5Slider").click(function() {
|
||||
$("#ex5").slider('destroy');
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex6").slider();
|
||||
$("#ex6").on("slide", function(slideEvt) {
|
||||
$("#ex6SliderVal").text(<number>slideEvt.value);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex7").slider();
|
||||
|
||||
$("#ex7-enabled").click(function() {
|
||||
if(this.checked) {
|
||||
// With JQuery
|
||||
$("#ex7").slider("enable");
|
||||
}
|
||||
else {
|
||||
// With JQuery
|
||||
$("#ex7").slider("disable");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex8").slider({
|
||||
tooltip: 'always'
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex9").slider({
|
||||
precision: 2,
|
||||
value: 8.115 // Slider will instantiate showing 8.12 due to specified precision
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex11").slider({step: 20000, min: 0, max: 200000});
|
||||
|
||||
|
||||
|
||||
$("#ex12a").slider({ id: "slider12a", min: 0, max: 10, value: 5 });
|
||||
$("#ex12b").slider({ id: "slider12b", min: 0, max: 10, range: true, value: [3, 7] });
|
||||
$("#ex12c").slider({ id: "slider12c", min: 0, max: 10, range: true, value: [3, 7] });
|
||||
|
||||
|
||||
|
||||
$("#ex13").slider({
|
||||
ticks: [0, 100, 200, 300, 400],
|
||||
ticks_labels: ['$0', '$100', '$200', '$300', '$400'],
|
||||
ticks_snap_bounds: 30
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex14").slider({
|
||||
ticks: [0, 100, 200, 300, 400],
|
||||
ticks_positions: [0, 30, 60, 70, 90, 100],
|
||||
ticks_labels: ['$0', '$100', '$200', '$300', '$400'],
|
||||
ticks_snap_bounds: 30
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex15").slider({
|
||||
min: 1000,
|
||||
max: 10000000,
|
||||
scale: 'logarithmic',
|
||||
step: 10
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#ex16a").slider({ min: 0, max: 10, value: 0, focus: true });
|
||||
$("#ex16b").slider({ min: 0, max: 10, value: [0, 10], focus: true });
|
||||
});
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
// Type definitions for bootstrap-slider.js 4.8.3
|
||||
// Project: https://github.com/seiyria/bootstrap-slider
|
||||
// Definitions by: Daniel Beckwith <https://github.com/dbeckwith>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface SliderOptions {
|
||||
/**
|
||||
* Default: ''
|
||||
* set the id of the slider element when it's created
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Default: 0
|
||||
* minimum possible value
|
||||
*/
|
||||
min?: number;
|
||||
/**
|
||||
* Default: 10
|
||||
* maximum possible value
|
||||
*/
|
||||
max?: number;
|
||||
/**
|
||||
* Default: 1
|
||||
* increment step
|
||||
*/
|
||||
step?: number;
|
||||
/**
|
||||
* Default: number of digits after the decimal of step value
|
||||
* The number of digits shown after the decimal. Defaults to the number of digits after the decimal of step value.
|
||||
*/
|
||||
precision?: number;
|
||||
/**
|
||||
* Default: 'horizontal'
|
||||
* set the orientation. Accepts 'vertical' or 'horizontal'
|
||||
*/
|
||||
orientation?: number;
|
||||
/**
|
||||
* Default: 5
|
||||
* initial value. Use array to have a range slider.
|
||||
*/
|
||||
value?: number|number[];
|
||||
/**
|
||||
* Default: false
|
||||
* make range slider. Optional if initial value is an array. If initial value is scalar, max will be used for second value.
|
||||
*/
|
||||
range?: boolean;
|
||||
/**
|
||||
* Default: 'before'
|
||||
* selection placement. Accepts: 'before', 'after' or 'none'. In case of a range slider, the selection will be placed between the handles
|
||||
*/
|
||||
selection?: string;
|
||||
/**
|
||||
* Default: 'show'
|
||||
* whether to show the tooltip on drag, hide the tooltip, or always show the tooltip. Accepts: 'show', 'hide', or 'always'
|
||||
*/
|
||||
tooltip?: string;
|
||||
/**
|
||||
* Default: false
|
||||
* if false show one tootip if true show two tooltips one for each handler
|
||||
*/
|
||||
tooltip_split?: boolean;
|
||||
/**
|
||||
* Default: 'round'
|
||||
* handle shape. Accepts: 'round', 'square', 'triangle' or 'custom'
|
||||
*/
|
||||
handle?: string;
|
||||
/**
|
||||
* Default: false
|
||||
* whether or not the slider should be reversed
|
||||
*/
|
||||
reversed?: boolean;
|
||||
/**
|
||||
* Default: true
|
||||
* whether or not the slider is initially enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* Default: returns the plain value
|
||||
* formatter callback. Return the value wanted to be displayed in the tooltip
|
||||
* @param val the current value to display
|
||||
*/
|
||||
formatter?(val:number): string;
|
||||
/**
|
||||
* Default: false
|
||||
* The natural order is used for the arrow keys. Arrow up select the upper slider value for vertical sliders, arrow right the righter slider value for a horizontal slider - no matter if the slider was reversed or not. By default the arrow keys are oriented by arrow up/right to the higher slider value, arrow down/left to the lower slider value.
|
||||
*/
|
||||
natural_arrow_keys?: boolean;
|
||||
/**
|
||||
* Default: [ ]
|
||||
* Used to define the values of ticks. Tick marks are indicators to denote special values in the range. This option overwrites min and max options.
|
||||
*/
|
||||
ticks?: number[];
|
||||
/**
|
||||
* Default: [ ]
|
||||
* Defines the positions of the tick values in percentages. The first value should alwasy be 0, the last value should always be 100 percent.
|
||||
*/
|
||||
ticks_positions?: number[];
|
||||
/**
|
||||
* Default: [ ]
|
||||
* Defines the labels below the tick marks. Accepts HTML input.
|
||||
*/
|
||||
ticks_labels?: string[];
|
||||
/**
|
||||
* Default: 0
|
||||
* Used to define the snap bounds of a tick. Snaps to the tick if value is within these bounds.
|
||||
*/
|
||||
ticks_snap_bounds?: number;
|
||||
/**
|
||||
* Default: 'linear'
|
||||
* Set to 'logarithmic' to use a logarithmic scale.
|
||||
*/
|
||||
scale?: string;
|
||||
/**
|
||||
* Default: false
|
||||
* Focus the appropriate slider handle after a value change.
|
||||
*/
|
||||
focus?: boolean;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Creates a slider from the current element.
|
||||
* @param options
|
||||
*/
|
||||
slider(options?:SliderOptions): JQuery;
|
||||
slider(methodName:string, ...args:any[]): JQuery;
|
||||
}
|
||||
|
||||
interface ChangeValue {
|
||||
oldValue: number;
|
||||
newValue: number;
|
||||
}
|
||||
|
||||
interface JQueryEventObject {
|
||||
value: number|ChangeValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is actually not used when using the jQuery version of bootstrap-slider
|
||||
* The method documentation is still here thouh.
|
||||
* When using jQuery, slider methods like setValue(3, true) have to be called like $slider.slider('setValue', 3, true)
|
||||
*/
|
||||
interface Slider extends JQuery {
|
||||
/**
|
||||
* Get the current value from the slider
|
||||
*/
|
||||
getValue(): number;
|
||||
/**
|
||||
* Set a new value for the slider. If optional triggerSlideEvent parameter is true, 'slide' events will be triggered. If optional triggerChangeEvent parameter is true, 'change' events will be triggered.
|
||||
* @param newValue
|
||||
* @param triggerSlideEvent
|
||||
* @param triggerChangeEvent
|
||||
*/
|
||||
setValue(newValue:number, triggerSlideEvent?:boolean, triggerChangeEvent?:boolean): void;
|
||||
/**
|
||||
* Properly clean up and remove the slider instance
|
||||
*/
|
||||
destroy(): void;
|
||||
/**
|
||||
* Disables the slider and prevents the user from changing the value
|
||||
*/
|
||||
disable(): void;
|
||||
/**
|
||||
* Enables the slider
|
||||
*/
|
||||
enable(): void;
|
||||
/**
|
||||
* Returns true if enabled, false if disabled
|
||||
*/
|
||||
isEnabled(): boolean;
|
||||
/**
|
||||
* Updates the slider's attributes
|
||||
* @param attribute
|
||||
* @param value
|
||||
*/
|
||||
setAttribute(attribute:string, value:any): void;
|
||||
/**
|
||||
* Get the slider's attributes
|
||||
* @param attribute
|
||||
*/
|
||||
getAttribute(attribute:string): any;
|
||||
/**
|
||||
* Refreshes the current slider
|
||||
*/
|
||||
refresh(): void;
|
||||
/**
|
||||
* Renders the tooltip again, after initialization. Useful in situations when the slider and tooltip are initially hidden.
|
||||
*/
|
||||
relayout(): void;
|
||||
on: {
|
||||
(eventType:string, callback:(eventObject:JQueryEventObject, ...args:any[]) => any): Slider;
|
||||
(eventType:string, data:any, callback:(eventObject:JQueryEventObject, ...args:any[]) => any): Slider;
|
||||
(eventType:string, selector:string, callback:(eventObject:JQueryEventObject, ...eventData:any[]) => any): Slider;
|
||||
(eventType:string, selector:string, data:any, callback:(eventObject:JQueryEventObject, ...eventData:any[]) => any): Slider;
|
||||
(eventType:{ [key: string]: any; }, selector?:string, data?:any): Slider;
|
||||
(eventType:{ [key: string]: any; }, data?:any): Slider;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="bootstrap-touchspin.d.ts" />
|
||||
|
||||
$(function () {
|
||||
// Example 1 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo1']").TouchSpin({
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 0.1,
|
||||
decimals: 2,
|
||||
boostat: 5,
|
||||
maxboostedstep: 10,
|
||||
postfix: '%'
|
||||
});
|
||||
|
||||
// Example 2 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo2']").TouchSpin({
|
||||
min: -1000000000,
|
||||
max: 1000000000,
|
||||
stepinterval: 50,
|
||||
maxboostedstep: 10000000,
|
||||
prefix: '$'
|
||||
});
|
||||
|
||||
// Example 3 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo_vertical']").TouchSpin({
|
||||
verticalbuttons: true
|
||||
});
|
||||
|
||||
// Example 4 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo_vertical2']").TouchSpin({
|
||||
verticalbuttons: true,
|
||||
verticalupclass: 'glyphicon glyphicon-plus',
|
||||
verticaldownclass: 'glyphicon glyphicon-minus'
|
||||
});
|
||||
|
||||
// Example 5 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo3']").TouchSpin();
|
||||
|
||||
// Example 6 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo3_21']").TouchSpin({
|
||||
initval: 40
|
||||
});
|
||||
|
||||
// Example 7 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo4']").TouchSpin({
|
||||
postfix: "a button",
|
||||
postfix_extraclass: "btn btn-default"
|
||||
});
|
||||
|
||||
// Example 8 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo4_2']").TouchSpin({
|
||||
postfix: "a button",
|
||||
postfix_extraclass: "btn btn-default"
|
||||
});
|
||||
|
||||
// Example 9 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo5']").TouchSpin({
|
||||
prefix: "pre",
|
||||
postfix: "post"
|
||||
});
|
||||
|
||||
// Example 10 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo6']").TouchSpin({
|
||||
buttondown_class: "btn btn-link",
|
||||
buttonup_class: "btn btn-link"
|
||||
});
|
||||
});
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
// Type definitions for Bootstrap TouchSpin
|
||||
// Project: http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
// Definitions by: Albin Sunnanbo <https://github.com/albinsunnanbo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
/**
|
||||
* TouchSpinOptions. All options are optional
|
||||
*/
|
||||
interface TouchSpinOptions {
|
||||
/**
|
||||
* Applied when no explicit value is set on the input with the value attribute.
|
||||
* Empty string means that the value remains empty on initialization.
|
||||
*/
|
||||
initval?: number | string;
|
||||
|
||||
/**
|
||||
* Minimum value.
|
||||
*/
|
||||
min?: number;
|
||||
|
||||
/**
|
||||
* Maximum value.
|
||||
*/
|
||||
max?: number;
|
||||
|
||||
/**
|
||||
* Incremental/decremental step on up/down change.
|
||||
*/
|
||||
step?: number;
|
||||
|
||||
/**
|
||||
* How to force the value to be divisible by step value: 'none' | 'round' | 'floor' | 'ceil'
|
||||
*/
|
||||
forcestepdivisibility?: string;
|
||||
|
||||
/**
|
||||
* Number of decimal points.
|
||||
*/
|
||||
decimals?: number;
|
||||
|
||||
/**
|
||||
* Refresh rate of the spinner in milliseconds.
|
||||
*/
|
||||
stepinterval?: number;
|
||||
|
||||
/**
|
||||
* Time in milliseconds before the spinner starts to spin.
|
||||
*/
|
||||
stepintervaldelay?: number;
|
||||
|
||||
/**
|
||||
* Enables the traditional up/down buttons.
|
||||
*/
|
||||
verticalbuttons?: boolean;
|
||||
|
||||
/**
|
||||
* Class of the up button with vertical buttons mode enabled.
|
||||
*/
|
||||
verticalupclass?: string;
|
||||
|
||||
/**
|
||||
* Class of the down button with vertical buttons mode enabled.
|
||||
*/
|
||||
verticaldownclass?: string;
|
||||
|
||||
/**
|
||||
* Text before the input.
|
||||
*/
|
||||
prefix?: string;
|
||||
|
||||
/**
|
||||
* Text after the input.
|
||||
*/
|
||||
postfix?: string;
|
||||
|
||||
/**
|
||||
* Extra class(es) for prefix.
|
||||
*/
|
||||
prefix_extraclass?: string;
|
||||
|
||||
/**
|
||||
* Extra class(es) for postfix.
|
||||
*/
|
||||
postfix_extraclass?: string;
|
||||
|
||||
/**
|
||||
* If enabled, the the spinner is continually becoming faster as holding the button.
|
||||
*/
|
||||
booster?: boolean;
|
||||
|
||||
/**
|
||||
* Boost at every nth step.
|
||||
*/
|
||||
boostat?: number;
|
||||
|
||||
/**
|
||||
* Maximum step when boosted.
|
||||
*/
|
||||
maxboostedstep?: number | boolean;
|
||||
|
||||
/**
|
||||
* Enables the mouse wheel to change the value of the input.
|
||||
*/
|
||||
mousewheel?: boolean;
|
||||
|
||||
/**
|
||||
* Class(es) of down button.
|
||||
*/
|
||||
buttondown_class?: string;
|
||||
|
||||
/**
|
||||
* Class(es) of up button.
|
||||
*/
|
||||
buttonup_class?: string;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Initialize TouchSpin
|
||||
*/
|
||||
TouchSpin(): JQuery;
|
||||
|
||||
/**
|
||||
* Inialize TouchSpin with options
|
||||
* @param options a TouchSpinOptions object with one or more options
|
||||
*/
|
||||
TouchSpin(options: TouchSpinOptions): JQuery;
|
||||
}
|
||||
@@ -7,6 +7,13 @@ browserSync({
|
||||
}
|
||||
});
|
||||
|
||||
// multiple base directory
|
||||
browserSync({
|
||||
server: {
|
||||
baseDir: ["app", "dist"]
|
||||
}
|
||||
});
|
||||
|
||||
browserSync({
|
||||
proxy: "yourlocal.dev"
|
||||
});
|
||||
@@ -62,4 +69,14 @@ evt.on("init", function () {
|
||||
console.log("BrowserSync is running!");
|
||||
});
|
||||
|
||||
browserSync(config);
|
||||
browserSync(config);
|
||||
|
||||
var bs = browserSync.create();
|
||||
|
||||
bs.init({
|
||||
server: "./app"
|
||||
});
|
||||
|
||||
bs.reload();
|
||||
|
||||
|
||||
|
||||
Vendored
+103
-86
@@ -3,96 +3,113 @@
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../chokidar/chokidar.d.ts"/>
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "browser-sync" {
|
||||
import chokidar = require("chokidar");
|
||||
import fs = require("fs");
|
||||
import http = require("http");
|
||||
|
||||
function BrowserSync(config?: BrowserSync.Options, callback?: (err: Error, bs: Object) => any): void;
|
||||
|
||||
module BrowserSync {
|
||||
export function reload(): void;
|
||||
export function reload(file: string): void;
|
||||
export function reload(files: string[]): void;
|
||||
export function reload(options: {stream: boolean}): NodeJS.ReadWriteStream;
|
||||
|
||||
export function notify(message: string, timeout?: number): void;
|
||||
|
||||
export function exit(): void;
|
||||
|
||||
export var active: boolean;
|
||||
|
||||
export var emitter: NodeJS.EventEmitter;
|
||||
|
||||
interface Options {
|
||||
files?: string | string[];
|
||||
watchOptions?: GazeOptions;
|
||||
server?: ServerOptions;
|
||||
proxy?: string | boolean;
|
||||
port?: number;
|
||||
https?: boolean;
|
||||
ghostMode?: GhostOptions | boolean;
|
||||
logLevel?: string;
|
||||
logPrefix?: string;
|
||||
logConnections?: boolean;
|
||||
logFileChanges?: boolean;
|
||||
logSnippet?: boolean;
|
||||
snippetOptions?: SnippetOptions;
|
||||
tunnel?: string | boolean;
|
||||
online?: boolean;
|
||||
open?: string | boolean;
|
||||
browser?: string | string[];
|
||||
xip?: boolean;
|
||||
notify?: boolean;
|
||||
scrollProportionally?: boolean;
|
||||
scrollThrottle?: number;
|
||||
reloadDelay?: number;
|
||||
injectChanges?: boolean;
|
||||
startPath?: string;
|
||||
minify?: boolean;
|
||||
host?: string;
|
||||
codeSync?: boolean;
|
||||
timestamps?: boolean;
|
||||
scriptPath?: (path: string) => string;
|
||||
socket?: SocketOptions;
|
||||
}
|
||||
|
||||
interface GazeOptions {
|
||||
interval?: number;
|
||||
debounceDelay?: number;
|
||||
mode?: string;
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
interface ServerOptions {
|
||||
baseDir?: string;
|
||||
directory?: boolean;
|
||||
index?: string;
|
||||
routes?: {[path: string]: string};
|
||||
middleware?: MiddlewareHandler[];
|
||||
}
|
||||
|
||||
interface MiddlewareHandler {
|
||||
(req: http.ServerRequest, res: http.ServerResponse, next: Function): any;
|
||||
}
|
||||
|
||||
interface GhostOptions {
|
||||
clicks?: boolean;
|
||||
scroll?: boolean;
|
||||
forms?: boolean;
|
||||
}
|
||||
|
||||
interface SnippetOptions {
|
||||
ignorePaths?: string;
|
||||
rule?: {match?: RegExp; fn?: (snippet: string, match: string) => any};
|
||||
}
|
||||
|
||||
interface SocketOptions {
|
||||
path?: string;
|
||||
clientPath?: string;
|
||||
namespace?: string;
|
||||
}
|
||||
interface Options {
|
||||
files?: string | string[];
|
||||
watchOptions?: GazeOptions;
|
||||
server?: ServerOptions;
|
||||
proxy?: string | boolean;
|
||||
port?: number;
|
||||
https?: boolean;
|
||||
ghostMode?: GhostOptions | boolean;
|
||||
logLevel?: string;
|
||||
logPrefix?: string;
|
||||
logConnections?: boolean;
|
||||
logFileChanges?: boolean;
|
||||
logSnippet?: boolean;
|
||||
snippetOptions?: SnippetOptions;
|
||||
rewriteRules?: boolean | RewriteRules[];
|
||||
tunnel?: string | boolean;
|
||||
online?: boolean;
|
||||
open?: string | boolean;
|
||||
browser?: string | string[];
|
||||
xip?: boolean;
|
||||
notify?: boolean;
|
||||
scrollProportionally?: boolean;
|
||||
scrollThrottle?: number;
|
||||
reloadDelay?: number;
|
||||
reloadDebounce?: number;
|
||||
plugins?: any[];
|
||||
injectChanges?: boolean;
|
||||
startPath?: string;
|
||||
minify?: boolean;
|
||||
host?: string;
|
||||
codeSync?: boolean;
|
||||
timestamps?: boolean;
|
||||
scriptPath?: (path: string) => string;
|
||||
socket?: SocketOptions;
|
||||
}
|
||||
|
||||
export = BrowserSync;
|
||||
}
|
||||
interface GazeOptions {
|
||||
interval?: number;
|
||||
debounceDelay?: number;
|
||||
mode?: string;
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
interface ServerOptions {
|
||||
baseDir?: string | string[];
|
||||
directory?: boolean;
|
||||
index?: string;
|
||||
routes?: {[path: string]: string};
|
||||
middleware?: MiddlewareHandler[];
|
||||
}
|
||||
|
||||
interface MiddlewareHandler {
|
||||
(req: http.ServerRequest, res: http.ServerResponse, next: Function): any;
|
||||
}
|
||||
|
||||
interface GhostOptions {
|
||||
clicks?: boolean;
|
||||
scroll?: boolean;
|
||||
forms?: boolean;
|
||||
}
|
||||
|
||||
interface SnippetOptions {
|
||||
ignorePaths?: string;
|
||||
rule?: {match?: RegExp; fn?: (snippet: string, match: string) => any};
|
||||
}
|
||||
|
||||
interface SocketOptions {
|
||||
path?: string;
|
||||
clientPath?: string;
|
||||
namespace?: string;
|
||||
}
|
||||
|
||||
interface RewriteRules {
|
||||
match: RegExp;
|
||||
fn: (match: string) => string;
|
||||
}
|
||||
|
||||
interface BrowserSync {
|
||||
init(config?: Options, callback?: (err: Error, bs: Object) => any): void;
|
||||
reload(): void;
|
||||
reload(file: string): void;
|
||||
reload(files: string[]): void;
|
||||
reload(options: {stream: boolean}): NodeJS.ReadWriteStream;
|
||||
notify(message: string, timeout?: number): void;
|
||||
exit(): void;
|
||||
watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any): NodeJS.EventEmitter;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
emitter: NodeJS.EventEmitter;
|
||||
active: boolean;
|
||||
paused: boolean;
|
||||
}
|
||||
|
||||
interface Exports extends BrowserSync {
|
||||
create(): BrowserSync;
|
||||
(config?: Options, callback?: (err: Error, bs: Object) => any): void;
|
||||
}
|
||||
|
||||
var browserSync: Exports;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/// <reference path="calq.d.ts" />
|
||||
function calq_base()
|
||||
{
|
||||
calq.init("bfff14a4e0225789be3d9d22c4bb42a1");
|
||||
|
||||
calq.init("bfff14a4e0225789be3d9d22c4bb42a1", { your: "config" });
|
||||
|
||||
calq.action.track("Product Review", {"Rating": 9.0});
|
||||
|
||||
calq.action.trackSale("Product Sale", { "Product Id": 149, "Product Name": "Dinosaur T-Shirt XL" }, "USD",10);
|
||||
|
||||
calq.action.trackHTMLLink('Link', { 'Target': 'Calq'});
|
||||
|
||||
calq.action.trackPageView();
|
||||
|
||||
calq.action.trackPageView("Custom Action");
|
||||
|
||||
calq.action.setGlobalProperty("Referral Source", "Google Campaign");
|
||||
}
|
||||
|
||||
function calq_people()
|
||||
{
|
||||
calq.user.identify("1001");
|
||||
|
||||
calq.user.clear();
|
||||
|
||||
calq.user.profile( { "Company": "MegaCorp", "$email": "super_customer1@notarealemail.com" });
|
||||
}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for calq
|
||||
// Project: https://calq.io/docs/client/javascript/reference
|
||||
// Definitions by: Eirik Hoem <https://github.com/eirikhm>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface Calq
|
||||
{
|
||||
action:Calq.Action;
|
||||
user:Calq.User;
|
||||
|
||||
init(writeKey:string, options?:{[index:string]:any}):void;
|
||||
}
|
||||
|
||||
declare module Calq
|
||||
{
|
||||
interface Action
|
||||
{
|
||||
track(action:string, params?:{[index:string]:any}):void;
|
||||
trackSale(action:string, params:{[index:string]:any}, currency:string, amount:number):void;
|
||||
trackHTMLLink(action:string, params?:{[index:string]:any}):void;
|
||||
trackPageView(action?:string):void;
|
||||
setGlobalProperty(name:string,value:any):void;
|
||||
}
|
||||
|
||||
interface User
|
||||
{
|
||||
identify(userId:string):void;
|
||||
clear():void;
|
||||
profile(params:{[index:string]:any}):void;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
declare var calq:Calq;
|
||||
@@ -1,4 +1,3 @@
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
/// <reference path="chai-as-promised.d.ts" />
|
||||
|
||||
import chai = require('chai');
|
||||
@@ -6,9 +5,11 @@ import chaiAsPromised = require('chai-as-promised');
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
|
||||
// ReSharper disable WrongExpressionStatement
|
||||
var promise: any;
|
||||
chai.expect(promise).to.eventually.equal(3);
|
||||
chai.expect(promise).to.become(3);
|
||||
chai.expect(promise).to.be.fulfilled;
|
||||
chai.expect(promise).to.be.rejected;
|
||||
chai.expect(promise).to.be.rejectedWith(Error);
|
||||
chai.expect(promise).to.notify(() => console.log('done'));
|
||||
|
||||
+11
-10
@@ -6,21 +6,22 @@
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module 'chai-as-promised' {
|
||||
import chai = require('chai');
|
||||
|
||||
function chaiAsPromised(chai: any, utils: any): void;
|
||||
|
||||
export = chaiAsPromised;
|
||||
}
|
||||
|
||||
declare module chai {
|
||||
declare module Chai {
|
||||
|
||||
interface Assertion {
|
||||
become(expected: any): Assertion;
|
||||
fulfilled: Assertion;
|
||||
rejected: Assertion;
|
||||
rejectedWith(expected: any): Assertion;
|
||||
notify(fn: Function): Assertion;
|
||||
}
|
||||
|
||||
interface LanguageChains {
|
||||
become(expected: any): Expect;
|
||||
eventually: Expect;
|
||||
rejected: Expect;
|
||||
rejectedWith(expected: any): Expect;
|
||||
notify(fn: Function): Expect;
|
||||
eventually: Assertion;
|
||||
}
|
||||
|
||||
interface Assert {
|
||||
@@ -32,4 +33,4 @@ declare module chai {
|
||||
isRejected(promise: any, expected: any, message?: string): void;
|
||||
isRejected(promise: any, match: RegExp, message?: string): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
/// <reference path="chai-datetime.d.ts" />
|
||||
|
||||
import chai = require('chai');
|
||||
import chaiDateTime = require('chai-datetime');
|
||||
|
||||
chai.use(chaiDateTime);
|
||||
var expect = chai.expect;
|
||||
var assert = chai.assert;
|
||||
|
||||
function test_equalTime(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.be.equalTime(date);
|
||||
date.should.be.equalTime(date);
|
||||
expect(date).to.equalTime(date);
|
||||
date.should.equalTime(date);
|
||||
assert.equalTime(date, date);
|
||||
}
|
||||
|
||||
@@ -34,14 +37,14 @@ function test_equalDate(){
|
||||
|
||||
function test_beforeDate(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.beforeDate(date);
|
||||
date.should.beforeDate(date);
|
||||
expect(date).to.be.beforeDate(date);
|
||||
date.should.be.beforeDate(date);
|
||||
assert.beforeDate(date, date);
|
||||
}
|
||||
|
||||
function test_afterDate(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.afterDate(date);
|
||||
date.should.afterDate(date);
|
||||
expect(date).to.be.afterDate(date);
|
||||
date.should.be.afterDate(date);
|
||||
assert.afterDate(date, date);
|
||||
}
|
||||
|
||||
Vendored
+29
-26
@@ -5,35 +5,38 @@
|
||||
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module chai {
|
||||
declare module Chai {
|
||||
|
||||
interface Expect {
|
||||
afterDate(date: Date): boolean;
|
||||
beforeDate(date: Date): boolean;
|
||||
equalDate(date: Date): boolean;
|
||||
interface Assertion {
|
||||
afterDate(date: Date): Assertion;
|
||||
beforeDate(date: Date): Assertion;
|
||||
equalDate(date: Date): Assertion;
|
||||
afterTime(date: Date): Assertion;
|
||||
beforeTime(date: Date): Assertion;
|
||||
equalTime(date: Date): Assertion;
|
||||
}
|
||||
|
||||
afterTime(date: Date): boolean;
|
||||
beforeTime(date: Date): boolean;
|
||||
equalTime(date: Date): boolean;
|
||||
}
|
||||
|
||||
interface Assert {
|
||||
equalTime(val: Date, exp: Date, msg?: string): boolean;
|
||||
notEqualTime(val: Date, exp: Date, msg?: string): boolean;
|
||||
beforeTime(val: Date, exp: Date, msg?: string): boolean;
|
||||
notBeforeTime(val: Date, exp: Date, msg?: string): boolean;
|
||||
afterTime(val: Date, exp: Date, msg?: string): boolean;
|
||||
notAfterTime(val: Date, exp: Date, msg?: string): boolean;
|
||||
|
||||
equalDate(val: Date, exp: Date, msg?: string): boolean;
|
||||
notEqualDate(val: Date, exp: Date, msg?: string): boolean;
|
||||
beforeDate(val: Date, exp: Date, msg?: string): boolean;
|
||||
notBeforeDate(val: Date, exp: Date, msg?: string): boolean;
|
||||
afterDate(val: Date, exp: Date, msg?: string): boolean;
|
||||
notAfterDate(val: Date, exp: Date, msg?: string): boolean;
|
||||
}
|
||||
interface Assert {
|
||||
equalTime(val: Date, exp: Date, msg?: string): void;
|
||||
notEqualTime(val: Date, exp: Date, msg?: string): void;
|
||||
beforeTime(val: Date, exp: Date, msg?: string): void;
|
||||
notBeforeTime(val: Date, exp: Date, msg?: string): void;
|
||||
afterTime(val: Date, exp: Date, msg?: string): void;
|
||||
notAfterTime(val: Date, exp: Date, msg?: string): void;
|
||||
equalDate(val: Date, exp: Date, msg?: string): void;
|
||||
notEqualDate(val: Date, exp: Date, msg?: string): void;
|
||||
beforeDate(val: Date, exp: Date, msg?: string): void;
|
||||
notBeforeDate(val: Date, exp: Date, msg?: string): void;
|
||||
afterDate(val: Date, exp: Date, msg?: string): void;
|
||||
notAfterDate(val: Date, exp: Date, msg?: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
interface Date {
|
||||
should: chai.Expect;
|
||||
should: Chai.Assertion;
|
||||
}
|
||||
|
||||
declare module "chai-datetime" {
|
||||
function chaiDateTime(chai: any, utils: any): void;
|
||||
export = chaiDateTime;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/// <reference path="chai-fuzzy.d.ts" />
|
||||
|
||||
// tests taken from http://chaijs.com/plugins/chai-fuzzy
|
||||
|
||||
import chai = require('chai');
|
||||
import chaiFuzzy = require('chai-fuzzy');
|
||||
|
||||
chai.use(chaiFuzzy);
|
||||
var expect = chai.expect;
|
||||
var assert = chai.assert;
|
||||
|
||||
/**
|
||||
* compare object attributes and values rather than checking to see if they're the same reference
|
||||
*/
|
||||
function like() {
|
||||
var subject = { a: 'a' };
|
||||
|
||||
expect(subject).to.be.like({ a: 'a' });
|
||||
expect(subject).not.to.be.like({ x: 'x' });
|
||||
expect(subject).not.to.be.like({ a: 'a', b: 'b' });
|
||||
|
||||
assert.like(subject, { a: 'a' });
|
||||
assert.notLike(subject, { x: 'x' });
|
||||
assert.notLike(subject, { a: 'a', b: 'b' });
|
||||
|
||||
var subject2 = ['a'];
|
||||
|
||||
expect(subject2).to.be.like(['a']);
|
||||
expect(subject2).not.to.be.like(['x']);
|
||||
expect(subject2).not.to.be.like(['a', 'b']);
|
||||
|
||||
assert.like(subject2, ['a']);
|
||||
assert.notLike(subject2, ['x']);
|
||||
assert.notLike(subject2, ['a', 'b']);
|
||||
}
|
||||
Vendored
+67
-8
@@ -5,13 +5,72 @@
|
||||
|
||||
///<reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module chai {
|
||||
interface Assert {
|
||||
like(act:any, exp:any, msg?:string);
|
||||
notLike(act:any, exp:any, msg?:string);
|
||||
containOneLike(act:any, exp:any, msg?:string);
|
||||
notContainOneLike(act:any, exp:any, msg?:string);
|
||||
jsonOf(act:any, exp:any, msg?:string);
|
||||
notJsonOf(act:any, exp:any, msg?:string);
|
||||
declare module Chai {
|
||||
|
||||
interface Assertion {
|
||||
/**
|
||||
* Compare object attributes and values rather than checking to see if
|
||||
* they're the same reference.
|
||||
*/
|
||||
like(expected: any, message?: string): Assertion;
|
||||
/**
|
||||
* Compare object attributes and values rather than checking to see if
|
||||
* they're the same reference.
|
||||
*/
|
||||
notLike(expected: any, message?: string): Assertion;
|
||||
/**
|
||||
* Check the first level of the container for a value like the one provided.
|
||||
*/
|
||||
containOneLike(expected: any, message?: string): Assertion;
|
||||
/**
|
||||
* Check the first level of the container for a value like the one provided.
|
||||
*/
|
||||
notContainOneLike(expected: any, message?: string): Assertion;
|
||||
/**
|
||||
* Check that the given javascript object is like the JSON-ified expected
|
||||
* value. Useful for checking stringification and parsing of an object.
|
||||
*/
|
||||
jsonOf(expected: any, message?: string): Assertion;
|
||||
/**
|
||||
* Check that the given javascript object is like the JSON-ified expected
|
||||
* value. Useful for checking stringification and parsing of an object.
|
||||
*/
|
||||
notJsonOf(expected: any, message?: string): Assertion;
|
||||
}
|
||||
|
||||
export interface Assert {
|
||||
/**
|
||||
* Compare object attributes and values rather than checking to see if
|
||||
* they're the same reference.
|
||||
*/
|
||||
like(actual: any, expected: any, message?: string): void;
|
||||
/**
|
||||
* Compare object attributes and values rather than checking to see if
|
||||
* they're the same reference.
|
||||
*/
|
||||
notLike(actual: any, expected: any, message?: string): void;
|
||||
/**
|
||||
* Check the first level of the container for a value like the one provided.
|
||||
*/
|
||||
containOneLike(actual: any, expected: any, message?: string): void;
|
||||
/**
|
||||
* Check the first level of the container for a value like the one provided.
|
||||
*/
|
||||
notContainOneLike(actual: any, expected: any, message?: string): void;
|
||||
/**
|
||||
* Check that the given javascript object is like the JSON-ified expected
|
||||
* value. Useful for checking stringification and parsing of an object.
|
||||
*/
|
||||
jsonOf(actual: any, expected: any, message?: string): void;
|
||||
/**
|
||||
* Check that the given javascript object is like the JSON-ified expected
|
||||
* value. Useful for checking stringification and parsing of an object.
|
||||
*/
|
||||
notJsonOf(actual: any, expected: any, message?: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "chai-fuzzy" {
|
||||
function chaiFuzzy(chai: any, utils: any): void;
|
||||
export = chaiFuzzy;
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
/// <reference path="../when/when.d.ts" />
|
||||
/// <reference path="./chai-http.d.ts" />
|
||||
/// <reference path="chai-http.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import http = require('http');
|
||||
import chai = require('chai');
|
||||
import chaiHttp = require('chai-http');
|
||||
import ChaiHttp = require('chai-http');
|
||||
import when = require('when');
|
||||
|
||||
chai.use(chaiHttp);
|
||||
chai.use(ChaiHttp);
|
||||
|
||||
// ReSharper disable WrongExpressionStatement
|
||||
|
||||
// Add promise support if this does not exist natively.
|
||||
if (!global.Promise) {
|
||||
chai.request.addPromises(when.promise);
|
||||
}
|
||||
|
||||
|
||||
var app: http.Server;
|
||||
|
||||
chai.request(app).get('/');
|
||||
@@ -41,13 +42,12 @@ chai.request(app)
|
||||
|
||||
chai.request(app)
|
||||
.get('/search')
|
||||
.query('name', 'foo')
|
||||
.query('limit', '10');
|
||||
.query({name: 'foo', limit: 10});
|
||||
|
||||
chai.request(app)
|
||||
.put('/user/me')
|
||||
.send({ passsword: '123', confirmPassword: '123' })
|
||||
.end((err: any, res: chaiHttp.Response) => {
|
||||
.end((err: any, res: ChaiHttp.Response) => {
|
||||
chai.expect(err).to.be.null;
|
||||
chai.expect(res).to.have.status(200);
|
||||
});
|
||||
@@ -55,7 +55,7 @@ chai.request(app)
|
||||
chai.request(app)
|
||||
.put('/user/me')
|
||||
.send({ passsword: '123', confirmPassword: '123' })
|
||||
.then((res: chaiHttp.Response) => chai.expect(res).to.have.status(200))
|
||||
.then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200))
|
||||
.catch((err: any) => { throw err; });
|
||||
|
||||
var agent = chai.request.agent(app);
|
||||
@@ -63,17 +63,17 @@ var agent = chai.request.agent(app);
|
||||
agent
|
||||
.post('/session')
|
||||
.send({ username: 'me', password: '123' })
|
||||
.then((res: chaiHttp.Response) => {
|
||||
.then((res: ChaiHttp.Response) => {
|
||||
chai.expect(res).to.have.cookie('sessionid');
|
||||
// The `agent` now has the sessionid cookie saved, and will send it
|
||||
// back to the server in the next request:
|
||||
return agent.get('/user/me')
|
||||
.then((res: chaiHttp.Response) => chai.expect(res).to.have.status(200));
|
||||
.then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200));
|
||||
});
|
||||
|
||||
function test1() {
|
||||
var req = chai.request(app).get('/');
|
||||
req.then((res: chaiHttp.Response) => {
|
||||
req.then((res: ChaiHttp.Response) => {
|
||||
chai.expect(res).to.have.status(200);
|
||||
chai.expect(res).to.have.header('content-type', 'text/plain');
|
||||
chai.expect(res).to.have.header('content-type', /^text/);
|
||||
@@ -99,5 +99,4 @@ function test1() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
when(chai.request(app).get('/')).done(() => console.log('success'), () => console.log('failure'));
|
||||
|
||||
Vendored
+27
-30
@@ -6,27 +6,38 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module chai {
|
||||
export function request(server: any): chaiHttp.Agent;
|
||||
declare module Chai {
|
||||
|
||||
export module request {
|
||||
export function agent(server: any): chaiHttp.Agent;
|
||||
export function addPromises(promiseConstructor: chaiHttp.PromiseConstructor): void;
|
||||
interface ChaiStatic {
|
||||
request: ChaiHttpRequest;
|
||||
}
|
||||
|
||||
interface Assertions extends chaiHttp.Assertions {
|
||||
interface ChaiHttpRequest {
|
||||
(server: any): ChaiHttp.Agent;
|
||||
agent(server: any): ChaiHttp.Agent;
|
||||
addPromises(promiseConstructor: any): void;
|
||||
}
|
||||
|
||||
interface TypeComparison extends chaiHttp.TypeComparison {
|
||||
interface Assertion {
|
||||
status(code: number): Assertion;
|
||||
header(key: string, value?: string): Assertion;
|
||||
header(key: string, value?: RegExp): Assertion;
|
||||
headers: Assertion;
|
||||
json: Assertion;
|
||||
text: Assertion;
|
||||
html: Assertion;
|
||||
redirect: Assertion;
|
||||
redirectTo(location: string): Assertion;
|
||||
param(key: string, value?: string): Assertion;
|
||||
cookie(key: string, value?: string): Assertion;
|
||||
}
|
||||
|
||||
interface TypeComparison {
|
||||
ip: Assertion;
|
||||
}
|
||||
}
|
||||
|
||||
declare function chaiHttp(chai: any, utils: any): void;
|
||||
declare module chaiHttp {
|
||||
interface PromiseConstructor {
|
||||
<T>(resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): Promise<T>;
|
||||
}
|
||||
|
||||
declare module ChaiHttp {
|
||||
interface Promise<T> {
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Promise<U>;
|
||||
}
|
||||
@@ -38,10 +49,9 @@ declare module chaiHttp {
|
||||
}
|
||||
|
||||
interface Request extends FinishedRequest {
|
||||
attach(field: string, file: string, filename: string): Request;
|
||||
attach(field: string, file: Buffer, filename: string): Request;
|
||||
attach(field: string, file: string|Buffer, filename: string): Request;
|
||||
set(field: string, val: string): Request;
|
||||
query(key: string, value: string): Request;
|
||||
query(params: Object): Request;
|
||||
send(data: Object): Request;
|
||||
auth(user: string, name: string): Request;
|
||||
field(name: string, val: string): Request;
|
||||
@@ -63,25 +73,12 @@ declare module chaiHttp {
|
||||
patch(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
}
|
||||
|
||||
interface Assertions {
|
||||
status(code: number): any;
|
||||
header(key: string, value?: string): any;
|
||||
header(key: string, value?: RegExp): any;
|
||||
headers: any;
|
||||
json: any;
|
||||
// text: any;
|
||||
// html: any;
|
||||
redirect: any;
|
||||
redirectTo(location: string): any;
|
||||
param(key: string, value?: string): any;
|
||||
cookie(key: string, value?: string): any;
|
||||
}
|
||||
|
||||
interface TypeComparison {
|
||||
ip: any;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "chai-http" {
|
||||
function chaiHttp(chai: any, utils: any): void;
|
||||
export = chaiHttp;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
/// <reference path="chai-jquery.d.ts" />
|
||||
|
||||
// tests taken from https://github.com/chaijs/chai-jquery
|
||||
|
||||
declare var $;
|
||||
declare var $: ChaiJQueryStatic;
|
||||
import chai = require('chai');
|
||||
var expect = chai.expect;
|
||||
|
||||
function test_attr() {
|
||||
@@ -19,7 +19,7 @@ function test_css() {
|
||||
function test_data() {
|
||||
expect($('#foo')).to.have.data('toggle');
|
||||
expect($('#foo')).to.have.css('toggle', 'true');
|
||||
expect($('body')).to.have.css('font-family').match(/sans-serif/);
|
||||
expect($('body')).to.have.css('font-family').and.match(/sans-serif/);
|
||||
}
|
||||
|
||||
function test_class() {
|
||||
@@ -88,4 +88,4 @@ function test_be_selector() {
|
||||
function test_have_selector() {
|
||||
$('body').should.have('h1');
|
||||
expect($('#foo')).to.have('div');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
Vendored
+2570
-27
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
||||
/// <reference path="chai-subset.d.ts" />
|
||||
|
||||
import chai = require('chai');
|
||||
import chaiSubset = require('chai-subset');
|
||||
|
||||
chai.use(chaiSubset);
|
||||
var expect = chai.expect;
|
||||
var assert = chai.assert;
|
||||
|
||||
function test_containSubset() {
|
||||
var obj: Object = {
|
||||
a: 'b',
|
||||
c: 'd',
|
||||
e: {
|
||||
foo: 'bar',
|
||||
baz: {
|
||||
qux: 'quux'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
expect(obj).to.containSubset({
|
||||
a: 'b',
|
||||
e: {
|
||||
baz: {
|
||||
qux: 'quux'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
obj.should.containSubset({ a: 'b' });
|
||||
}
|
||||
|
||||
function test_notContainSubset() {
|
||||
var obj: Object = {
|
||||
a: 'b',
|
||||
c: 'd',
|
||||
e: {
|
||||
foo: 'bar',
|
||||
baz: {
|
||||
qux: 'quux'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
expect(obj).to.not.containSubset({ g: 'whatever' });
|
||||
obj.should.not.containSubset({ g: 'whatever' });
|
||||
}
|
||||
|
||||
function test_arrayContainSubset() {
|
||||
var list: Array<Object> = [{a: 'a', b: 'b'}, {v: 'f', d: {z: 'g'}} ];
|
||||
|
||||
expect(list).to.containSubset([{a:'a', b: 'b'}]);
|
||||
list.should.containSubset([{a:'a', b: 'b'}]);
|
||||
}
|
||||
|
||||
function test_arrayNotContainSubset() {
|
||||
var list: Array<Object> = [{a: 'a', b: 'b'}, {v: 'f', d: {z: 'g'}} ];
|
||||
|
||||
expect(list).not.to.containSubset([{a:'a', b: 'bd'}]);
|
||||
list.should.not.containSubset([{a:'a', b: 'bd'}]);
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for chai-subset 1.0.0
|
||||
// Project: https://github.com/e-conomic/chai-subset
|
||||
// Definitions by: Sam Noedel <https://github.com/delta62/>, Andrew Brown <https://github.com/AGBrown>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module Chai {
|
||||
interface Assertion {
|
||||
containSubset(obj: Object): Assertion;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "chai-subset" {
|
||||
function chaiSubset(chai: any, utils: any): void;
|
||||
export = chaiSubset;
|
||||
}
|
||||
+1076
-724
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
|
||||
Vendored
+182
-159
@@ -1,67 +1,67 @@
|
||||
// Type definitions for chai 2.0.0
|
||||
// Project: http://chaijs.com/
|
||||
// Definitions by: Jed Hunsaker <https://github.com/jedhunsaker/>, Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions by: Jed Mao <https://github.com/jedmao/>,
|
||||
// Bart van der Schoor <https://github.com/Bartvds>,
|
||||
// Andrew Brown <https://github.com/AGBrown>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module chai {
|
||||
export class AssertionError {
|
||||
constructor(message: string, _props?: any, ssf?: Function);
|
||||
name: string;
|
||||
message: string;
|
||||
showDiff: boolean;
|
||||
stack: string;
|
||||
declare module Chai {
|
||||
|
||||
interface ChaiStatic {
|
||||
expect: ExpectStatic;
|
||||
should(): Should;
|
||||
/**
|
||||
* Provides a way to extend the internals of Chai
|
||||
*/
|
||||
use(fn: (chai: any, utils: any) => void): any;
|
||||
assert: AssertStatic;
|
||||
config: Config;
|
||||
}
|
||||
|
||||
export function expect(target: any, message?: string): Expect;
|
||||
|
||||
export var assert: Assert;
|
||||
export var config: Config;
|
||||
|
||||
export interface Config {
|
||||
includeStack: boolean;
|
||||
export interface ExpectStatic extends AssertionStatic {
|
||||
}
|
||||
|
||||
// Provides a way to extend the internals of Chai
|
||||
function use(fn: (chai: any, utils: any) => void): any;
|
||||
|
||||
interface ExpectStatic {
|
||||
(target: any): Expect;
|
||||
export interface AssertStatic extends Assert {
|
||||
}
|
||||
|
||||
interface Assertions {
|
||||
attr(name: string, value?: string): any;
|
||||
css(name: string, value?: string): any;
|
||||
data(name: string, value?: string): any;
|
||||
class(className: string): any;
|
||||
id(id: string): any;
|
||||
html(html: string): any;
|
||||
text(text: string): any;
|
||||
value(value: string): any;
|
||||
visible: any;
|
||||
hidden: any;
|
||||
selected: any;
|
||||
checked: any;
|
||||
disabled: any;
|
||||
empty: any;
|
||||
exist: any;
|
||||
export interface AssertionStatic {
|
||||
(target: any, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Expect extends LanguageChains, NumericComparison, TypeComparison, Assertions {
|
||||
not: Expect;
|
||||
interface ShouldAssertion {
|
||||
equal(value1: any, value2: any, message?: string): void;
|
||||
Throw: ShouldThrow;
|
||||
throw: ShouldThrow;
|
||||
exist(value: any, message?: string): void;
|
||||
}
|
||||
|
||||
interface Should extends ShouldAssertion {
|
||||
not: ShouldAssertion;
|
||||
fail(actual: any, expected: any, message?: string, operator?: string): void;
|
||||
}
|
||||
|
||||
interface ShouldThrow {
|
||||
(actual: Function): void;
|
||||
(actual: Function, expected: string|RegExp, message?: string): void;
|
||||
(actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
|
||||
}
|
||||
|
||||
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
|
||||
not: Assertion;
|
||||
deep: Deep;
|
||||
a: TypeComparison;
|
||||
an: TypeComparison;
|
||||
include: Include;
|
||||
contain: Include;
|
||||
ok: Expect;
|
||||
true: Expect;
|
||||
false: Expect;
|
||||
null: Expect;
|
||||
undefined: Expect;
|
||||
exist: Expect;
|
||||
empty: Expect;
|
||||
arguments: Expect;
|
||||
Arguments: Expect;
|
||||
ok: Assertion;
|
||||
true: Assertion;
|
||||
false: Assertion;
|
||||
null: Assertion;
|
||||
undefined: Assertion;
|
||||
exist: Assertion;
|
||||
empty: Assertion;
|
||||
arguments: Assertion;
|
||||
Arguments: Assertion;
|
||||
equal: Equal;
|
||||
equals: Equal;
|
||||
eq: Equal;
|
||||
@@ -72,34 +72,34 @@ declare module chai {
|
||||
haveOwnProperty: OwnProperty;
|
||||
length: Length;
|
||||
lengthOf: Length;
|
||||
match(RegularExpression: RegExp, message?: string): Expect;
|
||||
string(string: string, message?: string): Expect;
|
||||
match(regexp: RegExp|string, message?: string): Assertion;
|
||||
string(string: string, message?: string): Assertion;
|
||||
keys: Keys;
|
||||
key(string: string): Expect;
|
||||
key(string: string): Assertion;
|
||||
throw: Throw;
|
||||
throws: Throw;
|
||||
Throw: Throw;
|
||||
respondTo(method: string, message?: string): Expect;
|
||||
itself: Expect;
|
||||
satisfy(matcher: Function, message?: string): Expect;
|
||||
closeTo(expected: number, delta: number, message?: string): Expect;
|
||||
respondTo(method: string, message?: string): Assertion;
|
||||
itself: Assertion;
|
||||
satisfy(matcher: Function, message?: string): Assertion;
|
||||
closeTo(expected: number, delta: number, message?: string): Assertion;
|
||||
members: Members;
|
||||
}
|
||||
|
||||
interface LanguageChains {
|
||||
to: Expect;
|
||||
be: Expect;
|
||||
been: Expect;
|
||||
is: Expect;
|
||||
that: Expect;
|
||||
which: Expect;
|
||||
and: Expect;
|
||||
have: Expect;
|
||||
has: Expect;
|
||||
with: Expect;
|
||||
at: Expect;
|
||||
of: Expect;
|
||||
same: Expect;
|
||||
to: Assertion;
|
||||
be: Assertion;
|
||||
been: Assertion;
|
||||
is: Assertion;
|
||||
that: Assertion;
|
||||
which: Assertion;
|
||||
and: Assertion;
|
||||
has: Assertion;
|
||||
have: Assertion;
|
||||
with: Assertion;
|
||||
at: Assertion;
|
||||
of: Assertion;
|
||||
same: Assertion;
|
||||
}
|
||||
|
||||
interface NumericComparison {
|
||||
@@ -113,173 +113,196 @@ declare module chai {
|
||||
lessThan: NumberComparer;
|
||||
most: NumberComparer;
|
||||
lte: NumberComparer;
|
||||
within(start: number, finish: number, message?: string): Expect;
|
||||
within(start: number, finish: number, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface NumberComparer {
|
||||
(value: number, message?: string): Expect;
|
||||
(value: number, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface TypeComparison {
|
||||
(type: string, message?: string): Expect;
|
||||
(type: string, message?: string): Assertion;
|
||||
instanceof: InstanceOf;
|
||||
instanceOf: InstanceOf;
|
||||
}
|
||||
|
||||
interface InstanceOf {
|
||||
(constructor: Object, message?: string): Expect;
|
||||
(constructor: Object, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Deep {
|
||||
equal: Equal;
|
||||
include: Include;
|
||||
property: Property;
|
||||
}
|
||||
|
||||
interface Equal {
|
||||
(value: any, message?: string): Expect;
|
||||
(value: any, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Property {
|
||||
(name: string, value?: any, message?: string): Expect;
|
||||
(name: string, value?: any, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface OwnProperty {
|
||||
(name: string, message?: string): Expect;
|
||||
(name: string, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Length extends LanguageChains, NumericComparison {
|
||||
(length: number, message?: string): Expect;
|
||||
(length: number, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Include {
|
||||
(value: Object, message?: string): Expect;
|
||||
(value: string, message?: string): Expect;
|
||||
(value: number, message?: string): Expect;
|
||||
(value: Object, message?: string): Assertion;
|
||||
(value: string, message?: string): Assertion;
|
||||
(value: number, message?: string): Assertion;
|
||||
keys: Keys;
|
||||
members: Members;
|
||||
}
|
||||
|
||||
interface Keys {
|
||||
(...keys: string[]): Expect;
|
||||
(keys: any[]): Expect;
|
||||
}
|
||||
|
||||
interface Members {
|
||||
(set: any[], message?: string): Expect;
|
||||
(...keys: string[]): Assertion;
|
||||
(keys: any[]): Assertion;
|
||||
}
|
||||
|
||||
interface Throw {
|
||||
(): Expect;
|
||||
(expected: string, message?: string): Expect;
|
||||
(expected: RegExp, message?: string): Expect;
|
||||
(constructor: Error, expected?: string, message?: string): Expect;
|
||||
(constructor: Error, expected?: RegExp, message?: string): Expect;
|
||||
(constructor: Function, expected?: string, message?: string): Expect;
|
||||
(constructor: Function, expected?: RegExp, message?: string): Expect;
|
||||
(): Assertion;
|
||||
(expected: string, message?: string): Assertion;
|
||||
(expected: RegExp, message?: string): Assertion;
|
||||
(constructor: Error, expected?: string, message?: string): Assertion;
|
||||
(constructor: Error, expected?: RegExp, message?: string): Assertion;
|
||||
(constructor: Function, expected?: string, message?: string): Assertion;
|
||||
(constructor: Function, expected?: RegExp, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Members {
|
||||
(set: any[], message?: string): Assertion;
|
||||
}
|
||||
|
||||
export interface Assert {
|
||||
(express: any, msg?: string):void;
|
||||
/**
|
||||
* @param expression Expression to test for truthiness.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
(expression: any, message?: string): void;
|
||||
|
||||
fail(actual?: any, expected?: any, msg?: string, operator?: string):void;
|
||||
fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
|
||||
|
||||
ok(val: any, msg?: string):void;
|
||||
notOk(val: any, msg?: string):void;
|
||||
ok(val: any, msg?: string): void;
|
||||
notOk(val: any, msg?: string): void;
|
||||
|
||||
equal(act: any, exp: any, msg?: string):void;
|
||||
notEqual(act: any, exp: any, msg?: string):void;
|
||||
equal(act: any, exp: any, msg?: string): void;
|
||||
notEqual(act: any, exp: any, msg?: string): void;
|
||||
|
||||
strictEqual(act: any, exp: any, msg?: string):void;
|
||||
notStrictEqual(act: any, exp: any, msg?: string):void;
|
||||
strictEqual(act: any, exp: any, msg?: string): void;
|
||||
notStrictEqual(act: any, exp: any, msg?: string): void;
|
||||
|
||||
deepEqual(act: any, exp: any, msg?: string):void;
|
||||
notDeepEqual(act: any, exp: any, msg?: string):void;
|
||||
deepEqual(act: any, exp: any, msg?: string): void;
|
||||
notDeepEqual(act: any, exp: any, msg?: string): void;
|
||||
|
||||
isTrue(val: any, msg?: string):void;
|
||||
isFalse(val: any, msg?: string):void;
|
||||
isTrue(val: any, msg?: string): void;
|
||||
isFalse(val: any, msg?: string): void;
|
||||
|
||||
isNull(val: any, msg?: string):void;
|
||||
isNotNull(val: any, msg?: string):void;
|
||||
isNull(val: any, msg?: string): void;
|
||||
isNotNull(val: any, msg?: string): void;
|
||||
|
||||
isUndefined(val: any, msg?: string):void;
|
||||
isDefined(val: any, msg?: string):void;
|
||||
isUndefined(val: any, msg?: string): void;
|
||||
isDefined(val: any, msg?: string): void;
|
||||
|
||||
isFunction(val: any, msg?: string):void;
|
||||
isNotFunction(val: any, msg?: string):void;
|
||||
isFunction(val: any, msg?: string): void;
|
||||
isNotFunction(val: any, msg?: string): void;
|
||||
|
||||
isObject(val: any, msg?: string):void;
|
||||
isNotObject(val: any, msg?: string):void;
|
||||
isObject(val: any, msg?: string): void;
|
||||
isNotObject(val: any, msg?: string): void;
|
||||
|
||||
isArray(val: any, msg?: string):void;
|
||||
isNotArray(val: any, msg?: string):void;
|
||||
isArray(val: any, msg?: string): void;
|
||||
isNotArray(val: any, msg?: string): void;
|
||||
|
||||
isString(val: any, msg?: string):void;
|
||||
isNotString(val: any, msg?: string):void;
|
||||
isString(val: any, msg?: string): void;
|
||||
isNotString(val: any, msg?: string): void;
|
||||
|
||||
isNumber(val: any, msg?: string):void;
|
||||
isNotNumber(val: any, msg?: string):void;
|
||||
isNumber(val: any, msg?: string): void;
|
||||
isNotNumber(val: any, msg?: string): void;
|
||||
|
||||
isBoolean(val: any, msg?: string):void;
|
||||
isNotBoolean(val: any, msg?: string):void;
|
||||
isBoolean(val: any, msg?: string): void;
|
||||
isNotBoolean(val: any, msg?: string): void;
|
||||
|
||||
typeOf(val: any, type: string, msg?: string):void;
|
||||
notTypeOf(val: any, type: string, msg?: string):void;
|
||||
typeOf(val: any, type: string, msg?: string): void;
|
||||
notTypeOf(val: any, type: string, msg?: string): void;
|
||||
|
||||
instanceOf(val: any, type: Function, msg?: string):void;
|
||||
notInstanceOf(val: any, type: Function, msg?: string):void;
|
||||
instanceOf(val: any, type: Function, msg?: string): void;
|
||||
notInstanceOf(val: any, type: Function, msg?: string): void;
|
||||
|
||||
include(exp: string, inc: any, msg?: string):void;
|
||||
include(exp: any[], inc: any, msg?: string):void;
|
||||
include(exp: string, inc: any, msg?: string): void;
|
||||
include(exp: any[], inc: any, msg?: string): void;
|
||||
|
||||
notInclude(exp: string, inc: any, msg?: string):void;
|
||||
notInclude(exp: any[], inc: any, msg?: string):void;
|
||||
notInclude(exp: string, inc: any, msg?: string): void;
|
||||
notInclude(exp: any[], inc: any, msg?: string): void;
|
||||
|
||||
match(exp: any, re: RegExp, msg?: string):void;
|
||||
notMatch(exp: any, re: RegExp, msg?: string):void;
|
||||
match(exp: any, re: RegExp, msg?: string): void;
|
||||
notMatch(exp: any, re: RegExp, msg?: string): void;
|
||||
|
||||
property(obj: Object, prop: string, msg?: string):void;
|
||||
notProperty(obj: Object, prop: string, msg?: string):void;
|
||||
deepProperty(obj: Object, prop: string, msg?: string):void;
|
||||
notDeepProperty(obj: Object, prop: string, msg?: string):void;
|
||||
property(obj: Object, prop: string, msg?: string): void;
|
||||
notProperty(obj: Object, prop: string, msg?: string): void;
|
||||
deepProperty(obj: Object, prop: string, msg?: string): void;
|
||||
notDeepProperty(obj: Object, prop: string, msg?: string): void;
|
||||
|
||||
propertyVal(obj: Object, prop: string, val: any, msg?: string):void;
|
||||
propertyNotVal(obj: Object, prop: string, val: any, msg?: string):void;
|
||||
propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
|
||||
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
|
||||
|
||||
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string):void;
|
||||
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string):void;
|
||||
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
|
||||
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
|
||||
|
||||
lengthOf(exp: any, len: number, msg?: string):void;
|
||||
lengthOf(exp: any, len: number, msg?: string): void;
|
||||
//alias frenzy
|
||||
throw(fn: Function, msg?: string):void;
|
||||
throw(fn: Function, regExp: RegExp):void;
|
||||
throw(fn: Function, errType: Function, msg?: string):void;
|
||||
throw(fn: Function, errType: Function, regExp: RegExp):void;
|
||||
throw(fn: Function, msg?: string): void;
|
||||
throw(fn: Function, regExp: RegExp): void;
|
||||
throw(fn: Function, errType: Function, msg?: string): void;
|
||||
throw(fn: Function, errType: Function, regExp: RegExp): void;
|
||||
|
||||
throws(fn: Function, msg?: string):void;
|
||||
throws(fn: Function, regExp: RegExp):void;
|
||||
throws(fn: Function, errType: Function, msg?: string):void;
|
||||
throws(fn: Function, errType: Function, regExp: RegExp):void;
|
||||
throws(fn: Function, msg?: string): void;
|
||||
throws(fn: Function, regExp: RegExp): void;
|
||||
throws(fn: Function, errType: Function, msg?: string): void;
|
||||
throws(fn: Function, errType: Function, regExp: RegExp): void;
|
||||
|
||||
Throw(fn: Function, msg?: string):void;
|
||||
Throw(fn: Function, regExp: RegExp):void;
|
||||
Throw(fn: Function, errType: Function, msg?: string):void;
|
||||
Throw(fn: Function, errType: Function, regExp: RegExp):void;
|
||||
Throw(fn: Function, msg?: string): void;
|
||||
Throw(fn: Function, regExp: RegExp): void;
|
||||
Throw(fn: Function, errType: Function, msg?: string): void;
|
||||
Throw(fn: Function, errType: Function, regExp: RegExp): void;
|
||||
|
||||
doesNotThrow(fn: Function, msg?: string):void;
|
||||
doesNotThrow(fn: Function, regExp: RegExp):void;
|
||||
doesNotThrow(fn: Function, errType: Function, msg?: string):void;
|
||||
doesNotThrow(fn: Function, errType: Function, regExp: RegExp):void;
|
||||
doesNotThrow(fn: Function, msg?: string): void;
|
||||
doesNotThrow(fn: Function, regExp: RegExp): void;
|
||||
doesNotThrow(fn: Function, errType: Function, msg?: string): void;
|
||||
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
|
||||
|
||||
operator(val: any, operator: string, val2: any, msg?: string):void;
|
||||
closeTo(act: number, exp: number, delta: number, msg?: string):void;
|
||||
operator(val: any, operator: string, val2: any, msg?: string): void;
|
||||
closeTo(act: number, exp: number, delta: number, msg?: string): void;
|
||||
|
||||
sameMembers(set1: any[], set2: any[], msg?: string):void;
|
||||
includeMembers(set1: any[], set2: any[], msg?: string):void;
|
||||
sameMembers(set1: any[], set2: any[], msg?: string): void;
|
||||
includeMembers(set1: any[], set2: any[], msg?: string): void;
|
||||
|
||||
ifError(val: any, msg?: string):void;
|
||||
ifError(val: any, msg?: string): void;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
includeStack: boolean;
|
||||
}
|
||||
|
||||
export class AssertionError {
|
||||
constructor(message: string, _props?: any, ssf?: Function);
|
||||
name: string;
|
||||
message: string;
|
||||
showDiff: boolean;
|
||||
stack: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare var chai: Chai.ChaiStatic;
|
||||
|
||||
declare module "chai" {
|
||||
export = chai;
|
||||
}
|
||||
|
||||
interface Object {
|
||||
should: Chai.Assertion;
|
||||
}
|
||||
|
||||
@@ -252,12 +252,12 @@ var myPolarAreaChart = new Chart(ctx).PolarArea(polarAreaData, {
|
||||
|
||||
var myPolarAreaChartLegend: string = myPolarAreaChart.generateLegend();
|
||||
var myPolarAreaChartImage: string = myPolarAreaChart.toBase64Image();
|
||||
myPolarAreaChart.addData([{
|
||||
myPolarAreaChart.addData({
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
}, 0);
|
||||
myPolarAreaChart.clear();
|
||||
myPolarAreaChart.removeData(0);
|
||||
myPolarAreaChart.resize();
|
||||
@@ -301,12 +301,12 @@ var myPieChart = new Chart(ctx).Pie(pieData, {
|
||||
|
||||
var myPieChartLegend: string = myPieChart.generateLegend();
|
||||
var myPieChartImage: string = myPieChart.toBase64Image();
|
||||
myPieChart.addData([{
|
||||
myPieChart.addData({
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
}, 0);
|
||||
myPieChart.clear();
|
||||
myPieChart.removeData(0);
|
||||
myPieChart.resize();
|
||||
@@ -329,12 +329,12 @@ var myDoughnutChart = new Chart(ctx).Doughnut(pieData, {
|
||||
|
||||
var myDoughnutChartLegend: string = myDoughnutChart.generateLegend();
|
||||
var myDoughnutChartImage: string = myDoughnutChart.toBase64Image();
|
||||
myPieChart.addData([{
|
||||
myPieChart.addData({
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
}, 0);
|
||||
myDoughnutChart.clear();
|
||||
myDoughnutChart.removeData(0);
|
||||
myDoughnutChart.resize();
|
||||
|
||||
Vendored
+1
-1
@@ -113,7 +113,7 @@ interface LinearInstance extends ChartInstance {
|
||||
interface CircularInstance extends ChartInstance {
|
||||
getSegmentsAtEvent: (event: Event) => {}[];
|
||||
update: () => void;
|
||||
addData: (valuesArray: CircularChartData[], index: number) => void;
|
||||
addData: (valuesArray: CircularChartData, index?: number) => void;
|
||||
removeData: (index: number) => void;
|
||||
segments: Array<CircularChartData>;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,21 @@ 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();
|
||||
|
||||
// listening to window events
|
||||
currentWindow.onBoundsChanged.addListener(function () { return; });
|
||||
currentWindow.onClosed.addListener(function () { return; });
|
||||
currentWindow.onFullscreened.addListener(function () { return; });
|
||||
currentWindow.onMaximized.addListener(function () { return; });
|
||||
currentWindow.onMinimized.addListener(function () { return; });
|
||||
currentWindow.onRestored.addListener(function () { return; });
|
||||
|
||||
// check platform capabilities
|
||||
var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces();
|
||||
|
||||
// FileSystem
|
||||
// https://developer.chrome.com/apps/fileSystem
|
||||
|
||||
Vendored
+9
@@ -122,10 +122,19 @@ declare module chrome.app.window {
|
||||
id: string;
|
||||
innerBounds: Bounds;
|
||||
outerBounds: Bounds;
|
||||
onBoundsChanged: WindowEvent;
|
||||
onClosed: WindowEvent;
|
||||
onFullscreened: WindowEvent;
|
||||
onMaximized: WindowEvent;
|
||||
onMinimized: WindowEvent;
|
||||
onRestored: WindowEvent;
|
||||
}
|
||||
|
||||
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
+3287
-3287
File diff suppressed because it is too large
Load Diff
+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
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user