diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e9d91ae10..2c07fac20 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,6 +2,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakame/dt-contributors-generator). (but run scripts are manual operation. please wait :P) +* [:link:](abs/abs.d.ts) [abs](https://github.com/IonicaBizau/node-abs) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](absolute/absolute.d.ts) [absolute](https://github.com/bahamas10/node-absolute) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](acc-wizard/acc-wizard.d.ts) [acc-wizard](https://github.com/sathomas/acc-wizard) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](accounting/accounting.d.ts) [accounting.js](http://josscrowcroft.github.io/accounting.js) by [Sergey Gerasimov](https://github.com/gerich-home) * [:link:](ace/ace.d.ts) [Ace Ajax.org Cloud9 Editor](http://ace.ajax.org) by [Diullei Gomes](https://github.com/Diullei) @@ -58,6 +60,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angular-signalr-hub/angular-signalr-hub.d.ts) [angular-signalr-hub](https://github.com/JustMaier/angular-signalr-hub) by [Adam Santaniello](https://github.com/AdamSantaniello) * [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal) * [:link:](angular-storage/angular-storage.d.ts) [angular-storage](https://github.com/auth0/angular-storage) by [Matthew DeKrey](https://github.com/mdekrey) +* [:link:](angular-strap/angular-strap.d.ts) [angular-strap v2.2.x](http://mgcrea.github.io/angular-strap) by [Sam Herrmann](https://github.com/samherrmann) * [:link:](angular-ui-tree/angular-ui-tree.d.ts) [angular-ui-tree](https://github.com/angular-ui-tree/angular-ui-tree) by [Calvin Fernandez](https://github.com/CalvinFernandez) * [:link:](angular.throttle/angular.throttle.d.ts) [angular.throttle](https://github.com/BaggersIO/angular.throttle) by [Stefan Steinhart](https://github.com/reppners) * [:link:](angular-ui-sortable/angular-ui-sortable.d.ts) [angular.ui.sortable module](https://github.com/angular-ui/ui-sortable) by [Thodoris Greasidis](https://github.com/thgreasi) @@ -91,6 +94,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](assertion-error/assertion-error.d.ts) [assertion-error](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](assertsharp/assertsharp.d.ts) [assertsharp](https://www.npmjs.com/package/assertsharp) by [Bruno Leonardo Michels](https://github.com/brunolm) * [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov), [Arseniy Maximov](https://github.com/kern0), [Joe Herman](https://github.com/Penryn) +* [:link:](async-writer/async-writer.d.ts) [async-writer](https://github.com/marko-js/async-writer) by [Yuce Tekol](http://yuce.me) * [: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) @@ -98,19 +102,21 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](atom-keymap/atom-keymap.d.ts) [atom-keymap](https://github.com/atom/atom-keymap) by [Vadim Macagon](https://github.com/enlight) * [: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:](auto-launch/auto-launch.d.ts) [auto-launch](https://github.com/Teamwork/node-auto-launch) by [rhysd](https://github.com/rhysd) * [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com) * [:link:](autoprefixer-core/autoprefixer-core.d.ts) [Autoprefixer Core](https://github.com/postcss/autoprefixer-core) by [Asana](https://asana.com) * [: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) * [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](babylonjs/babylon.d.ts) [BabylonJS](http://www.babylonjs.com) by [David Catuhe](https://github.com/deltakosh) * [:link:](backbone/backbone-global.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) * [:link:](backbone/backbone.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) * [:link:](backbone-associations/backbone-associations.d.ts) [Backbone-associations](https://github.com/dhruvaray/backbone-associations) by [Craig Brett](https://github.com/craigbrett17) * [:link:](backbone-relational/backbone-relational.d.ts) [Backbone-relational](http://backbonerelational.org) by [Eirik Hoem](https://github.com/eirikhm) * [:link:](backbone.layoutmanager/backbone.layoutmanager.d.ts) [Backbone.LayoutManager](http://layoutmanager.org) by [He Jiang](https://github.com/hejiang2000) +* [:link:](backbone.localstorage/backbone.localstorage.d.ts) [backbone.localStorage](https://github.com/jeromegn/Backbone.localStorage) by [Louis Grignon](https://github.com/lgrignon) * [:link:](backbone.paginator/backbone.paginator.d.ts) [backbone.paginator](https://github.com/backbone-paginator/backbone.paginator) by [Nyamazing](https://github.com/Nyamazing) * [:link:](backbone.radio/backbone.radio.d.ts) [Backbone.Radio](https://github.com/marionettejs/backbone.radio) by [Peter Palotas](https://github.com/alphaleonis) * [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan) @@ -120,8 +126,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](basic-auth/basic-auth.d.ts) [basic-auth](https://github.com/jshttp/basic-auth) by [Clément Bourgeois](https://github.com/moonpyk) * [:link:](batch-stream/batch-stream.d.ts) [batch-stream](https://github.com/segmentio/batch-stream) by [Nicholas Penree](http://github.com/drudge) * [:link:](bcrypt/bcrypt.d.ts) [bcrypt](https://www.npmjs.org/package/bcrypt) by [Peter Harris](https://github.com/codeanimal) +* [:link:](bcrypt-nodejs/bcrypt-nodejs.d.ts) [bcrypt-nodejs](https://github.com/shaneGirish/bcrypt-nodejs) by [David Broder-Rodgers](https://github.com/DavidBR-SW) +* [:link:](bcryptjs/bcryptjs.d.ts) [bcryptjs](https://github.com/dcodeIO/bcrypt.js) by [Joshua Filby](https://github.com/Joshua-F) * [:link:](benchmark/benchmark.d.ts) [Benchmark](http://benchmarkjs.com) by [Asana](https://asana.com) * [:link:](better-curry/better-curry.d.ts) [better-curry](https://github.com/pocesar/js-bettercurry) by [Paulo Cesar](https://github.com/pocesar) +* [:link:](bezier-easing/bezier-easing.d.ts) [bezier-easing](https://github.com/gre/bezier-easing) by [brian ridley](https://github.com/ptlis) * [:link:](bgiframe/typescript.bgiframe.d.ts) [bgiframe](https://github.com/sumegizoltan/BgiFrame) by [Zoltan Sumegi](https://github.com/sumegizoltan) * [:link:](big.js/big.js.d.ts) [big.js](https://github.com/MikeMcl/big.js) by [Steve Ognibene](https://github.com/nycdotnet) * [:link:](bigint/bigint.d.ts) [BigInt](https://github.com/Evgenus/BigInt) by [Eugene Chernyshov](https://github.com/Evgenus) @@ -130,7 +139,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bigscreen/bigscreen.d.ts) [BigScreen](http://brad.is/coding/BigScreen) by [Douglas Eichelberger](https://github.com/dduugg) * [:link:](bitwise-xor/bitwise-xor.d.ts) [bitwise-xor](https://github.com/czzarr/node-bitwise-xor) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](blob-stream/blob-stream.d.ts) [blob-stream](https://github.com/devongovett/blob-stream) by [Eric Hillah](https://github.com/erichillah) -* [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](blue-tape/blue-tape.d.ts) [blue-tape](https://github.com/spion/blue-tape) by [Haoqun Jiang](https://github.com/sodatea) +* [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds), [falsandtru](https://github.com/falsandtru) * [:link:](bluebird-retry/bluebird-retry.d.ts) [bluebird-retry](https://github.com/jut-io/bluebird-retry) by [Pascal Vomhoff](https://github.com/pvomhoff) * [:link:](blueimp-md5/blueimp-md5.d.ts) [blueimp-md5](https://github.com/blueimp/JavaScript-MD5) by [Ray Martone](https://github.com/rmartone) * [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse) @@ -154,30 +164,36 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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), [Joe Skeen](http://github.com/joeskeen) -* [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar), [John Vilk](https://github.com/jvilk) * [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](buffer-compare/buffer-compare.d.ts) [buffer-compare](https://github.com/soldair/node-buffer-compare) by [Ilya Mochalov](https://github.com/chrootsu) * [: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:](bull/bull.d.ts) [bull](https://github.com/OptimalBits/bull) by [Bruno Grieder](https://github.com/bgrieder) * [:link:](bunyan-prettystream/bunyan-prettystream.d.ts) [bunyan-prettystream](https://www.npmjs.com/package/bunyan-prettystream) by [Jason Swearingen](https://github.com/jasonswearingen), [Vadim Macagon](https://github.com/enlight) * [: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:](dw-bxslider-4/dw-bxslider-4.d.ts) [bxSlider](https://github.com/stevenwanderski/bxslider-4) by [Piotr Sałkowski](https://github.com/namerci) * [:link:](byline/byline.d.ts) [byline](https://github.com/jahewson/node-byline) by [Stefan Steinhart](https://github.com/reppners) +* [:link:](bytebuffer/bytebuffer.d.ts) [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js) by [Denis Cappellin](http://github.com/cappellin) * [:link:](bytes/bytes.d.ts) [bytes](https://github.com/visionmedia/bytes.js) by [Zhiyuan Wang](https://github.com/danny8002) * [:link:](c3/c3.d.ts) [C3js](http://c3js.org) by [Marc Climent](https://github.com/mcliment) +* [:link:](cal-heatmap/cal-heatmap.d.ts) [cal-heatmap](https://github.com/wa0x6e/cal-heatmap) by [Chris Baker](https://github.com/RetroChrisB) * [:link:](calq/calq.d.ts) [calq](https://calq.io/docs/client/javascript/reference) by [Eirik Hoem](https://github.com/eirikhm) * [:link:](camel-case/camel-case.d.ts) [camel-case](https://github.com/blakeembrey/camel-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [: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 Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown), [Olivier Chevet](https://github.com/olivr70) +* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown), [Olivier Chevet](https://github.com/olivr70), [Matt Wistrand](https://github.com/mwistrand) * [: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), [Yuki Kokubun](https://github.com/Kuniwak) * [: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) * [:link:](chai-http/chai-http.d.ts) [chai-http](https://github.com/chaijs/chai-http) by [Wim Looman](https://github.com/Nemo157) * [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](chai-string/chai-string.d.ts) [chai-string](https://github.com/onechiporenko/chai-string) by [Nick Malaguti](https://github.com/nmalaguti) * [:link:](chai-subset/chai-subset.d.ts) [chai-subset](https://github.com/e-conomic/chai-subset) by [Sam Noedel](https://github.com/delta62), [Andrew Brown](https://github.com/AGBrown) +* [:link:](chai-things/chai-things.d.ts) [chai-things](https://github.com/chaijs/chai-things) by [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chance/chance.d.ts) [Chance](http://chancejs.com) by [Chris Bowdon](https://github.com/cbowdon) * [:link:](change-case/change-case.d.ts) [change-case](https://github.com/blakeembrey/change-case) by [Asana](https://asana.com) @@ -190,7 +206,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](chosen/chosen.jquery.d.ts) [Chosen.JQuery](http://harvesthq.github.com/chosen) by [Boris Yankov](https://github.com/borisyankov) * [: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-cast.d.ts) [Chrome Cast application development](https://developers.google.com/cast) by [Thomas Stig Jacobsen](https://github.com/eXeDK) -* [: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), [couven92](https://gitbus.com/couven92) +* [: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), [couven92](https://github.com/couven92) * [: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:](chui/chui.d.ts) [chui](https://github.com/chocolatechipui/chocolatechip-ui) by [Robert Biggs](http://chocolatechip-ui.com) * [:link:](circular-json/circular-json.d.ts) [circular-json](https://github.com/WebReflection/circular-json) by [Jonathan Pevarnek](https://github.com/jpevarnek) @@ -199,16 +215,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](closure-compiler/closure-compiler.d.ts) [closure-compiler](https://github.com/tim-smart/node-closure) by [Martin Probst](https://github.com/mprobst) -* [:link:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) -* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) * [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik) * [:link:](codemirror/searchcursor.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt) +* [:link:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) +* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) * [:link:](coffeeify/coffeeify.d.ts) [coffeeify](https://github.com/jnordberg/coffeeify) by [Qubo](https://github.com/tkQubo) * [: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:](commonmark/commonmark.d.ts) [commonmark.js](https://github.com/jgm/commonmark.js) by [Nico Jansen](https://github.com/nicojs) * [:link:](compare-version/compare-version.d.ts) [compare-version](https://www.npmjs.com/package/compare-version) by [Jonathan Pevarnek](https://github.com/jpevarnek) +* [:link:](complex/complex.d.ts) [Complex](https://github.com/arian/Complex) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](debounce/debounce.d.ts) [compose-function](https://github.com/component/debounce) by [Denis Sokolov](https://github.com/denis-sokolov) +* [:link:](compose-function/compose-function.d.ts) [compose-function](https://github.com/stoeffel/compose-function) by [Denis Sokolov](https://github.com/denis-sokolov) * [: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/connect.d.ts) [connect](https://github.com/senchalabs/connect) by [Maxime LUCE](https://github.com/SomaticIT) @@ -217,23 +237,31 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](connect-modrewrite/connect-modrewrite.d.ts) [connect-modrewrite](https://github.com/tinganho/connect-modrewrite) by [Tingan Ho](https://github.com/tinganho) * [:link:](connect-mongo/connect-mongo.d.ts) [connect-mongo](https://github.com/kcbanner/connect-mongo) by [Mizuki Yamamoto](https://github.com/Syati) * [:link:](connect-slashes/connect-slashes.d.ts) [connect-slashes](https://github.com/avinoamr/connect-slashes) by [Sam Herrmann](https://github.com/samherrmann) +* [:link:](connect-timeout/connect-timeout.d.ts) [connect-timeout](https://github.com/expressjs/timeout) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](console-stamp/console-stamp.d.ts) [console-stamp](https://github.com/starak/node-console-stamp) by [Eric Byers](https://github.com/ericbyers) * [:link:](consolidate/consolidate.d.ts) [consolidate](https://github.com/visionmedia/consolidate.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](constant-case/constant-case.d.ts) [constant-case](https://github.com/blakeembrey/constant-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](content-type/content-type.d.ts) [content-type](https://github.com/deoxxa/content-type) by [Pine Mizune](https://github.com/pine613) +* [:link:](contentful-resolve-response/contentful-resolve-response.d.ts) [contentful-resolve-response](https://github.com/contentful/contentful-resolve-response) by [Anton Karsten](https://github.com/antonkarsten) * [:link:](contextjs/contextjs.d.ts) [contextjs](https://github.com/jakiestfu/Context.js) by [Kern Handa](https://github.com/kernhanda) * [: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) * [:link:](cookie/cookie.d.ts) [cookie](https://github.com/jshttp/cookie) by [Pine Mizune](https://github.com/pine613) * [:link:](cookie-parser/cookie-parser.d.ts) [cookie-parser](https://github.com/expressjs/cookie-parser) by [Santi Albo](https://github.com/santialbo) +* [:link:](cookies/cookies.d.ts) [cookie-parser](https://github.com/pillarjs/cookies) by [Wang Zishi](https://github.com/WangZishi) * [:link:](cookiejs/cookiejs.d.ts) [cookie.js](https://github.com/js-coder/cookie.js) by [Boltmade](https://github.com/Boltmade) * [:link:](cordova-ionic/plugins/keyboard.d.ts) [Cordova Keyboard plugin](https://github.com/driftyco/ionic-plugins-keyboard) by [Hendrik Maus](https://github.com/hendrikmaus) * [:link:](cordova-plugin-app-version/cordova-plugin-app-version.d.ts) [cordova-plugin-app-version](https://github.com/whiteoctober/cordova-plugin-app-version) by [Markus Wagner](https://github.com/Ritzlgrmft) * [:link:](cordova-plugin-ibeacon/cordova-plugin-ibeacon.d.ts) [cordova-plugin-ibeacon](https://github.com/petermetz/cordova-plugin-ibeacon) by [Markus Wagner](https://github.com/Ritzlgrmft) +* [:link:](cordova-plugin-mapsforge/cordova-plugin-mapsforge.d.ts) [cordova-plugin-mapsforge](https://github.com/afsuarez/mapsforge-cordova-plugin) by [rafw87](https://github.com/rafw87) * [:link:](cordova-plugin-ouralabs/cordova-plugin-ouralabs.d.ts) [cordova-plugin-ouralabs](https://github.com/Justin-Credible/cordova-plugin-ouralabs) by [Justin Unterreiner](https://github.com/Justin-Credible) +* [:link:](cordova-plugin-spinner/cordova-plugin-spinner.d.ts) [cordova-plugin-spinner](https://github.com/Justin-Credible/cordova-plugin-spinner) by [Justin Unterreiner](https://github.com/Justin-Credible) * [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus) * [:link:](core-decorators/core-decorators.d.ts) [core-decorators.js](https://github.com/jayphelps/core-decorators.js) by [Qubo](https://github.com/tkqubo) * [:link:](core-js/core-js.d.ts) [core-js](https://github.com/zloirock/core-js) by [Ron Buckton](http://github.com/rbuckton) * [:link:](cors/cors.d.ts) [cors](https://github.com/troygoode/node-cors) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin) -* [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat) +* [:link:](couchbase/couchbase.d.ts) [Couchbase Node.js SDK](https://github.com/couchbase/couchnode) by [Marwan Aouida](https://github.com/maouida) +* [:link:](cradle/cradle.d.ts) [cradle](https://github.com/flatiron/cradle) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) +* [:link:](create-error/create-error.d.ts) [create-error.js](https://github.com/tgriesser/create-error) by [Tanguy Krotoff](https://github.com/tkrotoff) * [: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:](credential/credential.d.ts) [credential](https://github.com/ericelliott/credential) by [Phú](https://github.com/phuvo) * [:link:](cron/cron.d.ts) [cron](https://www.npmjs.com/package/cron) by [Hiroki Horiuchi](https://github.com/horiuchi) @@ -246,6 +274,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:](cucumber/cucumber.d.ts) [cucumber-js](https://github.com/cucumber/cucumber-js) by [Abraão Alves](https://github.com/abraaoalves) * [:link:](cuid/cuid.d.ts) [cuid](https://github.com/ericelliott/cuid) by [Dave Keen](http://www.keendevelopment.ch) * [: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) @@ -259,7 +288,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](date.format.js/date.format.d.ts) [Date Format](http://blog.stevenlevithan.com/archives/date-time-format) by [Rob Stutton](https://github.com/balrob) * [: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:](debug/debug.d.ts) [debug](https://github.com/visionmedia/debug) by [Seon-Wook Park](https://github.com/swook), [Gal Talmor](https://github.com/galtalmor) * [:link:](decimal.js/decimal.js.d.ts) [decimal.js](http://mikemcl.github.io/decimal.js) by [Joseph Rossi](http://github.com/musicist288) * [:link:](decorum/decorum.d.ts) [Decorum JS](https://github.com/dflor003/decorum) by [Danil Flores](https://github.com/dflor003) * [:link:](deep-diff/deep-diff.d.ts) [deep-diff](https://github.com/flitbit/diff) by [ZauberNerd](https://github.com/ZauberNerd) @@ -284,8 +313,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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), [Samira Bazuzi](https://github.com/bazuzi) * [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton) -* [:link:](requirejs-domready/domready.d.ts) [domReady](https://github.com/requirejs/domReady) by [Nobuhiro Nakamura](https://github.com/lefb766) * [:link:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd) +* [:link:](requirejs-domready/domready.d.ts) [domReady](https://github.com/requirejs/domReady) by [Nobuhiro Nakamura](https://github.com/lefb766) * [: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:](dot-case/dot-case.d.ts) [dot-case](https://github.com/blakeembrey/dot-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) @@ -305,8 +334,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](easy-jsend/easy-jsend.d.ts) [easy-jsend](https://github.com/DeadAlready/easy-jsend) by [Karl Düüna](https://github.com/DeadAlready) * [: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 [Niklas Mollenhauer](https://github.com/nikeee) -* [:link:](easy-xapi-supertest/easy-xapi-supertest.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-x-headers/easy-x-headers.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready) +* [:link:](easy-xapi-supertest/easy-xapi-supertest.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-xapi/easy-xapi.d.ts) [easy-xapi](https://github.com/DeadAlready/easy-xapi) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-xapi-utils/easy-xapi-utils.d.ts) [easy-xapi-utils](https://github.com/DeadAlready/easy-xapi-utils) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin) @@ -314,17 +343,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000) * [:link:](ejs/ejs.d.ts) [ejs.js](http://ejs.co) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped) * [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) -* [:link:](github-electron/github-electron.d.ts) [Electron (shared between main and rederer processes)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) +* [:link:](github-electron/github-electron.d.ts) [Electron](http://electron.atom.io) by [jedmao](https://github.com/jedmao), [rhysd](https://rhysd.github.io) * [:link:](electron-builder/electron-builder.d.ts) [electron-builder](https://github.com/loopline-systems/electron-builder) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](electron-packager/electron-packager.d.ts) [electron-packager](https://github.com/maxogden/electron-packager) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](github-electron/electron-prebuilt.d.ts) [electron-prebuilt](https://github.com/mafintosh/electron-prebuilt) by [rhysd](https://github.com/rhysd) * [: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) * [:link:](elm/elm.d.ts) [Elm](http://elm-lang.org) by [Dénes Harmath](https://github.com/thSoft) +* [:link:](email-addresses/email-addresses.d.ts) [email-addresses](https://github.com/jackbowman/email-addresses) by [John Grimsey](https://github.com/johngrimsey) +* [:link:](email-validator/email-validator.d.ts) [email-validator](https://github.com/Sembiance/email-validator) by [Paul Lessing](https://github.com/paullessing) * [:link:](ember/ember.d.ts) [Ember.js](http://emberjs.com) by [Jed Mao](https://github.com/jedmao) * [:link:](emissary/emissary.d.ts) [emissary](https://github.com/atom/emissary) by [vvakame](https://github.com/vvakame) * [:link:](empower/empower.d.ts) [empower](https://github.com/twada/empower) by [vvakame](https://github.com/vvakame) * [:link:](emscripten/emscripten.d.ts) [Emscripten](http://kripken.github.io/emscripten-site/index.html) by [Kensuke Matsuzaki](https://github.com/zakki) * [:link:](envify/envify.d.ts) [envify](https://github.com/hughsk/envify) by [Qubo](https://github.com/tkQubo) +* [:link:](enzyme/enzyme.d.ts) [Enzyme](https://github.com/airbnb/enzyme) by [Marian Palkus](https://github.com/MarianPalkus), [Cap3](http://www.cap3.de) * [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](eq.js/eq.js.d.ts) [eq.js](https://github.com/Snugug/eq.js) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo) @@ -338,12 +370,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](event-kit/event-kit.d.ts) [event-kit](https://github.com/atom/event-kit) by [Vadim Macagon](https://github.com/enlight) * [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto) -* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21) +* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21), [Leon Yu](https://github.com/leonyu) * [:link:](evernote/evernote.d.ts) [evernote v](https://www.npmjs.com/package/evernote) by [Zachary Collins](https://github.com/corps) * [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/Automattic/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-brute/express-brute.d.ts) [express-brute](https://github.com/AdamPflug/express-brute) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](express-brute-mongo/express-brute-mongo.d.ts) [express-brute-mongo](https://github.com/auth0/express-brute-mongo) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](express-debug/express-debug.d.ts) [express-debug](https://github.com/devoidfury/express-debug) by [Federico Bond](https://github.com/federicobond) * [:link:](express-handlebars/express-handlebars.d.ts) [express-handlebars](https://github.com/ericf/express-handlebars) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](express-jwt/express-jwt.d.ts) [express-jwt](https://www.npmjs.org/package/express-jwt) by [Wonshik Kim](https://github.com/wokim) @@ -359,6 +393,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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), [Joseph Livecchi](https://github.com/joewashear007), [Michael Randolph](https://github.com/mrand01) * [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl) +* [:link:](fbemitter/fbemitter.d.ts) [Facebook's EventEmitter](https://github.com/facebook/emitter) by [kmxz](https://github.com/kmxz) * [:link:](faker/faker.d.ts) [faker](http://marak.com/faker.js) by [Bas Pennings](https://github.com/basp), [Yuki Kokubun](https://github.com/Kuniwak) * [:link:](famous/famous.d.ts) [Famous Engine](http://famous.org) by [Boris Vasilenko](https://github.com/borisvasilenko) * [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) @@ -370,6 +405,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](whatwg-fetch/whatwg-fetch.d.ts) [fetch API](https://github.com/github/fetch) by [Ryan Graham](https://github.com/ryan-codingintrigue) * [:link:](fhir/fhir.d.ts) [FHIR DSTU2](http://www.hl7.org/fhir/2015Sep/index.html) by [Artifact Health](http://www.artifacthealth.com) * [:link:](fibers/fibers.d.ts) [fibers](https://github.com/laverdet/node-fibers) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](field/field.d.ts) [field](https://www.npmjs.com/package/field) by [Leo Liang](https://github.com/aleung/DefinitelyTyped) * [:link:](filewriter/filewriter.d.ts) [File API: Writer](http://www.w3.org/TR/file-writer-api) by [Kon](http://phyzkit.net) * [:link:](filesystem/filesystem.d.ts) [File System API](http://www.w3.org/TR/file-system-api) by [Kon](http://phyzkit.net) * [:link:](file-url/file-url.d.ts) [file-url](https://github.com/sindresorhus/file-url) by [MEDIA CHECK s.r.o.](http://www.mediacheck.cz) @@ -383,7 +419,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](firebase-client/firebase-client.d.ts) [Firebase Client](https://www.github.com/jpstevens/firebase-client) by [Andrew Breen](https://github.com/fpsscarecrow) * [:link:](firebase/firebase-simplelogin.d.ts) [Firebase Simple Login](https://www.firebase.com/docs/security/simple-login-overview.html) by [Wilker Lucio](http://github.com/wilkerlucio) * [:link:](first-mate/first-mate.d.ts) [first-mate](https://github.com/atom/first-mate) by [Vadim Macagon](https://github.com/enlight) -* [:link:](fixed-data-table/fixed-data-table.d.ts) [fixed-data-table](https://github.com/facebook/fixed-data-table) by [Petar Paar](https://github.com/pepaar) +* [:link:](fixed-data-table/fixed-data-table.d.ts) [fixed-data-table](https://github.com/facebook/fixed-data-table) by [Petar Paar](https://github.com/pepaar), [Stephen Jelfs](https://github.com/stephenjelfs) * [:link:](flake-idgen/flake-idgen.d.ts) [flakge-idgen](https://github.com/T-PWK/flake-idgen) by [Yuce Tekol](http://yuce.me) * [:link:](flat/flat.d.ts) [flat](https://github.com/hughsk/flat) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](flexSlider/flexSlider.d.ts) [FlexSlider 2 jquery plugin](https://github.com/woothemes/FlexSlider) by [Diullei Gomes](https://github.com/diullei) @@ -391,19 +427,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) * [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) * [:link:](flowjs/flowjs.d.ts) [flowjs](https://github.com/flowjs/flow.js) by [Ryan McNamara](https://github.com/ryan10132) -* [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb) +* [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb), [Giedrius Grabauskas](https://github.com/QuatroDevOfficial) * [:link:](flux-standard-action/flux-standard-action.d.ts) [flux-standard-action](https://github.com/acdlite/flux-standard-action) by [Qubo](https://github.com/tkqubo) * [:link:](fluxxor/fluxxor.d.ts) [Fluxxor](https://github.com/BinaryMuse/fluxxor) by [Yuichi Murata](https://github.com/mrk21) * [:link:](fontoxml/fontoxml.d.ts) [FontoXML](http://www.fontoxml.com) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli) +* [:link:](jee-jsf/jsf.d.ts) [for the JSF 2.0 Ajax request API](https://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/js-api/symbols/jsf.ajax.html) by [Lars Michaelis and Stephan Zerhusen](https://github.com/ButterFaces/ButterFaces) * [:link:](forge-di/forge-di.d.ts) [forge-di](https://github.com/nkohari/forge) by [Adam Carr](https://github.com/adamcarr) -* [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](formidable/formidable.d.ts) [Formidable](https://github.com/felixge/node-formidable) by [Wim Looman](https://github.com/Nemo157) * [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](foundation-sites/foundation-sites.d.ts) [Foundation Sites](http://foundation.zurb.com) by [Sam Vloeberghs](https://github.com/samvloeberghs) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) -* [:link:](freedom/freedom-core-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](freedom/freedom-module-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](freedom/freedom.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) +* [:link:](freedom/freedom-core-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](fs-ext/fs-ext.d.ts) [fs-ext](https://github.com/baudehlo/node-fs-ext) by [Oguzhan Ergin](https://github.com/OguzhanE) * [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41) @@ -413,6 +450,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ftp/ftp.d.ts) [ftp](https://github.com/mscdex/node-ftp) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](ftpd/ftpd.d.ts) [ftpd](https://github.com/sstur/nodeftpd) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](fullCalendar/fullCalendar.d.ts) [FullCalendar](http://arshaw.com/fullcalendar) by [Neil Stalker](https://github.com/nestalk), [Marcelo Camargo](https://github.com/hasellcamargo) +* [:link:](fullname/fullname.d.ts) [fullname](https://www.npmjs.com/package/fullname) by [Klaus Reimer](https://github.com/kayahr) * [:link:](fuse/fuse.d.ts) [Fuse.js](https://github.com/krisk/Fuse) by [Greg Smith](https://github.com/smrq) * [:link:](jquery-galleria/jquery-galleria.d.ts) [galleria.js](https://github.com/aino/galleria) by [Robert Imig](https://github.com/rimig) * [:link:](gamepad/gamepad.d.ts) [Gamepad API](http://www.w3.org/TR/gamepad) by [Kon](http://phyzkit.net) @@ -434,33 +472,33 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](goJS/goJS.d.ts) [GoJS](http://gojs.net) by [Northwoods Software](https://github.com/NorthwoodsSoftware) * [: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-apps-script/google-apps-script.html.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.groups.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.gmail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.calendar.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.script.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.properties.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.maps.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.url-fetch.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.optimization.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.ui.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.forms.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.document.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.content.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.mail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.drive.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.types.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.spreadsheet.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.lock.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.sites.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.groups.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.xml-service.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.sites.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.utilities.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.language.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.jdbc.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.html.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.optimization.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.url-fetch.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.properties.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.ui.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.maps.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.mail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.lock.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.language.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.types.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.base.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.cache.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.calendar.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.spreadsheet.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.charts.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.contacts.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.content.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.document.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.drive.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.forms.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.gmail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [: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 Maps JavaScript API](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk), [Chris Wrench](https://github.com/cgwrench) @@ -472,6 +510,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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) +* [:link:](google-maps/google-maps.d.ts) [google-maps](https://www.npmjs.com/package/google-maps) by [Deividas Bakanas](https://github.com/DeividasBakanas), [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) * [:link:](gae.channel.api/gae.channel.api.d.ts) [GoogleAppEngine's Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) by [vvakame](https://github.com/vvakame) * [:link:](graceful-fs/graceful-fs.d.ts) [graceful-fs](https://github.com/cowboy/graceful-fs) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](graham_scan/graham_scan.d.ts) [graham_scan](https://github.com/brian3kb/graham_scan_js) by [Harm Berntsen](https://github.com/hberntsen) @@ -486,6 +525,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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-babel/gulp-babel.d.ts) [gulp-babel](https://github.com/babel/gulp-babel) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](gulp-cached/gulp-cached.d.ts) [gulp-cached](https://github.com/wearefractal/gulp-cached) by [Thomas Corbière](https://github.com/tomc974) * [:link:](gulp-changed/gulp-changed.d.ts) [gulp-changed](https://github.com/sindresorhus/gulp-changed) by [Thomas Corbière](https://github.com/tomc974) * [:link:](gulp-cheerio/gulp-cheerio.d.ts) [gulp-cheerio](https://github.com/KenPowers/gulp-cheerio) by [Qubo](https://github.com/tkQubo) @@ -552,7 +592,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](react-router/history.d.ts) [history](https://github.com/rackt/history) by [Sergey Buturlakin](http://github.com/sergey-buturlakin) * [: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:](hopscotch/hopscotch.d.ts) [Hopscotch](http://linkedin.github.io/hopscotch) by [Tim Perry](https://github.com/pimterry) * [: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) * [:link:](html-to-text/html-to-text.d.ts) [html-to-text](https://github.com/werk85/node-html-to-text) by [Eryk Warren](https://github.com/erykwarren) @@ -566,9 +608,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](iban/iban.d.ts) [iban.js](https://github.com/arhs/iban.js) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](icepick/icepick.d.ts) [icepick](https://github.com/aearly/icepick) by [Nathan Brown](https://github.com/ngbrown) * [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz) * [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](imagemagick-native/imagemagick-native.d.ts) [imagemagick-native](https://www.npmjs.org/package/imagemagick-native) by [Hiroki Horiuchi](https://github.com/horiuchi) @@ -578,6 +621,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov) * [:link:](incremental-dom/incremental-dom.d.ts) [Incremetal DOM](https://github.com/google/incremental-dom) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) +* [:link:](inherits/inherits.d.ts) [inherits](https://github.com/isaacs/inherits) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](ini/ini.d.ts) [ini](https://github.com/isaacs/ini) by [Marcin Porębski](https://github.com/marcinporebski) * [:link:](iniparser/iniparser.d.ts) [iniparser](https://github.com/shockie/node-iniparser) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](inline-css/inline-css.d.ts) [inline-css](https://github.com/jonkemp/inline-css) by [Philip Spain](https://github.com/philipisapain) @@ -598,6 +642,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](iscroll/iscroll-lite.d.ts) [iScroll Lite](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](iscroll/iscroll-5-lite.d.ts) [iScroll Lite 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](iso8601-localizer/iso8601-localizer.d.ts) [ISO8601-Localizer](https://github.com/avielfedida/ISO8601-Localizer) by [Aviel Fedida](https://github.com/avielfedida) +* [:link:](istanbul/istanbul.d.ts) [Istanbul](https://github.com/gotwarlost/istanbul) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](ix.js/ix.d.ts) [IxJS 1.0.6 / ix.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](ix.js/l2o.d.ts) [IxJS 1.0.6 / l2o.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](jade/jade.d.ts) [jade](https://github.com/jadejs/jade) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) @@ -606,6 +651,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) * [:link:](jasmine-ajax/jasmine-ajax.d.ts) [jasmine-ajax](https://github.com/jasmine/jasmine-ajax) by [Louis Grignon](https://github.com/lgrignon) * [:link:](jasmine-es6-promise-matchers/jasmine-es6-promise-matchers.d.ts) [jasmine-es6-promise-matchers](https://github.com/bvaughn/jasmine-es6-promise-matchers) by [Stephen Lautier](https://github.com/stephenlautier) +* [:link:](jasmine-expect/jasmine-expect.d.ts) [jasmine-expect](https://github.com/JamieMason/Jasmine-Matchers) by [UserPixel](https://github.com/UserPixel) * [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) * [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) * [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) @@ -614,6 +660,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](javascript-bignum/javascript-bignum.d.ts) [javascript-bignum](https://github.com/jtobey/javascript-bignum) by [Nathan Shively-Sanders](https://github.com/sandersn) * [: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) @@ -621,7 +668,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157) * [:link:](joData/joData.d.ts) [joData](https://github.com/mccow002/joData) by [Chris Wrench](https://github.com/cgwrench) * [:link:](johnny-five/johnny-five.d.ts) [johnny-five](https://github.com/rwaldron/johnny-five) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds), [Laurence Dougal Myers](https://github.com/laurence-myers), [Christopher Glantschnig](https://github.com/cglantschnig) +* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds), [Laurence Dougal Myers](https://github.com/laurence-myers), [Christopher Glantschnig](https://github.com/cglantschnig), [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman), [Ewout Van Gossum](https://github.com/DenEwout) * [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz) * [:link:](jquery/jquery.d.ts) [jQuery 1.10.x / 2.0.x](http://jquery.com) by [Boris Yankov](https://github.com/borisyankov), [Christian Hoffmeister](https://github.com/choffmeister), [Steve Fenton](https://github.com/Steve-Fenton), [Diullei Gomes](https://github.com/Diullei), [Tass Iliopoulos](https://github.com/tasoili), [Jason Swearingen](https://github.com/jasons-novaleaf), [Sean Hill](https://github.com/seanski), [Guus Goossens](https://github.com/Guuz), [Kelly Summerlin](https://github.com/ksummerlin), [Basarat Ali Syed](https://github.com/basarat), [Nicholas Wolverson](https://github.com/nwolverson), [Derek Cicerone](https://github.com/derekcicerone), [Andrew Gaspar](https://github.com/AndrewGaspar), [James Harrison Fisher](https://github.com/jameshfisher), [Seikichi Kondo](https://github.com/seikichi), [Benjamin Jackman](https://github.com/benjaminjackman), [Poul Sorensen](https://github.com/s093294), [Josh Strobl](https://github.com/JoshStrobl), [John Reilly](https://github.com/johnnyreilly), [Dick van den Brink](https://github.com/DickvdBrink) @@ -637,6 +684,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone) * [:link:](jqgrid/jqgrid.d.ts) [jQuery jqgrid Plugin](https://github.com/tonytomov/jqGrid) by [Lokesh Peta](https://github.com/lokeshpeta) * [:link:](jquery-knob/jquery-knob.d.ts) [jQuery Knob](http://anthonyterrien.com/knob) by [Iain Buchanan](https://github.com/iain8) +* [:link:](jquery.mmenu/jquery.mmenu.d.ts) [jQuery mmenu](http://mmenu.frebsite.nl) by [John Gouigouix](https://github.com/orchestra-ts/DefinitelyTyped) * [:link:](jquerymobile/jquerymobile.d.ts) [jQuery Mobile](http://jquerymobile.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](jquery.notifyBar/jquery.notifyBar.d.ts) [jQuery Notify Bar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar) by [Shunsuke Ohtani](https://github.com/zaneli) * [:link:](jquery.base64/jquery.base64.d.ts) [jQuery Plugin - base64 codec](https://github.com/yatt/jquery.base64) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) @@ -688,6 +736,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence), [Neil Culver](https://github.com/EnableSoftware) * [:link:](jquery.pnotify/jquery.pnotify.d.ts) [jquery.pnotify 2.x](https://github.com/sciactive/pnotify) by [David Sichau](https://github.com/DavidSichau) * [:link:](jquery.qrcode/jquery.qrcode.d.ts) [jQuery.qrcode](https://github.com/lrsjng/jquery-qrcode) by [Dan Manastireanu](https://github.com/danmana) +* [:link:](raty/raty.d.ts) [jQuery.raty](https://github.com/wbotelhos/raty) by [Matt Wheatley](http://github.com/terrawheat) * [:link:](jquery.scrollTo/jquery.scrollTo.d.ts) [jQuery.scrollTo.js](https://github.com/flesler/jquery.scrollTo) by [Neil Stalker](https://github.com/nestalk) * [:link:](form-serializer/form-serializer.d.ts) [jquery.serialize-object](https://github.com/macek/jquery-serialize-object) by [Florian Wagner](https://github.com/flqw) * [:link:](jquery.simulate/jquery.simulate.d.ts) [jquery.simulate.js](https://github.com/jquery/jquery-simulate) by [Derek Cicerone](https://github.com/derekcicerone) @@ -704,8 +753,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) * [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) * [:link:](js-beautify/js-beautify.d.ts) [js_beautify](https://github.com/beautify-web/js-beautify) by [Josh Goldberg](https://github.com/JoshuaKGoldberg) -* [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb) +* [:link:](js-combinatorics/js-combinatorics.d.ts) [js-combinatorics](https://github.com/dankogai/js-combinatorics) by [Vasya Aksyonov](https://github.com/outring) +* [:link:](js-combinatorics/js-combinatorics-global.d.ts) [js-combinatorics (global)](https://github.com/dankogai/js-combinatorics) by [Vasya Aksyonov](https://github.com/outring) * [:link:](ua-parser-js/ua-parser-js.d.ts) [js-cookie](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper) +* [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb) * [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](js-md5/md5.d.ts) [js-md5](https://github.com/emn178/js-md5) by [Roland Greim](https://github.com/tigerxy) @@ -736,17 +787,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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) * [:link:](jsrender/jsrender.d.ts) [JsRender](http://www.jsviews.com/#jsrender) by [Kensuke Matsuzaki](https://github.com/zakki) -* [:link:](jssha/jssha.d.ts) [jsSHA](https://github.com/Caligatio/jsSHA) by [David Li](https://github.com/randombk) +* [:link:](jssha/jssha.d.ts) [jsSHA](https://github.com/Caligatio/jsSHA) by [David Li](https://github.com/randombk), [Tobias Kahlert](https://github.com/SrTobi) * [: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:](jsts/jsts.d.ts) [jsts](https://github.com/bjornharrtell/jsts) by [Stephane Alie](https://github.com/StephaneAlie) * [:link:](jsuri/jsuri.d.ts) [jsUri](https://github.com/derek-watson/jsUri) by [Chris Charabaruk](http://github.com/coldacid), [Florian Wagner](http://github.com/flqw) +* [:link:](jsurl/jsurl.d.ts) [jsurl](https://github.com/Mikhus/jsurl) by [Alexey Gorshkov](https://github.com/agorshkov23) * [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher) * [:link:](jug/jug.d.ts) [jug](https://github.com/kaiquewdev/Graph) by [yevt](https://github.com/yevt) * [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc) +* [:link:](jwt-decode/jwt-decode.d.ts) [jwt-decode](https://github.com/auth0/jwt-decode) by [Giedrius Grabauskas](https://github.com/QuatroDevOfficial) * [:link:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev) * [:link:](kafka-node/kafka-node.d.ts) [kafka-node](https://github.com/SOHU-Co/kafka-node) by [Daniel Imrie-Situnayake](https://github.com/dansitu) * [:link:](karma/karma.d.ts) [karma](https://github.com/karma-runner/karma) by [Tanguy Krotoff](https://github.com/tkrotoff) +* [:link:](karma-coverage/karma-coverage.d.ts) [karma-coverage](https://github.com/karma-runner/karma-coverage) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) * [:link:](katex/katex.d.ts) [KaTeX v.0.5.0](http://khan.github.io/KaTeX) by [Michael Randolph](https://github.com/mrand01) * [:link:](kefir/kefir.d.ts) [Kefir](http://rpominov.github.io/kefir) by [Aya Morisawa](https://github.com/AyaMorisawa) @@ -754,6 +808,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) * [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) * [:link:](keypress/keypress.d.ts) [Keypress](https://github.com/dmauro/Keypress) by [Roger Chen](https://github.com/rcchen) +* [:link:](keytar/keytar.d.ts) [keytar](http://atom.github.io/node-keytar) by [Milan Burda](https://github.com/miniak) * [:link:](kii-cloud-sdk/kii-cloud-sdk.d.ts) [Kii Cloud SDK](http://en.kii.com) by [Kii Consortium](http://jp.kii.com/consortium) * [:link:](kineticjs/kineticjs.d.ts) [KineticJS](http://kineticjs.com) by [Basarat Ali Syed](http://www.github.com/basarat), [Ralph de Ruijter](http://www.superdopey.nl/techblog) * [:link:](knex/knex.d.ts) [Knex.js](https://github.com/tgriesser/knex) by [Qubo](https://github.com/tkQubo) @@ -792,9 +847,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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 [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:](lestate/lestate.d.ts) [LeState](https://github.com/LeTools/LeState) by [Hadrian Oliveira](https://github.com/thelambdaparty) * [:link:](level-sublevel/level-sublevel.d.ts) [level-sublevel](https://github.com/dominictarr/level-sublevel) by [Bas Pennings](https://github.com/basp) * [: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:](lwip/lwip.d.ts) [Light-weight image processor](https://github.com/EyalAr/lwip) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](lime-js/lime-js.d.ts) [lime-js](https://github.com/takenet/lime-js) by [Arthur Xavier](https://github.com/arthur-xavier) * [:link:](line-reader/line-reader.d.ts) [line-reader](https://github.com/nickewing/line-reader) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](dustjs-linkedin/dustjs-linkedin.d.ts) [linkedin dustjs](https://github.com/linkedin/dustjs) by [Marcelo Dezem](http://github.com/mdezem) * [:link:](linq/linq.jquery.d.ts) [linq.jquery (from linq.js)](http://linqjs.codeplex.com) by [neuecc](http://www.codeplex.com/site/users/view/neuecc) @@ -802,6 +860,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](linqsharp/linqsharp.d.ts) [linqsharp](https://www.npmjs.com/package/linqsharp) by [Bruno Leonardo Michels](https://github.com/brunolm) * [:link:](jquery.livestampjs/jquery.livestampjs.d.ts) [Livestamp.js](http://mattbradley.github.com/livestampjs) by [Vincent Bortone](https://github.com/vbortone) * [:link:](lodash/lodash.d.ts) [Lo-Dash](http://lodash.com) by [Brian Zengel](https://github.com/bczengel), [Ilya Mochalov](https://github.com/chrootsu) +* [:link:](lobibox/lobibox.d.ts) [lobibox](https://github.com/arboshiki/lobibox) by [Sabeeh Ul Hussnain](https://github.com/itboy87) * [:link:](lockfile/lockfile.d.ts) [lockfile](https://github.com/isaacs/lockfile) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](lodash-decorators/lodash-decorators.d.ts) [lodash-decorators](https://github.com/steelsojka/lodash-decorators) by [Qubo](https://github.com/tkqubo) * [:link:](log4javascript/log4javascript.d.ts) [log4javascript](http://log4javascript.org) by [Markus Wagner](https://github.com/Ritzlgrmft) @@ -812,7 +871,7 @@ 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:](lokijs/lokijs.d.ts) [lokijs](https://github.com/techfort/LokiJS) by [TeamworkGuy2](https://github.com/TeamworkGuy2) * [: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 [Peter Kooijmans](https://github.com/peterkooijmans) +* [:link:](long/long.d.ts) [long.js](https://github.com/dcodeIO/long.js) by [Peter Kooijmans](https://github.com/peterkooijmans) * [:link:](lory.js/lory.js.d.ts) [lory](https://github.com/meandmax/lory) by [kubosho](https://github.com/kubosho) * [:link:](lovefield/lovefield.d.ts) [Lovefield](http://google.github.io/lovefield) by [freshp86](https://github.com/freshp86) * [:link:](lower-case/lower-case.d.ts) [lower-case](https://github.com/blakeembrey/lower-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) @@ -836,6 +895,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mariasql/mariasql.d.ts) [mariasql](https://github.com/mscdex/node-mariasql) by [MichaelBennett](https://github.com/bennett000) * [:link:](marionette/marionette.d.ts) [Marionette](https://github.com/marionettejs) by [Zeeshan Hamid](https://github.com/zhamid), [Natan Vivo](https://github.com/nvivo), [Sven Tschui](https://github.com/sventschui) * [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr) +* [:link:](ngwysiwyg/ngwysiwyg.d.ts) [Marked](https://github.com/psergus/ngWYSIWYG) by [Patrick Mac Kay](https://github.com/patrick-mackay) * [:link:](markerclustererplus/markerclustererplus.d.ts) [MarkerClustererPlus for Google Maps V3](http://github.com/mahnunchik/markerclustererplus) by [Mathias Rodriguez](http://github.com/enanox) * [:link:](markitup/markitup.d.ts) [markitup 1.x](https://github.com/markitup/1.x) by [drillbits](https://github.com/drillbits) * [:link:](maskedinput/maskedinput.d.ts) [Masked Input plugin for jQuery](http://digitalbush.com/projects/masked-input-plugin) by [Lokesh Peta](https://github.com/lokeshpeta) @@ -881,21 +941,24 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mixto/mixto.d.ts) [mixto](https://github.com/atom/mixto) by [vvakame](https://github.com/vvakame) * [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical) +* [:link:](mmmagic/mmmagic.d.ts) [mmmagic](https://github.com/mscdex/mmmagic) by [Andrei Sebastian Cîmpean](http://andreime.com) * [:link:](mobile-detect/mobile-detect.d.ts) [mobile-detect](http://hgoebl.github.io/mobile-detect.js) by [Martin McWhorter](https://github.com/martinmcwhorter) -* [:link:](mobservable-react/mobservable-react.d.ts) [mobservable](https://github.com/mweststrate/mobservable-react) by [Michel Weststrate](https://github.com/mweststrate) * [:link:](mobservable/mobservable.d.ts) [mobservable](https://mweststrate.github.io/mobservable) by [Michel Weststrate](https://github.com/mweststrate) +* [:link:](mobservable-react/mobservable-react.d.ts) [mobservable](https://github.com/mweststrate/mobservable-react) by [Michel Weststrate](https://github.com/mweststrate) * [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight) * [:link:](mocha/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame) * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) * [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157) * [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000) -* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [Leon Yu](https://github.com/leonyu) * [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) -* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) -* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) * [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert) +* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) +* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) * [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov) * [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi) +* [:link:](mongoose-auto-increment/mongoose-auto-increment.d.ts) [mongoose-auto-increment](https://github.com/codetunnel/mongoose-auto-increment) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](mongoose-deep-populate/mongoose-deep-populate.d.ts) [mongoose-deep-populate](https://github.com/buunguyen/mongoose-deep-populate) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](mongoose-mock/mongoose-mock.d.ts) [mongoose-mock](https://github.com/JohanObrink/mongoose-mock) by [jt000](https://github.com/jt000) * [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction) * [: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) @@ -910,7 +973,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](msportalfx-test/msportalfx-test.d.ts) [msportalfx-test](https://msazure.visualstudio.com/DefaultCollection/AzureUX/_git/portalfx-msportalfx-test) by [Julio Casal](https://github.com/julioct) * [:link:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com), [Ben Farr](https://github.com/jaminfarr) * [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) -* [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000), [vilicvane](https://vilic.github.io) +* [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000), [vilicvane](https://vilic.github.io), [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](multiplexjs/multiplexjs.d.ts) [Multiplex.js](http://github.com/multiplex/multiplex.js) by [Kamyar Nazeri](http://github.com/KamyarNazeri) * [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell) * [:link:](natural/natural.d.ts) [Natural](https://github.com/NaturalNode/natural) by [Dylan R. E. Moonfire](https://github.com/dmoonfire) @@ -925,23 +988,30 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ng-flow/ng-flow.d.ts) [ng-flow](https://github.com/flowjs/ng-flow) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper) * [:link:](angular-idle/angular-idle.d.ts) [ng-idle](http://hackedbychinese.github.io/ng-idle) by [mthamil](https://github.com/mthamil) +* [:link:](ng-notify/ng-notify.d.ts) [ng-notify](https://github.com/matowens/ng-notify) by [Nick Zamosenchuk](https://github.com/nzamosenchuk) * [:link:](ngbootbox/ngbootbox.d.ts) [ngbootbox](https://github.com/eriktufvesson/ngBootbox) by [Sam Saint-Pettersen](https://github.com/stpettersens) +* [:link:](ng-cordova/actionSheet.d.ts) [ngCordova Action Sheet plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) * [:link:](ng-cordova/appAvailability.d.ts) [ngCordova AppAvailability plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) -* [:link:](ng-cordova/datepicker.d.ts) [ngCordova datepicker plugin](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) +* [:link:](ng-cordova/badge.d.ts) [ngCordova badge plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) * [:link:](ng-cordova/app-version.d.ts) [ngCordova datepicker plugin](https://github.com/driftyco/ng-cordova) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) +* [:link:](ng-cordova/datepicker.d.ts) [ngCordova datepicker plugin](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) * [:link:](ng-cordova/deviceMotion.d.ts) [ngCordova device motion plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-cordova/deviceOrientation.d.ts) [ngCordova device orientation plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-cordova/device.d.ts) [ngCordova device plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-cordova/dialogs.d.ts) [ngCordova dialogs plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-cordova/emailComposer.d.ts) [ngCordova emailComposer plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/file.d.ts) [ngCordova file plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [:link:](ng-cordova/fileTransfer.d.ts) [ngCordova file-transfer plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) * [:link:](ng-cordova/geolocation.d.ts) [ngCordova geolocation plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-cordova/network.d.ts) [ngCordova network plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-cordova/tsd.d.ts) [ngCordova plugins](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-cordova/toast.d.ts) [ngCordova toast plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/camera.d.ts) [ngCordova.plugins.camera](https://github.com/driftyco/ng-cordova) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) * [:link:](ng-dialog/ng-dialog.d.ts) [ngDialog](https://github.com/likeastore/ngDialog) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](ngkookies/ngkookies.d.ts) [ngKookes](https://github.com/voronianski/ngKookies) by [Martin McWhorter](https://github.com/martinmcwhorter) * [:link:](ngprogress/ngprogress.d.ts) [ngProgress](http://victorbjelkholm.github.io/ngProgress) by [Martin McWhorter](https://github.com/martinmcwhorter) * [:link:](ngprogress-lite/ngprogress-lite.d.ts) [ngprogress-lite](https://github.com/voronianski/ngprogress-lite) by [Luke Forder](https://github.com/LukeForder) +* [:link:](ng-stomp/ng-stomp.d.ts) [ngStomp](https://github.com/beevelop/ng-stomp) by [Lukasz Potapczuk](https://github.com/lpotapczuk) * [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi) * [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook) * [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) @@ -959,6 +1029,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](config/config.d.ts) [node-config](https://github.com/lorenwest/node-config) by [Roman Korneev](https://github.com/RWander) * [:link:](node-config-manager/node-config-manager.d.ts) [node-config-manager](https://www.npmjs.com/package/node-config-manager) by [TANAKA Koichi](https://gitnub.com/mugeso) * [:link:](convict/convict.d.ts) [node-convict](https://github.com/mozilla/node-convict) by [Wim Looman](https://github.com/Nemo157) +* [:link:](node-dir/node-dir.d.ts) [node-dir](https://github.com/fshost/node-dir) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) +* [:link:](email-templates/email-templates.d.ts) [node-email-templates](https://github.com/niftylettuce/node-email-templates) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](node-ffi/node-ffi.d.ts) [node-ffi](https://github.com/rbranson/node-ffi) by [Paul Loyd](https://github.com/loyd) * [:link:](node-fibers/node-fibers.d.ts) [node-fibers](https://github.com/laverdet/node-fibers) by [Cary Haynie](https://github.com/caryhaynie) * [:link:](node-form/node-form.d.ts) [node-form](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) @@ -980,10 +1052,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](node-slack/node-slack.d.ts) [node-slack](https://github.com/xoxco/node-slack) by [Qubo](https://github.com/tkQubo) * [:link:](srp/srp.d.ts) [node-srp](https://github.com/mozilla/node-srp) by [Pat Smuk](https://github.com/Patman64) * [:link:](stack-trace/stack-trace.d.ts) [node-stack-trace](https://github.com/felixge/node-stack-trace) by [Exceptionless](https://github.com/exceptionless) -* [:link:](node-uuid/node-uuid-base.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) * [:link:](node-uuid/node-uuid-cjs.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) -* [:link:](node-uuid/node-uuid-global.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-uuid/node-uuid-base.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) * [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-uuid/node-uuid-global.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) * [:link:](node-validator/node-validator.d.ts) [node-validator](https://www.npmjs.com/package/node-validator) by [Ken Gorab](https://github.com/kengorab) * [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments) * [: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) @@ -991,6 +1063,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle) * [:link:](node/node.d.ts) [Node.js v4.x](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) * [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113) +* [:link:](yandex-money-sdk/yandex-money-sdk.d.ts) [NodeJS Yandex.Money API SDK](https://github.com/yandex-money/yandex-money-sdk-nodejs) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](nodemailer/nodemailer-types.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) @@ -1000,8 +1073,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) * [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj) * [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg) * [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) @@ -1026,23 +1099,25 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](OpenJsCad/openjscad.d.ts) [OpenJsCad.js](https://github.com/joostn/OpenJsCad) by [Dan Marshall](https://github.com/danmarshall) * [:link:](openlayers/openlayers.d.ts) [OpenLayers](http://openlayers.org) by [Wouter Goedhart](https://github.com/woutergd) * [:link:](openpgp/openpgp.d.ts) [openpgpjs](http://openpgpjs.org) by [Guillaume Lacasa](https://blog.lacasa.fr) -* [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn) +* [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](optimist/optimist.d.ts) [optimist](https://github.com/substack/node-optimist) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](orchestrator/orchestrator.d.ts) [Orchestrator](https://github.com/orchestrator/orchestrator) by [Qubo](https://github.com/tkQubo) * [:link:](os-locale/os-locale.d.ts) [os-locale](https://github.com/sindresorhus/os-locale) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](owlcarousel/owlcarousel.d.ts) [OwlCarousel v.1.3.3](https://github.com/OwlFonk/OwlCarousel) by [Damian Piątkowski](https://github.com/dpiatkowski) +* [:link:](p2/p2.d.ts) [p2.js](https://github.com/schteppe/p2.js) by [Clark Stevenson](https://github.com/clark-stevenson) * [:link:](packery/packery.d.ts) [Packery](http://packery.metafizzy.co) by [Piraveen Kamalathas from Kilix](https://github.com/piraveen) * [:link:](page/page.d.ts) [page](http://visionmedia.github.io/page.js) by [Alan Norbauer](http://alan.norbauer.com) +* [:link:](pako/pako.d.ts) [pako](https://github.com/nodeca/pako) by [Denis Cappellin](http://github.com/cappellin) * [:link:](papaparse/papaparse.d.ts) [PapaParse](https://github.com/mholt/PapaParse) by [Pedro Flemming](https://github.com/torpedro) * [:link:](parallel/parallel.d.ts) [parallel.js](http://adambom.github.io/parallel.js) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](param-case/param-case.d.ts) [param-case](https://github.com/blakeembrey/param-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](parse/parse.d.ts) [Parse](https://parse.com) by [Ullisen Media Group](http://ullisenmedia.com) -* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds), [Mizunashi Mana](https://github.com/mizunashi-mana) * [:link:](pascal-case/pascal-case.d.ts) [pascal-case](https://github.com/blakeembrey/pascal-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi) * [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm) -* [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-google-oauth/passport-google-oauth.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone) * [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) @@ -1085,6 +1160,7 @@ 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:](polyline/polyline.d.ts) [Polyline](https://github.com/mapbox/polyline) by [Arseniy Maximov](https://github.com/Kern0) * [:link:](polymer/polymer.d.ts) [polymer](https://github.com/Polymer/polymer) by [Louis Grignon](https://github.com/lgrignon), [Suguru Inatomi](https://github.com/laco0416) +* [:link:](polymer-ts/polymer-ts.d.ts) [PolymerTS](https://github.com/nippur72/PolymerTS) 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:](postal/postal.d.ts) [Postal](https://github.com/postaljs/postal.js) by [Lokesh Peta](https://github.com/lokeshpeta), [Paul Jolly](https://github.com/myitcv) * [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U) @@ -1099,6 +1175,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic) * [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](protobufjs/protobufjs.d.ts) [ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) +* [:link:](protractor-http-mock/protractor-http-mock.d.ts) [protractor-http-mock](https://github.com/atecarlos/protractor-http-mock) by [Crevil](https://github.com/Crevil) * [:link:](proxyquire/proxyquire.d.ts) [Proxyquire](https://github.com/thlorenz/proxyquire) by [jt000](https://github.com/jt000) * [:link:](pty.js/pty.js.d.ts) [pty.js 0.2.7-1](https://github.com/chjj/pty.js) by [Vadim Macagon](https://github.com/enlight) * [:link:](pubsubjs/pubsub.d.ts) [PubSubJS](https://github.com/mroderick/PubSubJS) by [Boris Yankov](https://github.com/borisyankov) @@ -1110,6 +1187,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade) * [:link:](qs/qs.d.ts) [qs](https://github.com/hapijs/qs) by [Roman Korneev](https://github.com/RWander) * [:link:](qtip2/qtip2.d.ts) [qtip2](http://qtip2.com) by [Nathan Pitman](https://github.com/Seltzer) +* [:link:](query-string/query-string.d.ts) [query-string](https://github.com/sindresorhus/query-string) by [Sam Verschueren](https://github.com/SamVerschueren) * [:link:](quixote/quixote.d.ts) [quixote](http://quixote-css.com) by [Aleksandr Filatov](https://github.com/greybax) * [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) * [:link:](qwest/qwest.d.ts) [qwest](https://github.com/pyrsmk/qwest) by [Lindsay Evans](https://github.com/lindsayevans) @@ -1119,13 +1197,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rangy/rangy.d.ts) [Rangy](https://github.com/timdown/rangy) by [Rudolph Gottesheim](http://www.midnight-design.at) * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](rappid/rappid.d.ts) [Rappid](http://jointjs.com/about-rappid) by [Ewout Van Gossum](https://github.com/DenEwout) +* [:link:](ratelimiter/ratelimiter.d.ts) [ratelimiter](https://github.com/tj/node-ratelimiter) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) * [:link:](raygun4js/raygun4js.d.ts) [raygun4js](https://github.com/MindscapeHQ/raygun4js) by [Brian Surowiec](https://github.com/xt0rted) +* [:link:](rcloader/rcloader.d.ts) [rcloader](https://github.com/spalger/rcloader) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) * [:link:](react/react.d.ts) [React](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-global.d.ts) [React (namespace)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-addons-create-fragment.d.ts) [React (react-addons-create-fragment)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) -* [:link:](react/react-addons-shallow-compare.d.ts) [React (react-addons-css-transition-group)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-addons-css-transition-group.d.ts) [React (react-addons-css-transition-group)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-shallow-compare.d.ts) [React (react-addons-css-transition-group)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-addons-linked-state-mixin.d.ts) [React (react-addons-linked-state-mixin)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-addons-perf.d.ts) [React (react-addons-perf)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-addons-pure-render-mixin.d.ts) [React (react-addons-pure-render-mixin)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) @@ -1134,16 +1214,19 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](react/react-addons-update.d.ts) [React (react-addons-update)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-dom.d.ts) [React (react-dom)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react-dnd/react-dnd.d.ts) [React DnD](https://github.com/gaearon/react-dnd) by [Asana](https://asana.com) -* [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17) * [:link:](react-bootstrap/react-bootstrap.d.ts) [react-bootstrap](https://github.com/react-bootstrap/react-bootstrap) by [Walker Burgin](https://github.com/walkerburgin) +* [:link:](react-datagrid/react-datagrid.d.ts) [react-datagrid](https://github.com/zippyui/react-datagrid.git) by [Stephen Jelfs](https://github.com/stephenjelfs) * [:link:](react-day-picker/react-day-picker.d.ts) [react-day-picker](https://github.com/gpbl/react-day-picker) by [Giampaolo Bellavite](https://github.com/gpbl), [Jason Killian](https://github.com/jkillian) * [:link:](react-dropzone/react-dropzone.d.ts) [react-dropzone](https://github.com/paramaggarwal/react-dropzone) by [Mathieu Larouche Dube](https://github.com/matdube) +* [:link:](react-infinite/react-infinite.d.ts) [react-infinite](https://github.com/seatgeek/react-infinite) by [rhysd](https://github.com/rhysd) * [:link:](react-input-calendar/react-input-calendar.d.ts) [react-input-calendar](https://github.com/Rudeg/react-input-calendar) by [Stepan Mikhaylyuk](https://github.com/stepancar) * [:link:](react-intl/react-intl.d.ts) [react-intl](http://formatjs.io/react) by [Bruno Grieder](https://github.com/bgrieder), [Christian Droulers](https://github.com/cdroulers) * [:link:](react-mixin/react-mixin.d.ts) [react-mixin](https://github.com/brigand/react-mixin) by [Qubo](https://github.com/tkqubo) * [:link:](react-native/react-native.d.ts) [react-native](https://github.com/facebook/react-native) by [Bruno Grieder](https://github.com/bgrieder) * [:link:](react-props-decorators/react-props-decorators.d.ts) [react-props-decorators](https://github.com/popkirby/react-props-decorators) by [Qubo](https://github.com/tkqubo) * [:link:](react-redux/react-redux.d.ts) [react-redux](https://github.com/rackt/react-redux) by [Qubo](https://github.com/tkqubo) +* [:link:](react-router/react-router.d.ts) [react-router](https://github.com/rackt/react-router) by [Sergey Buturlakin](http://github.com/sergey-buturlakin), [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17) +* [:link:](react-select/react-select.d.ts) [react-select](https://github.com/JedWatson/react-select) by [ESQUIBET Hugo](https://github.com/Hesquibet) * [:link:](react-spinkit/react-spinkit.d.ts) [react-spinkit](https://github.com/KyleAMathews/react-spinkit) by [Qubo](https://github.com/tkqubo) * [:link:](react-swf/react-swf.d.ts) [react-swf](https://github.com/syranide/react-swf) by [Stepan Mikhaylyuk](https://github.com/stepancar) * [:link:](read/read.d.ts) [read](https://github.com/isaacs/read) by [Tim JK](https://github.com/timjk) @@ -1155,11 +1238,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](redux-action-utils/redux-action-utils.d.ts) [redux-action-utils](https://github.com/insin/redux-action-utils) by [Qubo](https://github.com/tkqubo) * [:link:](redux-actions/redux-actions.d.ts) [redux-actions](https://github.com/acdlite/redux-actions) by [Jack Hsu](https://github.com/jaysoo) * [:link:](redux-devtools/redux-devtools.d.ts) [redux-devtools](https://github.com/gaearon/redux-devtools) by [Qubo](https://github.com/tkqubo) +* [:link:](redux-form/redux-form.d.ts) [redux-form](https://github.com/erikras/redux-form) by [Daniel Lytkin](https://github.com/aikoven) * [:link:](redux-logger/redux-logger.d.ts) [redux-logger](https://github.com/fcomb/redux-logger) by [Alexander Rusakov](https://github.com/arusakov) * [:link:](redux-thunk/redux-thunk.d.ts) [redux-thunk](https://github.com/gaearon/redux-thunk) by [Qubo](https://github.com/tkqubo) -* [: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) -* [:link:](ref-struct/ref-struct.d.ts) [ref-struct](https://github.com/TooTallNate/ref-struct) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) * [:link:](reflux/reflux.d.ts) [RefluxJS](https://github.com/reflux/refluxjs) by [Maurice de Beijer](https://github.com/mauricedb) * [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds), [Joe Skeen](http://github.com/joeskeen) @@ -1186,6 +1268,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson) * [:link:](rsmq/rsmq.d.ts) [rsmq](http://smrchy.github.io/rsmq) by [Qubo](https://github.com/MugeSo) * [:link:](rsmq-worker/rsmq-worker.d.ts) [rsmq-worker](http://smrchy.github.io/rsmq/rsmq-worker) by [TANAKA Koichi](https://github.com/MugeSo) +* [:link:](rss/rss.d.ts) [rss](https://github.com/dylang/node-rss) by [Second Datke](https://github.com/secondwtq) * [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz) * [:link:](run-sequence/run-sequence.d.ts) [run-sequence](https://github.com/OverZealous/run-sequence) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](rx/rx.d.ts) [RxJS](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) @@ -1203,7 +1286,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rx/rx.time.d.ts) [RxJS-Time](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) * [:link:](rx/rx.virtualtime.d.ts) [RxJS-VirtualTime](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) * [:link:](s3-uploader/s3-uploader.d.ts) [s3-uploader](https://www.npmjs.com/package/s3-uploader) by [COLSA Corporation](http://www.colsa.com) +* [:link:](s3rver/s3rver.d.ts) [S3rver](https://github.com/jamhall/s3rver) by [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising) +* [:link:](sandboxed-module/sandboxed-module.d.ts) [sandboxed-module](https://github.com/felixge/node-sandboxed-module) by [Sven Reglitzki](https://github.com/svi3c) * [: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) @@ -1212,6 +1297,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](scalike/scalike.d.ts) [scalike API](https://github.com/ryoppy/scalike-typescript) by [ryoppy](https://github.com/ryoppy) * [:link:](screenfull/screenfull.d.ts) [screenfull.js](https://github.com/sindresorhus/screenfull.js) by [Ilia Choly](http://github.com/icholy) * [:link:](scrolltofixed/scrolltofixed.d.ts) [ScrollToFixed](https://github.com/bigspotteddog/ScrollToFixed) by [Ben Dixon](https://github.com/bmdixon) +* [:link:](scrypt-async/scrypt-async.d.ts) [scrypt-async](https://github.com/dchest/scrypt-async-js) by [Kaur Kuut](https://github.com/xStrom) * [:link:](seedrandom/seedrandom.d.ts) [seedrandom](https://github.com/davidbau/seedrandom) by [Kern Handa](https://github.com/kernhanda) * [:link:](segment-analytics/segment-analytics.d.ts) [Segment's analytics.js](https://segment.com/docs/libraries/analytics.js) by [Andrew Fong](https://github.com/fongandrew) * [:link:](analytics-node/analytics-node.d.ts) [Segment's analytics.js for Node.js](https://segment.com/docs/libraries/node) by [Andrew Fong](https://github.com/fongandrew) @@ -1226,6 +1312,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sequelize-fixtures/sequelize-fixtures.d.ts) [Sequelize-Fixtures](https://github.com/domasx2/sequelize-fixtures) by [Christian Schwarz](https://github.com/cschwarz) * [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery) +* [:link:](serve-index/serve-index.d.ts) [serve-index](https://github.com/expressjs/serve-index) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](sharepoint/SharePoint.d.ts) [SharePoint 2010 and 2013](https://github.com/gandjustas/sptypescript) by [Stanislav Vyshchepan](http://blog.gandjustas.ru), [Andrey Markeev](http://markeev.com) @@ -1234,11 +1321,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](should-promised/should-promised.d.ts) [should-promised](https://github.com/shouldjs/promised) by [Yaroslav Admin](https://github.com/devoto13) * [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon) +* [:link:](shuffle-array/shuffle-array.d.ts) [shuffle-array](https://github.com/pazguille/shuffle-array) by [rhysd](https://rhysd.github.io) * [:link:](siesta/siesta.d.ts) [Siesta](http://www.bryntum.com/products/siesta) by [bquarmby](https://github.com/bquarmby) * [:link:](sigmajs/sigmajs.d.ts) [sigma.js](https://github.com/jacomyal/sigma.js) by [Qinfeng Chen](https://github.com/qinfchen) * [:link:](signalr/signalr.d.ts) [SignalR](http://www.asp.net/signalr) by [Boris Yankov](https://github.com/borisyankov), [T. Michael Keesey](https://github.com/keesey) * [:link:](signature_pad/signature_pad.d.ts) [signature_pad](https://github.com/szimek/signature_pad) by [Abubaker Bashir](https://github.com/AbubakerB) * [: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:](simple-mock/simple-mock.d.ts) [simple-mock](https://github.com/jupiter/simple-mock) by [Leon Yu](https://github.com/leonyu) * [:link:](simplebar/simplebar.d.ts) [simplebar.js](https://github.com/Grsmto/simplebar) by [Gregor Woiwode](https://github.com/gregonnet) * [:link:](jquery.simplemodal/jquery.simplemodal.d.ts) [SimpleModal](http://www.ericmmartin.com/projects/simplemodal) by [Friedrich von Never](https://github.com/ForNeVeR) * [:link:](simplestorage.js/simplestorage.js.d.ts) [simpleStorage](https://github.com/andris9/simpleStorage) by [Áxel Costas Pena](https://github.com/axelcostaspena) @@ -1259,6 +1348,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages) * [:link:](socket.io-client/socket.io-client.d.ts) [socket.io-client](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages) * [:link:](socket.io.users/socket.io.users.d.ts) [socket.io.users](https://github.com/nodets/socket.io.users) by [Makis Maropoulos](https://github.com/kataras) +* [:link:](socketty/socketty.d.ts) [Socketty](https://www.npmjs.com/package/socketty) by [Nax](https://github.com/Nax) * [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) * [:link:](sockjs-client/sockjs-client.d.ts) [sockjs-client](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev), [Alexander Rusakov](https://github.com/arusakov) * [:link:](sockjs-node/sockjs-node.d.ts) [sockjs-node 0.3.x](https://github.com/sockjs/sockjs-node) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) @@ -1272,6 +1362,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](sql.js/sql.js.d.ts) [sql.js](https://github.com/kripken/sql.js) by [George Wu](https://github.com/Hozuki) * [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti) * [:link:](squirejs/squirejs.d.ts) [Squire](https://github.com/iammerrick/Squire.js) by [Bradley Ayers](https://github.com/bradleyayers) * [:link:](ssh2/ssh2.d.ts) [ssh2](https://github.com/mscdex/ssh2) by [Qubo](https://github.com/tkQubo) @@ -1285,13 +1376,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](status-bar/status-bar.d.ts) [status-bar](https://github.com/atom/status-bar) by [vvakame](https://github.com/vvakame) * [:link:](statuses/statuses.d.ts) [statuses](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](steam/steam.d.ts) [steam](https://github.com/seishun/node-steam) by [Andrey Kurdyumov](https://github.com/kant2002) +* [:link:](slick-carousel/slick-carousel.d.ts) [stick](http://kenwheeler.github.io/slick) by [John Gouigouix](https://github.com/orchestra-ts/DefinitelyTyped) * [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone) * [: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:](streamjs/streamjs.d.ts) [streamjs](http://winterbe.github.io/streamjs) by [Bence Eros](https://github.com/erosb) * [:link:](string_score/string_score.d.ts) [string_score](https://github.com/joshaven/string_score) by [Marcin Porębski](https://github.com/marcinporebski) * [:link:](string/string.d.ts) [string.js](http://stringjs.com) by [Bas Pennings](https://github.com/basp) -* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com), [Eric J. Smith](https://github.com/ejsmith) +* [:link:](strip-json-comments/strip-json-comments.d.ts) [strip-json-comments](https://github.com/sindresorhus/strip-json-comments) by [Dylan R. E. Moonfire](https://github.com/dmoonfire) +* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com), [Eric J. Smith](https://github.com/ejsmith), [Amrit Kahlon](https://github.com/amritk) * [:link:](stripe-checkout/stripe-checkout.d.ts) [Stripe Checkout](https://stripe.com/checkout) by [Chris Wrench](https://github.com/cgwrench) * [: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) @@ -1299,6 +1392,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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) * [:link:](supertest/supertest.d.ts) [SuperTest](https://github.com/visionmedia/supertest) by [Alex Varju](https://github.com/varju) +* [:link:](supertest-as-promised/supertest-as-promised.d.ts) [SuperTest as Promised](https://github.com/WhoopInc/supertest-as-promised) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](svg-injector/svg-injector.d.ts) [SVG Injector](https://github.com/iconic/SVGInjector) by [Patrick Westerhoff](https://github.com/poke) * [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact) * [:link:](svg-sprite/svg-sprite.d.ts) [svg-sprite](https://github.com/jkphl/svg-sprite) by [Qubo](https://github.com/tkqubo) @@ -1310,6 +1404,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](swap-case/swap-case.d.ts) [swap-case](https://github.com/blakeembrey/swap-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [: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:](swiftclick/swiftclick.d.ts) [SwiftClick](https://github.com/munkychop/swiftclick) by [Laurence C](https://github.com/Laurence-C) * [: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:](swig-email-templates/swig-email-templates.d.ts) [swig-email-templates](https://github.com/andrewrk/swig-email-templates) by [Adam Babcock](https://github.com/mrhen) * [:link:](swipe/swipe.d.ts) [Swipe](https://github.com/thebird/Swipe) by [Andrey Kurdyumov](https://github.com/kant2002) @@ -1320,20 +1415,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](systemjs/systemjs.d.ts) [System.js](https://github.com/systemjs/systemjs) by [Ludovic HENIN](https://github.com/ludohenin), [Nathan Walker](https://github.com/NathanWalker) * [:link:](tabris/tabris.d.ts) [Tabris.js](http://tabrisjs.com) by [Tabris.js team](http://github.com/eclipsesource/tabris) * [:link:](tabtab/tabtab.d.ts) [tabtab](https://github.com/mklabs/node-tabtab) by [Vojtěch Habarta](https://github.com/vojtechhabarta) -* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds), [Haoqun Jiang](https://github.com/sodatea) * [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](tcomb/tcomb.d.ts) [tcomb](http://gcanti.github.io/tcomb/guide/index.html) by [Hans Windhoff](https://github.com/hansrwindhoff) * [:link:](tea-merge/tea-merge.d.ts) [tea-merge](https://github.com/qualiancy/tea-merge) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin) * [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](tedious-connection-pool/tedious-connection-pool.d.ts) [tedious-connection-pool](https://github.com/pekim/tedious-connection-pool) by [Cyprien Autexier](https://github.com/sandorfr) * [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com) +* [:link:](temp/temp.d.ts) [temp](https://www.npmjs.com/package/temp) by [Daniel Rosenwasser](https://github.com/DanielRosenwasser) * [:link:](temp-fs/temp-fs.d.ts) [temp-fs](https://github.com/jakwings/node-temp-fs) by [MEDIA CHECK s.r.o.](http://www.mediacheck.cz) * [:link:](tether/tether.d.ts) [Tether](http://github.hubspot.com/tether) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](tether-shepherd/tether-shepherd.d.ts) [Tether-Shepherd](http://github.hubspot.com/shepherd) by [Matt Gibbs](https://github.com/mtgibbs) * [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame) * [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613) -* [:link:](github-electron/github-electron-main.d.ts) [the Electron 0.25.2 main process](http://electron.atom.io) by [jedmao](https://github.com/jedmao) -* [:link:](github-electron/github-electron-renderer.d.ts) [the Electron 0.25.2 renderer process (web page)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) +* [:link:](spotify-api/spotify-api.d.ts) [The Spotify Web API](https://developer.spotify.com/web-api) by [Niels Kristian Hansen Skovmand](https://github.com/skovmand) * [:link:](threejs/three-FirstPersonControls.d.ts) [three.js](http://mrdoob.github.com/three.js) by [Poul Kjeldager Sørensen](https://github.com/s093294) * [:link:](threejs/three-canvasrenderer.d.ts) [three.js (CanvasRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-copyshader.d.ts) [three.js (CopyShader.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/shaders/CopyShader.js) by [Satoru Kimura](https://github.com/gyohk) @@ -1353,7 +1448,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](threejs/three.d.ts) [three.js r73](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk) * [:link:](thrift/thrift.d.ts) [thrift](https://www.npmjs.com/package/thrift) by [Zachary Collins](https://github.com/corps) * [:link:](through/through.d.ts) [through](https://github.com/dominictarr/through) by [Andrew Gaspar](https://github.com/AndrewGaspar) -* [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao) +* [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao), [Georgios Valotasios](https://github.com/valotas) * [:link:](timelinejs/timelinejs.d.ts) [timelinejs](https://github.com/NUKnightLab/TimelineJS) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](timezone-js/timezone-js.d.ts) [timezone-js](https://github.com/mde/timezone-js) by [bonnici](https://github.com/bonnici) * [:link:](timezonecomplete/timezonecomplete.d.ts) [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) by [Rogier Schouten](https://github.com/rogierschouten) @@ -1367,10 +1462,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](tooltipster/tooltipster.d.ts) [tooltipster](https://github.com/iamceege/tooltipster) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428) * [:link:](traceback/traceback.d.ts) [Traceback](http://github.com/iriscouch/traceback) by [Michael Zabka](https://github.com/misak113) +* [:link:](tracking/tracking.d.ts) [Tracking.js](https://github.com/eduardolundgren/tracking.js) by [Tim Perry](https://github.com/pimterry) * [:link:](traverson/traverson.d.ts) [Traverson](https://github.com/basti1302/traverson) by [Marcin Porębski](https://github.com/marcinporebski) * [:link:](trunk8/trunk8.d.ts) [trunk8](https://github.com/rviscomi/trunk8) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](tsmonad/tsmonad.d.ts) [TsMonad](https://github.com/cbowdon/TsMonad) by [Chris Bowdon](https://github.com/cbowdon) * [:link:](tspromise/tspromise.d.ts) [tspromise](https://github.com/soywiz/tspromise) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](turf/turf.d.ts) [Turf](http://turfjs.org) by [Guillaume Croteau](https://github.com/gcroteau) * [:link:](tween.js/tween.js.d.ts) [tween.js r12](https://github.com/sole/tween.js) by [sunetos](https://github.com/sunetos), [jzarnikov](https://github.com/jzarnikov) * [:link:](tweenjs/tweenjs.d.ts) [TweenJS](http://www.createjs.com/#!/TweenJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) * [:link:](twig/twig.d.ts) [twig](https://github.com/justjohn/twig.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) @@ -1389,9 +1486,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ui-grid/ui-grid.d.ts) [ui-grid](http://www.ui-grid.info) by [Ben Tesser](https://github.com/btesser), [Joe Skeen](http://github.com/joeskeen) * [:link:](ui-router-extras/ui-router-extras.d.ts) [UI-Router Extras (ct.ui.router.extras module)](https://github.com/christopherthielen/ui-router-extras) by [Michael Putters](https://github.com/mputters), [Marcel van de Kamp](https://github.com/marcel-k) * [:link:](uikit/uikit.d.ts) [uikit](http://getuikit.org) by [Giovanni Silva](https://github.com/giovannicandido) -* [:link:](umbraco/umbraco.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) -* [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) +* [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) +* [:link:](umbraco/umbraco.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) +* [:link:](umzug/umzug.d.ts) [Umzug](https://github.com/sequelize/umzug) by [Ivan Drinchev](https://github.com/drinchev) * [: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) @@ -1399,6 +1497,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.uniform/jquery.uniform.d.ts) [Uniform.js](https://github.com/pixelmatrix/uniform) by [flyfishMT](https://github.com/flyfishMT) * [:link:](uniq/uniq.d.ts) [uniq](https://www.npmjs.com/package/uniq) by [Hans Windhoff](https://github.com/hansrwindhoff) * [:link:](unique-random/unique-random.d.ts) [unique-random](https://github.com/sindresorhus/unique-random) by [Yuki Kokubun](https://github.com/Kuniwak) +* [:link:](winrt/winrt-uwp.d.ts) [Universal Windows Platform](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [Kagami Sascha Rosylight](https://github.com/saschanaz), [Taylor Starfield](https://github.com/taylor224) * [: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:](unorm/unorm.d.ts) [unorm](https://github.com/walling/unorm) by [Christopher Brown](https://github.com/chbrown) * [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame) @@ -1411,12 +1510,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](urlrouter/urlrouter.d.ts) [urlrouter](https://github.com/fengmk2/urlrouter) by [soywiz](https://github.com/soywiz) * [:link:](urlsafe-base64/urlsafe-base64.d.ts) [urlsafe-base64](https://github.com/RGBboy/urlsafe-base64) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](usage/usage.d.ts) [usage](https://github.com/arunoda/node-usage) by [Pascal Vomhoff](https://github.com/pvomhoff) +* [:link:](username/username.d.ts) [username](https://www.npmjs.com/package/username) by [Klaus Reimer](https://github.com/kayahr) * [:link:](utils-merge/utils-merge.d.ts) [utils-merge](https://github.com/jaredhanson/utils-merge) by [Ilya Mochalov](https://github.com/chrootsu) -* [:link:](UUID/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) +* [:link:](uuid/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) * [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient) * [:link:](validator/validator.d.ts) [validator.js](https://github.com/chriso/validator.js) by [tgfjt](https://github.com/tgfjt) * [: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:](verror/verror.d.ts) [verror](https://github.com/davepacheco/node-verror) by [Sven Reglitzki](https://github.com/svi3c) * [:link:](vex-js/vex-js.d.ts) [Vex](https://github.com/HubSpot/vex) by [Greg Cohan](https://github.com/gdcohan) * [:link:](vexflow/vexflow.d.ts) [VexFlow](http://vexflow.com) by [Roman Quiring](https://github.com/rquiring) * [:link:](victor/victor.d.ts) [Victor.js](http://victorjs.org) by [Ivane Gegia](https://twitter.com/ivanegegia) @@ -1431,7 +1532,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](vortex-web-client/vortex-web-client.d.ts) [Vortex Web 1.2.0p1](http://www.prismtech.com/vortex/vortex-web) by [Stefan Profanter](https://github.com/Pro) * [:link:](voximplant-websdk/voximplant-websdk.d.ts) [VoxImplant Web SDK 3.0.x](http://voximplant.com) by [Alexey Aylarov](https://github.com/aylarov) * [:link:](vso-node-api/vso-node-api.d.ts) [vso-node-api](https://github.com/Microsoft/vso-node-api) by [Teddy Ward](https://github.com/teddyward) -* [:link:](vue/vue.d.ts) [vuejs](https://github.com/yyx990803/vue) by [odangosan](https://github.com/odangosan) +* [:link:](vue-router/vue-router.d.ts) [vue-router](https://github.com/vuejs/vue-router) by [kaorun343](https://github.com/kaorun343) +* [:link:](vue/vue.d.ts) [vuejs](https://github.com/vuejs/vue) by [odangosan](https://github.com/odangosan), [kaorun343](https://github.com/kaorun343) +* [:link:](wake_on_lan/wake_on_lan.d.ts) [wake_on_lan](https://github.com/agnat/node_wake_on_lan) by [Tobias Kahlert](https://github.com/SrTobi) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) * [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho) @@ -1441,6 +1544,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](webcola/webcola.d.ts) [webcola](https://github.com/tgdwyer/WebCola) by [Qinfeng Chen](https://github.com/qinfchen), [Tim Dwyer](https://github.com/tgdwyer), [Noah Chen](https://github.com/nchen63) * [:link:](webcomponents.js/webcomponents.js.d.ts) [webcomponents.js](https://github.com/webcomponents/webcomponentsjs) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas) +* [:link:](webdriverio/webdriverio.d.ts) [webdriverio](http://www.webdriver.io) by [Nick Malaguti](https://github.com/nmalaguti) * [:link:](webgl-ext/webgl-ext.d.ts) [WebGL Extensions](http://webgl.org) by [Arthur Langereis](https://github.com/zenmumbler) * [:link:](webix/webix.d.ts) [Webix UI](http://webix.com) by [Maksim Kozhukh](http://github.com/mkozhukh) * [:link:](webpack/webpack.d.ts) [webpack](https://github.com/webpack/webpack) by [Qubo](https://github.com/tkqubo) @@ -1457,8 +1561,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org) * [:link:](winston/winston.d.ts) [winston](https://github.com/flatiron/winston) by [bonnici](https://github.com/bonnici), [Peter Harris](https://github.com/codeanimal) * [:link:](wolfy87-eventemitter/wolfy87-eventemitter.d.ts) [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) by [ryiwamoto](https://github.com/ryiwamoto) +* [:link:](wordcloud/wordcloud.d.ts) [wordcloud](https://github.com/timdream/wordcloud2.js) by [Joe Skeen](http://github.com/joeskeen) +* [:link:](wreck/wreck.d.ts) [wreck](https://github.com/hapijs/wreck) by [Marcin Porębski](http://github.com/marcinporebski) * [:link:](wrench/wrench.d.ts) [wrench](https://github.com/ryanmcgrath/wrench-js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](ws/ws.d.ts) [ws](https://github.com/einaros/ws) by [Paul Loyd](https://github.com/loyd) +* [:link:](wu/wu.d.ts) [wu.js](https://fitzgen.github.io/wu.js) by [phiresky](https://github.com/phiresky) * [:link:](x-editable/x-editable.d.ts) [X-Editable](http://vitalets.github.io/x-editable/index.html) by [Chris Kirby](https://github.com/sirkirby) * [:link:](x2js/xml2json.d.ts) [x2js](https://code.google.com/p/x2js) by [Horiuchi_H](https://github.com/horiuchi) * [:link:](xdate/xdate.d.ts) [XDate](http://arshaw.com/xdate) by [yamada28go](https://github.com/yamada28go) @@ -1481,7 +1588,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](yui/yui.d.ts) [yui](https://github.com/yui/yui3) by [Gia Bảo @ Sân Đình](https://github.com/giabao) * [:link:](z-schema/z-schema.d.ts) [z-schema](https://github.com/zaggino/z-schema) by [Adam Meadows](https://github.com/job13er) * [:link:](zepto/zepto.d.ts) [Zepto](http://zeptojs.com) by [Josh Baldwin](https://github.com/jbaldwin) -* [:link:](zeroclipboard/zeroclipboard.d.ts) [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) by [Eric J. Smith](https://github.com/ejsmith), [Blake Niemyjski](https://github.com/niemyjski), [György Balássy](https://github.com/balassy) +* [:link:](zeroclipboard/zeroclipboard.d.ts) [ZeroClipboard v2.x.x](https://github.com/zeroclipboard/zeroclipboard) by [Eric J. Smith](https://github.com/ejsmith), [Blake Niemyjski](https://github.com/niemyjski), [György Balássy](https://github.com/balassy), [Leon Yu](https://github.com/leonyu) * [:link:](node_zeromq/zmq.d.ts) [ZeroMQ Node](https://github.com/JustinTulloss/zeromq.node) by [Dave McKeown](http://github.com/davemckeown) * [:link:](zip.js/zip.js.d.ts) [zip.js 2.x](https://github.com/gildas-lormeau/zip.js) by [Louis Grignon](https://github.com/lgrignon) * [:link:](zone.js/zone.js.d.ts) [Zone.js](https://github.com/angular/zone.js) by [angular team](https://github.com/angular) diff --git a/angular-formly/angular-formly-tests.ts b/angular-formly/angular-formly-tests.ts index ef6a38463..01449aa4b 100644 --- a/angular-formly/angular-formly-tests.ts +++ b/angular-formly/angular-formly-tests.ts @@ -20,11 +20,23 @@ class FormConfig { name: 'customInput', extends: 'input' }); + + formlyConfig.disableWarnings = true; + formlyConfig.templateManipulators = undefined; + + formlyConfig.extras.apiCheckInstance = null; + formlyConfig.extras.defaultHideDirective = 'ng-if'; + formlyConfig.extras.disableNgModelAttrsManipulator = true; + formlyConfig.extras.errorExistsAndShouldBeVisibleExpression = angular.noop; + formlyConfig.extras.explicitAsync = true; + formlyConfig.extras.fieldTransform = angular.noop; + formlyConfig.extras.getFieldId = angular.noop; + formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound = true; } } class AppController { - fields: AngularFormly.IFieldConfigurationObject[]; + fields: AngularFormly.IFieldArray; constructor() { var vm = this; vm.fields = [ @@ -99,6 +111,21 @@ class AppController { templateOptions: { label: 'no wrapper here...' } + }, + { + //From http://angular-formly.com/#/example/other/nested-formly-forms + key: 'address', + wrapper: 'panel', + templateOptions: { label: 'Address' }, + fieldGroup: [{ + key: 'town', + type: 'input', + templateOptions: { + required: true, + type: 'text', + label: 'Town' + } + }] } ] } diff --git a/angular-formly/angular-formly.d.ts b/angular-formly/angular-formly.d.ts index fce793e7e..f42b35a89 100644 --- a/angular-formly/angular-formly.d.ts +++ b/angular-formly/angular-formly.d.ts @@ -1,7 +1,7 @@ -// Type definitions for angular-formly 6.18.0 +// Type definitions for angular-formly 7.2.3 // Project: https://github.com/formly-js/angular-formly // Definitions by: Scott Hatcher -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -16,18 +16,23 @@ declare module 'angular-formly' { declare module AngularFormly { + interface IFieldArray extends Array { + + } interface IFieldGroup { data?: Object; className?: string; - elementAttributes?: { [key: string]: string }; - fieldGroup: IFieldConfigurationObject[]; + elementAttributes?: string; + fieldGroup?: IFieldArray; form?: Object; hide?: boolean; - hideExpression?: string | IExpresssionFunction; + hideExpression?: string | IExpressionFunction; key?: string | number; model?: string | Object; - options?: IFormOptionsAPI + options?: IFormOptionsAPI; + templateOptions?: ITemplateOptions; + wrapper?: string | string[]; } @@ -46,7 +51,7 @@ declare module AngularFormly { /** * see http://docs.angular-formly.com/docs/formly-expressions#expressionproperties-validators--messages */ - interface IExpresssionFunction { + interface IExpressionFunction { ($viewValue: any, $modelValue: any, scope: ITemplateScope): any; } @@ -122,8 +127,8 @@ declare module AngularFormly { * see http://docs.angular-formly.com/docs/field-configuration-object#validators-object */ interface IValidator { - expression: string | IExpresssionFunction; - message?: string | IExpresssionFunction; + expression: string | IExpressionFunction; + message?: string | IExpressionFunction; } @@ -154,8 +159,8 @@ declare module AngularFormly { * see http://angular-formly.com/#/example/other/unique-value-async-validation */ asyncValidators?: { - [key: string]: string | IExpresssionFunction | IValidator; - } + [key: string]: string | IExpressionFunction | IValidator; + }; /** * This is a great way to add custom behavior to a specific field. It is injectable with the $scope of the @@ -204,8 +209,8 @@ declare module AngularFormly { * see http://docs.angular-formly.com/docs/field-configuration-object#expressionproperties-object */ expressionProperties?: { - [key: string]: string | IExpresssionFunction | IValidator; - } + [key: string]: string | IExpressionFunction | IValidator; + }; /** @@ -214,7 +219,7 @@ declare module AngularFormly { * * see http://docs.angular-formly.com/docs/field-configuration-object#hide-boolean */ - hide?: boolean + hide?: boolean; /** @@ -224,7 +229,7 @@ declare module AngularFormly { * * see http://docs.angular-formly.com/docs/field-configuration-object#hideexpression-string--function */ - hideExpression?: string | IExpresssionFunction; + hideExpression?: string | IExpressionFunction; /** @@ -416,7 +421,7 @@ declare module AngularFormly { * like in this example. */ messages?: { - [key: string]: IExpresssionFunction | string; + [key: string]: IExpressionFunction | string; } @@ -427,7 +432,7 @@ declare module AngularFormly { */ show?: boolean; - } + }; /** @@ -440,8 +445,8 @@ declare module AngularFormly { * see http://docs.angular-formly.com/docs/field-configuration-object#validators-object */ validators?: { - [key: string]: string | IExpresssionFunction | IValidator; - } + [key: string]: string | IExpressionFunction | IValidator; + }; /** @@ -553,10 +558,24 @@ declare module AngularFormly { validateOptions?: Function; } + interface IFormlyConfigExtras { + disableNgModelAttrsManipulator: boolean; + apiCheckInstance: any; + ngModelAttrsManipulatorPreferUnbound: boolean; + removeChromeAutoComplete: boolean; + defaultHideDirective: string; + errorExistsAndShouldBeVisibleExpression: any; + getFieldId: Function; + fieldTransform: Function; + explicitAsync: boolean; + } + interface IFormlyConfig { + disableWarnings: boolean; + extras: IFormlyConfigExtras; setType(typeOptions: ITypeOptions): void; setWrapper(wrapperOptions: IWrapperOptions): void; - + templateManipulators: ITemplateManipulators; } interface ITemplateScopeOptions { @@ -573,7 +592,7 @@ declare module AngularFormly { //Shortcut to options.formControl fc: ng.IFormController | ng.IFormController[]; //all the fields for the form - fields: IFieldConfigurationObject[]; + fields: IFieldArray; //the form controller the field is in form: any; //The object passed as options.formState to the formly-form directive. Use this to share state between fields. diff --git a/angular-growl-v2/angular-growl-v2-tests.ts b/angular-growl-v2/angular-growl-v2-tests.ts index fdb661161..c03e0725a 100644 --- a/angular-growl-v2/angular-growl-v2-tests.ts +++ b/angular-growl-v2/angular-growl-v2-tests.ts @@ -58,4 +58,8 @@ app.controller("Ctrl", ($scope:angular.IScope, growlMessages.destroyAllMessages(0); growlMessages.addMessage(messages[0]); growlMessages.deleteMessage(messages[1]); + + var testMessage = growl.warning(message); + testMessage.setText("Some other message"); + testMessage.destroy(); }); diff --git a/angular-growl-v2/angular-growl-v2.d.ts b/angular-growl-v2/angular-growl-v2.d.ts index a8e262071..07c0dbe37 100644 --- a/angular-growl-v2/angular-growl-v2.d.ts +++ b/angular-growl-v2/angular-growl-v2.d.ts @@ -39,6 +39,16 @@ declare module angular.growl { */ interface IGrowlMessage extends IGrowlMessageConfig { text: string; + + /** + * Destroy the message. + */ + destroy(): void; + /** + * Update the message body. + * @param newText new message body + */ + setText(newText: string): void; } /** @@ -223,7 +233,7 @@ declare module angular.growl { * @param referenceId * @param limitMessages */ - initDirective(referenceId: number, limitMessages: number): ng.IDirective; + initDirective(referenceId: number, limitMessages: number): angular.IDirective; /** * Get current messages diff --git a/angular-locker/angular-locker-tests.ts b/angular-locker/angular-locker-tests.ts new file mode 100644 index 000000000..c3c280e77 --- /dev/null +++ b/angular-locker/angular-locker-tests.ts @@ -0,0 +1,133 @@ +/// +/// + +angular +.module('angular-locker-tests', ['angular-locker']) +.config(['lockerProvider', function config(lockerProvider: angular.locker.ILockerProvider) { + let lockerSettings: angular.locker.ILockerSettings = { + driver: 'session', + namespace: 'myApp', + separator: '.', + eventsEnabled: true, + extend: {} + }; + + lockerProvider.defaults(lockerSettings); +}]) +.controller('LockerController', ['$scope', 'locker', function ($scope: angular.IScope, locker: angular.locker.ILockerService) { + locker.put('someKey', 'someVal'); + + // put an item into session storage + locker.driver('session').put('sessionKey', ['some', 'session', 'data']); + + // add an item within a different namespace + locker.namespace('otherNamespace').put('foo', 'bar'); + + locker.put('someString', 'anyDataType'); + locker.put('someObject', { foo: 'I will be serialized', bar: 'pretty cool eh' }); + locker.put('someArray', ['foo', 'bar', 'baz']); + // etc + + //Inserts specified key and return value of function + locker.put('someKey', function() { + var obj = { foo: 'bar', bar: 'baz' }; + // some other logic + return obj; + }); + + locker.put('someKey', ['foo', 'bar']); + + //The current value will be passed into the function so you can perform logic on the current value, before returning it. e.g. + locker.put('someKey', function(current: any) { + current.push('baz'); + + return current; + }); + + locker.get('someKey'); // = ['foo', 'bar', 'baz'] + + // given locker.get('foo') is not defined + locker.put('foo', function (current: any) { + // current will equal 'bar' + }, 'bar'); + + //This will add each key/value pair as a separate item in storage + locker.put({ + someKey: 'johndoe', + anotherKey: ['some', 'random', 'array'], + boolKey: true + }); + + locker.add('someKey', 'someVal'); // true or false - whether the item was added or not + + // locker.put('fooArray', ['bar', 'baz', 'bob']); + + locker.get('fooArray'); // ['bar', 'baz', 'bob'] + + locker.get('keyDoesNotExist', 'a default value'); // 'a default value' + + locker.get(['someKey', 'anotherKey', 'foo']); + /* will return something like... + { + someKey: 'someValue', + anotherKey: true, + foo: 'bar' + }*/ + + // locker.put('someKey', { foo: 'bar', baz: 'bob' }); + + locker.pull('someKey', 'defaultVal'); // { foo: 'bar', baz: 'bob' } + + // then... + + locker.get('someKey', 'defaultVal'); // 'defaultVal' + + locker.all(); + // or + locker.namespace('somethingElse').all(); + + locker.count(); + // or + locker.namespace('somethingElse').count(); + + locker.has('someKey'); // true or false + + // or + locker.namespace('foo').has('bar'); + + // e.g. + if (locker.has('user.authToken') ) { + // we're logged in + } else { + // go to login page or something + } + + locker.forget('keyToRemove'); + // or + locker.driver('session').forget('sessionKey'); + // etc.. + + locker.forget(['keyToRemove', 'anotherKeyToRemove', 'something', 'else']); + + locker.clean(); + // or + locker.namespace('someOtherNamespace').clean(); + + locker.empty(); + + locker.bind($scope, 'foo'); + $scope['foo'] = ['bar', 'baz']; + locker.get('foo'); // = ['bar', 'baz'] + + locker.bind($scope, 'foo', 'someDefault'); + $scope['foo']; // = 'someDefault' + locker.get('foo'); // = 'someDefault' + + locker.unbind($scope, 'foo'); + $scope['foo']; // = undefined + locker.get('foo'); // = undefined + + if (! locker.supported()) { + // load a polyfill? + } +}]); diff --git a/angular-locker/angular-locker.d.ts b/angular-locker/angular-locker.d.ts new file mode 100644 index 000000000..e911e3be7 --- /dev/null +++ b/angular-locker/angular-locker.d.ts @@ -0,0 +1,170 @@ +// Type definitions for Angular Locker v2.0.3 +// Project: https://github.com/tymondesigns/angular-locker +// Definitions by: Niko Kovačič +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "angular-locker" { + var _: string; + export = _; +} + +declare module angular.locker { + interface ILockerServicePutFunction { + (current: any): any + } + + interface ILockerService { + /** + * Add an item to storage if it doesn't already exist + * + * @param {String} key The key to add + * @param {Mixed} value The value to add + */ + add(key: string, value: any): boolean; + /** + * Return all items in storage within the current namespace/driver + * + */ + all(): any; + /** + * Remove all items set within the current namespace/driver + */ + clean(): ILockerService; + /** + * Get the total number of items within the current namespace + */ + count(): number; + /** + * Retrieve the specified item from storage + * + * @param {String|Array} key The key to get + * @param {Mixed} def The default value if it does not exist + */ + get(key: string | Array, defaultValue?: any): any; + /** + * Determine whether the item exists in storage + * + * @param {String|Function} key - The key to remove + */ + has(key: string): boolean + /** + * Get the storage keys as an array + */ + keys(): Array; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Object} keyValuePairs Key value object + */ + put(keyValuePairs: Object): ILockerService | boolean; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Mixed} putFunction The default to pass to function if doesn't already exist + */ + put(putFunction: Function): ILockerService | boolean; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Mixed} key The key to add + * @param {Mixed} value The value to add + */ + put(key: string, value: any): ILockerService | boolean; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Mixed} key The key to add + * @param {Mixed} putFunction The default to pass to function if doesn't already exist + * @param {Mixed} value The value to add + */ + put(key: string, putFunction: ILockerServicePutFunction, value: any): ILockerService | boolean; + /** + * Remove specified item(s) from storage + * + * @param {String} key The key to remove + */ + forget(key: string): ILockerService; + /** + * Remove specified item(s) from storage + * + * @param {Array} keys The array of keys to remove + * + */ + forget(keys: Array): ILockerService; + /** + * Retrieve the specified item from storage and then remove it + * + * @param {String|Array} key The key to pull from storage + * @param {Mixed} def The default value if it does not exist + */ + pull(key: string | Array, defaultValue?: any): any; + /** + * Bind a storage key to a $scope property + * + * @param {Object} $scope The angular $scope object + * @param {String} key The key in storage to bind to + * @param {Mixed} def The default value to initially bind + */ + bind(scope: IScope, property: string, defaultPropertyValue?: any): ILockerService; + /** + * Set the storage driver on a new instance to enable overriding defaults + * + * @param {String} driver The driver to switch to + */ + driver(localStorageType: string): ILockerService; + /** + * Empty the current storage driver completely. careful now. + */ + empty(): ILockerService; + /** + * Get the currently set namespace + */ + getNamespace(): string; + /** + * Get a new instance of Locker + * + * @param {Object} options The config options to instantiate with + */ + instance(lockerSettings: ILockerSettings): ILockerService; + /** + * Set the namespace on a new instance to enable overriding defaults + * + * @param {String} namespace The namespace to switch to + */ + 'namespace'(name: string): ILockerService; + /** + * Check browser support + * + * @see github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js#L38-L47 + * + * @param {String} driver The driver to check support with + */ + supported(): boolean; + /** + * Unbind a storage key from a $scope property + * + * @param {Object} $scope The angular $scope object + * @param {String} key The key to remove from bindings + */ + unbind(scope: IScope, property: string): ILockerService; + } + + interface ILockerSettings { + driver?: string; + 'namespace'?: string | boolean; + separator?: string; + eventsEnabled?: boolean; + extend?: Object; + } + + interface ILockerProvider extends angular.IServiceProvider { + /** + * Allow the defaults to be specified via the `lockerProvider` + * + * @param {ILockerSettings} lockerSettings The defaults to override + */ + defaults(lockerSettings: ILockerSettings): void; + } +} \ No newline at end of file diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 7d29e7492..4ce3fe103 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -16,6 +16,7 @@ declare module angular.material { targetEvent?: MouseEvent; resolve?: {[index: string]: angular.IPromise} controllerAs?: string; + bindToController?: boolean; parent?: string|Element|JQuery; // default: root node disableParentScroll?: boolean; // default: true } @@ -76,6 +77,7 @@ declare module angular.material { resolve?: {[index: string]: angular.IPromise} controllerAs?: string; parent?: string|Element|JQuery; // default: root node + fullscreen?: boolean; onComplete?: Function; } diff --git a/angular-meteor/angular-meteor.d.ts b/angular-meteor/angular-meteor.d.ts index b3f520ac5..e536e3203 100644 --- a/angular-meteor/angular-meteor.d.ts +++ b/angular-meteor/angular-meteor.d.ts @@ -39,6 +39,28 @@ declare module angular.meteor { * @return The promise solved successfully when subscription is ready. The success promise holds the subscription handle. */ subscribe(name: string, ...publisherArguments: any[]): angular.IPromise; + + /** + * The helpers method is part of the ReactiveContext, and available on every context and $scope. + * These method are defined as Object, where each key is the name of the variable that will be available on the context we run, and each value is a function with a return value. + * Under the hood, each helper starts a new Tracker.autorun. When its reactive dependencies change, the helper is rerun. + * To trigger a rerun every time an specific Angular variable change, use getReactively](/api/1.3.1/get-reactively) to make your Angular variable reactive inside the helper its used in. + * Each helper function should return a MongoDB Cursor and the helpers will expose it as a normal array to the context. + * + * @param definitions - Object containing `name` => `function` definition, where each name is a string and each function is the helper function. Should return a [MongoDB Cursor](http://docs.meteor.com/#/full/mongo_cursor) + * @return This method returns this, which the the reactive context, in order to provide the ability to chain the logic. + */ + helpers(definitions : { [helperName : string] : () => Mongo.Cursor }): IScope; + + /** + * This method is a wrapper of Tracker.autorun and shares exactly the same API. + * The autorun method is part of the ReactiveContext, and available on every context and $scope. + * The argument of this method is a callback, which will be called each time Autorun will be used. + * The Autorun will stop automatically when when it's context ($scope) is destroyed. + * + * @param runFunc - The function to run. It receives one argument: the Computation object that will be returned. + */ + autorun(runFunc : () => void) : Tracker.Computation; } /** diff --git a/angular-protractor/angular-protractor.d.ts b/angular-protractor/angular-protractor.d.ts index dc969927e..08f83e27d 100644 --- a/angular-protractor/angular-protractor.d.ts +++ b/angular-protractor/angular-protractor.d.ts @@ -1806,6 +1806,16 @@ declare module protractor { * @return {Protractor} a protractor instance. */ forkNewDriverInstance(opt_useSameUrl?: boolean, opt_copyMockModules?: boolean): Protractor; + + /** + * Get the processed configuration object that is currently being run. This will contain + * the specs and capabilities properties of the current runner instance. + * + * Set by the runner. + * + * @return {webdriver.promise.Promise} A promise which resolves to the capabilities object. + */ + getProcessedConfig(): webdriver.promise.Promise; } /** diff --git a/angular-toastr/angular-toastr-tests.ts b/angular-toastr/angular-toastr-tests.ts new file mode 100644 index 000000000..e5701746f --- /dev/null +++ b/angular-toastr/angular-toastr-tests.ts @@ -0,0 +1,64 @@ +/// +/// + + +angular + .module('toastr-tests', ['toastr']) + .config(function(toastrConfig: angular.toastr.IToastrConfig) { + let toastContainerConfig: angular.toastr.IToastContainerConfig = { + autoDismiss: false, + containerId: 'toast-container', + maxOpened: 0, + newestOnTop: true, + positionClass: 'toast-top-right', + preventDuplicates: false, + preventOpenDuplicates: false, + target: 'body' + }, + toastConfig: angular.toastr.IToastConfig = { + allowHtml: false, + closeButton: false, + closeHtml: '', + extendedTimeOut: 1000, + iconClasses: { + error: 'toast-error', + info: 'toast-info', + success: 'toast-success', + warning: 'toast-warning' + }, + messageClass: 'toast-message', + onHidden: null, + onShown: null, + onTap: null, + progressBar: false, + tapToDismiss: true, + templates: { + + toast: 'directives/toast/toast.html', + progressbar: 'directives/progressbar/progressbar.html' + }, + timeOut: 5000, + titleClass: 'toast-title', + toastClass: 'toast' + }; + + angular.extend(toastrConfig, toastContainerConfig, toastConfig); + }) + .controller('ToastrController', function(toastr: angular.toastr.IToastrService) { + toastr.info(' Success!', 'With HTML', { + allowHtml: true + }); + + toastr.success('What a nice button', 'Button spree', { + closeButton: true + }); + + toastr.info('What a nice apple button', 'Button spree', { + closeButton: true, + closeHtml: '' + }); + + toastr.info('I am totally custom!', 'Happy toast', { + iconClass: 'toast-pink' + }); + }); \ No newline at end of file diff --git a/angular-toastr/angular-toastr.d.ts b/angular-toastr/angular-toastr.d.ts new file mode 100644 index 000000000..96e8e78cc --- /dev/null +++ b/angular-toastr/angular-toastr.d.ts @@ -0,0 +1,121 @@ +// Type definitions for Angular Toastr v1.6.0 +// Project: https://github.com/Foxandxss/angular-toastr +// Definitions by: Niko Kovačič +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "angular-toastr" { + var _: string; + export = _; +} + +interface IToastBaseConfig { + allowHtml?: boolean; + closeButton?: boolean; + closeHtml?: string; + extendedTimeOut?: number; + messageClass?: string; + onHidden?: Function; + onShown?: Function; + onTap?: Function; + progressBar?: boolean; + tapToDismiss?: boolean; + templates?: { + toast?: string; + progressbar?: string; + }; + timeOut?: number; + titleClass?: string; + toastClass?: string; +} + +declare module angular.toastr { + interface IToastContainerConfig { + autoDismiss?: boolean; + containerId?: string; + maxOpened?: number; + newestOnTop?: boolean; + positionClass?: string; + preventDuplicates?: boolean; + preventOpenDuplicates?: boolean; + target?: string; + } + + interface IToastConfig extends IToastBaseConfig { + iconClasses?: { + error?: string; + info?: string; + success?: string; + warning?: string; + }; + } + + interface IToastrConfig extends IToastContainerConfig, IToastConfig { } + + interface IToastScope extends angular.IScope { + message: string; + options: IToastConfig; + title: string; + toastId: number; + toastType: string; + } + + interface IToast { + el: angular.IAugmentedJQuery; + iconClass: string; + isOpened: boolean; + open: angular.IPromise; + scope: IToastScope; + toastId: number; + } + + interface IToastOptions extends IToastBaseConfig { + iconClass?: string; + } + + interface IToastrService { + /** + * Return the number of active toasts in screen. + */ + active(): number; + /** + * Remove toast from screen. If no toast is passed in, all toasts will be closed. + * + * @param {IToast} toast Optional toast object to delete + */ + clear(toast?: IToast): void; + /** + * Create error toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + error(message: string, title?: string, options?: IToastOptions): IToast; + /** + * Create info toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + info(message: string, title?: string, options?: IToastOptions): IToast; + /** + * Create success toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + success(message: string, title?: string, options?: IToastOptions): IToast; + /** + * Create warning toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + warning(message: string, title?: string, options?: IToastOptions): IToast; + } +} \ No newline at end of file diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index 8bef360ee..960012a57 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -22,7 +22,7 @@ declare module angular.translate { interface IStorage { get(name: string): string; - set(name: string, value: string): void; + put(name: string, value: string): void; } interface IStaticFilesLoaderOptions { diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index 41661d60d..07711b9b8 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -177,8 +177,13 @@ class UrlLocatorTestService implements IUrlLocatorTestService { if (this.$state.href("myState") === "/myState") { // } - this.$state.get("myState"); this.$state.get(); + this.$state.get("myState"); + this.$state.get("myState", "yourState"); + this.$state.get("myState", this.$state.current); + this.$state.get(this.$state.current); + this.$state.get(this.$state.current, "yourState"); + this.$state.get(this.$state.current, this.$state.current); this.$state.reload(); // http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#properties diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index a22b7d0da..324ec676c 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -261,7 +261,10 @@ declare module angular.ui { is(state: IState, params?: {}): boolean; href(state: IState, params?: {}, options?: IHrefOptions): string; href(state: string, params?: {}, options?: IHrefOptions): string; - get(state: string): IState; + get(state: string, context?: string): IState; + get(state: IState, context?: string): IState; + get(state: string, context?: IState): IState; + get(state: IState, context?: IState): IState; get(): IState[]; /** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */ current: IState; diff --git a/angular-ui-tree/angular-ui-tree-tests.ts b/angular-ui-tree/angular-ui-tree-tests.ts index 4e5ef91b9..718fada2c 100644 --- a/angular-ui-tree/angular-ui-tree-tests.ts +++ b/angular-ui-tree/angular-ui-tree-tests.ts @@ -78,5 +78,6 @@ var droppedCallback: AngularUITree.IDroppedCallback = (eventInfo: AngularUITree. var callbacks: AngularUITree.ICallbacks = { accept: acceptCallback, + dragStart: droppedCallback, dropped: droppedCallback }; diff --git a/angular-ui-tree/angular-ui-tree.d.ts b/angular-ui-tree/angular-ui-tree.d.ts index 62c8899fa..cfcb2b108 100644 --- a/angular-ui-tree/angular-ui-tree.d.ts +++ b/angular-ui-tree/angular-ui-tree.d.ts @@ -54,6 +54,7 @@ declare module AngularUITree { interface ICallbacks { accept: IAcceptCallback; + dragStart: IDroppedCallback; dropped: IDroppedCallback; } diff --git a/angularjs/angular-component-router.d.ts b/angularjs/angular-component-router.d.ts new file mode 100644 index 000000000..da93596ca --- /dev/null +++ b/angularjs/angular-component-router.d.ts @@ -0,0 +1,429 @@ +// Type definitions for Angular JS 1.5 component router +// Project: http://angularjs.org +// Definitions by: David Reher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module angular { + /** + * `Instruction` is a tree of {@link ComponentInstruction}s with all the information needed + * to transition each component in the app to a given route, including all auxiliary routes. + * + * `Instruction`s can be created using {@link Router#generate}, and can be used to + * perform route changes with {@link Router#navigateByInstruction}. + * + * ### Example + * + * ``` + * import {Component} from 'angular2/core'; + * import {bootstrap} from 'angular2/platform/browser'; + * import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; + * + * @Component({directives: [ROUTER_DIRECTIVES]}) + * @RouteConfig([ + * {...}, + * ]) + * class AppCmp { + * constructor(router: Router) { + * var instruction = router.generate(['/MyRoute']); + * router.navigateByInstruction(instruction); + * } + * } + * + * bootstrap(AppCmp, ROUTER_PROVIDERS); + * ``` + */ + interface Instruction { + + urlPath(): string; + + urlParams(): string[]; + + specificity(): number; + + resolveComponent(): Promise; + + /** + * converts the instruction into a URL string + */ + toRootUrl(): string; + + toUrlQuery(): string; + + /** + * Returns a new instruction that shares the state of the existing instruction, but with + * the given child {@link Instruction} replacing the existing child. + */ + replaceChild(child: Instruction): Instruction; + + /** + * If the final URL for the instruction is `` + */ + toUrlPath(): string; + + /** + * default instructions override these + */ + toLinkUrl(): string; + } + + /** + * A router outlet is a placeholder that Angular dynamically fills based on the application's route. + * + * ## Use + * + * ``` + * + * ``` + */ + interface RouterOutlet { + name: string; + + /** + * Called by the Router to instantiate a new component during the commit phase of a navigation. + * This method in turn is responsible for calling the `routerOnActivate` hook of its child. + */ + activate(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} during the commit phase of a navigation when an outlet + * reuses a component between different routes. + * This method in turn is responsible for calling the `routerOnReuse` hook of its child. + */ + reuse(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} when an outlet disposes of a component's contents. + * This method in turn is responsible for calling the `routerOnDeactivate` hook of its child. + */ + deactivate(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} during recognition phase of a navigation. + * + * If this resolves to `false`, the given navigation is cancelled. + * + * This method delegates to the child component's `routerCanDeactivate` hook if it exists, + * and otherwise resolves to true. + */ + routerCanDeactivate(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} during recognition phase of a navigation. + * + * If the new child component has a different Type than the existing child component, + * this will resolve to `false`. You can't reuse an old component when the new component + * is of a different Type. + * + * Otherwise, this method delegates to the child component's `routerCanReuse` hook if it exists, + * or resolves to true if the hook is not present. + */ + routerCanReuse(nextInstruction: ComponentInstruction): Promise; + } + + interface RouteRegistry { + /** + * Given a component and a configuration object, add the route to this registry + */ + config(parentComponent: any, config: RouteDefinition): void; + + /** + * Reads the annotations of a component and configures the registry based on them + */ + configFromComponent(component: any): void; + + /** + * Given a URL and a parent component, return the most specific instruction for navigating + * the application into the state specified by the url + */ + recognize(url: string, ancestorInstructions: Instruction[]): Promise; + + /** + * Given a normalized list with component names and params like: `['user', {id: 3 }]` + * generates a url with a leading slash relative to the provided `parentComponent`. + * + * If the optional param `_aux` is `true`, then we generate starting at an auxiliary + * route boundary. + */ + generate(linkParams: any[], ancestorInstructions: Instruction[], _aux?: boolean): Instruction; + + hasRoute(name: string, parentComponent: any): boolean; + + generateDefault(componentCursor: any): Instruction; + } + + /** + * The `Router` is responsible for mapping URLs to components. + * + * You can see the state of the router by inspecting the read-only field `router.navigating`. + * This may be useful for showing a spinner, for instance. + * + * ## Concepts + * + * Routers and component instances have a 1:1 correspondence. + * + * The router holds reference to a number of {@link RouterOutlet}. + * An outlet is a placeholder that the router dynamically fills in depending on the current URL. + * + * When the router navigates from a URL, it must first recognize it and serialize it into an + * `Instruction`. + * The router uses the `RouteRegistry` to get an `Instruction`. + */ + interface Router { + navigating: boolean; + lastNavigationAttempt: string; + registry: RouteRegistry; + parent: Router; + hostComponent: any; + + /** + * Constructs a child router. You probably don't need to use this unless you're writing a reusable + * component. + */ + childRouter(hostComponent: any): Router; + + /** + * Constructs a child router. You probably don't need to use this unless you're writing a reusable + * component. + */ + auxRouter(hostComponent: any): Router; + + /** + * Register an outlet to be notified of primary route changes. + * + * You probably don't need to use this unless you're writing a reusable component. + */ + registerPrimaryOutlet(outlet: RouterOutlet): Promise; + + /** + * Register an outlet to notified of auxiliary route changes. + * + * You probably don't need to use this unless you're writing a reusable component. + */ + registerAuxOutlet(outlet: RouterOutlet): Promise; + + /** + * Given an instruction, returns `true` if the instruction is currently active, + * otherwise `false`. + */ + isRouteActive(instruction: Instruction): boolean; + + /** + * Dynamically update the routing configuration and trigger a navigation. + * + * ### Usage + * + * ``` + * router.config([ + * { 'path': '/', 'component': IndexComp }, + * { 'path': '/user/:id', 'component': UserComp }, + * ]); + * ``` + */ + config(definitions: RouteDefinition[]): Promise; + + /** + * Navigate based on the provided Route Link DSL. It's preferred to navigate with this method + * over `navigateByUrl`. + * + * ### Usage + * + * This method takes an array representing the Route Link DSL: + * ``` + * ['./MyCmp', {param: 3}] + * ``` + * See the {@link RouterLink} directive for more. + */ + navigate(linkParams: any[]): Promise; + + /** + * Navigate to a URL. Returns a promise that resolves when navigation is complete. + * It's preferred to navigate with `navigate` instead of this method, since URLs are more brittle. + * + * If the given URL begins with a `/`, router will navigate absolutely. + * If the given URL does not begin with `/`, the router will navigate relative to this component. + */ + navigateByUrl(url: string, _skipLocationChange?: boolean): Promise; + + /** + * Navigate via the provided instruction. Returns a promise that resolves when navigation is + * complete. + */ + navigateByInstruction(instruction: Instruction, + _skipLocationChange?: boolean): Promise; + + /** + * Updates this router and all descendant routers according to the given instruction + */ + commit(instruction: Instruction, _skipLocationChange?: boolean): Promise; + + /** + * Subscribe to URL updates from the router + */ + subscribe(onNext: (value: any) => void): Object; + + /** + * Removes the contents of this router's outlet and all descendant outlets + */ + deactivate(instruction: Instruction): Promise; + + /** + * Given a URL, returns an instruction representing the component graph + */ + recognize(url: string): Promise; + + /** + * Navigates to either the last URL successfully navigated to, or the last URL requested if the + * router has yet to successfully navigate. + */ + renavigate(): Promise; + + /** + * Generate an `Instruction` based on the provided Route Link DSL. + */ + generate(linkParams: any[]): Instruction; + } + + /** + * RouteData is an immutable map of additional data you can configure in your Route. + * You can inject RouteData into the constructor of a component to use it. + */ + interface RouteData { + data: {[key: string]: any}; + get(key: string): any; + } + + /** + * A `ComponentInstruction` represents the route state for a single component. An `Instruction` is + * composed of a tree of these `ComponentInstruction`s. + * + * `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed + * to route lifecycle hooks, like {@link CanActivate}. + * + * `ComponentInstruction`s are [https://en.wikipedia.org/wiki/Hash_consing](hash consed). You should + * never construct one yourself with "new." Instead, rely on {@link Router/RouteRecognizer} to + * construct `ComponentInstruction`s. + * + * You should not modify this object. It should be treated as immutable. + */ + interface ComponentInstruction { + reuse: boolean; + routeData: RouteData; + urlPath: string; + urlParams: string[]; + data: RouteData; + componentType: any; + terminal: boolean; + specificity: number; + params: {[key: string]: any}; + } + + /** + * Defines route lifecycle method `routerOnActivate`, which is called by the router at the end of a + * successful route navigation. + * + * For a single component's navigation, only one of either {@link OnActivate} or {@link OnReuse} + * will be called depending on the result of {@link CanReuse}. + * + * The `routerOnActivate` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route or `null`. + * + * If `routerOnActivate` returns a promise, the route change will wait until the promise settles to + * instantiate and activate child components. + * + * ### Example + * {@example router/ts/on_activate/on_activate_example.ts region='routerOnActivate'} + */ + interface OnActivate { + $routerOnActivate(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; + } + + /** + * Defines route lifecycle method `routerCanDeactivate`, which is called by the router to determine + * if a component can be removed as part of a navigation. + * + * The `routerCanDeactivate` hook is called with two {@link ComponentInstruction}s as parameters, + * the + * first representing the current route being navigated to, and the second parameter + * representing the previous route. + * + * If `routerCanDeactivate` returns or resolves to `false`, the navigation is cancelled. If it + * returns or + * resolves to `true`, then the navigation continues, and the component will be deactivated + * (the {@link OnDeactivate} hook will be run) and removed. + * + * If `routerCanDeactivate` throws or rejects, the navigation is also cancelled. + * + * ### Example + * {@example router/ts/can_deactivate/can_deactivate_example.ts region='routerCanDeactivate'} + */ + interface CanDeactivate { + $routerCanDeactivate(next?: ComponentInstruction, prev?: ComponentInstruction): boolean | Promise; + } + + /** + * Defines route lifecycle method `routerOnDeactivate`, which is called by the router before + * destroying + * a component as part of a route change. + * + * The `routerOnDeactivate` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route. + * + * If `routerOnDeactivate` returns a promise, the route change will wait until the promise settles. + * + * ### Example + * {@example router/ts/on_deactivate/on_deactivate_example.ts region='routerOnDeactivate'} + */ + interface OnDeactivate { + $routerOnDeactivate(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; + } + + /** + * Defines route lifecycle method `routerCanReuse`, which is called by the router to determine + * whether a + * component should be reused across routes, or whether to destroy and instantiate a new component. + * + * The `routerCanReuse` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route. + * + * If `routerCanReuse` returns or resolves to `true`, the component instance will be reused and the + * {@link OnDeactivate} hook will be run. If `routerCanReuse` returns or resolves to `false`, a new + * component will be instantiated, and the existing component will be deactivated and removed as + * part of the navigation. + * + * If `routerCanReuse` throws or rejects, the navigation will be cancelled. + * + * ### Example + * {@example router/ts/reuse/reuse_example.ts region='reuseCmp'} + */ + interface CanReuse { + $routerCanReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): boolean | Promise; + } + + /** + * Defines route lifecycle method `routerOnReuse`, which is called by the router at the end of a + * successful route navigation when {@link CanReuse} is implemented and returns or resolves to true. + * + * For a single component's navigation, only one of either {@link OnActivate} or {@link OnReuse} + * will be called, depending on the result of {@link CanReuse}. + * + * The `routerOnReuse` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route or `null`. + * + * ### Example + * {@example router/ts/reuse/reuse_example.ts region='reuseCmp'} + */ + interface OnReuse { + $routerOnReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; + } +} diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 97477e9a8..14ccdbf04 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1632,18 +1632,99 @@ declare module angular { // see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html // and http://toddmotto.com/exploring-the-angular-1-5-component-method/ /////////////////////////////////////////////////////////////////////////// + /** + * Runtime representation a type that a Component or other object is instances of. + * + * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by + * the `MyCustomComponent` constructor function. + */ + interface Type extends Function { + } + /** + * `RouteDefinition` defines a route within a {@link RouteConfig} decorator. + * + * Supported keys: + * - `path` or `aux` (requires exactly one of these) + * - `component`, `loader`, `redirectTo` (requires exactly one of these) + * - `name` or `as` (optional) (requires exactly one of these) + * - `data` (optional) + * + * See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}. + */ + interface RouteDefinition { + path?: string; + aux?: string; + component?: Type | ComponentDefinition | string; + loader?: Function; + redirectTo?: any[]; + as?: string; + name?: string; + data?: any; + useAsDefault?: boolean; + } + + /** + * Represents either a component type (`type` is `component`) or a loader function + * (`type` is `loader`). + * + * See also {@link RouteDefinition}. + */ + interface ComponentDefinition { + type: string; + loader?: Function; + component?: Type; + } + + /** + * Component definition object (a simplified directive definition object) + */ interface IComponentOptions { - bindings?: Object; + /** + * Controller constructor function that should be associated with newly created scope or the name of a registered + * controller if passed as a string. Empty function by default. + */ controller?: string | Function; + /** + * An identifier name for a reference to the controller. If present, the controller will be published to scope under + * the controllerAs name. If not present, this will default to be the same as the component name. + */ controllerAs?: string; - isolate?: boolean; - template?: string | IComponentTemplateFn; - templateUrl?: string | IComponentTemplateFn; + /** + * html template as a string or a function that returns an html template as a string which should be used as the + * contents of this component. Empty string by default. + * If template is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + */ + template?: string | Function; + /** + * path or function that returns a path to an html template that should be used as the contents of this component. + * If templateUrl is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + */ + templateUrl?: string | Function; + /** + * Define DOM attribute binding to component properties. Component properties are always bound to the component + * controller and not to the scope. + */ + bindings?: any; + /** + * Whether transclusion is enabled. Enabled by default. + */ transclude?: boolean; + /** + * Whether the new scope is isolated. Isolated by default. + */ + isolate?: boolean; + /** + * String of subset of EACM which restricts the component to specific directive declaration style. If omitted, + * this defaults to 'E'. + */ restrict?: string; - $canActivate?: Function; - $routeConfig?: Object; + $canActivate?: () => boolean; + $routeConfig?: RouteDefinition[]; } interface IComponentTemplateFn { diff --git a/any-db/any-db.d.ts b/any-db/any-db.d.ts index 04817623a..f14befb20 100644 --- a/any-db/any-db.d.ts +++ b/any-db/any-db.d.ts @@ -50,7 +50,7 @@ declare module "any-db" { /** * Result rows */ - rows: Object[]; + rows: any[]; /** * Result field descriptions */ diff --git a/applicationinsights/applicationinsights-tests.ts b/applicationinsights/applicationinsights-tests.ts index 8d4d83e9d..eb9d5e701 100644 --- a/applicationinsights/applicationinsights-tests.ts +++ b/applicationinsights/applicationinsights-tests.ts @@ -1,5 +1,5 @@ /// -import appInsights = require("applicationinsights"); +import * as appInsights from "applicationinsights"; // basic use appInsights.setup("").start(); @@ -24,3 +24,8 @@ appInsights.client.trackDependency("dependency name", "commandName", 500, true); appInsights.client.commonProperties = { environment: "dev" }; + +// send any pending data and log the response +appInsights.client.sendPendingData(function (response) { + console.log(response); +}); diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index 9fc6f494d..d5c895466 100644 --- a/applicationinsights/applicationinsights.d.ts +++ b/applicationinsights/applicationinsights.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Application Insights v0.15.7 +// Type definitions for Application Insights v0.15.8 // Project: https://github.com/Microsoft/ApplicationInsights-node.js // Definitions by: Scott Southwood // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -358,7 +358,7 @@ interface Client { /** * Immediately send all queued telemetry. */ - sendPendingData(): void; + sendPendingData(callback?: (response: string) => void): void; getEnvelope(data: ContractsModule.Data, tagOverrides?: { [key: string]: string; }): ContractsModule.Envelope; @@ -409,66 +409,58 @@ interface Sender { * 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; +interface ApplicationInsights { + client: Client; /** * Initializes a client with the given instrumentation key, if this is not specified, the value will be * read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY * @returns {ApplicationInsights/Client} a new client */ - static getClient(instrumentationKey?: string): Client; + getClient(instrumentationKey?: string): Client; /** * 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_INSTRUMENTATIONKEY * @returns {ApplicationInsights} this interface */ - static setup(instrumentationKey?: string): typeof ApplicationInsights; + setup(instrumentationKey?: string): ApplicationInsights; /** * Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected * @returns {ApplicationInsights} this interface */ - static start(): typeof ApplicationInsights; + start(): 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; + setAutoCollectConsole(value: boolean): 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; + setAutoCollectExceptions(value: boolean): 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; + setAutoCollectPerformance(value: boolean): 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; + setAutoCollectRequests(value: boolean): ApplicationInsights; /** * Enables verbose debug logging * @returns {ApplicationInsights} this interface */ - static enableVerboseLogging(): typeof ApplicationInsights; + enableVerboseLogging(): ApplicationInsights; } declare module "applicationinsights" { - export = ApplicationInsights; + const applicationinsights: ApplicationInsights; + export = applicationinsights; } \ No newline at end of file diff --git a/auth0/auth0.d.ts b/auth0/auth0.d.ts index b2e1149fb..1548bd06f 100644 --- a/auth0/auth0.d.ts +++ b/auth0/auth0.d.ts @@ -51,6 +51,8 @@ interface Auth0UserProfile { user_id: string; /** Represents one or more Identities that may be associated with the User. */ identities: Auth0Identity[]; + user_metadata?: any; + app_metadata?: any; } /** Represents an Auth0UserProfile that has a Microsoft Account as the primary identity. */ diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index 128341729..f89059463 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -154,6 +154,12 @@ declare module "aws-sdk" { constructor(options?: any); } + export module DynamoDB { + export class DocumentClient { + constructor(options?: any); + } + } + export module SQS { export interface SqsOptions { diff --git a/babylonjs/babylon-tests.ts b/babylonjs/babylon-tests.ts new file mode 100644 index 000000000..142d3840f --- /dev/null +++ b/babylonjs/babylon-tests.ts @@ -0,0 +1 @@ +/// diff --git a/babylonjs/babylon.d.ts b/babylonjs/babylon.d.ts new file mode 100644 index 000000000..1cc835442 --- /dev/null +++ b/babylonjs/babylon.d.ts @@ -0,0 +1,6327 @@ +// Type definitions for BabylonJS v2.2 +// Project: http://www.babylonjs.com/ +// Definitions by: David Catuhe +// Definitions: https://github.com/borisyankov/babylonjs + + +declare module BABYLON { + class _DepthCullingState { + private _isDepthTestDirty; + private _isDepthMaskDirty; + private _isDepthFuncDirty; + private _isCullFaceDirty; + private _isCullDirty; + private _isZOffsetDirty; + private _depthTest; + private _depthMask; + private _depthFunc; + private _cull; + private _cullFace; + private _zOffset; + isDirty: boolean; + zOffset: number; + cullFace: number; + cull: boolean; + depthFunc: number; + depthMask: boolean; + depthTest: boolean; + reset(): void; + apply(gl: WebGLRenderingContext): void; + } + class _AlphaState { + private _isAlphaBlendDirty; + private _isBlendFunctionParametersDirty; + private _alphaBlend; + private _blendFunctionParameters; + isDirty: boolean; + alphaBlend: boolean; + setAlphaBlendFunctionParameters(value0: number, value1: number, value2: number, value3: number): void; + reset(): void; + apply(gl: WebGLRenderingContext): void; + } + class EngineCapabilities { + maxTexturesImageUnits: number; + maxTextureSize: number; + maxCubemapTextureSize: number; + maxRenderTextureSize: number; + standardDerivatives: boolean; + s3tc: any; + textureFloat: boolean; + textureAnisotropicFilterExtension: any; + maxAnisotropy: number; + instancedArrays: any; + uintIndices: boolean; + highPrecisionShaderSupported: boolean; + } + /** + * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio. + */ + class Engine { + private static _ALPHA_DISABLE; + private static _ALPHA_ADD; + private static _ALPHA_COMBINE; + private static _ALPHA_SUBTRACT; + private static _ALPHA_MULTIPLY; + private static _ALPHA_MAXIMIZED; + private static _ALPHA_ONEONE; + private static _DELAYLOADSTATE_NONE; + private static _DELAYLOADSTATE_LOADED; + private static _DELAYLOADSTATE_LOADING; + private static _DELAYLOADSTATE_NOTLOADED; + private static _TEXTUREFORMAT_ALPHA; + private static _TEXTUREFORMAT_LUMINANCE; + private static _TEXTUREFORMAT_LUMINANCE_ALPHA; + private static _TEXTUREFORMAT_RGB; + private static _TEXTUREFORMAT_RGBA; + private static _TEXTURETYPE_UNSIGNED_INT; + private static _TEXTURETYPE_FLOAT; + static ALPHA_DISABLE: number; + static ALPHA_ONEONE: number; + static ALPHA_ADD: number; + static ALPHA_COMBINE: number; + static ALPHA_SUBTRACT: number; + static ALPHA_MULTIPLY: number; + static ALPHA_MAXIMIZED: number; + static DELAYLOADSTATE_NONE: number; + static DELAYLOADSTATE_LOADED: number; + static DELAYLOADSTATE_LOADING: number; + static DELAYLOADSTATE_NOTLOADED: number; + static TEXTUREFORMAT_ALPHA: number; + static TEXTUREFORMAT_LUMINANCE: number; + static TEXTUREFORMAT_LUMINANCE_ALPHA: number; + static TEXTUREFORMAT_RGB: number; + static TEXTUREFORMAT_RGBA: number; + static TEXTURETYPE_UNSIGNED_INT: number; + static TEXTURETYPE_FLOAT: number; + static Version: string; + static Epsilon: number; + static CollisionsEpsilon: number; + static CodeRepository: string; + static ShadersRepository: string; + isFullscreen: boolean; + isPointerLock: boolean; + cullBackFaces: boolean; + renderEvenInBackground: boolean; + enableOfflineSupport: boolean; + scenes: Scene[]; + _gl: WebGLRenderingContext; + private _renderingCanvas; + private _windowIsBackground; + static audioEngine: AudioEngine; + private _onBlur; + private _onFocus; + private _onFullscreenChange; + private _onPointerLockChange; + private _hardwareScalingLevel; + private _caps; + private _pointerLockRequested; + private _alphaTest; + private _resizeLoadingUI; + private _loadingDiv; + private _loadingTextDiv; + private _loadingDivBackgroundColor; + private _drawCalls; + private _glVersion; + private _glRenderer; + private _glVendor; + private _videoTextureSupported; + private _renderingQueueLaunched; + private _activeRenderLoops; + private fpsRange; + private previousFramesDuration; + private fps; + private deltaTime; + private _depthCullingState; + private _alphaState; + private _alphaMode; + private _loadedTexturesCache; + _activeTexturesCache: BaseTexture[]; + private _currentEffect; + private _compiledEffects; + private _vertexAttribArrays; + private _cachedViewport; + private _cachedVertexBuffers; + private _cachedIndexBuffer; + private _cachedEffectForVertexBuffers; + private _currentRenderTarget; + private _uintIndicesCurrentlySet; + private _workingCanvas; + private _workingContext; + /** + * @constructor + * @param {HTMLCanvasElement} canvas - the canvas to be used for rendering + * @param {boolean} [antialias] - enable antialias + * @param options - further options to be sent to the getContext function + */ + constructor(canvas: HTMLCanvasElement, antialias?: boolean, options?: any); + private _prepareWorkingCanvas(); + getGlInfo(): { + vendor: string; + renderer: string; + version: string; + }; + getAspectRatio(camera: Camera): number; + getRenderWidth(): number; + getRenderHeight(): number; + getRenderingCanvas(): HTMLCanvasElement; + getRenderingCanvasClientRect(): ClientRect; + setHardwareScalingLevel(level: number): void; + getHardwareScalingLevel(): number; + getLoadedTexturesCache(): WebGLTexture[]; + getCaps(): EngineCapabilities; + drawCalls: number; + resetDrawCalls(): void; + setDepthFunctionToGreater(): void; + setDepthFunctionToGreaterOrEqual(): void; + setDepthFunctionToLess(): void; + setDepthFunctionToLessOrEqual(): void; + /** + * stop executing a render loop function and remove it from the execution array + * @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed. + */ + stopRenderLoop(renderFunction?: () => void): void; + _renderLoop(): void; + /** + * Register and execute a render loop. The engine can have more than one render function. + * @param {Function} renderFunction - the function to continuesly execute starting the next render loop. + * @example + * engine.runRenderLoop(function () { + * scene.render() + * }) + */ + runRenderLoop(renderFunction: () => void): void; + /** + * Toggle full screen mode. + * @param {boolean} requestPointerLock - should a pointer lock be requested from the user + */ + switchFullscreen(requestPointerLock: boolean): void; + clear(color: any, backBuffer: boolean, depthStencil: boolean): void; + /** + * Set the WebGL's viewport + * @param {BABYLON.Viewport} viewport - the viewport element to be used. + * @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used. + * @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used. + */ + setViewport(viewport: Viewport, requiredWidth?: number, requiredHeight?: number): void; + setDirectViewport(x: number, y: number, width: number, height: number): void; + beginFrame(): void; + endFrame(): void; + /** + * resize the view according to the canvas' size. + * @example + * window.addEventListener("resize", function () { + * engine.resize(); + * }); + */ + resize(): void; + /** + * force a specific size of the canvas + * @param {number} width - the new canvas' width + * @param {number} height - the new canvas' height + */ + setSize(width: number, height: number): void; + bindFramebuffer(texture: WebGLTexture): void; + unBindFramebuffer(texture: WebGLTexture): void; + flushFramebuffer(): void; + restoreDefaultFramebuffer(): void; + private _resetVertexBufferBinding(); + createVertexBuffer(vertices: number[]): WebGLBuffer; + createDynamicVertexBuffer(capacity: number): WebGLBuffer; + updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: any, offset?: number): void; + private _resetIndexBufferBinding(); + createIndexBuffer(indices: number[]): WebGLBuffer; + bindBuffers(vertexBuffer: WebGLBuffer, indexBuffer: WebGLBuffer, vertexDeclaration: number[], vertexStrideSize: number, effect: Effect): void; + bindMultiBuffers(vertexBuffers: VertexBuffer[], indexBuffer: WebGLBuffer, effect: Effect): void; + _releaseBuffer(buffer: WebGLBuffer): boolean; + createInstancesBuffer(capacity: number): WebGLBuffer; + deleteInstancesBuffer(buffer: WebGLBuffer): void; + updateAndBindInstancesBuffer(instancesBuffer: WebGLBuffer, data: Float32Array, offsetLocations: number[]): void; + unBindInstancesBuffer(instancesBuffer: WebGLBuffer, offsetLocations: number[]): void; + applyStates(): void; + draw(useTriangles: boolean, indexStart: number, indexCount: number, instancesCount?: number): void; + drawPointClouds(verticesStart: number, verticesCount: number, instancesCount?: number): void; + _releaseEffect(effect: Effect): void; + createEffect(baseName: any, attributesNames: string[], uniformsNames: string[], samplers: string[], defines: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect; + createEffectForParticles(fragmentName: string, uniformsNames?: string[], samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect; + createShaderProgram(vertexCode: string, fragmentCode: string, defines: string): WebGLProgram; + getUniforms(shaderProgram: WebGLProgram, uniformsNames: string[]): WebGLUniformLocation[]; + getAttributes(shaderProgram: WebGLProgram, attributesNames: string[]): number[]; + enableEffect(effect: Effect): void; + setArray(uniform: WebGLUniformLocation, array: number[]): void; + setArray2(uniform: WebGLUniformLocation, array: number[]): void; + setArray3(uniform: WebGLUniformLocation, array: number[]): void; + setArray4(uniform: WebGLUniformLocation, array: number[]): void; + setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): void; + setMatrix(uniform: WebGLUniformLocation, matrix: Matrix): void; + setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): void; + setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): void; + setFloat(uniform: WebGLUniformLocation, value: number): void; + setFloat2(uniform: WebGLUniformLocation, x: number, y: number): void; + setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): void; + setBool(uniform: WebGLUniformLocation, bool: number): void; + setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + setColor3(uniform: WebGLUniformLocation, color3: Color3): void; + setColor4(uniform: WebGLUniformLocation, color3: Color3, alpha: number): void; + setState(culling: boolean, zOffset?: number, force?: boolean): void; + setDepthBuffer(enable: boolean): void; + getDepthWrite(): boolean; + setDepthWrite(enable: boolean): void; + setColorWrite(enable: boolean): void; + setAlphaMode(mode: number): void; + getAlphaMode(): number; + setAlphaTesting(enable: boolean): void; + getAlphaTesting(): boolean; + wipeCaches(): void; + setSamplingMode(texture: WebGLTexture, samplingMode: number): void; + createTexture(url: string, noMipmap: boolean, invertY: boolean, scene: Scene, samplingMode?: number, onLoad?: () => void, onError?: () => void, buffer?: any): WebGLTexture; + updateRawTexture(texture: WebGLTexture, data: ArrayBufferView, format: number, invertY: boolean, compression?: string): void; + createRawTexture(data: ArrayBufferView, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: string): WebGLTexture; + createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number, forceExponantOfTwo?: boolean): WebGLTexture; + updateTextureSamplingMode(samplingMode: number, texture: WebGLTexture): void; + updateDynamicTexture(texture: WebGLTexture, canvas: HTMLCanvasElement, invertY: boolean): void; + updateVideoTexture(texture: WebGLTexture, video: HTMLVideoElement, invertY: boolean): void; + createRenderTargetTexture(size: any, options: any): WebGLTexture; + createCubeTexture(rootUrl: string, scene: Scene, extensions: string[], noMipmap?: boolean): WebGLTexture; + _releaseTexture(texture: WebGLTexture): void; + bindSamplers(effect: Effect): void; + _bindTexture(channel: number, texture: WebGLTexture): void; + setTextureFromPostProcess(channel: number, postProcess: PostProcess): void; + setTexture(channel: number, texture: BaseTexture): void; + _setAnisotropicLevel(key: number, texture: BaseTexture): void; + readPixels(x: number, y: number, width: number, height: number): Uint8Array; + dispose(): void; + displayLoadingUI(): void; + loadingUIText: string; + loadingUIBackgroundColor: string; + hideLoadingUI(): void; + getFps(): number; + getDeltaTime(): number; + private _measureFps(); + static isSupported(): boolean; + } +} + +interface Window { + mozIndexedDB(func: any): any; + webkitIndexedDB(func: any): any; + IDBTransaction(func: any): any; + webkitIDBTransaction(func: any): any; + msIDBTransaction(func: any): any; + IDBKeyRange(func: any): any; + webkitIDBKeyRange(func: any): any; + msIDBKeyRange(func: any): any; + webkitURL: HTMLURL; + webkitRequestAnimationFrame(func: any): any; + mozRequestAnimationFrame(func: any): any; + oRequestAnimationFrame(func: any): any; + WebGLRenderingContext: WebGLRenderingContext; + MSGesture: MSGesture; + CANNON: any; + SIMD: any; + AudioContext: AudioContext; + webkitAudioContext: AudioContext; +} +interface HTMLURL { + createObjectURL(param1: any, param2?: any): any; +} +interface Document { + exitFullscreen(): void; + webkitCancelFullScreen(): void; + mozCancelFullScreen(): void; + msCancelFullScreen(): void; + mozFullScreen: boolean; + msIsFullScreen: boolean; + fullscreen: boolean; + mozPointerLockElement: HTMLElement; + msPointerLockElement: HTMLElement; + webkitPointerLockElement: HTMLElement; +} +interface HTMLCanvasElement { + requestPointerLock(): void; + msRequestPointerLock(): void; + mozRequestPointerLock(): void; + webkitRequestPointerLock(): void; +} +interface CanvasRenderingContext2D { + imageSmoothingEnabled: boolean; + mozImageSmoothingEnabled: boolean; + oImageSmoothingEnabled: boolean; + webkitImageSmoothingEnabled: boolean; +} +interface WebGLTexture { + isReady: boolean; + isCube: boolean; + url: string; + noMipmap: boolean; + samplingMode: number; + references: number; + generateMipMaps: boolean; + _size: number; + _baseWidth: number; + _baseHeight: number; + _width: number; + _height: number; + _workingCanvas: HTMLCanvasElement; + _workingContext: CanvasRenderingContext2D; + _framebuffer: WebGLFramebuffer; + _depthBuffer: WebGLRenderbuffer; + _cachedCoordinatesMode: number; + _cachedWrapU: number; + _cachedWrapV: number; + _isDisabled: boolean; +} +interface WebGLBuffer { + references: number; + capacity: number; + is32Bits: boolean; +} +interface MouseEvent { + mozMovementX: number; + mozMovementY: number; + webkitMovementX: number; + webkitMovementY: number; + msMovementX: number; + msMovementY: number; +} +interface MSStyleCSSProperties { + webkitTransform: string; + webkitTransition: string; +} +interface Navigator { + getVRDevices: () => any; + mozGetVRDevices: (any: any) => any; + isCocoonJS: boolean; +} +interface Screen { + orientation: string; + mozOrientation: string; +} + +declare module BABYLON { + /** + * Node is the basic class for all scene objects (Mesh, Light Camera). + */ + class Node { + parent: Node; + name: string; + id: string; + uniqueId: number; + state: string; + animations: Animation[]; + onReady: (node: Node) => void; + private _childrenFlag; + private _isEnabled; + private _isReady; + _currentRenderId: number; + private _parentRenderId; + _waitingParentId: string; + private _scene; + _cache: any; + /** + * @constructor + * @param {string} name - the name and id to be given to this node + * @param {BABYLON.Scene} the scene this node will be added to + */ + constructor(name: string, scene: Scene); + getScene(): Scene; + getEngine(): Engine; + getWorldMatrix(): Matrix; + _initCache(): void; + updateCache(force?: boolean): void; + _updateCache(ignoreParentClass?: boolean): void; + _isSynchronized(): boolean; + _markSyncedWithParent(): void; + isSynchronizedWithParent(): boolean; + isSynchronized(updateCache?: boolean): boolean; + hasNewParent(update?: boolean): boolean; + /** + * Is this node ready to be used/rendered + * @return {boolean} is it ready + */ + isReady(): boolean; + /** + * Is this node enabled. + * If the node has a parent and is enabled, the parent will be inspected as well. + * @return {boolean} whether this node (and its parent) is enabled. + * @see setEnabled + */ + isEnabled(): boolean; + /** + * Set the enabled state of this node. + * @param {boolean} value - the new enabled state + * @see isEnabled + */ + setEnabled(value: boolean): void; + /** + * Is this node a descendant of the given node. + * The function will iterate up the hierarchy until the ancestor was found or no more parents defined. + * @param {BABYLON.Node} ancestor - The parent node to inspect + * @see parent + */ + isDescendantOf(ancestor: Node): boolean; + _getDescendants(list: Node[], results: Node[]): void; + /** + * Will return all nodes that have this node as parent. + * @return {BABYLON.Node[]} all children nodes of all types. + */ + getDescendants(): Node[]; + _setReady(state: boolean): void; + } +} + +declare module BABYLON { + interface IDisposable { + dispose(): void; + } + /** + * Represents a scene to be rendered by the engine. + * @see http://doc.babylonjs.com/page.php?p=21911 + */ + class Scene { + private static _FOGMODE_NONE; + private static _FOGMODE_EXP; + private static _FOGMODE_EXP2; + private static _FOGMODE_LINEAR; + static MinDeltaTime: number; + static MaxDeltaTime: number; + static FOGMODE_NONE: number; + static FOGMODE_EXP: number; + static FOGMODE_EXP2: number; + static FOGMODE_LINEAR: number; + autoClear: boolean; + clearColor: any; + ambientColor: Color3; + /** + * A function to be executed before rendering this scene + * @type {Function} + */ + beforeRender: () => void; + /** + * A function to be executed after rendering this scene + * @type {Function} + */ + afterRender: () => void; + /** + * A function to be executed when this scene is disposed. + * @type {Function} + */ + onDispose: () => void; + beforeCameraRender: (camera: Camera) => void; + afterCameraRender: (camera: Camera) => void; + forceWireframe: boolean; + forcePointsCloud: boolean; + forceShowBoundingBoxes: boolean; + clipPlane: Plane; + animationsEnabled: boolean; + private _onPointerMove; + private _onPointerDown; + private _onPointerUp; + onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void; + onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void; + cameraToUseForPointers: Camera; + private _pointerX; + private _pointerY; + private _meshUnderPointer; + private _onKeyDown; + private _onKeyUp; + /** + * is fog enabled on this scene. + * @type {boolean} + */ + fogEnabled: boolean; + fogMode: number; + fogColor: Color3; + fogDensity: number; + fogStart: number; + fogEnd: number; + /** + * is shadow enabled on this scene. + * @type {boolean} + */ + shadowsEnabled: boolean; + /** + * is light enabled on this scene. + * @type {boolean} + */ + lightsEnabled: boolean; + /** + * All of the lights added to this scene. + * @see BABYLON.Light + * @type {BABYLON.Light[]} + */ + lights: Light[]; + onNewLightAdded: (newLight?: Light, positionInArray?: number, scene?: Scene) => void; + onLightRemoved: (removedLight?: Light) => void; + /** + * All of the cameras added to this scene. + * @see BABYLON.Camera + * @type {BABYLON.Camera[]} + */ + cameras: Camera[]; + onNewCameraAdded: (newCamera?: Camera, positionInArray?: number, scene?: Scene) => void; + onCameraRemoved: (removedCamera?: Camera) => void; + activeCameras: Camera[]; + activeCamera: Camera; + /** + * All of the (abstract) meshes added to this scene. + * @see BABYLON.AbstractMesh + * @type {BABYLON.AbstractMesh[]} + */ + meshes: AbstractMesh[]; + onNewMeshAdded: (newMesh?: AbstractMesh, positionInArray?: number, scene?: Scene) => void; + onMeshRemoved: (removedMesh?: AbstractMesh) => void; + private _geometries; + onGeometryAdded: (newGeometry?: Geometry) => void; + onGeometryRemoved: (removedGeometry?: Geometry) => void; + materials: Material[]; + multiMaterials: MultiMaterial[]; + defaultMaterial: StandardMaterial; + texturesEnabled: boolean; + textures: BaseTexture[]; + particlesEnabled: boolean; + particleSystems: ParticleSystem[]; + spritesEnabled: boolean; + spriteManagers: SpriteManager[]; + layers: Layer[]; + skeletonsEnabled: boolean; + skeletons: Skeleton[]; + lensFlaresEnabled: boolean; + lensFlareSystems: LensFlareSystem[]; + collisionsEnabled: boolean; + private _workerCollisions; + collisionCoordinator: ICollisionCoordinator; + gravity: Vector3; + postProcessesEnabled: boolean; + postProcessManager: PostProcessManager; + postProcessRenderPipelineManager: PostProcessRenderPipelineManager; + renderTargetsEnabled: boolean; + dumpNextRenderTargets: boolean; + customRenderTargets: RenderTargetTexture[]; + useDelayedTextureLoading: boolean; + importedMeshesFiles: String[]; + database: any; + /** + * This scene's action manager + * @type {BABYLON.ActionManager} + */ + actionManager: ActionManager; + _actionManagers: ActionManager[]; + private _meshesForIntersections; + proceduralTexturesEnabled: boolean; + _proceduralTextures: ProceduralTexture[]; + mainSoundTrack: SoundTrack; + soundTracks: SoundTrack[]; + private _audioEnabled; + private _headphone; + simplificationQueue: SimplificationQueue; + private _engine; + private _totalVertices; + _activeIndices: number; + _activeParticles: number; + private _lastFrameDuration; + private _evaluateActiveMeshesDuration; + private _renderTargetsDuration; + _particlesDuration: number; + private _renderDuration; + _spritesDuration: number; + private _animationRatio; + private _animationStartDate; + _cachedMaterial: Material; + private _renderId; + private _executeWhenReadyTimeoutId; + _toBeDisposed: SmartArray; + private _onReadyCallbacks; + private _pendingData; + private _onBeforeRenderCallbacks; + private _onAfterRenderCallbacks; + private _activeMeshes; + private _processedMaterials; + private _renderTargets; + _activeParticleSystems: SmartArray; + private _activeSkeletons; + private _softwareSkinnedMeshes; + _activeBones: number; + private _renderingManager; + private _physicsEngine; + _activeAnimatables: Animatable[]; + private _transformMatrix; + private _pickWithRayInverseMatrix; + private _edgesRenderers; + private _boundingBoxRenderer; + private _outlineRenderer; + private _viewMatrix; + private _projectionMatrix; + private _frustumPlanes; + private _selectionOctree; + private _pointerOverMesh; + private _debugLayer; + private _depthRenderer; + private _uniqueIdCounter; + /** + * @constructor + * @param {BABYLON.Engine} engine - the engine to be used to render this scene. + */ + constructor(engine: Engine); + debugLayer: DebugLayer; + workerCollisions: boolean; + SelectionOctree: Octree; + /** + * The mesh that is currently under the pointer. + * @return {BABYLON.AbstractMesh} mesh under the pointer/mouse cursor or null if none. + */ + meshUnderPointer: AbstractMesh; + /** + * Current on-screen X position of the pointer + * @return {number} X position of the pointer + */ + pointerX: number; + /** + * Current on-screen Y position of the pointer + * @return {number} Y position of the pointer + */ + pointerY: number; + getCachedMaterial(): Material; + getBoundingBoxRenderer(): BoundingBoxRenderer; + getOutlineRenderer(): OutlineRenderer; + getEngine(): Engine; + getTotalVertices(): number; + getActiveIndices(): number; + getActiveParticles(): number; + getActiveBones(): number; + getLastFrameDuration(): number; + getEvaluateActiveMeshesDuration(): number; + getActiveMeshes(): SmartArray; + getRenderTargetsDuration(): number; + getRenderDuration(): number; + getParticlesDuration(): number; + getSpritesDuration(): number; + getAnimationRatio(): number; + getRenderId(): number; + incrementRenderId(): void; + private _updatePointerPosition(evt); + attachControl(): void; + detachControl(): void; + isReady(): boolean; + resetCachedMaterial(): void; + registerBeforeRender(func: () => void): void; + unregisterBeforeRender(func: () => void): void; + registerAfterRender(func: () => void): void; + unregisterAfterRender(func: () => void): void; + _addPendingData(data: any): void; + _removePendingData(data: any): void; + getWaitingItemsCount(): number; + /** + * Registers a function to be executed when the scene is ready. + * @param {Function} func - the function to be executed. + */ + executeWhenReady(func: () => void): void; + _checkIsReady(): void; + /** + * Will start the animation sequence of a given target + * @param target - the target + * @param {number} from - from which frame should animation start + * @param {number} to - till which frame should animation run. + * @param {boolean} [loop] - should the animation loop + * @param {number} [speedRatio] - the speed in which to run the animation + * @param {Function} [onAnimationEnd] function to be executed when the animation ended. + * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params. + * @return {BABYLON.Animatable} the animatable object created for this animation + * @see BABYLON.Animatable + * @see http://doc.babylonjs.com/page.php?p=22081 + */ + beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable): Animatable; + beginDirectAnimation(target: any, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Animatable; + getAnimatableByTarget(target: any): Animatable; + /** + * Will stop the animation of the given target + * @param target - the target + * @see beginAnimation + */ + stopAnimation(target: any): void; + private _animate(); + getViewMatrix(): Matrix; + getProjectionMatrix(): Matrix; + getTransformMatrix(): Matrix; + setTransformMatrix(view: Matrix, projection: Matrix): void; + addMesh(newMesh: AbstractMesh): void; + removeMesh(toRemove: AbstractMesh): number; + removeLight(toRemove: Light): number; + removeCamera(toRemove: Camera): number; + addLight(newLight: Light): void; + addCamera(newCamera: Camera): void; + /** + * sets the active camera of the scene using its ID + * @param {string} id - the camera's ID + * @return {BABYLON.Camera|null} the new active camera or null if none found. + * @see activeCamera + */ + setActiveCameraByID(id: string): Camera; + /** + * sets the active camera of the scene using its name + * @param {string} name - the camera's name + * @return {BABYLON.Camera|null} the new active camera or null if none found. + * @see activeCamera + */ + setActiveCameraByName(name: string): Camera; + /** + * get a material using its id + * @param {string} the material's ID + * @return {BABYLON.Material|null} the material or null if none found. + */ + getMaterialByID(id: string): Material; + /** + * get a material using its name + * @param {string} the material's name + * @return {BABYLON.Material|null} the material or null if none found. + */ + getMaterialByName(name: string): Material; + getLensFlareSystemByName(name: string): LensFlareSystem; + getCameraByID(id: string): Camera; + getCameraByUniqueID(uniqueId: number): Camera; + /** + * get a camera using its name + * @param {string} the camera's name + * @return {BABYLON.Camera|null} the camera or null if none found. + */ + getCameraByName(name: string): Camera; + /** + * get a light node using its name + * @param {string} the light's name + * @return {BABYLON.Light|null} the light or null if none found. + */ + getLightByName(name: string): Light; + /** + * get a light node using its ID + * @param {string} the light's id + * @return {BABYLON.Light|null} the light or null if none found. + */ + getLightByID(id: string): Light; + /** + * get a light node using its scene-generated unique ID + * @param {number} the light's unique id + * @return {BABYLON.Light|null} the light or null if none found. + */ + getLightByUniqueID(uniqueId: number): Light; + /** + * get a geometry using its ID + * @param {string} the geometry's id + * @return {BABYLON.Geometry|null} the geometry or null if none found. + */ + getGeometryByID(id: string): Geometry; + /** + * add a new geometry to this scene. + * @param {BABYLON.Geometry} geometry - the geometry to be added to the scene. + * @param {boolean} [force] - force addition, even if a geometry with this ID already exists + * @return {boolean} was the geometry added or not + */ + pushGeometry(geometry: Geometry, force?: boolean): boolean; + /** + * Removes an existing geometry + * @param {BABYLON.Geometry} geometry - the geometry to be removed from the scene. + * @return {boolean} was the geometry removed or not + */ + removeGeometry(geometry: Geometry): boolean; + getGeometries(): Geometry[]; + /** + * Get the first added mesh found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + getMeshByID(id: string): AbstractMesh; + /** + * Get a mesh with its auto-generated unique id + * @param {number} uniqueId - the unique id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + getMeshByUniqueID(uniqueId: number): AbstractMesh; + /** + * Get a the last added mesh found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + getLastMeshByID(id: string): AbstractMesh; + /** + * Get a the last added node (Mesh, Camera, Light) found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.Node|null} the node found or null if not found at all. + */ + getLastEntryByID(id: string): Node; + getNodeByID(id: string): Node; + getNodeByName(name: string): Node; + getMeshByName(name: string): AbstractMesh; + getSoundByName(name: string): Sound; + getLastSkeletonByID(id: string): Skeleton; + getSkeletonById(id: string): Skeleton; + getSkeletonByName(name: string): Skeleton; + isActiveMesh(mesh: Mesh): boolean; + private _evaluateSubMesh(subMesh, mesh); + private _evaluateActiveMeshes(); + private _activeMesh(mesh); + updateTransformMatrix(force?: boolean): void; + private _renderForCamera(camera); + private _processSubCameras(camera); + private _checkIntersections(); + render(): void; + private _updateAudioParameters(); + audioEnabled: boolean; + private _disableAudio(); + private _enableAudio(); + headphone: boolean; + private _switchAudioModeForHeadphones(); + private _switchAudioModeForNormalSpeakers(); + enableDepthRenderer(): DepthRenderer; + disableDepthRenderer(): void; + dispose(): void; + disposeSounds(): void; + getWorldExtends(): { + min: Vector3; + max: Vector3; + }; + createOrUpdateSelectionOctree(maxCapacity?: number, maxDepth?: number): Octree; + createPickingRay(x: number, y: number, world: Matrix, camera: Camera): Ray; + private _internalPick(rayFunction, predicate, fastCheck?); + pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo; + pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo; + setPointerOverMesh(mesh: AbstractMesh): void; + getPointerOverMesh(): AbstractMesh; + getPhysicsEngine(): PhysicsEngine; + enablePhysics(gravity: Vector3, plugin?: IPhysicsEnginePlugin): boolean; + disablePhysicsEngine(): void; + isPhysicsEnabled(): boolean; + setGravity(gravity: Vector3): void; + createCompoundImpostor(parts: any, options: PhysicsBodyCreationOptions): any; + deleteCompoundImpostor(compound: any): void; + createDefaultCameraOrLight(): void; + private _getByTags(list, tagsQuery, forEach?); + getMeshesByTags(tagsQuery: string, forEach?: (mesh: AbstractMesh) => void): Mesh[]; + getCamerasByTags(tagsQuery: string, forEach?: (camera: Camera) => void): Camera[]; + getLightsByTags(tagsQuery: string, forEach?: (light: Light) => void): Light[]; + getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[]; + } +} + +declare module BABYLON { + class Action { + triggerOptions: any; + trigger: number; + _actionManager: ActionManager; + private _nextActiveAction; + private _child; + private _condition; + private _triggerParameter; + constructor(triggerOptions: any, condition?: Condition); + _prepare(): void; + getTriggerParameter(): any; + _executeCurrent(evt: ActionEvent): void; + execute(evt: ActionEvent): void; + then(action: Action): Action; + _getProperty(propertyPath: string): string; + _getEffectiveTarget(target: any, propertyPath: string): any; + } +} + +declare module BABYLON { + /** + * ActionEvent is the event beint sent when an action is triggered. + */ + class ActionEvent { + source: AbstractMesh; + pointerX: number; + pointerY: number; + meshUnderPointer: AbstractMesh; + sourceEvent: any; + additionalData: any; + /** + * @constructor + * @param source The mesh that triggered the action. + * @param pointerX the X mouse cursor position at the time of the event + * @param pointerY the Y mouse cursor position at the time of the event + * @param meshUnderPointer The mesh that is currently pointed at (can be null) + * @param sourceEvent the original (browser) event that triggered the ActionEvent + */ + constructor(source: AbstractMesh, pointerX: number, pointerY: number, meshUnderPointer: AbstractMesh, sourceEvent?: any, additionalData?: any); + /** + * Helper function to auto-create an ActionEvent from a source mesh. + * @param source the source mesh that triggered the event + * @param evt {Event} The original (browser) event + */ + static CreateNew(source: AbstractMesh, evt?: Event, additionalData?: any): ActionEvent; + /** + * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew + * @param scene the scene where the event occurred + * @param evt {Event} The original (browser) event + */ + static CreateNewFromScene(scene: Scene, evt: Event): ActionEvent; + } + /** + * Action Manager manages all events to be triggered on a given mesh or the global scene. + * A single scene can have many Action Managers to handle predefined actions on specific meshes. + */ + class ActionManager { + private static _NothingTrigger; + private static _OnPickTrigger; + private static _OnLeftPickTrigger; + private static _OnRightPickTrigger; + private static _OnCenterPickTrigger; + private static _OnPointerOverTrigger; + private static _OnPointerOutTrigger; + private static _OnEveryFrameTrigger; + private static _OnIntersectionEnterTrigger; + private static _OnIntersectionExitTrigger; + private static _OnKeyDownTrigger; + private static _OnKeyUpTrigger; + private static _OnPickUpTrigger; + static NothingTrigger: number; + static OnPickTrigger: number; + static OnLeftPickTrigger: number; + static OnRightPickTrigger: number; + static OnCenterPickTrigger: number; + static OnPointerOverTrigger: number; + static OnPointerOutTrigger: number; + static OnEveryFrameTrigger: number; + static OnIntersectionEnterTrigger: number; + static OnIntersectionExitTrigger: number; + static OnKeyDownTrigger: number; + static OnKeyUpTrigger: number; + static OnPickUpTrigger: number; + actions: Action[]; + private _scene; + constructor(scene: Scene); + dispose(): void; + getScene(): Scene; + /** + * Does this action manager handles actions of any of the given triggers + * @param {number[]} triggers - the triggers to be tested + * @return {boolean} whether one (or more) of the triggers is handeled + */ + hasSpecificTriggers(triggers: number[]): boolean; + /** + * Does this action manager handles actions of a given trigger + * @param {number} trigger - the trigger to be tested + * @return {boolean} whether the trigger is handeled + */ + hasSpecificTrigger(trigger: number): boolean; + /** + * Does this action manager has pointer triggers + * @return {boolean} whether or not it has pointer triggers + */ + hasPointerTriggers: boolean; + /** + * Does this action manager has pick triggers + * @return {boolean} whether or not it has pick triggers + */ + hasPickTriggers: boolean; + /** + * Registers an action to this action manager + * @param {BABYLON.Action} action - the action to be registered + * @return {BABYLON.Action} the action amended (prepared) after registration + */ + registerAction(action: Action): Action; + /** + * Process a specific trigger + * @param {number} trigger - the trigger to process + * @param evt {BABYLON.ActionEvent} the event details to be processed + */ + processTrigger(trigger: number, evt: ActionEvent): void; + _getEffectiveTarget(target: any, propertyPath: string): any; + _getProperty(propertyPath: string): string; + } +} + +declare module BABYLON { + class Condition { + _actionManager: ActionManager; + _evaluationId: number; + _currentResult: boolean; + constructor(actionManager: ActionManager); + isValid(): boolean; + _getProperty(propertyPath: string): string; + _getEffectiveTarget(target: any, propertyPath: string): any; + } + class ValueCondition extends Condition { + propertyPath: string; + value: any; + operator: number; + private static _IsEqual; + private static _IsDifferent; + private static _IsGreater; + private static _IsLesser; + static IsEqual: number; + static IsDifferent: number; + static IsGreater: number; + static IsLesser: number; + _actionManager: ActionManager; + private _target; + private _property; + constructor(actionManager: ActionManager, target: any, propertyPath: string, value: any, operator?: number); + isValid(): boolean; + } + class PredicateCondition extends Condition { + predicate: () => boolean; + _actionManager: ActionManager; + constructor(actionManager: ActionManager, predicate: () => boolean); + isValid(): boolean; + } + class StateCondition extends Condition { + value: string; + _actionManager: ActionManager; + private _target; + constructor(actionManager: ActionManager, target: any, value: string); + isValid(): boolean; + } +} + +declare module BABYLON { + class SwitchBooleanAction extends Action { + propertyPath: string; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, condition?: Condition); + _prepare(): void; + execute(): void; + } + class SetStateAction extends Action { + value: string; + private _target; + constructor(triggerOptions: any, target: any, value: string, condition?: Condition); + execute(): void; + } + class SetValueAction extends Action { + propertyPath: string; + value: any; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class IncrementValueAction extends Action { + propertyPath: string; + value: any; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class PlayAnimationAction extends Action { + from: number; + to: number; + loop: boolean; + private _target; + constructor(triggerOptions: any, target: any, from: number, to: number, loop?: boolean, condition?: Condition); + _prepare(): void; + execute(): void; + } + class StopAnimationAction extends Action { + private _target; + constructor(triggerOptions: any, target: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class DoNothingAction extends Action { + constructor(triggerOptions?: any, condition?: Condition); + execute(): void; + } + class CombineAction extends Action { + children: Action[]; + constructor(triggerOptions: any, children: Action[], condition?: Condition); + _prepare(): void; + execute(evt: ActionEvent): void; + } + class ExecuteCodeAction extends Action { + func: (evt: ActionEvent) => void; + constructor(triggerOptions: any, func: (evt: ActionEvent) => void, condition?: Condition); + execute(evt: ActionEvent): void; + } + class SetParentAction extends Action { + private _parent; + private _target; + constructor(triggerOptions: any, target: any, parent: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class PlaySoundAction extends Action { + private _sound; + constructor(triggerOptions: any, sound: Sound, condition?: Condition); + _prepare(): void; + execute(): void; + } + class StopSoundAction extends Action { + private _sound; + constructor(triggerOptions: any, sound: Sound, condition?: Condition); + _prepare(): void; + execute(): void; + } +} + +declare module BABYLON { + class InterpolateValueAction extends Action { + propertyPath: string; + value: any; + duration: number; + stopOtherAnimations: boolean; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, value: any, duration?: number, condition?: Condition, stopOtherAnimations?: boolean); + _prepare(): void; + execute(): void; + } +} + +declare module BABYLON { + class Animatable { + target: any; + fromFrame: number; + toFrame: number; + loopAnimation: boolean; + speedRatio: number; + onAnimationEnd: any; + private _localDelayOffset; + private _pausedDelay; + private _animations; + private _paused; + private _scene; + animationStarted: boolean; + constructor(scene: Scene, target: any, fromFrame?: number, toFrame?: number, loopAnimation?: boolean, speedRatio?: number, onAnimationEnd?: any, animations?: any); + appendAnimations(target: any, animations: Animation[]): void; + getAnimationByTargetProperty(property: string): Animation; + reset(): void; + pause(): void; + restart(): void; + stop(): void; + _animate(delay: number): boolean; + } +} + +declare module BABYLON { + class Animation { + name: string; + targetProperty: string; + framePerSecond: number; + dataType: number; + loopMode: number; + private _keys; + private _offsetsCache; + private _highLimitsCache; + private _stopped; + _target: any; + private _easingFunction; + targetPropertyPath: string[]; + currentFrame: number; + allowMatricesInterpolation: boolean; + static CreateAndStartAnimation(name: string, mesh: AbstractMesh, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): Animatable; + constructor(name: string, targetProperty: string, framePerSecond: number, dataType: number, loopMode?: number); + reset(): void; + isStopped(): boolean; + getKeys(): any[]; + getEasingFunction(): IEasingFunction; + setEasingFunction(easingFunction: EasingFunction): void; + floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number; + quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion; + vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3; + vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2; + color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3; + matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number): Matrix; + clone(): Animation; + setKeys(values: Array): void; + private _getKeyValue(value); + private _interpolate(currentFrame, repeatCount, loopMode, offsetValue?, highLimitValue?); + animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number): boolean; + private static _ANIMATIONTYPE_FLOAT; + private static _ANIMATIONTYPE_VECTOR3; + private static _ANIMATIONTYPE_QUATERNION; + private static _ANIMATIONTYPE_MATRIX; + private static _ANIMATIONTYPE_COLOR3; + private static _ANIMATIONTYPE_VECTOR2; + private static _ANIMATIONLOOPMODE_RELATIVE; + private static _ANIMATIONLOOPMODE_CYCLE; + private static _ANIMATIONLOOPMODE_CONSTANT; + static ANIMATIONTYPE_FLOAT: number; + static ANIMATIONTYPE_VECTOR3: number; + static ANIMATIONTYPE_VECTOR2: number; + static ANIMATIONTYPE_QUATERNION: number; + static ANIMATIONTYPE_MATRIX: number; + static ANIMATIONTYPE_COLOR3: number; + static ANIMATIONLOOPMODE_RELATIVE: number; + static ANIMATIONLOOPMODE_CYCLE: number; + static ANIMATIONLOOPMODE_CONSTANT: number; + } +} + +declare module BABYLON { + interface IEasingFunction { + ease(gradient: number): number; + } + class EasingFunction implements IEasingFunction { + private static _EASINGMODE_EASEIN; + private static _EASINGMODE_EASEOUT; + private static _EASINGMODE_EASEINOUT; + static EASINGMODE_EASEIN: number; + static EASINGMODE_EASEOUT: number; + static EASINGMODE_EASEINOUT: number; + private _easingMode; + setEasingMode(easingMode: number): void; + getEasingMode(): number; + easeInCore(gradient: number): number; + ease(gradient: number): number; + } + class CircleEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class BackEase extends EasingFunction implements IEasingFunction { + amplitude: number; + constructor(amplitude?: number); + easeInCore(gradient: number): number; + } + class BounceEase extends EasingFunction implements IEasingFunction { + bounces: number; + bounciness: number; + constructor(bounces?: number, bounciness?: number); + easeInCore(gradient: number): number; + } + class CubicEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class ElasticEase extends EasingFunction implements IEasingFunction { + oscillations: number; + springiness: number; + constructor(oscillations?: number, springiness?: number); + easeInCore(gradient: number): number; + } + class ExponentialEase extends EasingFunction implements IEasingFunction { + exponent: number; + constructor(exponent?: number); + easeInCore(gradient: number): number; + } + class PowerEase extends EasingFunction implements IEasingFunction { + power: number; + constructor(power?: number); + easeInCore(gradient: number): number; + } + class QuadraticEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class QuarticEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class QuinticEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class SineEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class BezierCurveEase extends EasingFunction implements IEasingFunction { + x1: number; + y1: number; + x2: number; + y2: number; + constructor(x1?: number, y1?: number, x2?: number, y2?: number); + easeInCore(gradient: number): number; + } +} + +declare module BABYLON { + class Analyser { + SMOOTHING: number; + FFT_SIZE: number; + BARGRAPHAMPLITUDE: number; + DEBUGCANVASPOS: { + x: number; + y: number; + }; + DEBUGCANVASSIZE: { + width: number; + height: number; + }; + private _byteFreqs; + private _byteTime; + private _floatFreqs; + private _webAudioAnalyser; + private _debugCanvas; + private _debugCanvasContext; + private _scene; + private _registerFunc; + private _audioEngine; + constructor(scene: Scene); + getFrequencyBinCount(): number; + getByteFrequencyData(): Uint8Array; + getByteTimeDomainData(): Uint8Array; + getFloatFrequencyData(): Uint8Array; + drawDebugCanvas(): void; + stopDebugCanvas(): void; + connectAudioNodes(inputAudioNode: AudioNode, outputAudioNode: AudioNode): void; + dispose(): void; + } +} + +declare module BABYLON { + class AudioEngine { + private _audioContext; + private _audioContextInitialized; + canUseWebAudio: boolean; + masterGain: GainNode; + private _connectedAnalyser; + WarnedWebAudioUnsupported: boolean; + audioContext: AudioContext; + constructor(); + private _initializeAudioContext(); + dispose(): void; + getGlobalVolume(): number; + setGlobalVolume(newVolume: number): void; + connectToAnalyser(analyser: Analyser): void; + } +} + +declare module BABYLON { + class Sound { + name: string; + autoplay: boolean; + loop: boolean; + useCustomAttenuation: boolean; + soundTrackId: number; + spatialSound: boolean; + refDistance: number; + rolloffFactor: number; + maxDistance: number; + distanceModel: string; + private _panningModel; + onended: () => any; + private _playbackRate; + private _startTime; + private _startOffset; + private _position; + private _localDirection; + private _volume; + private _isLoaded; + private _isReadyToPlay; + isPlaying: boolean; + isPaused: boolean; + private _isDirectional; + private _readyToPlayCallback; + private _audioBuffer; + private _soundSource; + private _soundPanner; + private _soundGain; + private _inputAudioNode; + private _ouputAudioNode; + private _coneInnerAngle; + private _coneOuterAngle; + private _coneOuterGain; + private _scene; + private _connectedMesh; + private _customAttenuationFunction; + private _registerFunc; + private _isOutputConnected; + /** + * Create a sound and attach it to a scene + * @param name Name of your sound + * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer + * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played + * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel + */ + constructor(name: string, urlOrArrayBuffer: any, scene: Scene, readyToPlayCallback?: () => void, options?: any); + dispose(): void; + private _soundLoaded(audioData); + setAudioBuffer(audioBuffer: AudioBuffer): void; + updateOptions(options: any): void; + private _createSpatialParameters(); + private _updateSpatialParameters(); + switchPanningModelToHRTF(): void; + switchPanningModelToEqualPower(): void; + private _switchPanningModel(); + connectToSoundTrackAudioNode(soundTrackAudioNode: AudioNode): void; + /** + * Transform this sound into a directional source + * @param coneInnerAngle Size of the inner cone in degree + * @param coneOuterAngle Size of the outer cone in degree + * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0) + */ + setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): void; + setPosition(newPosition: Vector3): void; + setLocalDirectionToMesh(newLocalDirection: Vector3): void; + private _updateDirection(); + updateDistanceFromListener(): void; + setAttenuationFunction(callback: (currentVolume: number, currentDistance: number, maxDistance: number, refDistance: number, rolloffFactor: number) => number): void; + /** + * Play the sound + * @param time (optional) Start the sound after X seconds. Start immediately (0) by default. + */ + play(time?: number): void; + private _onended(); + /** + * Stop the sound + * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default. + */ + stop(time?: number): void; + pause(): void; + setVolume(newVolume: number, time?: number): void; + setPlaybackRate(newPlaybackRate: number): void; + getVolume(): number; + attachToMesh(meshToConnectTo: AbstractMesh): void; + private _onRegisterAfterWorldMatrixUpdate(connectedMesh); + } +} + +declare module BABYLON { + class SoundTrack { + private _audioEngine; + private _outputAudioNode; + private _inputAudioNode; + private _trackConvolver; + private _scene; + id: number; + soundCollection: Array; + private _isMainTrack; + private _connectedAnalyser; + constructor(scene: Scene, options?: any); + dispose(): void; + AddSound(sound: Sound): void; + RemoveSound(sound: Sound): void; + setVolume(newVolume: number): void; + switchPanningModelToHRTF(): void; + switchPanningModelToEqualPower(): void; + connectToAnalyser(analyser: Analyser): void; + } +} + +declare module BABYLON { + class Bone extends Node { + name: string; + children: Bone[]; + animations: Animation[]; + private _skeleton; + private _matrix; + private _baseMatrix; + private _worldTransform; + private _absoluteTransform; + private _invertedAbsoluteTransform; + private _parent; + constructor(name: string, skeleton: Skeleton, parentBone: Bone, matrix: Matrix); + getParent(): Bone; + getLocalMatrix(): Matrix; + getBaseMatrix(): Matrix; + getWorldMatrix(): Matrix; + getInvertedAbsoluteTransform(): Matrix; + getAbsoluteMatrix(): Matrix; + updateMatrix(matrix: Matrix): void; + private _updateDifferenceMatrix(); + markAsDirty(): void; + } +} + +declare module BABYLON { + class Skeleton { + name: string; + id: string; + bones: Bone[]; + private _scene; + private _isDirty; + private _transformMatrices; + private _animatables; + private _identity; + constructor(name: string, id: string, scene: Scene); + getTransformMatrices(): Float32Array; + getScene(): Scene; + _markAsDirty(): void; + prepare(): void; + getAnimatables(): IAnimatable[]; + clone(name: string, id: string): Skeleton; + } +} + +declare module BABYLON { + class ArcRotateCamera extends TargetCamera { + alpha: number; + beta: number; + radius: number; + target: any; + inertialAlphaOffset: number; + inertialBetaOffset: number; + inertialRadiusOffset: number; + lowerAlphaLimit: any; + upperAlphaLimit: any; + lowerBetaLimit: number; + upperBetaLimit: number; + lowerRadiusLimit: any; + upperRadiusLimit: any; + angularSensibilityX: number; + angularSensibilityY: number; + wheelPrecision: number; + pinchPrecision: number; + panningSensibility: number; + inertialPanningX: number; + inertialPanningY: number; + keysUp: number[]; + keysDown: number[]; + keysLeft: number[]; + keysRight: number[]; + zoomOnFactor: number; + targetScreenOffset: Vector2; + pinchInwards: boolean; + allowUpsideDown: boolean; + private _keys; + _viewMatrix: Matrix; + private _attachedElement; + private _onContextMenu; + private _onPointerDown; + private _onPointerUp; + private _onPointerMove; + private _wheel; + private _onMouseMove; + private _onKeyDown; + private _onKeyUp; + private _onLostFocus; + _reset: () => void; + private _onGestureStart; + private _onGesture; + private _MSGestureHandler; + private _localDirection; + private _transformedDirection; + private _isRightClick; + private _isCtrlPushed; + onCollide: (collidedMesh: AbstractMesh) => void; + checkCollisions: boolean; + collisionRadius: Vector3; + private _collider; + private _previousPosition; + private _collisionVelocity; + private _newPosition; + private _previousAlpha; + private _previousBeta; + private _previousRadius; + private _collisionTriggered; + angularSensibility: number; + constructor(name: string, alpha: number, beta: number, radius: number, target: any, scene: Scene); + _getTargetPosition(): Vector3; + _initCache(): void; + _updateCache(ignoreParentClass?: boolean): void; + _isSynchronizedViewMatrix(): boolean; + attachControl(element: HTMLElement, noPreventDefault?: boolean, useCtrlForPanning?: boolean): void; + detachControl(element: HTMLElement): void; + _checkInputs(): void; + private _checkLimits(); + setPosition(position: Vector3): void; + setTarget(target: Vector3): void; + _getViewMatrix(): Matrix; + private _onCollisionPositionChange; + zoomOn(meshes?: AbstractMesh[], doNotUpdateMaxZ?: boolean): void; + focusOn(meshesOrMinMaxVectorAndDistance: any, doNotUpdateMaxZ?: boolean): void; + /** + * @override + * Override Camera.createRigCamera + */ + createRigCamera(name: string, cameraIndex: number): Camera; + /** + * @override + * Override Camera._updateRigCameras + */ + _updateRigCameras(): void; + } +} + +declare module BABYLON { + class VRCameraMetrics { + hResolution: number; + vResolution: number; + hScreenSize: number; + vScreenSize: number; + vScreenCenter: number; + eyeToScreenDistance: number; + lensSeparationDistance: number; + interpupillaryDistance: number; + distortionK: number[]; + chromaAbCorrection: number[]; + postProcessScaleFactor: number; + lensCenterOffset: number; + compensateDistorsion: boolean; + aspectRatio: number; + aspectRatioFov: number; + leftHMatrix: Matrix; + rightHMatrix: Matrix; + leftPreViewMatrix: Matrix; + rightPreViewMatrix: Matrix; + static GetDefault(): VRCameraMetrics; + } + class Camera extends Node { + position: Vector3; + private static _PERSPECTIVE_CAMERA; + private static _ORTHOGRAPHIC_CAMERA; + private static _FOVMODE_VERTICAL_FIXED; + private static _FOVMODE_HORIZONTAL_FIXED; + private static _RIG_MODE_NONE; + private static _RIG_MODE_STEREOSCOPIC_ANAGLYPH; + private static _RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL; + private static _RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED; + private static _RIG_MODE_STEREOSCOPIC_OVERUNDER; + private static _RIG_MODE_VR; + static PERSPECTIVE_CAMERA: number; + static ORTHOGRAPHIC_CAMERA: number; + static FOVMODE_VERTICAL_FIXED: number; + static FOVMODE_HORIZONTAL_FIXED: number; + static RIG_MODE_NONE: number; + static RIG_MODE_STEREOSCOPIC_ANAGLYPH: number; + static RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: number; + static RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: number; + static RIG_MODE_STEREOSCOPIC_OVERUNDER: number; + static RIG_MODE_VR: number; + upVector: Vector3; + orthoLeft: any; + orthoRight: any; + orthoBottom: any; + orthoTop: any; + fov: number; + minZ: number; + maxZ: number; + inertia: number; + mode: number; + isIntermediate: boolean; + viewport: Viewport; + layerMask: number; + fovMode: number; + cameraRigMode: number; + _cameraRigParams: any; + _rigCameras: Camera[]; + private _computedViewMatrix; + _projectionMatrix: Matrix; + private _worldMatrix; + _postProcesses: PostProcess[]; + _postProcessesTakenIndices: any[]; + _activeMeshes: SmartArray; + private _globalPosition; + constructor(name: string, position: Vector3, scene: Scene); + globalPosition: Vector3; + getActiveMeshes(): SmartArray; + isActiveMesh(mesh: Mesh): boolean; + _initCache(): void; + _updateCache(ignoreParentClass?: boolean): void; + _updateFromScene(): void; + _isSynchronized(): boolean; + _isSynchronizedViewMatrix(): boolean; + _isSynchronizedProjectionMatrix(): boolean; + attachControl(element: HTMLElement): void; + detachControl(element: HTMLElement): void; + _update(): void; + _checkInputs(): void; + attachPostProcess(postProcess: PostProcess, insertAt?: number): number; + detachPostProcess(postProcess: PostProcess, atIndices?: any): number[]; + getWorldMatrix(): Matrix; + _getViewMatrix(): Matrix; + getViewMatrix(force?: boolean): Matrix; + _computeViewMatrix(force?: boolean): Matrix; + getProjectionMatrix(force?: boolean): Matrix; + dispose(): void; + setCameraRigMode(mode: number, rigParams: any): void; + private _getVRProjectionMatrix(); + setCameraRigParameter(name: string, value: any): void; + /** + * May needs to be overridden by children so sub has required properties to be copied + */ + createRigCamera(name: string, cameraIndex: number): Camera; + /** + * May needs to be overridden by children + */ + _updateRigCameras(): void; + } +} + +declare module BABYLON { + class DeviceOrientationCamera extends FreeCamera { + private _offsetX; + private _offsetY; + private _orientationGamma; + private _orientationBeta; + private _initialOrientationGamma; + private _initialOrientationBeta; + private _attachedCanvas; + private _orientationChanged; + angularSensibility: number; + moveSensibility: number; + constructor(name: string, position: Vector3, scene: Scene); + attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void; + detachControl(canvas: HTMLCanvasElement): void; + _checkInputs(): void; + } +} + +declare module BABYLON { + class FollowCamera extends TargetCamera { + radius: number; + rotationOffset: number; + heightOffset: number; + cameraAcceleration: number; + maxCameraSpeed: number; + target: AbstractMesh; + constructor(name: string, position: Vector3, scene: Scene); + private getRadians(degrees); + private follow(cameraTarget); + _checkInputs(): void; + } + class ArcFollowCamera extends TargetCamera { + alpha: number; + beta: number; + radius: number; + target: AbstractMesh; + private _cartesianCoordinates; + constructor(name: string, alpha: number, beta: number, radius: number, target: AbstractMesh, scene: Scene); + private follow(); + _checkInputs(): void; + } +} + +declare module BABYLON { + class FreeCamera extends TargetCamera { + ellipsoid: Vector3; + keysUp: number[]; + keysDown: number[]; + keysLeft: number[]; + keysRight: number[]; + checkCollisions: boolean; + applyGravity: boolean; + angularSensibility: number; + onCollide: (collidedMesh: AbstractMesh) => void; + private _keys; + private _collider; + private _needMoveForGravity; + private _oldPosition; + private _diffPosition; + private _newPosition; + private _attachedElement; + private _localDirection; + private _transformedDirection; + private _onMouseDown; + private _onMouseUp; + private _onMouseOut; + private _onMouseMove; + private _onKeyDown; + private _onKeyUp; + _onLostFocus: (e: FocusEvent) => any; + _waitingLockedTargetId: string; + constructor(name: string, position: Vector3, scene: Scene); + attachControl(element: HTMLElement, noPreventDefault?: boolean): void; + detachControl(element: HTMLElement): void; + _collideWithWorld(velocity: Vector3): void; + private _onCollisionPositionChange; + _checkInputs(): void; + _decideIfNeedsToMove(): boolean; + _updatePosition(): void; + } +} + +declare module BABYLON { + class GamepadCamera extends FreeCamera { + private _gamepad; + private _gamepads; + angularSensibility: number; + moveSensibility: number; + constructor(name: string, position: Vector3, scene: Scene); + private _onNewGameConnected(gamepad); + _checkInputs(): void; + dispose(): void; + } +} + +declare module BABYLON { + class AnaglyphFreeCamera extends FreeCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, scene: Scene); + } + class AnaglyphArcRotateCamera extends ArcRotateCamera { + constructor(name: string, alpha: number, beta: number, radius: number, target: any, interaxialDistance: number, scene: Scene); + } + class AnaglyphGamepadCamera extends GamepadCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, scene: Scene); + } + class StereoscopicFreeCamera extends FreeCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, isSideBySide: boolean, scene: Scene); + } + class StereoscopicArcRotateCamera extends ArcRotateCamera { + constructor(name: string, alpha: number, beta: number, radius: number, target: any, interaxialDistance: number, isSideBySide: boolean, scene: Scene); + } + class StereoscopicGamepadCamera extends GamepadCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, isSideBySide: boolean, scene: Scene); + } +} + +declare module BABYLON { + class TargetCamera extends Camera { + cameraDirection: Vector3; + cameraRotation: Vector2; + rotation: Vector3; + speed: number; + noRotationConstraint: boolean; + lockedTarget: any; + _currentTarget: Vector3; + _viewMatrix: Matrix; + _camMatrix: Matrix; + _cameraTransformMatrix: Matrix; + _cameraRotationMatrix: Matrix; + private _rigCamTransformMatrix; + _referencePoint: Vector3; + _transformedReferencePoint: Vector3; + _lookAtTemp: Matrix; + _tempMatrix: Matrix; + _reset: () => void; + _waitingLockedTargetId: string; + constructor(name: string, position: Vector3, scene: Scene); + getFrontPosition(distance: number): Vector3; + _getLockedTargetPosition(): Vector3; + _initCache(): void; + _updateCache(ignoreParentClass?: boolean): void; + _isSynchronizedViewMatrix(): boolean; + _computeLocalCameraSpeed(): number; + setTarget(target: Vector3): void; + getTarget(): Vector3; + _decideIfNeedsToMove(): boolean; + _updatePosition(): void; + _checkInputs(): void; + _getViewMatrix(): Matrix; + _getVRViewMatrix(): Matrix; + /** + * @override + * Override Camera.createRigCamera + */ + createRigCamera(name: string, cameraIndex: number): Camera; + /** + * @override + * Override Camera._updateRigCameras + */ + _updateRigCameras(): void; + private _getRigCamPosition(halfSpace, result); + } +} + +declare module BABYLON { + class TouchCamera extends FreeCamera { + private _offsetX; + private _offsetY; + private _pointerCount; + private _pointerPressed; + private _attachedCanvas; + private _onPointerDown; + private _onPointerUp; + private _onPointerMove; + angularSensibility: number; + moveSensibility: number; + constructor(name: string, position: Vector3, scene: Scene); + attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void; + detachControl(canvas: HTMLCanvasElement): void; + _checkInputs(): void; + } +} + +declare module BABYLON { + class VirtualJoysticksCamera extends FreeCamera { + private _leftjoystick; + private _rightjoystick; + constructor(name: string, position: Vector3, scene: Scene); + getLeftJoystick(): VirtualJoystick; + getRightJoystick(): VirtualJoystick; + _checkInputs(): void; + dispose(): void; + } +} + +declare module BABYLON { + class Collider { + radius: Vector3; + retry: number; + velocity: Vector3; + basePoint: Vector3; + epsilon: number; + collisionFound: boolean; + velocityWorldLength: number; + basePointWorld: Vector3; + velocityWorld: Vector3; + normalizedVelocity: Vector3; + initialVelocity: Vector3; + initialPosition: Vector3; + nearestDistance: number; + intersectionPoint: Vector3; + collidedMesh: AbstractMesh; + private _collisionPoint; + private _planeIntersectionPoint; + private _tempVector; + private _tempVector2; + private _tempVector3; + private _tempVector4; + private _edge; + private _baseToVertex; + private _destinationPoint; + private _slidePlaneNormal; + private _displacementVector; + _initialize(source: Vector3, dir: Vector3, e: number): void; + _checkPointInTriangle(point: Vector3, pa: Vector3, pb: Vector3, pc: Vector3, n: Vector3): boolean; + _canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): boolean; + _testTriangle(faceIndex: number, trianglePlaneArray: Array, p1: Vector3, p2: Vector3, p3: Vector3, hasMaterial: boolean): void; + _collide(trianglePlaneArray: Array, pts: Vector3[], indices: number[], indexStart: number, indexEnd: number, decal: number, hasMaterial: boolean): void; + _getResponse(pos: Vector3, vel: Vector3): void; + } +} + +declare module BABYLON { + var CollisionWorker: string; + interface ICollisionCoordinator { + getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void; + init(scene: Scene): void; + destroy(): void; + onMeshAdded(mesh: AbstractMesh): any; + onMeshUpdated(mesh: AbstractMesh): any; + onMeshRemoved(mesh: AbstractMesh): any; + onGeometryAdded(geometry: Geometry): any; + onGeometryUpdated(geometry: Geometry): any; + onGeometryDeleted(geometry: Geometry): any; + } + interface SerializedMesh { + id: string; + name: string; + uniqueId: number; + geometryId: string; + sphereCenter: Array; + sphereRadius: number; + boxMinimum: Array; + boxMaximum: Array; + worldMatrixFromCache: any; + subMeshes: Array; + checkCollisions: boolean; + } + interface SerializedSubMesh { + position: number; + verticesStart: number; + verticesCount: number; + indexStart: number; + indexCount: number; + hasMaterial: boolean; + sphereCenter: Array; + sphereRadius: number; + boxMinimum: Array; + boxMaximum: Array; + } + interface SerializedGeometry { + id: string; + positions: Float32Array; + indices: Int32Array; + normals: Float32Array; + } + interface BabylonMessage { + taskType: WorkerTaskType; + payload: InitPayload | CollidePayload | UpdatePayload; + } + interface SerializedColliderToWorker { + position: Array; + velocity: Array; + radius: Array; + } + enum WorkerTaskType { + INIT = 0, + UPDATE = 1, + COLLIDE = 2, + } + interface WorkerReply { + error: WorkerReplyType; + taskType: WorkerTaskType; + payload?: any; + } + interface CollisionReplyPayload { + newPosition: Array; + collisionId: number; + collidedMeshUniqueId: number; + } + interface InitPayload { + } + interface CollidePayload { + collisionId: number; + collider: SerializedColliderToWorker; + maximumRetry: number; + excludedMeshUniqueId?: number; + } + interface UpdatePayload { + updatedMeshes: { + [n: number]: SerializedMesh; + }; + updatedGeometries: { + [s: string]: SerializedGeometry; + }; + removedMeshes: Array; + removedGeometries: Array; + } + enum WorkerReplyType { + SUCCESS = 0, + UNKNOWN_ERROR = 1, + } + class CollisionCoordinatorWorker implements ICollisionCoordinator { + private _scene; + private _scaledPosition; + private _scaledVelocity; + private _collisionsCallbackArray; + private _init; + private _runningUpdated; + private _runningCollisionTask; + private _worker; + private _addUpdateMeshesList; + private _addUpdateGeometriesList; + private _toRemoveMeshesArray; + private _toRemoveGeometryArray; + constructor(); + static SerializeMesh: (mesh: AbstractMesh) => SerializedMesh; + static SerializeGeometry: (geometry: Geometry) => SerializedGeometry; + getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void; + init(scene: Scene): void; + destroy(): void; + onMeshAdded(mesh: AbstractMesh): void; + onMeshUpdated: (mesh: AbstractMesh) => void; + onMeshRemoved(mesh: AbstractMesh): void; + onGeometryAdded(geometry: Geometry): void; + onGeometryUpdated: (geometry: Geometry) => void; + onGeometryDeleted(geometry: Geometry): void; + private _afterRender; + private _onMessageFromWorker; + } + class CollisionCoordinatorLegacy implements ICollisionCoordinator { + private _scene; + private _scaledPosition; + private _scaledVelocity; + private _finalPosition; + getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void; + init(scene: Scene): void; + destroy(): void; + onMeshAdded(mesh: AbstractMesh): void; + onMeshUpdated(mesh: AbstractMesh): void; + onMeshRemoved(mesh: AbstractMesh): void; + onGeometryAdded(geometry: Geometry): void; + onGeometryUpdated(geometry: Geometry): void; + onGeometryDeleted(geometry: Geometry): void; + private _collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh?); + } +} + +declare module BABYLON { + var WorkerIncluded: boolean; + class CollisionCache { + private _meshes; + private _geometries; + getMeshes(): { + [n: number]: SerializedMesh; + }; + getGeometries(): { + [s: number]: SerializedGeometry; + }; + getMesh(id: any): SerializedMesh; + addMesh(mesh: SerializedMesh): void; + getGeometry(id: string): SerializedGeometry; + addGeometry(geometry: SerializedGeometry): void; + } + class CollideWorker { + collider: Collider; + private _collisionCache; + private finalPosition; + private collisionsScalingMatrix; + private collisionTranformationMatrix; + constructor(collider: Collider, _collisionCache: CollisionCache, finalPosition: Vector3); + collideWithWorld(position: Vector3, velocity: Vector3, maximumRetry: number, excludedMeshUniqueId?: number): void; + private checkCollision(mesh); + private processCollisionsForSubMeshes(transformMatrix, mesh); + private collideForSubMesh(subMesh, transformMatrix, meshGeometry); + private checkSubmeshCollision(subMesh); + } + interface ICollisionDetector { + onInit(payload: InitPayload): void; + onUpdate(payload: UpdatePayload): void; + onCollision(payload: CollidePayload): void; + } + class CollisionDetectorTransferable implements ICollisionDetector { + private _collisionCache; + onInit(payload: InitPayload): void; + onUpdate(payload: UpdatePayload): void; + onCollision(payload: CollidePayload): void; + } +} + +declare module BABYLON { + class IntersectionInfo { + bu: number; + bv: number; + distance: number; + faceId: number; + subMeshId: number; + constructor(bu: number, bv: number, distance: number); + } + class PickingInfo { + hit: boolean; + distance: number; + pickedPoint: Vector3; + pickedMesh: AbstractMesh; + bu: number; + bv: number; + faceId: number; + subMeshId: number; + getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3; + getTextureCoordinates(): Vector2; + } +} + +declare module BABYLON { + class BoundingBox { + minimum: Vector3; + maximum: Vector3; + vectors: Vector3[]; + center: Vector3; + extendSize: Vector3; + directions: Vector3[]; + vectorsWorld: Vector3[]; + minimumWorld: Vector3; + maximumWorld: Vector3; + private _worldMatrix; + constructor(minimum: Vector3, maximum: Vector3); + getWorldMatrix(): Matrix; + _update(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + isCompletelyInFrustum(frustumPlanes: Plane[]): boolean; + intersectsPoint(point: Vector3): boolean; + intersectsSphere(sphere: BoundingSphere): boolean; + intersectsMinMax(min: Vector3, max: Vector3): boolean; + static Intersects(box0: BoundingBox, box1: BoundingBox): boolean; + static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean; + static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean; + static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean; + } +} + +declare module BABYLON { + class BoundingInfo { + minimum: Vector3; + maximum: Vector3; + boundingBox: BoundingBox; + boundingSphere: BoundingSphere; + constructor(minimum: Vector3, maximum: Vector3); + _update(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + isCompletelyInFrustum(frustumPlanes: Plane[]): boolean; + _checkCollision(collider: Collider): boolean; + intersectsPoint(point: Vector3): boolean; + intersects(boundingInfo: BoundingInfo, precise: boolean): boolean; + } +} + +declare module BABYLON { + class BoundingSphere { + minimum: Vector3; + maximum: Vector3; + center: Vector3; + radius: number; + centerWorld: Vector3; + radiusWorld: number; + private _tempRadiusVector; + constructor(minimum: Vector3, maximum: Vector3); + _update(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + intersectsPoint(point: Vector3): boolean; + static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean; + } +} + +declare module BABYLON { + class DebugLayer { + private _scene; + private _camera; + private _transformationMatrix; + private _enabled; + private _labelsEnabled; + private _displayStatistics; + private _displayTree; + private _displayLogs; + private _globalDiv; + private _statsDiv; + private _statsSubsetDiv; + private _optionsDiv; + private _optionsSubsetDiv; + private _logDiv; + private _logSubsetDiv; + private _treeDiv; + private _treeSubsetDiv; + private _drawingCanvas; + private _drawingContext; + private _syncPositions; + private _syncData; + private _syncUI; + private _onCanvasClick; + private _clickPosition; + private _ratio; + private _identityMatrix; + private _showUI; + private _needToRefreshMeshesTree; + shouldDisplayLabel: (node: Node) => boolean; + shouldDisplayAxis: (mesh: Mesh) => boolean; + axisRatio: number; + accentColor: string; + customStatsFunction: () => string; + constructor(scene: Scene); + private _refreshMeshesTreeContent(); + private _renderSingleAxis(zero, unit, unitText, label, color); + private _renderAxis(projectedPosition, mesh, globalViewport); + private _renderLabel(text, projectedPosition, labelOffset, onClick, getFillStyle); + private _isClickInsideRect(x, y, width, height); + isVisible(): boolean; + hide(): void; + show(showUI?: boolean, camera?: Camera): void; + private _clearLabels(); + private _generateheader(root, text); + private _generateTexBox(root, title, color); + private _generateAdvancedCheckBox(root, leftTitle, rightTitle, initialState, task, tag?); + private _generateCheckBox(root, title, initialState, task, tag?); + private _generateButton(root, title, task, tag?); + private _generateRadio(root, title, name, initialState, task, tag?); + private _generateDOMelements(); + private _displayStats(); + } +} + +declare module BABYLON { + class Layer { + name: string; + texture: Texture; + isBackground: boolean; + color: Color4; + onDispose: () => void; + private _scene; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + private _indexBuffer; + private _effect; + constructor(name: string, imgUrl: string, scene: Scene, isBackground?: boolean, color?: Color4); + render(): void; + dispose(): void; + } +} + +declare module BABYLON { + class LensFlare { + size: number; + position: number; + color: Color3; + texture: Texture; + private _system; + constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem); + dispose: () => void; + } +} + +declare module BABYLON { + class LensFlareSystem { + name: string; + lensFlares: LensFlare[]; + borderLimit: number; + meshesSelectionPredicate: (mesh: Mesh) => boolean; + layerMask: number; + private _scene; + private _emitter; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + private _indexBuffer; + private _effect; + private _positionX; + private _positionY; + private _isEnabled; + constructor(name: string, emitter: any, scene: Scene); + isEnabled: boolean; + getScene(): Scene; + getEmitter(): any; + setEmitter(newEmitter: any): void; + getEmitterPosition(): Vector3; + computeEffectivePosition(globalViewport: Viewport): boolean; + _isVisible(): boolean; + render(): boolean; + dispose(): void; + } +} + +declare module BABYLON { + class DirectionalLight extends Light implements IShadowLight { + direction: Vector3; + position: Vector3; + private _transformedDirection; + transformedPosition: Vector3; + private _worldMatrix; + shadowOrthoScale: number; + constructor(name: string, direction: Vector3, scene: Scene); + getAbsolutePosition(): Vector3; + setDirectionToTarget(target: Vector3): Vector3; + setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; + supportsVSM(): boolean; + needRefreshPerFrame(): boolean; + computeTransformedPosition(): boolean; + transferToEffect(effect: Effect, directionUniformName: string): void; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + class HemisphericLight extends Light { + direction: Vector3; + groundColor: Color3; + private _worldMatrix; + constructor(name: string, direction: Vector3, scene: Scene); + setDirectionToTarget(target: Vector3): Vector3; + getShadowGenerator(): ShadowGenerator; + transferToEffect(effect: Effect, directionUniformName: string, groundColorUniformName: string): void; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + interface IShadowLight { + position: Vector3; + direction: Vector3; + transformedPosition: Vector3; + name: string; + computeTransformedPosition(): boolean; + getScene(): Scene; + setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; + supportsVSM(): boolean; + needRefreshPerFrame(): boolean; + _shadowGenerator: ShadowGenerator; + } + class Light extends Node { + diffuse: Color3; + specular: Color3; + intensity: number; + range: number; + includeOnlyWithLayerMask: number; + includedOnlyMeshes: AbstractMesh[]; + excludedMeshes: AbstractMesh[]; + excludeWithLayerMask: number; + _shadowGenerator: ShadowGenerator; + private _parentedWorldMatrix; + _excludedMeshesIds: string[]; + _includedOnlyMeshesIds: string[]; + constructor(name: string, scene: Scene); + getShadowGenerator(): ShadowGenerator; + getAbsolutePosition(): Vector3; + transferToEffect(effect: Effect, uniformName0?: string, uniformName1?: string): void; + _getWorldMatrix(): Matrix; + canAffectMesh(mesh: AbstractMesh): boolean; + getWorldMatrix(): Matrix; + dispose(): void; + } +} + +declare module BABYLON { + class PointLight extends Light { + position: Vector3; + private _worldMatrix; + private _transformedPosition; + constructor(name: string, position: Vector3, scene: Scene); + getAbsolutePosition(): Vector3; + transferToEffect(effect: Effect, positionUniformName: string): void; + getShadowGenerator(): ShadowGenerator; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + class SpotLight extends Light implements IShadowLight { + position: Vector3; + direction: Vector3; + angle: number; + exponent: number; + transformedPosition: Vector3; + private _transformedDirection; + private _worldMatrix; + constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponent: number, scene: Scene); + getAbsolutePosition(): Vector3; + setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; + supportsVSM(): boolean; + needRefreshPerFrame(): boolean; + setDirectionToTarget(target: Vector3): Vector3; + computeTransformedPosition(): boolean; + transferToEffect(effect: Effect, positionUniformName: string, directionUniformName: string): void; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + interface ISceneLoaderPlugin { + extensions: string; + importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean; + load: (scene: Scene, data: string, rootUrl: string) => boolean; + } + class SceneLoader { + private static _ForceFullSceneLoadingForIncremental; + private static _ShowLoadingScreen; + static ForceFullSceneLoadingForIncremental: boolean; + static ShowLoadingScreen: boolean; + private static _registeredPlugins; + private static _getPluginForFilename(sceneFilename); + static RegisterPlugin(plugin: ISceneLoaderPlugin): void; + static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void; + /** + * Load a scene + * @param rootUrl a string that defines the root url for scene and resources + * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene + * @param engine is the instance of BABYLON.Engine to use to create the scene + */ + static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void; + /** + * Append a scene + * @param rootUrl a string that defines the root url for scene and resources + * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene + * @param scene is the instance of BABYLON.Scene to append to + */ + static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void; + } +} + +declare module BABYLON { + class EffectFallbacks { + private _defines; + private _currentRank; + private _maxRank; + addFallback(rank: number, define: string): void; + isMoreFallbacks: boolean; + reduce(currentDefines: string): string; + } + class Effect { + name: any; + defines: string; + onCompiled: (effect: Effect) => void; + onError: (effect: Effect, errors: string) => void; + onBind: (effect: Effect) => void; + private _engine; + private _uniformsNames; + private _samplers; + private _isReady; + private _compilationError; + private _attributesNames; + private _attributes; + private _uniforms; + _key: string; + private _program; + private _valueCache; + constructor(baseName: any, attributesNames: string[], uniformsNames: string[], samplers: string[], engine: any, defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void); + isReady(): boolean; + getProgram(): WebGLProgram; + getAttributesNames(): string[]; + getAttributeLocation(index: number): number; + getAttributeLocationByName(name: string): number; + getAttributesCount(): number; + getUniformIndex(uniformName: string): number; + getUniform(uniformName: string): WebGLUniformLocation; + getSamplers(): string[]; + getCompilationError(): string; + _loadVertexShader(vertex: any, callback: (data: any) => void): void; + _loadFragmentShader(fragment: any, callback: (data: any) => void): void; + private _prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks?); + _bindTexture(channel: string, texture: WebGLTexture): void; + setTexture(channel: string, texture: BaseTexture): void; + setTextureFromPostProcess(channel: string, postProcess: PostProcess): void; + _cacheFloat2(uniformName: string, x: number, y: number): void; + _cacheFloat3(uniformName: string, x: number, y: number, z: number): void; + _cacheFloat4(uniformName: string, x: number, y: number, z: number, w: number): void; + setArray(uniformName: string, array: number[]): Effect; + setArray2(uniformName: string, array: number[]): Effect; + setArray3(uniformName: string, array: number[]): Effect; + setArray4(uniformName: string, array: number[]): Effect; + setMatrices(uniformName: string, matrices: Float32Array): Effect; + setMatrix(uniformName: string, matrix: Matrix): Effect; + setMatrix3x3(uniformName: string, matrix: Float32Array): Effect; + setMatrix2x2(uniformname: string, matrix: Float32Array): Effect; + setFloat(uniformName: string, value: number): Effect; + setBool(uniformName: string, bool: boolean): Effect; + setVector2(uniformName: string, vector2: Vector2): Effect; + setFloat2(uniformName: string, x: number, y: number): Effect; + setVector3(uniformName: string, vector3: Vector3): Effect; + setFloat3(uniformName: string, x: number, y: number, z: number): Effect; + setVector4(uniformName: string, vector4: Vector4): Effect; + setFloat4(uniformName: string, x: number, y: number, z: number, w: number): Effect; + setColor3(uniformName: string, color3: Color3): Effect; + setColor4(uniformName: string, color3: Color3, alpha: number): Effect; + static ShadersStore: {}; + } +} + +declare module BABYLON { + class Material { + name: string; + private static _TriangleFillMode; + private static _WireFrameFillMode; + private static _PointFillMode; + static TriangleFillMode: number; + static WireFrameFillMode: number; + static PointFillMode: number; + id: string; + checkReadyOnEveryCall: boolean; + checkReadyOnlyOnce: boolean; + state: string; + alpha: number; + backFaceCulling: boolean; + onCompiled: (effect: Effect) => void; + onError: (effect: Effect, errors: string) => void; + onDispose: () => void; + onBind: (material: Material, mesh: Mesh) => void; + getRenderTargetTextures: () => SmartArray; + alphaMode: number; + disableDepthWrite: boolean; + _effect: Effect; + _wasPreviouslyReady: boolean; + private _scene; + private _fillMode; + private _cachedDepthWriteState; + pointSize: number; + zOffset: number; + wireframe: boolean; + pointsCloud: boolean; + fillMode: number; + constructor(name: string, scene: Scene, doNotAdd?: boolean); + isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean; + getEffect(): Effect; + getScene(): Scene; + needAlphaBlending(): boolean; + needAlphaTesting(): boolean; + getAlphaTestTexture(): BaseTexture; + trackCreation(onCompiled: (effect: Effect) => void, onError: (effect: Effect, errors: string) => void): void; + _preBind(): void; + bind(world: Matrix, mesh?: Mesh): void; + bindOnlyWorldMatrix(world: Matrix): void; + unbind(): void; + clone(name: string): Material; + dispose(forceDisposeEffect?: boolean): void; + } +} + +declare module BABYLON { + class MultiMaterial extends Material { + subMaterials: Material[]; + constructor(name: string, scene: Scene); + getSubMaterial(index: any): Material; + isReady(mesh?: AbstractMesh): boolean; + clone(name: string): MultiMaterial; + } +} + +declare module BABYLON { + class ShaderMaterial extends Material { + private _shaderPath; + private _options; + private _textures; + private _floats; + private _floatsArrays; + private _colors3; + private _colors4; + private _vectors2; + private _vectors3; + private _vectors4; + private _matrices; + private _matrices3x3; + private _matrices2x2; + private _cachedWorldViewMatrix; + private _renderId; + constructor(name: string, scene: Scene, shaderPath: any, options: any); + needAlphaBlending(): boolean; + needAlphaTesting(): boolean; + private _checkUniform(uniformName); + setTexture(name: string, texture: Texture): ShaderMaterial; + setFloat(name: string, value: number): ShaderMaterial; + setFloats(name: string, value: number[]): ShaderMaterial; + setColor3(name: string, value: Color3): ShaderMaterial; + setColor4(name: string, value: Color4): ShaderMaterial; + setVector2(name: string, value: Vector2): ShaderMaterial; + setVector3(name: string, value: Vector3): ShaderMaterial; + setVector4(name: string, value: Vector4): ShaderMaterial; + setMatrix(name: string, value: Matrix): ShaderMaterial; + setMatrix3x3(name: string, value: Float32Array): ShaderMaterial; + setMatrix2x2(name: string, value: Float32Array): ShaderMaterial; + isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean; + bindOnlyWorldMatrix(world: Matrix): void; + bind(world: Matrix, mesh?: Mesh): void; + clone(name: string): ShaderMaterial; + dispose(forceDisposeEffect?: boolean): void; + } +} + +declare module BABYLON { + class FresnelParameters { + isEnabled: boolean; + leftColor: Color3; + rightColor: Color3; + bias: number; + power: number; + } + class StandardMaterial extends Material { + diffuseTexture: BaseTexture; + ambientTexture: BaseTexture; + opacityTexture: BaseTexture; + reflectionTexture: BaseTexture; + emissiveTexture: BaseTexture; + specularTexture: BaseTexture; + bumpTexture: BaseTexture; + ambientColor: Color3; + diffuseColor: Color3; + specularColor: Color3; + specularPower: number; + emissiveColor: Color3; + useAlphaFromDiffuseTexture: boolean; + useEmissiveAsIllumination: boolean; + useReflectionFresnelFromSpecular: boolean; + useSpecularOverAlpha: boolean; + fogEnabled: boolean; + roughness: number; + diffuseFresnelParameters: FresnelParameters; + opacityFresnelParameters: FresnelParameters; + reflectionFresnelParameters: FresnelParameters; + emissiveFresnelParameters: FresnelParameters; + useGlossinessFromSpecularMapAlpha: boolean; + private _renderTargets; + private _worldViewProjectionMatrix; + private _globalAmbientColor; + private _scaledDiffuse; + private _scaledSpecular; + private _renderId; + private _defines; + private _cachedDefines; + constructor(name: string, scene: Scene); + needAlphaBlending(): boolean; + needAlphaTesting(): boolean; + private _shouldUseAlphaFromDiffuseTexture(); + getAlphaTestTexture(): BaseTexture; + isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean; + unbind(): void; + bindOnlyWorldMatrix(world: Matrix): void; + bind(world: Matrix, mesh?: Mesh): void; + getAnimatables(): IAnimatable[]; + dispose(forceDisposeEffect?: boolean): void; + clone(name: string): StandardMaterial; + static DiffuseTextureEnabled: boolean; + static AmbientTextureEnabled: boolean; + static OpacityTextureEnabled: boolean; + static ReflectionTextureEnabled: boolean; + static EmissiveTextureEnabled: boolean; + static SpecularTextureEnabled: boolean; + static BumpTextureEnabled: boolean; + static FresnelEnabled: boolean; + } +} + +declare module BABYLON { + class Color3 { + r: number; + g: number; + b: number; + constructor(r?: number, g?: number, b?: number); + toString(): string; + toArray(array: number[], index?: number): Color3; + toColor4(alpha?: number): Color4; + asArray(): number[]; + toLuminance(): number; + multiply(otherColor: Color3): Color3; + multiplyToRef(otherColor: Color3, result: Color3): Color3; + equals(otherColor: Color3): boolean; + equalsFloats(r: number, g: number, b: number): boolean; + scale(scale: number): Color3; + scaleToRef(scale: number, result: Color3): Color3; + add(otherColor: Color3): Color3; + addToRef(otherColor: Color3, result: Color3): Color3; + subtract(otherColor: Color3): Color3; + subtractToRef(otherColor: Color3, result: Color3): Color3; + clone(): Color3; + copyFrom(source: Color3): Color3; + copyFromFloats(r: number, g: number, b: number): Color3; + toHexString(): string; + static FromHexString(hex: string): Color3; + static FromArray(array: number[], offset?: number): Color3; + static FromInts(r: number, g: number, b: number): Color3; + static Lerp(start: Color3, end: Color3, amount: number): Color3; + static Red(): Color3; + static Green(): Color3; + static Blue(): Color3; + static Black(): Color3; + static White(): Color3; + static Purple(): Color3; + static Magenta(): Color3; + static Yellow(): Color3; + static Gray(): Color3; + } + class Color4 { + r: number; + g: number; + b: number; + a: number; + constructor(r: number, g: number, b: number, a: number); + addInPlace(right: any): Color4; + asArray(): number[]; + toArray(array: number[], index?: number): Color4; + add(right: Color4): Color4; + subtract(right: Color4): Color4; + subtractToRef(right: Color4, result: Color4): Color4; + scale(scale: number): Color4; + scaleToRef(scale: number, result: Color4): Color4; + toString(): string; + clone(): Color4; + copyFrom(source: Color4): Color4; + toHexString(): string; + static FromHexString(hex: string): Color4; + static Lerp(left: Color4, right: Color4, amount: number): Color4; + static LerpToRef(left: Color4, right: Color4, amount: number, result: Color4): void; + static FromArray(array: number[], offset?: number): Color4; + static FromInts(r: number, g: number, b: number, a: number): Color4; + } + class Vector2 { + x: number; + y: number; + constructor(x: number, y: number); + toString(): string; + toArray(array: number[], index?: number): Vector2; + asArray(): number[]; + copyFrom(source: Vector2): Vector2; + copyFromFloats(x: number, y: number): Vector2; + add(otherVector: Vector2): Vector2; + addVector3(otherVector: Vector3): Vector2; + subtract(otherVector: Vector2): Vector2; + subtractInPlace(otherVector: Vector2): Vector2; + multiplyInPlace(otherVector: Vector2): Vector2; + multiply(otherVector: Vector2): Vector2; + multiplyToRef(otherVector: Vector2, result: Vector2): Vector2; + multiplyByFloats(x: number, y: number): Vector2; + divide(otherVector: Vector2): Vector2; + divideToRef(otherVector: Vector2, result: Vector2): Vector2; + negate(): Vector2; + scaleInPlace(scale: number): Vector2; + scale(scale: number): Vector2; + equals(otherVector: Vector2): boolean; + equalsWithEpsilon(otherVector: Vector2, epsilon?: number): boolean; + length(): number; + lengthSquared(): number; + normalize(): Vector2; + clone(): Vector2; + static Zero(): Vector2; + static FromArray(array: number[], offset?: number): Vector2; + static FromArrayToRef(array: number[], offset: number, result: Vector2): void; + static CatmullRom(value1: Vector2, value2: Vector2, value3: Vector2, value4: Vector2, amount: number): Vector2; + static Clamp(value: Vector2, min: Vector2, max: Vector2): Vector2; + static Hermite(value1: Vector2, tangent1: Vector2, value2: Vector2, tangent2: Vector2, amount: number): Vector2; + static Lerp(start: Vector2, end: Vector2, amount: number): Vector2; + static Dot(left: Vector2, right: Vector2): number; + static Normalize(vector: Vector2): Vector2; + static Minimize(left: Vector2, right: Vector2): Vector2; + static Maximize(left: Vector2, right: Vector2): Vector2; + static Transform(vector: Vector2, transformation: Matrix): Vector2; + static Distance(value1: Vector2, value2: Vector2): number; + static DistanceSquared(value1: Vector2, value2: Vector2): number; + } + class Vector3 { + x: number; + y: number; + z: number; + constructor(x: number, y: number, z: number); + toString(): string; + asArray(): number[]; + toArray(array: number[], index?: number): Vector3; + toQuaternion(): Quaternion; + addInPlace(otherVector: Vector3): Vector3; + add(otherVector: Vector3): Vector3; + addToRef(otherVector: Vector3, result: Vector3): Vector3; + subtractInPlace(otherVector: Vector3): Vector3; + subtract(otherVector: Vector3): Vector3; + subtractToRef(otherVector: Vector3, result: Vector3): Vector3; + subtractFromFloats(x: number, y: number, z: number): Vector3; + subtractFromFloatsToRef(x: number, y: number, z: number, result: Vector3): Vector3; + negate(): Vector3; + scaleInPlace(scale: number): Vector3; + scale(scale: number): Vector3; + scaleToRef(scale: number, result: Vector3): void; + equals(otherVector: Vector3): boolean; + equalsWithEpsilon(otherVector: Vector3, epsilon?: number): boolean; + equalsToFloats(x: number, y: number, z: number): boolean; + multiplyInPlace(otherVector: Vector3): Vector3; + multiply(otherVector: Vector3): Vector3; + multiplyToRef(otherVector: Vector3, result: Vector3): Vector3; + multiplyByFloats(x: number, y: number, z: number): Vector3; + divide(otherVector: Vector3): Vector3; + divideToRef(otherVector: Vector3, result: Vector3): Vector3; + MinimizeInPlace(other: Vector3): Vector3; + MaximizeInPlace(other: Vector3): Vector3; + length(): number; + lengthSquared(): number; + normalize(): Vector3; + clone(): Vector3; + copyFrom(source: Vector3): Vector3; + copyFromFloats(x: number, y: number, z: number): Vector3; + static GetClipFactor(vector0: Vector3, vector1: Vector3, axis: Vector3, size: any): number; + static FromArray(array: number[], offset?: number): Vector3; + static FromFloatArray(array: Float32Array, offset?: number): Vector3; + static FromArrayToRef(array: number[], offset: number, result: Vector3): void; + static FromFloatArrayToRef(array: Float32Array, offset: number, result: Vector3): void; + static FromFloatsToRef(x: number, y: number, z: number, result: Vector3): void; + static Zero(): Vector3; + static Up(): Vector3; + static TransformCoordinates(vector: Vector3, transformation: Matrix): Vector3; + static TransformCoordinatesToRef(vector: Vector3, transformation: Matrix, result: Vector3): void; + static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void; + static TransformCoordinatesToRefSIMD(vector: Vector3, transformation: Matrix, result: Vector3): void; + static TransformCoordinatesFromFloatsToRefSIMD(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void; + static TransformNormal(vector: Vector3, transformation: Matrix): Vector3; + static TransformNormalToRef(vector: Vector3, transformation: Matrix, result: Vector3): void; + static TransformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void; + static CatmullRom(value1: Vector3, value2: Vector3, value3: Vector3, value4: Vector3, amount: number): Vector3; + static Clamp(value: Vector3, min: Vector3, max: Vector3): Vector3; + static Hermite(value1: Vector3, tangent1: Vector3, value2: Vector3, tangent2: Vector3, amount: number): Vector3; + static Lerp(start: Vector3, end: Vector3, amount: number): Vector3; + static Dot(left: Vector3, right: Vector3): number; + static Cross(left: Vector3, right: Vector3): Vector3; + static CrossToRef(left: Vector3, right: Vector3, result: Vector3): void; + static Normalize(vector: Vector3): Vector3; + static NormalizeToRef(vector: Vector3, result: Vector3): void; + static Project(vector: Vector3, world: Matrix, transform: Matrix, viewport: Viewport): Vector3; + static UnprojectFromTransform(source: Vector3, viewportWidth: number, viewportHeight: number, world: Matrix, transform: Matrix): Vector3; + static Unproject(source: Vector3, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Vector3; + static Minimize(left: Vector3, right: Vector3): Vector3; + static Maximize(left: Vector3, right: Vector3): Vector3; + static Distance(value1: Vector3, value2: Vector3): number; + static DistanceSquared(value1: Vector3, value2: Vector3): number; + static Center(value1: Vector3, value2: Vector3): Vector3; + /** + * Given three orthogonal left-handed oriented Vector3 axis in space (target system), + * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply + * to something in order to rotate it from its local system to the given target system. + */ + static RotationFromAxis(axis1: Vector3, axis2: Vector3, axis3: Vector3): Vector3; + /** + * The same than RotationFromAxis but updates the passed ref Vector3 parameter. + */ + static RotationFromAxisToRef(axis1: Vector3, axis2: Vector3, axis3: Vector3, ref: Vector3): void; + } + class Vector4 { + x: number; + y: number; + z: number; + w: number; + constructor(x: number, y: number, z: number, w: number); + toString(): string; + asArray(): number[]; + toArray(array: number[], index?: number): Vector4; + addInPlace(otherVector: Vector4): Vector4; + add(otherVector: Vector4): Vector4; + addToRef(otherVector: Vector4, result: Vector4): Vector4; + subtractInPlace(otherVector: Vector4): Vector4; + subtract(otherVector: Vector4): Vector4; + subtractToRef(otherVector: Vector4, result: Vector4): Vector4; + subtractFromFloats(x: number, y: number, z: number, w: number): Vector4; + subtractFromFloatsToRef(x: number, y: number, z: number, w: number, result: Vector4): Vector4; + negate(): Vector4; + scaleInPlace(scale: number): Vector4; + scale(scale: number): Vector4; + scaleToRef(scale: number, result: Vector4): void; + equals(otherVector: Vector4): boolean; + equalsWithEpsilon(otherVector: Vector4, epsilon?: number): boolean; + equalsToFloats(x: number, y: number, z: number, w: number): boolean; + multiplyInPlace(otherVector: Vector4): Vector4; + multiply(otherVector: Vector4): Vector4; + multiplyToRef(otherVector: Vector4, result: Vector4): Vector4; + multiplyByFloats(x: number, y: number, z: number, w: number): Vector4; + divide(otherVector: Vector4): Vector4; + divideToRef(otherVector: Vector4, result: Vector4): Vector4; + MinimizeInPlace(other: Vector4): Vector4; + MaximizeInPlace(other: Vector4): Vector4; + length(): number; + lengthSquared(): number; + normalize(): Vector4; + clone(): Vector4; + copyFrom(source: Vector4): Vector4; + copyFromFloats(x: number, y: number, z: number, w: number): Vector4; + static FromArray(array: number[], offset?: number): Vector4; + static FromArrayToRef(array: number[], offset: number, result: Vector4): void; + static FromFloatArrayToRef(array: Float32Array, offset: number, result: Vector4): void; + static FromFloatsToRef(x: number, y: number, z: number, w: number, result: Vector4): void; + static Zero(): Vector4; + static Normalize(vector: Vector4): Vector4; + static NormalizeToRef(vector: Vector4, result: Vector4): void; + static Minimize(left: Vector4, right: Vector4): Vector4; + static Maximize(left: Vector4, right: Vector4): Vector4; + static Distance(value1: Vector4, value2: Vector4): number; + static DistanceSquared(value1: Vector4, value2: Vector4): number; + static Center(value1: Vector4, value2: Vector4): Vector4; + } + class Quaternion { + x: number; + y: number; + z: number; + w: number; + constructor(x?: number, y?: number, z?: number, w?: number); + toString(): string; + asArray(): number[]; + equals(otherQuaternion: Quaternion): boolean; + clone(): Quaternion; + copyFrom(other: Quaternion): Quaternion; + copyFromFloats(x: number, y: number, z: number, w: number): Quaternion; + add(other: Quaternion): Quaternion; + subtract(other: Quaternion): Quaternion; + scale(value: number): Quaternion; + multiply(q1: Quaternion): Quaternion; + multiplyToRef(q1: Quaternion, result: Quaternion): Quaternion; + length(): number; + normalize(): Quaternion; + toEulerAngles(): Vector3; + toEulerAnglesToRef(result: Vector3): Quaternion; + toRotationMatrix(result: Matrix): Quaternion; + fromRotationMatrix(matrix: Matrix): Quaternion; + static FromRotationMatrix(matrix: Matrix): Quaternion; + static FromRotationMatrixToRef(matrix: Matrix, result: Quaternion): void; + static Inverse(q: Quaternion): Quaternion; + static Identity(): Quaternion; + static RotationAxis(axis: Vector3, angle: number): Quaternion; + static FromArray(array: number[], offset?: number): Quaternion; + static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion; + static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): void; + static RotationAlphaBetaGamma(alpha: number, beta: number, gamma: number): Quaternion; + static RotationAlphaBetaGammaToRef(alpha: number, beta: number, gamma: number, result: Quaternion): void; + static Slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion; + } + class Matrix { + private static _tempQuaternion; + private static _xAxis; + private static _yAxis; + private static _zAxis; + m: Float32Array; + isIdentity(): boolean; + determinant(): number; + toArray(): Float32Array; + asArray(): Float32Array; + invert(): Matrix; + reset(): Matrix; + add(other: Matrix): Matrix; + addToRef(other: Matrix, result: Matrix): Matrix; + addToSelf(other: Matrix): Matrix; + invertToRef(other: Matrix): Matrix; + invertToRefSIMD(other: Matrix): Matrix; + setTranslation(vector3: Vector3): Matrix; + multiply(other: Matrix): Matrix; + copyFrom(other: Matrix): Matrix; + copyToArray(array: Float32Array, offset?: number): Matrix; + multiplyToRef(other: Matrix, result: Matrix): Matrix; + multiplyToArray(other: Matrix, result: Float32Array, offset: number): Matrix; + multiplyToArraySIMD(other: Matrix, result: Matrix, offset?: number): void; + equals(value: Matrix): boolean; + clone(): Matrix; + decompose(scale: Vector3, rotation: Quaternion, translation: Vector3): boolean; + static FromArray(array: number[], offset?: number): Matrix; + static FromArrayToRef(array: number[], offset: number, result: Matrix): void; + static FromFloat32ArrayToRefScaled(array: Float32Array, offset: number, scale: number, result: Matrix): void; + static FromValuesToRef(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number, result: Matrix): void; + static FromValues(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number): Matrix; + static Compose(scale: Vector3, rotation: Quaternion, translation: Vector3): Matrix; + static Identity(): Matrix; + static IdentityToRef(result: Matrix): void; + static Zero(): Matrix; + static RotationX(angle: number): Matrix; + static Invert(source: Matrix): Matrix; + static RotationXToRef(angle: number, result: Matrix): void; + static RotationY(angle: number): Matrix; + static RotationYToRef(angle: number, result: Matrix): void; + static RotationZ(angle: number): Matrix; + static RotationZToRef(angle: number, result: Matrix): void; + static RotationAxis(axis: Vector3, angle: number): Matrix; + static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix; + static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Matrix): void; + static Scaling(x: number, y: number, z: number): Matrix; + static ScalingToRef(x: number, y: number, z: number, result: Matrix): void; + static Translation(x: number, y: number, z: number): Matrix; + static TranslationToRef(x: number, y: number, z: number, result: Matrix): void; + static LookAtLH(eye: Vector3, target: Vector3, up: Vector3): Matrix; + static LookAtLHToRef(eye: Vector3, target: Vector3, up: Vector3, result: Matrix): void; + static LookAtLHToRefSIMD(eyeRef: Vector3, targetRef: Vector3, upRef: Vector3, result: Matrix): void; + static OrthoLH(width: number, height: number, znear: number, zfar: number): Matrix; + static OrthoLHToRef(width: number, height: number, znear: number, zfar: number, result: Matrix): void; + static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): Matrix; + static OrthoOffCenterLHToRef(left: number, right: any, bottom: number, top: number, znear: number, zfar: number, result: Matrix): void; + static PerspectiveLH(width: number, height: number, znear: number, zfar: number): Matrix; + static PerspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number): Matrix; + static PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, fovMode?: number): void; + static GetFinalMatrix(viewport: Viewport, world: Matrix, view: Matrix, projection: Matrix, zmin: number, zmax: number): Matrix; + static GetAsMatrix2x2(matrix: Matrix): Float32Array; + static GetAsMatrix3x3(matrix: Matrix): Float32Array; + static Transpose(matrix: Matrix): Matrix; + static Reflection(plane: Plane): Matrix; + static ReflectionToRef(plane: Plane, result: Matrix): void; + } + class Plane { + normal: Vector3; + d: number; + constructor(a: number, b: number, c: number, d: number); + asArray(): number[]; + clone(): Plane; + normalize(): Plane; + transform(transformation: Matrix): Plane; + dotCoordinate(point: any): number; + copyFromPoints(point1: Vector3, point2: Vector3, point3: Vector3): Plane; + isFrontFacingTo(direction: Vector3, epsilon: number): boolean; + signedDistanceTo(point: Vector3): number; + static FromArray(array: number[]): Plane; + static FromPoints(point1: any, point2: any, point3: any): Plane; + static FromPositionAndNormal(origin: Vector3, normal: Vector3): Plane; + static SignedDistanceToPlaneFromPositionAndNormal(origin: Vector3, normal: Vector3, point: Vector3): number; + } + class Viewport { + x: number; + y: number; + width: number; + height: number; + constructor(x: number, y: number, width: number, height: number); + toGlobal(engine: any): Viewport; + } + class Frustum { + static GetPlanes(transform: Matrix): Plane[]; + static GetPlanesToRef(transform: Matrix, frustumPlanes: Plane[]): void; + } + class Ray { + origin: Vector3; + direction: Vector3; + length: number; + private _edge1; + private _edge2; + private _pvec; + private _tvec; + private _qvec; + constructor(origin: Vector3, direction: Vector3, length?: number); + intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean; + intersectsBox(box: BoundingBox): boolean; + intersectsSphere(sphere: any): boolean; + intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo; + static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray; + /** + * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be + * transformed to the given world matrix. + * @param origin The origin point + * @param end The end point + * @param world a matrix to transform the ray to. Default is the identity matrix. + */ + static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray; + static Transform(ray: Ray, matrix: Matrix): Ray; + } + enum Space { + LOCAL = 0, + WORLD = 1, + } + class Axis { + static X: Vector3; + static Y: Vector3; + static Z: Vector3; + } + class BezierCurve { + static interpolate(t: number, x1: number, y1: number, x2: number, y2: number): number; + } + enum Orientation { + CW = 0, + CCW = 1, + } + class Angle { + private _radians; + constructor(radians: number); + degrees: () => number; + radians: () => number; + static BetweenTwoPoints(a: Vector2, b: Vector2): Angle; + static FromRadians(radians: number): Angle; + static FromDegrees(degrees: number): Angle; + } + class Arc2 { + startPoint: Vector2; + midPoint: Vector2; + endPoint: Vector2; + centerPoint: Vector2; + radius: number; + angle: Angle; + startAngle: Angle; + orientation: Orientation; + constructor(startPoint: Vector2, midPoint: Vector2, endPoint: Vector2); + } + class PathCursor { + private path; + private _onchange; + value: number; + animations: Animation[]; + constructor(path: Path2); + getPoint(): Vector3; + moveAhead(step?: number): PathCursor; + moveBack(step?: number): PathCursor; + move(step: number): PathCursor; + private ensureLimits(); + private markAsDirty(propertyName); + private raiseOnChange(); + onchange(f: (cursor: PathCursor) => void): PathCursor; + } + class Path2 { + private _points; + private _length; + closed: boolean; + constructor(x: number, y: number); + addLineTo(x: number, y: number): Path2; + addArcTo(midX: number, midY: number, endX: number, endY: number, numberOfSegments?: number): Path2; + close(): Path2; + length(): number; + getPoints(): Vector2[]; + getPointAtLengthPosition(normalizedLengthPosition: number): Vector2; + static StartingAt(x: number, y: number): Path2; + } + class Path3D { + path: Vector3[]; + private _curve; + private _distances; + private _tangents; + private _normals; + private _binormals; + private _raw; + /** + * new Path3D(path, normal, raw) + * path : an array of Vector3, the curve axis of the Path3D + * normal (optional) : Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal. + * raw (optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed. + */ + constructor(path: Vector3[], firstNormal?: Vector3, raw?: boolean); + getCurve(): Vector3[]; + getTangents(): Vector3[]; + getNormals(): Vector3[]; + getBinormals(): Vector3[]; + getDistances(): number[]; + update(path: Vector3[], firstNormal?: Vector3): Path3D; + private _compute(firstNormal); + private _getFirstNonNullVector(index); + private _getLastNonNullVector(index); + private _normalVector(v0, vt, va); + } + class Curve3 { + private _points; + private _length; + static CreateQuadraticBezier(v0: Vector3, v1: Vector3, v2: Vector3, nbPoints: number): Curve3; + static CreateCubicBezier(v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, nbPoints: number): Curve3; + static CreateHermiteSpline(p1: Vector3, t1: Vector3, p2: Vector3, t2: Vector3, nbPoints: number): Curve3; + constructor(points: Vector3[]); + getPoints(): Vector3[]; + length(): number; + continue(curve: Curve3): Curve3; + private _computeLength(path); + } + class PositionNormalVertex { + position: Vector3; + normal: Vector3; + constructor(position?: Vector3, normal?: Vector3); + clone(): PositionNormalVertex; + } + class PositionNormalTextureVertex { + position: Vector3; + normal: Vector3; + uv: Vector2; + constructor(position?: Vector3, normal?: Vector3, uv?: Vector2); + clone(): PositionNormalTextureVertex; + } + class SIMDHelper { + private static _isEnabled; + static IsEnabled: boolean; + static DisableSIMD(): void; + static EnableSIMD(): void; + } +} + +declare module BABYLON { + class AbstractMesh extends Node implements IDisposable { + private static _BILLBOARDMODE_NONE; + private static _BILLBOARDMODE_X; + private static _BILLBOARDMODE_Y; + private static _BILLBOARDMODE_Z; + private static _BILLBOARDMODE_ALL; + static BILLBOARDMODE_NONE: number; + static BILLBOARDMODE_X: number; + static BILLBOARDMODE_Y: number; + static BILLBOARDMODE_Z: number; + static BILLBOARDMODE_ALL: number; + definedFacingForward: boolean; + position: Vector3; + rotation: Vector3; + rotationQuaternion: Quaternion; + scaling: Vector3; + billboardMode: number; + visibility: number; + alphaIndex: number; + infiniteDistance: boolean; + isVisible: boolean; + isPickable: boolean; + showBoundingBox: boolean; + showSubMeshesBoundingBox: boolean; + onDispose: any; + isBlocker: boolean; + skeleton: Skeleton; + renderingGroupId: number; + material: Material; + receiveShadows: boolean; + actionManager: ActionManager; + renderOutline: boolean; + outlineColor: Color3; + outlineWidth: number; + renderOverlay: boolean; + overlayColor: Color3; + overlayAlpha: number; + hasVertexAlpha: boolean; + useVertexColors: boolean; + applyFog: boolean; + computeBonesUsingShaders: boolean; + useOctreeForRenderingSelection: boolean; + useOctreeForPicking: boolean; + useOctreeForCollisions: boolean; + layerMask: number; + alwaysSelectAsActiveMesh: boolean; + _physicImpostor: number; + _physicsMass: number; + _physicsFriction: number; + _physicRestitution: number; + private _checkCollisions; + ellipsoid: Vector3; + ellipsoidOffset: Vector3; + private _collider; + private _oldPositionForCollisions; + private _diffPositionForCollisions; + private _newPositionForCollisions; + onCollide: (collidedMesh: AbstractMesh) => void; + private _meshToBoneReferal; + edgesWidth: number; + edgesColor: Color4; + _edgesRenderer: EdgesRenderer; + private _localScaling; + private _localRotation; + private _localTranslation; + private _localBillboard; + private _localPivotScaling; + private _localPivotScalingRotation; + private _localMeshReferalTransform; + private _localWorld; + _worldMatrix: Matrix; + private _rotateYByPI; + private _absolutePosition; + private _collisionsTransformMatrix; + private _collisionsScalingMatrix; + _positions: Vector3[]; + private _isDirty; + _masterMesh: AbstractMesh; + _boundingInfo: BoundingInfo; + private _pivotMatrix; + _isDisposed: boolean; + _renderId: number; + subMeshes: SubMesh[]; + _submeshesOctree: Octree; + _intersectionsInProgress: AbstractMesh[]; + private _onAfterWorldMatrixUpdate; + private _isWorldMatrixFrozen; + _waitingActions: any; + _waitingFreezeWorldMatrix: boolean; + constructor(name: string, scene: Scene); + disableEdgesRendering(): void; + enableEdgesRendering(epsilon?: number, checkVerticesInsteadOfIndices?: boolean): void; + isBlocked: boolean; + getLOD(camera: Camera): AbstractMesh; + getTotalVertices(): number; + getIndices(): number[]; + getVerticesData(kind: string): number[]; + isVerticesDataPresent(kind: string): boolean; + getBoundingInfo(): BoundingInfo; + useBones: boolean; + _preActivate(): void; + _activate(renderId: number): void; + getWorldMatrix(): Matrix; + worldMatrixFromCache: Matrix; + absolutePosition: Vector3; + freezeWorldMatrix(): void; + unfreezeWorldMatrix(): void; + isWorldMatrixFrozen: boolean; + rotate(axis: Vector3, amount: number, space: Space): void; + translate(axis: Vector3, distance: number, space: Space): void; + getAbsolutePosition(): Vector3; + setAbsolutePosition(absolutePosition: Vector3): void; + /** + * Perform relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward. + * @param {number} amountRight + * @param {number} amountUp + * @param {number} amountForward + */ + movePOV(amountRight: number, amountUp: number, amountForward: number): void; + /** + * Calculate relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward. + * @param {number} amountRight + * @param {number} amountUp + * @param {number} amountForward + */ + calcMovePOV(amountRight: number, amountUp: number, amountForward: number): Vector3; + /** + * Perform relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward. + * @param {number} flipBack + * @param {number} twirlClockwise + * @param {number} tiltRight + */ + rotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): void; + /** + * Calculate relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward. + * @param {number} flipBack + * @param {number} twirlClockwise + * @param {number} tiltRight + */ + calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3; + setPivotMatrix(matrix: Matrix): void; + getPivotMatrix(): Matrix; + _isSynchronized(): boolean; + _initCache(): void; + markAsDirty(property: string): void; + _updateBoundingInfo(): void; + _updateSubMeshesBoundingInfo(matrix: Matrix): void; + computeWorldMatrix(force?: boolean): Matrix; + /** + * If you'd like to be callbacked after the mesh position, rotation or scaling has been updated + * @param func: callback function to add + */ + registerAfterWorldMatrixUpdate(func: (mesh: AbstractMesh) => void): void; + unregisterAfterWorldMatrixUpdate(func: (mesh: AbstractMesh) => void): void; + setPositionWithLocalVector(vector3: Vector3): void; + getPositionExpressedInLocalSpace(): Vector3; + locallyTranslate(vector3: Vector3): void; + lookAt(targetPoint: Vector3, yawCor: number, pitchCor: number, rollCor: number): void; + attachToBone(bone: Bone, affectedMesh: AbstractMesh): void; + detachFromBone(): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + isCompletelyInFrustum(camera?: Camera): boolean; + intersectsMesh(mesh: AbstractMesh, precise?: boolean): boolean; + intersectsPoint(point: Vector3): boolean; + setPhysicsState(impostor?: any, options?: PhysicsBodyCreationOptions): any; + getPhysicsImpostor(): number; + getPhysicsMass(): number; + getPhysicsFriction(): number; + getPhysicsRestitution(): number; + getPositionInCameraSpace(camera?: Camera): Vector3; + getDistanceToCamera(camera?: Camera): number; + applyImpulse(force: Vector3, contactPoint: Vector3): void; + setPhysicsLinkWith(otherMesh: Mesh, pivot1: Vector3, pivot2: Vector3, options?: any): void; + updatePhysicsBodyPosition(): void; + checkCollisions: boolean; + moveWithCollisions(velocity: Vector3): void; + private _onCollisionPositionChange; + /** + * This function will create an octree to help select the right submeshes for rendering, picking and collisions + * Please note that you must have a decent number of submeshes to get performance improvements when using octree + */ + createOrUpdateSubmeshesOctree(maxCapacity?: number, maxDepth?: number): Octree; + _collideForSubMesh(subMesh: SubMesh, transformMatrix: Matrix, collider: Collider): void; + _processCollisionsForSubMeshes(collider: Collider, transformMatrix: Matrix): void; + _checkCollision(collider: Collider): void; + _generatePointsArray(): boolean; + intersects(ray: Ray, fastCheck?: boolean): PickingInfo; + clone(name: string, newParent: Node, doNotCloneChildren?: boolean): AbstractMesh; + releaseSubMeshes(): void; + dispose(doNotRecurse?: boolean): void; + } +} + +declare module BABYLON { + class CSG { + private polygons; + matrix: Matrix; + position: Vector3; + rotation: Vector3; + rotationQuaternion: Quaternion; + scaling: Vector3; + static FromMesh(mesh: Mesh): CSG; + private static FromPolygons(polygons); + clone(): CSG; + private toPolygons(); + union(csg: CSG): CSG; + unionInPlace(csg: CSG): void; + subtract(csg: CSG): CSG; + subtractInPlace(csg: CSG): void; + intersect(csg: CSG): CSG; + intersectInPlace(csg: CSG): void; + inverse(): CSG; + inverseInPlace(): void; + copyTransformAttributes(csg: CSG): CSG; + buildMeshGeometry(name: string, scene: Scene, keepSubMeshes: boolean): Mesh; + toMesh(name: string, material: Material, scene: Scene, keepSubMeshes: boolean): Mesh; + } +} + +declare module BABYLON { + class Geometry implements IGetSetVerticesData { + id: string; + delayLoadState: number; + delayLoadingFile: string; + onGeometryUpdated: (geometry: Geometry, kind?: string) => void; + private _scene; + private _engine; + private _meshes; + private _totalVertices; + private _indices; + private _vertexBuffers; + private _isDisposed; + _delayInfo: any; + private _indexBuffer; + _boundingInfo: BoundingInfo; + _delayLoadingFunction: (any: any, geometry: Geometry) => void; + constructor(id: string, scene: Scene, vertexData?: VertexData, updatable?: boolean, mesh?: Mesh); + getScene(): Scene; + getEngine(): Engine; + isReady(): boolean; + setAllVerticesData(vertexData: VertexData, updatable?: boolean): void; + setVerticesData(kind: string, data: number[], updatable?: boolean, stride?: number): void; + updateVerticesDataDirectly(kind: string, data: Float32Array, offset: number): void; + updateVerticesData(kind: string, data: number[], updateExtends?: boolean): void; + getTotalVertices(): number; + getVerticesData(kind: string, copyWhenShared?: boolean): number[]; + getVertexBuffer(kind: string): VertexBuffer; + getVertexBuffers(): VertexBuffer[]; + isVerticesDataPresent(kind: string): boolean; + getVerticesDataKinds(): string[]; + setIndices(indices: number[], totalVertices?: number): void; + getTotalIndices(): number; + getIndices(copyWhenShared?: boolean): number[]; + getIndexBuffer(): any; + releaseForMesh(mesh: Mesh, shouldDispose?: boolean): void; + applyToMesh(mesh: Mesh): void; + private _applyToMesh(mesh); + private notifyUpdate(kind?); + load(scene: Scene, onLoaded?: () => void): void; + isDisposed(): boolean; + dispose(): void; + copy(id: string): Geometry; + static ExtractFromMesh(mesh: Mesh, id: string): Geometry; + static RandomId(): string; + } + module Geometry.Primitives { + class _Primitive extends Geometry { + private _beingRegenerated; + private _canBeRegenerated; + constructor(id: string, scene: Scene, vertexData?: VertexData, canBeRegenerated?: boolean, mesh?: Mesh); + canBeRegenerated(): boolean; + regenerate(): void; + asNewGeometry(id: string): Geometry; + setAllVerticesData(vertexData: VertexData, updatable?: boolean): void; + setVerticesData(kind: string, data: number[], updatable?: boolean): void; + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Ribbon extends _Primitive { + pathArray: Vector3[][]; + closeArray: boolean; + closePath: boolean; + offset: number; + side: number; + constructor(id: string, scene: Scene, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Box extends _Primitive { + size: number; + side: number; + constructor(id: string, scene: Scene, size: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Sphere extends _Primitive { + segments: number; + diameter: number; + side: number; + constructor(id: string, scene: Scene, segments: number, diameter: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Cylinder extends _Primitive { + height: number; + diameterTop: number; + diameterBottom: number; + tessellation: number; + subdivisions: number; + side: number; + constructor(id: string, scene: Scene, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions?: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Torus extends _Primitive { + diameter: number; + thickness: number; + tessellation: number; + side: number; + constructor(id: string, scene: Scene, diameter: number, thickness: number, tessellation: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Ground extends _Primitive { + width: number; + height: number; + subdivisions: number; + constructor(id: string, scene: Scene, width: number, height: number, subdivisions: number, canBeRegenerated?: boolean, mesh?: Mesh); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class TiledGround extends _Primitive { + xmin: number; + zmin: number; + xmax: number; + zmax: number; + subdivisions: { + w: number; + h: number; + }; + precision: { + w: number; + h: number; + }; + constructor(id: string, scene: Scene, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: { + w: number; + h: number; + }, precision: { + w: number; + h: number; + }, canBeRegenerated?: boolean, mesh?: Mesh); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Plane extends _Primitive { + size: number; + side: number; + constructor(id: string, scene: Scene, size: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class TorusKnot extends _Primitive { + radius: number; + tube: number; + radialSegments: number; + tubularSegments: number; + p: number; + q: number; + side: number; + constructor(id: string, scene: Scene, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + } +} + +declare module BABYLON { + class GroundMesh extends Mesh { + generateOctree: boolean; + private _worldInverse; + _subdivisions: number; + constructor(name: string, scene: Scene); + subdivisions: number; + optimize(chunksCount: number, octreeBlocksSize?: number): void; + getHeightAtCoordinates(x: number, z: number): number; + } +} + +declare module BABYLON { + /** + * Creates an instance based on a source mesh. + */ + class InstancedMesh extends AbstractMesh { + private _sourceMesh; + private _currentLOD; + constructor(name: string, source: Mesh); + receiveShadows: boolean; + material: Material; + visibility: number; + skeleton: Skeleton; + getTotalVertices(): number; + sourceMesh: Mesh; + getVerticesData(kind: string): number[]; + isVerticesDataPresent(kind: string): boolean; + getIndices(): number[]; + _positions: Vector3[]; + refreshBoundingInfo(): void; + _preActivate(): void; + _activate(renderId: number): void; + getLOD(camera: Camera): AbstractMesh; + _syncSubMeshes(): void; + _generatePointsArray(): boolean; + clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh; + dispose(doNotRecurse?: boolean): void; + } +} + +declare module BABYLON { + class LinesMesh extends Mesh { + color: Color3; + alpha: number; + private _colorShader; + constructor(name: string, scene: Scene, parent?: Node, source?: Mesh, doNotCloneChildren?: boolean); + material: Material; + isPickable: boolean; + checkCollisions: boolean; + _bind(subMesh: SubMesh, effect: Effect, fillMode: number): void; + _draw(subMesh: SubMesh, fillMode: number, instancesCount?: number): void; + intersects(ray: Ray, fastCheck?: boolean): any; + dispose(doNotRecurse?: boolean): void; + clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): LinesMesh; + } +} + +declare module BABYLON { + class _InstancesBatch { + mustReturn: boolean; + visibleInstances: InstancedMesh[][]; + renderSelf: boolean[]; + } + class Mesh extends AbstractMesh implements IGetSetVerticesData { + static _FRONTSIDE: number; + static _BACKSIDE: number; + static _DOUBLESIDE: number; + static _DEFAULTSIDE: number; + static _NO_CAP: number; + static _CAP_START: number; + static _CAP_END: number; + static _CAP_ALL: number; + static FRONTSIDE: number; + static BACKSIDE: number; + static DOUBLESIDE: number; + static DEFAULTSIDE: number; + static NO_CAP: number; + static CAP_START: number; + static CAP_END: number; + static CAP_ALL: number; + delayLoadState: number; + instances: InstancedMesh[]; + delayLoadingFile: string; + _binaryInfo: any; + private _LODLevels; + onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Mesh) => void; + _geometry: Geometry; + private _onBeforeRenderCallbacks; + private _onAfterRenderCallbacks; + _delayInfo: any; + _delayLoadingFunction: (any: any, mesh: Mesh) => void; + _visibleInstances: any; + private _renderIdForInstances; + private _batchCache; + private _worldMatricesInstancesBuffer; + private _worldMatricesInstancesArray; + private _instancesBufferSize; + _shouldGenerateFlatShading: boolean; + private _preActivateId; + private _sideOrientation; + private _areNormalsFrozen; + private _sourcePositions; + private _sourceNormals; + /** + * @constructor + * @param {string} name - The value used by scene.getMeshByName() to do a lookup. + * @param {Scene} scene - The scene to add this mesh to. + * @param {Node} parent - The parent of this mesh, if it has one + * @param {Mesh} source - An optional Mesh from which geometry is shared, cloned. + * @param {boolean} doNotCloneChildren - When cloning, skip cloning child meshes of source, default False. + * When false, achieved by calling a clone(), also passing False. + * This will make creation of children, recursive. + */ + constructor(name: string, scene: Scene, parent?: Node, source?: Mesh, doNotCloneChildren?: boolean); + hasLODLevels: boolean; + private _sortLODLevels(); + /** + * Add a mesh as LOD level triggered at the given distance. + * @param {number} distance - the distance from the center of the object to show this level + * @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level + * @return {BABYLON.Mesh} this mesh (for chaining) + */ + addLODLevel(distance: number, mesh: Mesh): Mesh; + getLODLevelAtDistance(distance: number): Mesh; + /** + * Remove a mesh from the LOD array + * @param {BABYLON.Mesh} mesh - the mesh to be removed. + * @return {BABYLON.Mesh} this mesh (for chaining) + */ + removeLODLevel(mesh: Mesh): Mesh; + getLOD(camera: Camera, boundingSphere?: BoundingSphere): AbstractMesh; + geometry: Geometry; + getTotalVertices(): number; + getVerticesData(kind: string, copyWhenShared?: boolean): number[]; + getVertexBuffer(kind: any): VertexBuffer; + isVerticesDataPresent(kind: string): boolean; + getVerticesDataKinds(): string[]; + getTotalIndices(): number; + getIndices(copyWhenShared?: boolean): number[]; + isBlocked: boolean; + isReady(): boolean; + isDisposed(): boolean; + sideOrientation: number; + areNormalsFrozen: boolean; + /** This function affects parametric shapes on update only : ribbons, tubes, etc. It has no effect at all on other shapes */ + freezeNormals(): void; + /** This function affects parametric shapes on update only : ribbons, tubes, etc. It has no effect at all on other shapes */ + unfreezeNormals(): void; + _preActivate(): void; + _registerInstanceForRenderId(instance: InstancedMesh, renderId: number): void; + refreshBoundingInfo(): void; + _createGlobalSubMesh(): SubMesh; + subdivide(count: number): void; + setVerticesData(kind: any, data: any, updatable?: boolean, stride?: number): void; + updateVerticesData(kind: string, data: number[], updateExtends?: boolean, makeItUnique?: boolean): void; + updateVerticesDataDirectly(kind: string, data: Float32Array, offset?: number, makeItUnique?: boolean): void; + updateMeshPositions(positionFunction: any, computeNormals?: boolean): void; + makeGeometryUnique(): void; + setIndices(indices: number[], totalVertices?: number): void; + _bind(subMesh: SubMesh, effect: Effect, fillMode: number): void; + _draw(subMesh: SubMesh, fillMode: number, instancesCount?: number): void; + registerBeforeRender(func: (mesh: AbstractMesh) => void): void; + unregisterBeforeRender(func: (mesh: AbstractMesh) => void): void; + registerAfterRender(func: (mesh: AbstractMesh) => void): void; + unregisterAfterRender(func: (mesh: AbstractMesh) => void): void; + _getInstancesRenderList(subMeshId: number): _InstancesBatch; + _renderWithInstances(subMesh: SubMesh, fillMode: number, batch: _InstancesBatch, effect: Effect, engine: Engine): void; + _processRendering(subMesh: SubMesh, effect: Effect, fillMode: number, batch: _InstancesBatch, hardwareInstancedRendering: boolean, onBeforeDraw: (isInstance: boolean, world: Matrix) => void): void; + render(subMesh: SubMesh, enableAlphaMode: boolean): void; + getEmittedParticleSystems(): ParticleSystem[]; + getHierarchyEmittedParticleSystems(): ParticleSystem[]; + getChildren(): Node[]; + _checkDelayState(): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + setMaterialByID(id: string): void; + getAnimatables(): IAnimatable[]; + bakeTransformIntoVertices(transform: Matrix): void; + bakeCurrentTransformIntoVertices(): void; + _resetPointsArrayCache(): void; + _generatePointsArray(): boolean; + clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): Mesh; + dispose(doNotRecurse?: boolean): void; + applyDisplacementMap(url: string, minHeight: number, maxHeight: number, onSuccess?: (mesh: Mesh) => void): void; + applyDisplacementMapFromBuffer(buffer: Uint8Array, heightMapWidth: number, heightMapHeight: number, minHeight: number, maxHeight: number): void; + convertToFlatShadedMesh(): void; + flipFaces(flipNormals?: boolean): void; + createInstance(name: string): InstancedMesh; + synchronizeInstances(): void; + /** + * Simplify the mesh according to the given array of settings. + * Function will return immediately and will simplify async. + * @param settings a collection of simplification settings. + * @param parallelProcessing should all levels calculate parallel or one after the other. + * @param type the type of simplification to run. + * @param successCallback optional success callback to be called after the simplification finished processing all settings. + */ + simplify(settings: Array, parallelProcessing?: boolean, simplificationType?: SimplificationType, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): void; + /** + * Optimization of the mesh's indices, in case a mesh has duplicated vertices. + * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes. + * This should be used together with the simplification to avoid disappearing triangles. + * @param successCallback an optional success callback to be called after the optimization finished. + */ + optimizeIndices(successCallback?: (mesh?: Mesh) => void): void; + static CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, scene: Scene, updatable?: boolean, sideOrientation?: number, ribbonInstance?: Mesh): Mesh; + static CreateDisc(name: string, radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateBox(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateBox(name: string, options: { + width?: number; + height?: number; + depth?: number; + faceUV?: Vector4[]; + faceColors?: Color4[]; + sideOrientation?: number; + updatable?: boolean; + }, scene: Scene): Mesh; + static CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateSphere(name: string, options: { + segments?: number; + diameterX?: number; + diameterY?: number; + diameterZ?: number; + sideOrientation?: number; + updatable?: boolean; + }, scene: any): Mesh; + static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene: Scene, updatable?: any, sideOrientation?: number): Mesh; + static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateLines(name: string, points: Vector3[], scene: Scene, updatable?: boolean, linesInstance?: LinesMesh): LinesMesh; + static CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene: Scene, updatable?: boolean, linesInstance?: LinesMesh): LinesMesh; + static ExtrudeShape(name: string, shape: Vector3[], path: Vector3[], scale: number, rotation: number, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, extrudedInstance?: Mesh): Mesh; + static ExtrudeShapeCustom(name: string, shape: Vector3[], path: Vector3[], scaleFunction: any, rotationFunction: any, ribbonCloseArray: boolean, ribbonClosePath: boolean, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, extrudedInstance?: Mesh): Mesh; + private static _ExtrudeShapeGeneric(name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance); + static CreateLathe(name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreatePlane(name: string, options: { + width?: number; + height?: number; + sideOrientation?: number; + updatable?: boolean; + }, scene: Scene): Mesh; + static CreateGround(name: string, width: number, height: number, subdivisions: number, scene: Scene, updatable?: boolean): Mesh; + static CreateGround(name: string, options: { + width?: number; + height?: number; + subdivisions?: number; + sideOrientation?: number; + updatable?: boolean; + }, scene: any): Mesh; + static CreateTiledGround(name: string, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: { + w: number; + h: number; + }, precision: { + w: number; + h: number; + }, scene: Scene, updatable?: boolean): Mesh; + static CreateGroundFromHeightMap(name: string, url: string, width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, scene: Scene, updatable?: boolean, onReady?: (mesh: GroundMesh) => void): GroundMesh; + static CreateTube(name: string, path: Vector3[], radius: number, tessellation: number, radiusFunction: { + (i: number, distance: number): number; + }, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, tubeInstance?: Mesh): Mesh; + static CreateDecal(name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle?: number): Mesh; + /** + * Update the vertex buffers by applying transformation from the bones + * @param {skeleton} skeleton to apply + */ + applySkeleton(skeleton: Skeleton): Mesh; + static MinMax(meshes: AbstractMesh[]): { + min: Vector3; + max: Vector3; + }; + static Center(meshesOrMinMaxVector: any): Vector3; + /** + * Merge the array of meshes into a single mesh for performance reasons. + * @param {Array} meshes - The vertices source. They should all be of the same material. Entries can empty + * @param {boolean} disposeSource - When true (default), dispose of the vertices from the source meshes + * @param {boolean} allow32BitsIndices - When the sum of the vertices > 64k, this must be set to true. + * @param {Mesh} meshSubclass - When set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class. + */ + static MergeMeshes(meshes: Array, disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh): Mesh; + } +} + +declare module BABYLON { + interface IGetSetVerticesData { + isVerticesDataPresent(kind: string): boolean; + getVerticesData(kind: string, copyWhenShared?: boolean): number[]; + getIndices(copyWhenShared?: boolean): number[]; + setVerticesData(kind: string, data: number[], updatable?: boolean): void; + updateVerticesData(kind: string, data: number[], updateExtends?: boolean, makeItUnique?: boolean): void; + setIndices(indices: number[]): void; + } + class VertexData { + positions: number[]; + normals: number[]; + uvs: number[]; + uvs2: number[]; + uvs3: number[]; + uvs4: number[]; + uvs5: number[]; + uvs6: number[]; + colors: number[]; + matricesIndices: number[]; + matricesWeights: number[]; + indices: number[]; + set(data: number[], kind: string): void; + applyToMesh(mesh: Mesh, updatable?: boolean): void; + applyToGeometry(geometry: Geometry, updatable?: boolean): void; + updateMesh(mesh: Mesh, updateExtends?: boolean, makeItUnique?: boolean): void; + updateGeometry(geometry: Geometry, updateExtends?: boolean, makeItUnique?: boolean): void; + private _applyTo(meshOrGeometry, updatable?); + private _update(meshOrGeometry, updateExtends?, makeItUnique?); + transform(matrix: Matrix): void; + merge(other: VertexData): void; + static ExtractFromMesh(mesh: Mesh, copyWhenShared?: boolean): VertexData; + static ExtractFromGeometry(geometry: Geometry, copyWhenShared?: boolean): VertexData; + private static _ExtractFrom(meshOrGeometry, copyWhenShared?); + static CreateRibbon(pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, sideOrientation?: number): VertexData; + static CreateBox(options: { + width?: number; + height?: number; + depth?: number; + faceUV?: Vector4[]; + faceColors?: Color4[]; + sideOrientation?: number; + }): VertexData; + static CreateBox(size: number, sideOrientation?: number): VertexData; + static CreateSphere(options: { + segments?: number; + diameterX?: number; + diameterY?: number; + diameterZ?: number; + sideOrientation?: number; + }): VertexData; + static CreateSphere(segments: number, diameter?: number, sideOrientation?: number): VertexData; + static CreateCylinder(height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions?: number, sideOrientation?: number): VertexData; + static CreateTorus(diameter: any, thickness: any, tessellation: any, sideOrientation?: number): VertexData; + static CreateLines(points: Vector3[]): VertexData; + static CreateDashedLines(points: Vector3[], dashSize: number, gapSize: number, dashNb: number): VertexData; + static CreateGround(options: { + width?: number; + height?: number; + subdivisions?: number; + sideOrientation?: number; + }): VertexData; + static CreateGround(width: number, height: number, subdivisions?: number): VertexData; + static CreateTiledGround(xmin: number, zmin: number, xmax: number, zmax: number, subdivisions?: { + w: number; + h: number; + }, precision?: { + w: number; + h: number; + }): VertexData; + static CreateGroundFromHeightMap(width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, buffer: Uint8Array, bufferWidth: number, bufferHeight: number): VertexData; + static CreatePlane(options: { + width?: number; + height?: number; + sideOrientation?: number; + }): VertexData; + static CreatePlane(size: number, sideOrientation?: number): VertexData; + static CreateDisc(radius: number, tessellation: number, sideOrientation?: number): VertexData; + static CreateTorusKnot(radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, sideOrientation?: number): VertexData; + /** + * @param {any} - positions (number[] or Float32Array) + * @param {any} - indices (number[] or Uint16Array) + * @param {any} - normals (number[] or Float32Array) + */ + static ComputeNormals(positions: any, indices: any, normals: any): void; + private static _ComputeSides(sideOrientation, positions, indices, normals, uvs); + } +} + +declare module BABYLON.Internals { + class MeshLODLevel { + distance: number; + mesh: Mesh; + constructor(distance: number, mesh: Mesh); + } +} + +declare module BABYLON { + /** + * A simplifier interface for future simplification implementations. + */ + interface ISimplifier { + /** + * Simplification of a given mesh according to the given settings. + * Since this requires computation, it is assumed that the function runs async. + * @param settings The settings of the simplification, including quality and distance + * @param successCallback A callback that will be called after the mesh was simplified. + * @param errorCallback in case of an error, this callback will be called. optional. + */ + simplify(settings: ISimplificationSettings, successCallback: (simplifiedMeshes: Mesh) => void, errorCallback?: () => void): void; + } + /** + * Expected simplification settings. + * Quality should be between 0 and 1 (1 being 100%, 0 being 0%); + */ + interface ISimplificationSettings { + quality: number; + distance: number; + optimizeMesh?: boolean; + } + class SimplificationSettings implements ISimplificationSettings { + quality: number; + distance: number; + optimizeMesh: boolean; + constructor(quality: number, distance: number, optimizeMesh?: boolean); + } + interface ISimplificationTask { + settings: Array; + simplificationType: SimplificationType; + mesh: Mesh; + successCallback?: () => void; + parallelProcessing: boolean; + } + class SimplificationQueue { + private _simplificationArray; + running: any; + constructor(); + addTask(task: ISimplificationTask): void; + executeNext(): void; + runSimplification(task: ISimplificationTask): void; + private getSimplifier(task); + } + /** + * The implemented types of simplification. + * At the moment only Quadratic Error Decimation is implemented. + */ + enum SimplificationType { + QUADRATIC = 0, + } + class DecimationTriangle { + vertices: Array; + normal: Vector3; + error: Array; + deleted: boolean; + isDirty: boolean; + borderFactor: number; + deletePending: boolean; + originalOffset: number; + constructor(vertices: Array); + } + class DecimationVertex { + position: Vector3; + id: any; + q: QuadraticMatrix; + isBorder: boolean; + triangleStart: number; + triangleCount: number; + originalOffsets: Array; + constructor(position: Vector3, id: any); + updatePosition(newPosition: Vector3): void; + } + class QuadraticMatrix { + data: Array; + constructor(data?: Array); + det(a11: any, a12: any, a13: any, a21: any, a22: any, a23: any, a31: any, a32: any, a33: any): number; + addInPlace(matrix: QuadraticMatrix): void; + addArrayInPlace(data: Array): void; + add(matrix: QuadraticMatrix): QuadraticMatrix; + static FromData(a: number, b: number, c: number, d: number): QuadraticMatrix; + static DataFromNumbers(a: number, b: number, c: number, d: number): number[]; + } + class Reference { + vertexId: number; + triangleId: number; + constructor(vertexId: number, triangleId: number); + } + /** + * An implementation of the Quadratic Error simplification algorithm. + * Original paper : http://www1.cs.columbia.edu/~cs4162/html05s/garland97.pdf + * Ported mostly from QSlim and http://voxels.blogspot.de/2014/05/quadric-mesh-simplification-with-source.html to babylon JS + * @author RaananW + */ + class QuadraticErrorSimplification implements ISimplifier { + private _mesh; + private triangles; + private vertices; + private references; + private initialized; + private _reconstructedMesh; + syncIterations: number; + aggressiveness: number; + decimationIterations: number; + boundingBoxEpsilon: number; + constructor(_mesh: Mesh); + simplify(settings: ISimplificationSettings, successCallback: (simplifiedMesh: Mesh) => void): void; + private isTriangleOnBoundingBox(triangle); + private runDecimation(settings, submeshIndex, successCallback); + private initWithMesh(submeshIndex, callback, optimizeMesh?); + private init(callback); + private reconstructMesh(submeshIndex); + private initDecimatedMesh(); + private isFlipped(vertex1, vertex2, point, deletedArray, borderFactor, delTr); + private updateTriangles(origVertex, vertex, deletedArray, deletedTriangles); + private identifyBorder(); + private updateMesh(identifyBorders?); + private vertexError(q, point); + private calculateError(vertex1, vertex2, pointResult?, normalResult?, uvResult?, colorResult?); + } +} + +declare module BABYLON { + class Polygon { + static Rectangle(xmin: number, ymin: number, xmax: number, ymax: number): Vector2[]; + static Circle(radius: number, cx?: number, cy?: number, numberOfSides?: number): Vector2[]; + static Parse(input: string): Vector2[]; + static StartingAt(x: number, y: number): Path2; + } + class PolygonMeshBuilder { + private _swctx; + private _points; + private _outlinepoints; + private _holes; + private _name; + private _scene; + constructor(name: string, contours: Path2, scene: Scene); + constructor(name: string, contours: Vector2[], scene: Scene); + addHole(hole: Vector2[]): PolygonMeshBuilder; + build(updatable?: boolean, depth?: number): Mesh; + private addSide(positions, normals, uvs, indices, bounds, points, depth, flip); + } +} + +declare module BABYLON { + class SubMesh { + materialIndex: number; + verticesStart: number; + verticesCount: number; + indexStart: any; + indexCount: number; + linesIndexCount: number; + private _mesh; + private _renderingMesh; + private _boundingInfo; + private _linesIndexBuffer; + _lastColliderWorldVertices: Vector3[]; + _trianglePlanes: Plane[]; + _lastColliderTransformMatrix: Matrix; + _renderId: number; + _alphaIndex: number; + _distanceToCamera: number; + _id: number; + constructor(materialIndex: number, verticesStart: number, verticesCount: number, indexStart: any, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh, createBoundingBox?: boolean); + getBoundingInfo(): BoundingInfo; + getMesh(): AbstractMesh; + getRenderingMesh(): Mesh; + getMaterial(): Material; + refreshBoundingInfo(): void; + _checkCollision(collider: Collider): boolean; + updateBoundingInfo(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + render(enableAlphaMode: boolean): void; + getLinesIndexBuffer(indices: number[], engine: any): WebGLBuffer; + canIntersects(ray: Ray): boolean; + intersects(ray: Ray, positions: Vector3[], indices: number[], fastCheck?: boolean): IntersectionInfo; + clone(newMesh: AbstractMesh, newRenderingMesh?: Mesh): SubMesh; + dispose(): void; + static CreateFromIndices(materialIndex: number, startIndex: number, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh): SubMesh; + } +} + +declare module BABYLON { + class VertexBuffer { + private _mesh; + private _engine; + private _buffer; + private _data; + private _updatable; + private _kind; + private _strideSize; + constructor(engine: any, data: number[], kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number); + isUpdatable(): boolean; + getData(): number[]; + getBuffer(): WebGLBuffer; + getStrideSize(): number; + create(data?: number[]): void; + update(data: number[]): void; + updateDirectly(data: Float32Array, offset: number): void; + dispose(): void; + private static _PositionKind; + private static _NormalKind; + private static _UVKind; + private static _UV2Kind; + private static _UV3Kind; + private static _UV4Kind; + private static _UV5Kind; + private static _UV6Kind; + private static _ColorKind; + private static _MatricesIndicesKind; + private static _MatricesWeightsKind; + static PositionKind: string; + static NormalKind: string; + static UVKind: string; + static UV2Kind: string; + static UV3Kind: string; + static UV4Kind: string; + static UV5Kind: string; + static UV6Kind: string; + static ColorKind: string; + static MatricesIndicesKind: string; + static MatricesWeightsKind: string; + } +} + +declare module BABYLON { + class Particle { + position: Vector3; + direction: Vector3; + color: Color4; + colorStep: Color4; + lifeTime: number; + age: number; + size: number; + angle: number; + angularSpeed: number; + copyTo(other: Particle): void; + } +} + +declare module BABYLON { + class ParticleSystem implements IDisposable { + name: string; + static BLENDMODE_ONEONE: number; + static BLENDMODE_STANDARD: number; + id: string; + renderingGroupId: number; + emitter: any; + emitRate: number; + manualEmitCount: number; + updateSpeed: number; + targetStopDuration: number; + disposeOnStop: boolean; + minEmitPower: number; + maxEmitPower: number; + minLifeTime: number; + maxLifeTime: number; + minSize: number; + maxSize: number; + minAngularSpeed: number; + maxAngularSpeed: number; + particleTexture: Texture; + layerMask: number; + onDispose: () => void; + updateFunction: (particles: Particle[]) => void; + blendMode: number; + forceDepthWrite: boolean; + gravity: Vector3; + direction1: Vector3; + direction2: Vector3; + minEmitBox: Vector3; + maxEmitBox: Vector3; + color1: Color4; + color2: Color4; + colorDead: Color4; + textureMask: Color4; + startDirectionFunction: (emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3) => void; + startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3) => void; + private particles; + private _capacity; + private _scene; + private _vertexDeclaration; + private _vertexStrideSize; + private _stockParticles; + private _newPartsExcess; + private _vertexBuffer; + private _indexBuffer; + private _vertices; + private _effect; + private _customEffect; + private _cachedDefines; + private _scaledColorStep; + private _colorDiff; + private _scaledDirection; + private _scaledGravity; + private _currentRenderId; + private _alive; + private _started; + private _stopped; + private _actualFrame; + private _scaledUpdateSpeed; + constructor(name: string, capacity: number, scene: Scene, customEffect?: Effect); + recycleParticle(particle: Particle): void; + getCapacity(): number; + isAlive(): boolean; + isStarted(): boolean; + start(): void; + stop(): void; + _appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void; + private _update(newParticles); + private _getEffect(); + animate(): void; + render(): number; + dispose(): void; + clone(name: string, newEmitter: any): ParticleSystem; + } +} + +declare module BABYLON { + interface IPhysicsEnginePlugin { + initialize(iterations?: number): any; + setGravity(gravity: Vector3): void; + runOneStep(delta: number): void; + registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any; + registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + unregisterMesh(mesh: AbstractMesh): any; + applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean; + dispose(): void; + isSupported(): boolean; + updateBodyPosition(mesh: AbstractMesh): void; + } + interface PhysicsBodyCreationOptions { + mass: number; + friction: number; + restitution: number; + } + interface PhysicsCompoundBodyPart { + mesh: Mesh; + impostor: number; + } + class PhysicsEngine { + gravity: Vector3; + private _currentPlugin; + constructor(plugin?: IPhysicsEnginePlugin); + _initialize(gravity?: Vector3): void; + _runOneStep(delta: number): void; + _setGravity(gravity: Vector3): void; + _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any; + _registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + _unregisterMesh(mesh: AbstractMesh): void; + _applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + _createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean; + _updateBodyPosition(mesh: AbstractMesh): void; + dispose(): void; + isSupported(): boolean; + static NoImpostor: number; + static SphereImpostor: number; + static BoxImpostor: number; + static PlaneImpostor: number; + static MeshImpostor: number; + static CapsuleImpostor: number; + static ConeImpostor: number; + static CylinderImpostor: number; + static ConvexHullImpostor: number; + static Epsilon: number; + } +} + +declare module BABYLON { + class BoundingBoxRenderer { + frontColor: Color3; + backColor: Color3; + showBackLines: boolean; + renderList: SmartArray; + private _scene; + private _colorShader; + private _vb; + private _ib; + constructor(scene: Scene); + private _prepareRessources(); + reset(): void; + render(): void; + dispose(): void; + } +} + +declare module BABYLON { + class DepthRenderer { + private _scene; + private _depthMap; + private _effect; + private _viewMatrix; + private _projectionMatrix; + private _transformMatrix; + private _worldViewProjection; + private _cachedDefines; + constructor(scene: Scene, type?: number); + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + getDepthMap(): RenderTargetTexture; + dispose(): void; + } +} + +declare module BABYLON { + class EdgesRenderer { + private _source; + private _linesPositions; + private _linesNormals; + private _linesIndices; + private _epsilon; + private _indicesCount; + private _lineShader; + private _vb0; + private _vb1; + private _ib; + private _buffers; + private _checkVerticesInsteadOfIndices; + constructor(source: AbstractMesh, epsilon?: number, checkVerticesInsteadOfIndices?: boolean); + private _prepareRessources(); + dispose(): void; + private _processEdgeForAdjacencies(pa, pb, p0, p1, p2); + private _processEdgeForAdjacenciesWithVertices(pa, pb, p0, p1, p2); + private _checkEdge(faceIndex, edge, faceNormals, p0, p1); + _generateEdgesLines(): void; + render(): void; + } +} + +declare module BABYLON { + class OutlineRenderer { + private _scene; + private _effect; + private _cachedDefines; + constructor(scene: Scene); + render(subMesh: SubMesh, batch: _InstancesBatch, useOverlay?: boolean): void; + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + } +} + +declare module BABYLON { + class RenderingGroup { + index: number; + private _scene; + private _opaqueSubMeshes; + private _transparentSubMeshes; + private _alphaTestSubMeshes; + private _activeVertices; + constructor(index: number, scene: Scene); + render(customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray) => void): boolean; + prepare(): void; + dispatch(subMesh: SubMesh): void; + } +} + +declare module BABYLON { + class RenderingManager { + static MAX_RENDERINGGROUPS: number; + private _scene; + private _renderingGroups; + private _depthBufferAlreadyCleaned; + constructor(scene: Scene); + private _renderParticles(index, activeMeshes); + private _renderSprites(index); + private _clearDepthBuffer(); + render(customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray) => void, activeMeshes: AbstractMesh[], renderParticles: boolean, renderSprites: boolean): void; + reset(): void; + dispatch(subMesh: SubMesh): void; + } +} + +declare module BABYLON { + class AnaglyphPostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class BlackAndWhitePostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class BlurPostProcess extends PostProcess { + direction: Vector2; + blurWidth: number; + constructor(name: string, direction: Vector2, blurWidth: number, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class ColorCorrectionPostProcess extends PostProcess { + private _colorTableTexture; + constructor(name: string, colorTableUrl: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class ConvolutionPostProcess extends PostProcess { + kernel: number[]; + constructor(name: string, kernel: number[], ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + static EdgeDetect0Kernel: number[]; + static EdgeDetect1Kernel: number[]; + static EdgeDetect2Kernel: number[]; + static SharpenKernel: number[]; + static EmbossKernel: number[]; + static GaussianKernel: number[]; + } +} + +declare module BABYLON { + class DisplayPassPostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class FilterPostProcess extends PostProcess { + kernelMatrix: Matrix; + constructor(name: string, kernelMatrix: Matrix, ratio: number, camera?: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class FxaaPostProcess extends PostProcess { + texelWidth: number; + texelHeight: number; + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class HDRRenderingPipeline extends PostProcessRenderPipeline implements IDisposable { + /** + * Public members + */ + /** + * Gaussian blur coefficient + * @type {number} + */ + gaussCoeff: number; + /** + * Gaussian blur mean + * @type {number} + */ + gaussMean: number; + /** + * Gaussian blur standard deviation + * @type {number} + */ + gaussStandDev: number; + /** + * Exposure, controls the overall intensity of the pipeline + * @type {number} + */ + exposure: number; + /** + * Minimum luminance that the post-process can output. Luminance is >= 0 + * @type {number} + */ + minimumLuminance: number; + /** + * Maximum luminance that the post-process can output. Must be suprerior to minimumLuminance + * @type {number} + */ + maximumLuminance: number; + /** + * Increase rate for luminance: eye adaptation speed to dark + * @type {number} + */ + luminanceIncreaserate: number; + /** + * Decrease rate for luminance: eye adaptation speed to bright + * @type {number} + */ + luminanceDecreaseRate: number; + /** + * Minimum luminance needed to compute HDR + * @type {number} + */ + brightThreshold: number; + /** + * Private members + */ + private _guassianBlurHPostProcess; + private _guassianBlurVPostProcess; + private _brightPassPostProcess; + private _textureAdderPostProcess; + private _downSampleX4PostProcess; + private _originalPostProcess; + private _hdrPostProcess; + private _hdrCurrentLuminance; + private _hdrOutputLuminance; + static LUM_STEPS: number; + private _downSamplePostProcesses; + private _scene; + private _needUpdate; + /** + * @constructor + * @param {string} name - The rendering pipeline name + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {any} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.PostProcess} originalPostProcess - the custom original color post-process. Must be "reusable". Can be null. + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + constructor(name: string, scene: Scene, ratio: number, originalPostProcess?: PostProcess, cameras?: Camera[]); + /** + * Tells the pipeline to update its post-processes + */ + update(): void; + /** + * Returns the current calculated luminance + */ + getCurrentLuminance(): number; + /** + * Returns the currently drawn luminance + */ + getOutputLuminance(): number; + /** + * Releases the rendering pipeline and its internal effects. Detaches pipeline from cameras + */ + dispose(): void; + /** + * Creates the HDR post-process and computes the luminance adaptation + */ + private _createHDRPostProcess(scene, ratio); + /** + * Texture Adder post-process + */ + private _createTextureAdderPostProcess(scene, ratio); + /** + * Down sample X4 post-process + */ + private _createDownSampleX4PostProcess(scene, ratio); + /** + * Bright pass post-process + */ + private _createBrightPassPostProcess(scene, ratio); + /** + * Luminance generator. Creates the luminance post-process and down sample post-processes + */ + private _createLuminanceGeneratorPostProcess(scene); + /** + * Gaussian blur post-processes. Horizontal and Vertical + */ + private _createGaussianBlurPostProcess(scene, ratio); + } +} + +declare module BABYLON { + class LensRenderingPipeline extends PostProcessRenderPipeline { + /** + * The chromatic aberration PostProcess id in the pipeline + * @type {string} + */ + LensChromaticAberrationEffect: string; + /** + * The highlights enhancing PostProcess id in the pipeline + * @type {string} + */ + HighlightsEnhancingEffect: string; + /** + * The depth-of-field PostProcess id in the pipeline + * @type {string} + */ + LensDepthOfFieldEffect: string; + private _scene; + private _depthTexture; + private _grainTexture; + private _chromaticAberrationPostProcess; + private _highlightsPostProcess; + private _depthOfFieldPostProcess; + private _edgeBlur; + private _grainAmount; + private _chromaticAberration; + private _distortion; + private _highlightsGain; + private _highlightsThreshold; + private _dofDistance; + private _dofAperture; + private _dofDarken; + private _dofPentagon; + private _blurNoise; + /** + * @constructor + * + * Effect parameters are as follow: + * { + * chromatic_aberration: number; // from 0 to x (1 for realism) + * edge_blur: number; // from 0 to x (1 for realism) + * distortion: number; // from 0 to x (1 for realism) + * grain_amount: number; // from 0 to 1 + * grain_texture: BABYLON.Texture; // texture to use for grain effect; if unset, use random B&W noise + * dof_focus_distance: number; // depth-of-field: focus distance; unset to disable (disabled by default) + * dof_aperture: number; // depth-of-field: focus blur bias (default: 1) + * dof_darken: number; // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default) + * dof_pentagon: boolean; // depth-of-field: makes a pentagon-like "bokeh" effect + * dof_gain: number; // depth-of-field: highlights gain; unset to disable (disabled by default) + * dof_threshold: number; // depth-of-field: highlights threshold (default: 1) + * blur_noise: boolean; // add a little bit of noise to the blur (default: true) + * } + * Note: if an effect parameter is unset, effect is disabled + * + * @param {string} name - The rendering pipeline name + * @param {object} parameters - An object containing all parameters (see above) + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {number} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + constructor(name: string, parameters: any, scene: Scene, ratio?: number, cameras?: Camera[]); + setEdgeBlur(amount: number): void; + disableEdgeBlur(): void; + setGrainAmount(amount: number): void; + disableGrain(): void; + setChromaticAberration(amount: number): void; + disableChromaticAberration(): void; + setEdgeDistortion(amount: number): void; + disableEdgeDistortion(): void; + setFocusDistance(amount: number): void; + disableDepthOfField(): void; + setAperture(amount: number): void; + setDarkenOutOfFocus(amount: number): void; + enablePentagonBokeh(): void; + disablePentagonBokeh(): void; + enableNoiseBlur(): void; + disableNoiseBlur(): void; + setHighlightsGain(amount: number): void; + setHighlightsThreshold(amount: number): void; + disableHighlights(): void; + /** + * Removes the internal pipeline assets and detaches the pipeline from the scene cameras + */ + dispose(disableDepthRender?: boolean): void; + private _createChromaticAberrationPostProcess(ratio); + private _createHighlightsPostProcess(ratio); + private _createDepthOfFieldPostProcess(ratio); + private _createGrainTexture(); + } +} + +declare module BABYLON { + class PassPostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class PostProcess { + name: string; + onApply: (effect: Effect) => void; + onBeforeRender: (effect: Effect) => void; + onAfterRender: (effect: Effect) => void; + onSizeChanged: () => void; + onActivate: (camera: Camera) => void; + width: number; + height: number; + renderTargetSamplingMode: number; + clearColor: Color4; + private _camera; + private _scene; + private _engine; + private _renderRatio; + private _reusable; + private _textureType; + _textures: SmartArray; + _currentRenderTextureInd: number; + private _effect; + constructor(name: string, fragmentUrl: string, parameters: string[], samplers: string[], ratio: number | any, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean, defines?: string, textureType?: number); + isReusable(): boolean; + activate(camera: Camera, sourceTexture?: WebGLTexture): void; + apply(): Effect; + dispose(camera?: Camera): void; + } +} + +declare module BABYLON { + class PostProcessManager { + private _scene; + private _indexBuffer; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + constructor(scene: Scene); + private _prepareBuffers(); + _prepareFrame(sourceTexture?: WebGLTexture): boolean; + directRender(postProcesses: PostProcess[], targetTexture?: WebGLTexture): void; + _finalizeFrame(doNotPresent?: boolean, targetTexture?: WebGLTexture, postProcesses?: PostProcess[]): void; + dispose(): void; + } +} + +declare module BABYLON { + class RefractionPostProcess extends PostProcess { + color: Color3; + depth: number; + colorLevel: number; + private _refRexture; + constructor(name: string, refractionTextureUrl: string, color: Color3, depth: number, colorLevel: number, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + dispose(camera: Camera): void; + } +} + +declare module BABYLON { + class SSAORenderingPipeline extends PostProcessRenderPipeline { + /** + * The PassPostProcess id in the pipeline that contains the original scene color + * @type {string} + */ + SSAOOriginalSceneColorEffect: string; + /** + * The SSAO PostProcess id in the pipeline + * @type {string} + */ + SSAORenderEffect: string; + /** + * The horizontal blur PostProcess id in the pipeline + * @type {string} + */ + SSAOBlurHRenderEffect: string; + /** + * The vertical blur PostProcess id in the pipeline + * @type {string} + */ + SSAOBlurVRenderEffect: string; + /** + * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect) + * @type {string} + */ + SSAOCombineRenderEffect: string; + /** + * The output strength of the SSAO post-process. Default value is 1.0. + * @type {number} + */ + totalStrength: number; + /** + * The radius around the analyzed pixel used by the SSAO post-process. Default value is 0.0002 + * @type {number} + */ + radius: number; + /** + * Related to fallOff, used to interpolate SSAO samples (first interpolate function input) based on the occlusion difference of each pixel + * Must not be equal to fallOff and superior to fallOff. + * Default value is 0.0075 + * @type {number} + */ + area: number; + /** + * Related to area, used to interpolate SSAO samples (second interpolate function input) based on the occlusion difference of each pixel + * Must not be equal to area and inferior to area. + * Default value is 0.0002 + * @type {number} + */ + fallOff: number; + private _scene; + private _depthTexture; + private _randomTexture; + private _originalColorPostProcess; + private _ssaoPostProcess; + private _blurHPostProcess; + private _blurVPostProcess; + private _ssaoCombinePostProcess; + private _firstUpdate; + /** + * @constructor + * @param {string} name - The rendering pipeline name + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {any} ratio - The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, combineRatio: 1.0 } + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + constructor(name: string, scene: Scene, ratio: any, cameras?: Camera[]); + /** + * Returns the horizontal blur PostProcess + * @return {BABYLON.BlurPostProcess} The horizontal blur post-process + */ + getBlurHPostProcess(): BlurPostProcess; + /** + * Returns the vertical blur PostProcess + * @return {BABYLON.BlurPostProcess} The vertical blur post-process + */ + getBlurVPostProcess(): BlurPostProcess; + /** + * Removes the internal pipeline assets and detatches the pipeline from the scene cameras + */ + dispose(disableDepthRender?: boolean): void; + private _createSSAOPostProcess(ratio); + private _createSSAOCombinePostProcess(ratio); + private _createRandomTexture(); + } +} + +declare module BABYLON { + class StereoscopicInterlacePostProcess extends PostProcess { + private _stepSize; + constructor(name: string, camB: Camera, postProcessA: PostProcess, isStereoscopicHoriz: boolean, samplingMode?: number); + } +} + +declare module BABYLON { + enum TonemappingOperator { + Hable = 0, + Reinhard = 1, + HejiDawson = 2, + Photographic = 3, + } + class TonemapPostProcess extends PostProcess { + private _operator; + private _exposureAdjustment; + constructor(name: string, operator: TonemappingOperator, exposureAdjustment: number, camera: Camera, samplingMode?: number, engine?: Engine, textureFormat?: number); + } +} + +declare module BABYLON { + class VolumetricLightScatteringPostProcess extends PostProcess { + private _volumetricLightScatteringPass; + private _volumetricLightScatteringRTT; + private _viewPort; + private _screenCoordinates; + private _cachedDefines; + private _customMeshPosition; + /** + * Set if the post-process should use a custom position for the light source (true) or the internal mesh position (false) + * @type {boolean} + */ + useCustomMeshPosition: boolean; + /** + * If the post-process should inverse the light scattering direction + * @type {boolean} + */ + invert: boolean; + /** + * The internal mesh used by the post-process + * @type {boolean} + */ + mesh: Mesh; + /** + * Set to true to use the diffuseColor instead of the diffuseTexture + * @type {boolean} + */ + useDiffuseColor: boolean; + /** + * Array containing the excluded meshes not rendered in the internal pass + */ + excludedMeshes: AbstractMesh[]; + /** + * Controls the overall intensity of the post-process + * @type {number} + */ + exposure: number; + /** + * Dissipates each sample's contribution in range [0, 1] + * @type {number} + */ + decay: number; + /** + * Controls the overall intensity of each sample + * @type {number} + */ + weight: number; + /** + * Controls the density of each sample + * @type {number} + */ + density: number; + /** + * @constructor + * @param {string} name - The post-process name + * @param {any} ratio - The size of the post-process and/or internal pass (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.Camera} camera - The camera that the post-process will be attached to + * @param {BABYLON.Mesh} mesh - The mesh used to create the light scattering + * @param {number} samples - The post-process quality, default 100 + * @param {number} samplingMode - The post-process filtering mode + * @param {BABYLON.Engine} engine - The babylon engine + * @param {boolean} reusable - If the post-process is reusable + * @param {BABYLON.Scene} scene - The constructor needs a scene reference to initialize internal components. If "camera" is null (RenderPipelineà, "scene" must be provided + */ + constructor(name: string, ratio: any, camera: Camera, mesh?: Mesh, samples?: number, samplingMode?: number, engine?: Engine, reusable?: boolean, scene?: Scene); + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + /** + * Sets the new light position for light scattering effect + * @param {BABYLON.Vector3} The new custom light position + */ + setCustomMeshPosition(position: Vector3): void; + /** + * Returns the light position for light scattering effect + * @return {BABYLON.Vector3} The custom light position + */ + getCustomMeshPosition(): Vector3; + /** + * Disposes the internal assets and detaches the post-process from the camera + */ + dispose(camera: Camera): void; + /** + * Returns the render target texture used by the post-process + * @return {BABYLON.RenderTargetTexture} The render target texture used by the post-process + */ + getPass(): RenderTargetTexture; + private _meshExcluded(mesh); + private _createPass(scene, ratio); + private _updateMeshScreenCoordinates(scene); + /** + * Creates a default mesh for the Volumeric Light Scattering post-process + * @param {string} The mesh name + * @param {BABYLON.Scene} The scene where to create the mesh + * @return {BABYLON.Mesh} the default mesh + */ + static CreateDefaultMesh(name: string, scene: Scene): Mesh; + } +} + +declare module BABYLON { + class VRDistortionCorrectionPostProcess extends PostProcess { + aspectRatio: number; + private _isRightEye; + private _distortionFactors; + private _postProcessScaleFactor; + private _lensCenterOffset; + private _scaleIn; + private _scaleFactor; + private _lensCenter; + constructor(name: string, camera: Camera, isRightEye: boolean, vrMetrics: VRCameraMetrics); + } +} + +declare module BABYLON { + class Sprite { + name: string; + position: Vector3; + color: Color4; + width: number; + height: number; + angle: number; + cellIndex: number; + invertU: number; + invertV: number; + disposeWhenFinishedAnimating: boolean; + animations: Animation[]; + private _animationStarted; + private _loopAnimation; + private _fromIndex; + private _toIndex; + private _delay; + private _direction; + private _frameCount; + private _manager; + private _time; + size: number; + constructor(name: string, manager: SpriteManager); + playAnimation(from: number, to: number, loop: boolean, delay: number): void; + stopAnimation(): void; + _animate(deltaTime: number): void; + dispose(): void; + } +} + +declare module BABYLON { + class SpriteManager { + name: string; + cellSize: number; + sprites: Sprite[]; + renderingGroupId: number; + layerMask: number; + onDispose: () => void; + fogEnabled: boolean; + private _capacity; + private _spriteTexture; + private _epsilon; + private _scene; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + private _indexBuffer; + private _vertices; + private _effectBase; + private _effectFog; + constructor(name: string, imgUrl: string, capacity: number, cellSize: number, scene: Scene, epsilon?: number, samplingMode?: number); + private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize); + render(): void; + dispose(): void; + } +} + +declare module BABYLON.Internals { + class AndOrNotEvaluator { + static Eval(query: string, evaluateCallback: (val: any) => boolean): boolean; + private static _HandleParenthesisContent(parenthesisContent, evaluateCallback); + private static _SimplifyNegation(booleanString); + } +} + +declare module BABYLON { + interface IAssetTask { + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + run(scene: Scene, onSuccess: () => void, onError: () => void): any; + } + class MeshAssetTask implements IAssetTask { + name: string; + meshesNames: any; + rootUrl: string; + sceneFilename: string; + loadedMeshes: Array; + loadedParticleSystems: Array; + loadedSkeletons: Array; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + constructor(name: string, meshesNames: any, rootUrl: string, sceneFilename: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class TextFileAssetTask implements IAssetTask { + name: string; + url: string; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + text: string; + constructor(name: string, url: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class BinaryFileAssetTask implements IAssetTask { + name: string; + url: string; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + data: ArrayBuffer; + constructor(name: string, url: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class ImageAssetTask implements IAssetTask { + name: string; + url: string; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + image: HTMLImageElement; + constructor(name: string, url: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class TextureAssetTask implements IAssetTask { + name: string; + url: string; + noMipmap: boolean; + invertY: boolean; + samplingMode: number; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + texture: Texture; + constructor(name: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode?: number); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class AssetsManager { + private _tasks; + private _scene; + private _waitingTasksCount; + onFinish: (tasks: IAssetTask[]) => void; + onTaskSuccess: (task: IAssetTask) => void; + onTaskError: (task: IAssetTask) => void; + useDefaultLoadingScreen: boolean; + constructor(scene: Scene); + addMeshTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string): IAssetTask; + addTextFileTask(taskName: string, url: string): IAssetTask; + addBinaryFileTask(taskName: string, url: string): IAssetTask; + addImageTask(taskName: string, url: string): IAssetTask; + addTextureTask(taskName: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode?: number): IAssetTask; + private _decreaseWaitingTasksCount(); + private _runTask(task); + reset(): AssetsManager; + load(): AssetsManager; + } +} + +declare module BABYLON { + class Database { + private callbackManifestChecked; + private currentSceneUrl; + private db; + private enableSceneOffline; + private enableTexturesOffline; + private manifestVersionFound; + private mustUpdateRessources; + private hasReachedQuota; + private isSupported; + private idbFactory; + static IsUASupportingBlobStorage: boolean; + static IDBStorageEnabled: boolean; + constructor(urlToScene: string, callbackManifestChecked: (checked: boolean) => any); + static parseURL: (url: string) => string; + static ReturnFullUrlLocation: (url: string) => string; + checkManifestFile(): void; + openAsync(successCallback: any, errorCallback: any): void; + loadImageFromDB(url: string, image: HTMLImageElement): void; + private _loadImageFromDBAsync(url, image, notInDBCallback); + private _saveImageIntoDBAsync(url, image); + private _checkVersionFromDB(url, versionLoaded); + private _loadVersionFromDBAsync(url, callback, updateInDBCallback); + private _saveVersionIntoDBAsync(url, callback); + private loadFileFromDB(url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer?); + private _loadFileFromDBAsync(url, callback, notInDBCallback, useArrayBuffer?); + private _saveFileIntoDBAsync(url, callback, progressCallback, useArrayBuffer?); + } +} + +declare module BABYLON { + class FilesInput { + private _engine; + private _currentScene; + private _canvas; + private _sceneLoadedCallback; + private _progressCallback; + private _additionnalRenderLoopLogicCallback; + private _textureLoadingCallback; + private _startingProcessingFilesCallback; + private _elementToMonitor; + static FilesTextures: any[]; + static FilesToLoad: any[]; + private _sceneFileToLoad; + private _filesToLoad; + constructor(p_engine: Engine, p_scene: Scene, p_canvas: HTMLCanvasElement, p_sceneLoadedCallback: any, p_progressCallback: any, p_additionnalRenderLoopLogicCallback: any, p_textureLoadingCallback: any, p_startingProcessingFilesCallback: any); + monitorElementForDragNDrop(p_elementToMonitor: HTMLElement): void; + private renderFunction(); + private drag(e); + private drop(eventDrop); + loadFiles(event: any): void; + reload(): void; + } +} + +declare module BABYLON { + class Gamepads { + private babylonGamepads; + private oneGamepadConnected; + private isMonitoring; + private gamepadEventSupported; + private gamepadSupportAvailable; + private _callbackGamepadConnected; + private buttonADataURL; + private static gamepadDOMInfo; + constructor(ongamedpadconnected: (gamepad: Gamepad) => void); + private _insertGamepadDOMInstructions(); + private _insertGamepadDOMNotSupported(); + dispose(): void; + private _onGamepadConnected(evt); + private _addNewGamepad(gamepad); + private _onGamepadDisconnected(evt); + private _startMonitoringGamepads(); + private _stopMonitoringGamepads(); + private _checkGamepadsStatus(); + private _updateGamepadObjects(); + } + class StickValues { + x: any; + y: any; + constructor(x: any, y: any); + } + class Gamepad { + id: string; + index: number; + browserGamepad: any; + private _leftStick; + private _rightStick; + private _onleftstickchanged; + private _onrightstickchanged; + constructor(id: string, index: number, browserGamepad: any); + onleftstickchanged(callback: (values: StickValues) => void): void; + onrightstickchanged(callback: (values: StickValues) => void): void; + leftStick: StickValues; + rightStick: StickValues; + update(): void; + } + class GenericPad extends Gamepad { + id: string; + index: number; + gamepad: any; + private _buttons; + private _onbuttondown; + private _onbuttonup; + onbuttondown(callback: (buttonPressed: number) => void): void; + onbuttonup(callback: (buttonReleased: number) => void): void; + constructor(id: string, index: number, gamepad: any); + private _setButtonValue(newValue, currentValue, buttonIndex); + update(): void; + } + enum Xbox360Button { + A = 0, + B = 1, + X = 2, + Y = 3, + Start = 4, + Back = 5, + LB = 6, + RB = 7, + LeftStick = 8, + RightStick = 9, + } + enum Xbox360Dpad { + Up = 0, + Down = 1, + Left = 2, + Right = 3, + } + class Xbox360Pad extends Gamepad { + private _leftTrigger; + private _rightTrigger; + private _onlefttriggerchanged; + private _onrighttriggerchanged; + private _onbuttondown; + private _onbuttonup; + private _ondpaddown; + private _ondpadup; + private _buttonA; + private _buttonB; + private _buttonX; + private _buttonY; + private _buttonBack; + private _buttonStart; + private _buttonLB; + private _buttonRB; + private _buttonLeftStick; + private _buttonRightStick; + private _dPadUp; + private _dPadDown; + private _dPadLeft; + private _dPadRight; + onlefttriggerchanged(callback: (value: number) => void): void; + onrighttriggerchanged(callback: (value: number) => void): void; + leftTrigger: number; + rightTrigger: number; + onbuttondown(callback: (buttonPressed: Xbox360Button) => void): void; + onbuttonup(callback: (buttonReleased: Xbox360Button) => void): void; + ondpaddown(callback: (dPadPressed: Xbox360Dpad) => void): void; + ondpadup(callback: (dPadReleased: Xbox360Dpad) => void): void; + private _setButtonValue(newValue, currentValue, buttonType); + private _setDPadValue(newValue, currentValue, buttonType); + buttonA: number; + buttonB: number; + buttonX: number; + buttonY: number; + buttonStart: number; + buttonBack: number; + buttonLB: number; + buttonRB: number; + buttonLeftStick: number; + buttonRightStick: number; + dPadUp: number; + dPadDown: number; + dPadLeft: number; + dPadRight: number; + update(): void; + } +} +interface Navigator { + getGamepads(func?: any): any; + webkitGetGamepads(func?: any): any; + msGetGamepads(func?: any): any; + webkitGamepads(func?: any): any; +} + +declare module BABYLON { + class SceneOptimization { + priority: number; + apply: (scene: Scene) => boolean; + constructor(priority?: number); + } + class TextureOptimization extends SceneOptimization { + priority: number; + maximumSize: number; + constructor(priority?: number, maximumSize?: number); + apply: (scene: Scene) => boolean; + } + class HardwareScalingOptimization extends SceneOptimization { + priority: number; + maximumScale: number; + private _currentScale; + constructor(priority?: number, maximumScale?: number); + apply: (scene: Scene) => boolean; + } + class ShadowsOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class PostProcessesOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class LensFlaresOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class ParticlesOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class RenderTargetsOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class MergeMeshesOptimization extends SceneOptimization { + static _UpdateSelectionTree: boolean; + static UpdateSelectionTree: boolean; + private _canBeMerged; + apply: (scene: Scene, updateSelectionTree?: boolean) => boolean; + } + class SceneOptimizerOptions { + targetFrameRate: number; + trackerDuration: number; + optimizations: SceneOptimization[]; + constructor(targetFrameRate?: number, trackerDuration?: number); + static LowDegradationAllowed(targetFrameRate?: number): SceneOptimizerOptions; + static ModerateDegradationAllowed(targetFrameRate?: number): SceneOptimizerOptions; + static HighDegradationAllowed(targetFrameRate?: number): SceneOptimizerOptions; + } + class SceneOptimizer { + static _CheckCurrentState(scene: Scene, options: SceneOptimizerOptions, currentPriorityLevel: number, onSuccess?: () => void, onFailure?: () => void): void; + static OptimizeAsync(scene: Scene, options?: SceneOptimizerOptions, onSuccess?: () => void, onFailure?: () => void): void; + } +} + +declare module BABYLON { + class SceneSerializer { + static Serialize(scene: Scene): any; + static SerializeMesh(toSerialize: any, withParents?: boolean, withChildren?: boolean): any; + } +} + +declare module BABYLON { + class SmartArray { + data: Array; + length: number; + private _id; + private _duplicateId; + constructor(capacity: number); + push(value: any): void; + pushNoDuplicate(value: any): void; + sort(compareFn: any): void; + reset(): void; + concat(array: any): void; + concatWithNoDuplicate(array: any): void; + indexOf(value: any): number; + private static _GlobalId; + } +} + +declare module BABYLON { + class SmartCollection { + count: number; + items: any; + private _keys; + private _initialCapacity; + constructor(capacity?: number); + add(key: any, item: any): number; + remove(key: any): number; + removeItemOfIndex(index: number): number; + indexOf(key: any): number; + item(key: any): any; + getAllKeys(): any[]; + getKeyByIndex(index: number): any; + getItemByIndex(index: number): any; + empty(): void; + forEach(block: (item: any) => void): void; + } +} + +declare module BABYLON { + class Tags { + static EnableFor(obj: any): void; + static DisableFor(obj: any): void; + static HasTags(obj: any): boolean; + static GetTags(obj: any): any; + static AddTagsTo(obj: any, tagsString: string): void; + static _AddTagTo(obj: any, tag: string): void; + static RemoveTagsFrom(obj: any, tagsString: string): void; + static _RemoveTagFrom(obj: any, tag: string): void; + static MatchesQuery(obj: any, tagsQuery: string): boolean; + } +} + +declare module BABYLON.Internals { + interface DDSInfo { + width: number; + height: number; + mipmapCount: number; + isFourCC: boolean; + isRGB: boolean; + isLuminance: boolean; + isCube: boolean; + } + class DDSTools { + static GetDDSInfo(arrayBuffer: any): DDSInfo; + private static GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + private static GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + private static GetLuminanceArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + static UploadDDSLevels(gl: WebGLRenderingContext, ext: any, arrayBuffer: any, info: DDSInfo, loadMipmaps: boolean, faces: number): void; + } +} + +declare module BABYLON.Internals { + class TGATools { + private static _TYPE_NO_DATA; + private static _TYPE_INDEXED; + private static _TYPE_RGB; + private static _TYPE_GREY; + private static _TYPE_RLE_INDEXED; + private static _TYPE_RLE_RGB; + private static _TYPE_RLE_GREY; + private static _ORIGIN_MASK; + private static _ORIGIN_SHIFT; + private static _ORIGIN_BL; + private static _ORIGIN_BR; + private static _ORIGIN_UL; + private static _ORIGIN_UR; + static GetTGAHeader(data: Uint8Array): any; + static UploadContent(gl: WebGLRenderingContext, data: Uint8Array): void; + static _getImageData8bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageData16bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageData24bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageData32bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageDataGrey8bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageDataGrey16bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + } +} + +declare module BABYLON { + interface IAnimatable { + animations: Array; + } + interface ISize { + width: number; + height: number; + } + class Tools { + static BaseUrl: string; + static ToHex(i: number): string; + static SetImmediate(action: () => void): void; + static IsExponantOfTwo(value: number): boolean; + static GetExponantOfTwo(value: number, max: number): number; + static GetFilename(path: string): string; + static GetDOMTextContent(element: HTMLElement): string; + static ToDegrees(angle: number): number; + static ToRadians(angle: number): number; + static ExtractMinAndMaxIndexed(positions: number[], indices: number[], indexStart: number, indexCount: number): { + minimum: Vector3; + maximum: Vector3; + }; + static ExtractMinAndMax(positions: number[], start: number, count: number): { + minimum: Vector3; + maximum: Vector3; + }; + static MakeArray(obj: any, allowsNullUndefined?: boolean): Array; + static GetPointerPrefix(): string; + static QueueNewFrame(func: any): void; + static RequestFullscreen(element: any): void; + static ExitFullscreen(): void; + static CleanUrl(url: string): string; + static LoadImage(url: string, onload: any, onerror: any, database: any): HTMLImageElement; + static LoadFile(url: string, callback: (data: any) => void, progressCallBack?: () => void, database?: any, useArrayBuffer?: boolean, onError?: () => void): void; + static ReadFileAsDataURL(fileToLoad: any, callback: any, progressCallback: any): void; + static ReadFile(fileToLoad: any, callback: any, progressCallBack: any, useArrayBuffer?: boolean): void; + static Clamp(value: number, min?: number, max?: number): number; + static Sign(value: number): number; + static Format(value: number, decimals?: number): string; + static CheckExtends(v: Vector3, min: Vector3, max: Vector3): void; + static WithinEpsilon(a: number, b: number, epsilon?: number): boolean; + static DeepCopy(source: any, destination: any, doNotCopyList?: string[], mustCopyList?: string[]): void; + static IsEmpty(obj: any): boolean; + static RegisterTopRootEvents(events: { + name: string; + handler: EventListener; + }[]): void; + static UnregisterTopRootEvents(events: { + name: string; + handler: EventListener; + }[]): void; + static DumpFramebuffer(width: number, height: number, engine: Engine, successCallback?: (data: String) => void): void; + static CreateScreenshot(engine: Engine, camera: Camera, size: any, successCallback?: (data: String) => void): void; + static ValidateXHRData(xhr: XMLHttpRequest, dataType?: number): boolean; + private static _NoneLogLevel; + private static _MessageLogLevel; + private static _WarningLogLevel; + private static _ErrorLogLevel; + private static _LogCache; + static errorsCount: number; + static OnNewCacheEntry: (entry: string) => void; + static NoneLogLevel: number; + static MessageLogLevel: number; + static WarningLogLevel: number; + static ErrorLogLevel: number; + static AllLogLevel: number; + private static _AddLogEntry(entry); + private static _FormatMessage(message); + static Log: (message: string) => void; + private static _LogDisabled(message); + private static _LogEnabled(message); + static Warn: (message: string) => void; + private static _WarnDisabled(message); + private static _WarnEnabled(message); + static Error: (message: string) => void; + private static _ErrorDisabled(message); + private static _ErrorEnabled(message); + static LogCache: string; + static ClearLogCache(): void; + static LogLevels: number; + private static _PerformanceNoneLogLevel; + private static _PerformanceUserMarkLogLevel; + private static _PerformanceConsoleLogLevel; + private static _performance; + static PerformanceNoneLogLevel: number; + static PerformanceUserMarkLogLevel: number; + static PerformanceConsoleLogLevel: number; + static PerformanceLogLevel: number; + static _StartPerformanceCounterDisabled(counterName: string, condition?: boolean): void; + static _EndPerformanceCounterDisabled(counterName: string, condition?: boolean): void; + static _StartUserMark(counterName: string, condition?: boolean): void; + static _EndUserMark(counterName: string, condition?: boolean): void; + static _StartPerformanceConsole(counterName: string, condition?: boolean): void; + static _EndPerformanceConsole(counterName: string, condition?: boolean): void; + static StartPerformanceCounter: (counterName: string, condition?: boolean) => void; + static EndPerformanceCounter: (counterName: string, condition?: boolean) => void; + static Now: number; + static GetFps(): number; + } + /** + * An implementation of a loop for asynchronous functions. + */ + class AsyncLoop { + iterations: number; + private _fn; + private _successCallback; + index: number; + private _done; + /** + * Constroctor. + * @param iterations the number of iterations. + * @param _fn the function to run each iteration + * @param _successCallback the callback that will be called upon succesful execution + * @param offset starting offset. + */ + constructor(iterations: number, _fn: (asyncLoop: AsyncLoop) => void, _successCallback: () => void, offset?: number); + /** + * Execute the next iteration. Must be called after the last iteration was finished. + */ + executeNext(): void; + /** + * Break the loop and run the success callback. + */ + breakLoop(): void; + /** + * Helper function + */ + static Run(iterations: number, _fn: (asyncLoop: AsyncLoop) => void, _successCallback: () => void, offset?: number): AsyncLoop; + /** + * A for-loop that will run a given number of iterations synchronous and the rest async. + * @param iterations total number of iterations + * @param syncedIterations number of synchronous iterations in each async iteration. + * @param fn the function to call each iteration. + * @param callback a success call back that will be called when iterating stops. + * @param breakFunction a break condition (optional) + * @param timeout timeout settings for the setTimeout function. default - 0. + * @constructor + */ + static SyncAsyncForLoop(iterations: number, syncedIterations: number, fn: (iteration: number) => void, callback: () => void, breakFunction?: () => boolean, timeout?: number): void; + } +} + +declare module BABYLON { + enum JoystickAxis { + X = 0, + Y = 1, + Z = 2, + } + class VirtualJoystick { + reverseLeftRight: boolean; + reverseUpDown: boolean; + deltaPosition: Vector3; + pressed: boolean; + private static _globalJoystickIndex; + private static vjCanvas; + private static vjCanvasContext; + private static vjCanvasWidth; + private static vjCanvasHeight; + private static halfWidth; + private static halfHeight; + private _action; + private _axisTargetedByLeftAndRight; + private _axisTargetedByUpAndDown; + private _joystickSensibility; + private _inversedSensibility; + private _rotationSpeed; + private _inverseRotationSpeed; + private _rotateOnAxisRelativeToMesh; + private _joystickPointerID; + private _joystickColor; + private _joystickPointerPos; + private _joystickPreviousPointerPos; + private _joystickPointerStartPos; + private _deltaJoystickVector; + private _leftJoystick; + private _joystickIndex; + private _touches; + private _onPointerDownHandlerRef; + private _onPointerMoveHandlerRef; + private _onPointerUpHandlerRef; + private _onPointerOutHandlerRef; + private _onResize; + constructor(leftJoystick?: boolean); + setJoystickSensibility(newJoystickSensibility: number): void; + private _onPointerDown(e); + private _onPointerMove(e); + private _onPointerUp(e); + /** + * Change the color of the virtual joystick + * @param newColor a string that must be a CSS color value (like "red") or the hexa value (like "#FF0000") + */ + setJoystickColor(newColor: string): void; + setActionOnTouch(action: () => any): void; + setAxisForLeftRight(axis: JoystickAxis): void; + setAxisForUpDown(axis: JoystickAxis): void; + private _clearCanvas(); + private _drawVirtualJoystick(); + releaseCanvas(): void; + } +} + +declare module BABYLON { + class VRDeviceOrientationFreeCamera extends FreeCamera { + _alpha: number; + _beta: number; + _gamma: number; + private _offsetOrientation; + private _deviceOrientationHandler; + constructor(name: string, position: Vector3, scene: Scene, compensateDistorsion?: boolean); + _onOrientationEvent(evt: DeviceOrientationEvent): void; + attachControl(element: HTMLElement, noPreventDefault?: boolean): void; + detachControl(element: HTMLElement): void; + } +} + +declare var HMDVRDevice: any; +declare var PositionSensorVRDevice: any; +declare module BABYLON { + class WebVRFreeCamera extends FreeCamera { + _hmdDevice: any; + _sensorDevice: any; + _cacheState: any; + _cacheQuaternion: Quaternion; + _cacheRotation: Vector3; + _vrEnabled: boolean; + constructor(name: string, position: Vector3, scene: Scene, compensateDistorsion?: boolean); + private _getWebVRDevices(devices); + _checkInputs(): void; + attachControl(element: HTMLElement, noPreventDefault?: boolean): void; + detachControl(element: HTMLElement): void; + } +} + +declare module BABYLON { + interface IOctreeContainer { + blocks: Array>; + } + class Octree { + maxDepth: number; + blocks: Array>; + dynamicContent: T[]; + private _maxBlockCapacity; + private _selectionContent; + private _creationFunc; + constructor(creationFunc: (entry: T, block: OctreeBlock) => void, maxBlockCapacity?: number, maxDepth?: number); + update(worldMin: Vector3, worldMax: Vector3, entries: T[]): void; + addMesh(entry: T): void; + select(frustumPlanes: Plane[], allowDuplicate?: boolean): SmartArray; + intersects(sphereCenter: Vector3, sphereRadius: number, allowDuplicate?: boolean): SmartArray; + intersectsRay(ray: Ray): SmartArray; + static _CreateBlocks(worldMin: Vector3, worldMax: Vector3, entries: T[], maxBlockCapacity: number, currentDepth: number, maxDepth: number, target: IOctreeContainer, creationFunc: (entry: T, block: OctreeBlock) => void): void; + static CreationFuncForMeshes: (entry: AbstractMesh, block: OctreeBlock) => void; + static CreationFuncForSubMeshes: (entry: SubMesh, block: OctreeBlock) => void; + } +} + +declare module BABYLON { + class OctreeBlock { + entries: T[]; + blocks: Array>; + private _depth; + private _maxDepth; + private _capacity; + private _minPoint; + private _maxPoint; + private _boundingVectors; + private _creationFunc; + constructor(minPoint: Vector3, maxPoint: Vector3, capacity: number, depth: number, maxDepth: number, creationFunc: (entry: T, block: OctreeBlock) => void); + capacity: number; + minPoint: Vector3; + maxPoint: Vector3; + addEntry(entry: T): void; + addEntries(entries: T[]): void; + select(frustumPlanes: Plane[], selection: SmartArray, allowDuplicate?: boolean): void; + intersects(sphereCenter: Vector3, sphereRadius: number, selection: SmartArray, allowDuplicate?: boolean): void; + intersectsRay(ray: Ray, selection: SmartArray): void; + createInnerBlocks(): void; + } +} + +declare module BABYLON { + class ShadowGenerator { + private static _FILTER_NONE; + private static _FILTER_VARIANCESHADOWMAP; + private static _FILTER_POISSONSAMPLING; + private static _FILTER_BLURVARIANCESHADOWMAP; + static FILTER_NONE: number; + static FILTER_VARIANCESHADOWMAP: number; + static FILTER_POISSONSAMPLING: number; + static FILTER_BLURVARIANCESHADOWMAP: number; + private _filter; + blurScale: number; + private _blurBoxOffset; + private _bias; + private _lightDirection; + bias: number; + blurBoxOffset: number; + filter: number; + useVarianceShadowMap: boolean; + usePoissonSampling: boolean; + useBlurVarianceShadowMap: boolean; + private _light; + private _scene; + private _shadowMap; + private _shadowMap2; + private _darkness; + private _transparencyShadow; + private _effect; + private _viewMatrix; + private _projectionMatrix; + private _transformMatrix; + private _worldViewProjection; + private _cachedPosition; + private _cachedDirection; + private _cachedDefines; + private _currentRenderID; + private _downSamplePostprocess; + private _boxBlurPostprocess; + private _mapSize; + constructor(mapSize: number, light: IShadowLight); + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + getShadowMap(): RenderTargetTexture; + getShadowMapForRendering(): RenderTargetTexture; + getLight(): IShadowLight; + getTransformMatrix(): Matrix; + getDarkness(): number; + setDarkness(darkness: number): void; + setTransparencyShadow(hasShadow: boolean): void; + private _packHalf(depth); + dispose(): void; + } +} + +declare module BABYLON.Internals { +} + +declare module BABYLON { + class BaseTexture { + name: string; + delayLoadState: number; + hasAlpha: boolean; + getAlphaFromRGB: boolean; + level: number; + isCube: boolean; + isRenderTarget: boolean; + animations: Animation[]; + onDispose: () => void; + coordinatesIndex: number; + coordinatesMode: number; + wrapU: number; + wrapV: number; + uScale: number; + vScale: number; + anisotropicFilteringLevel: number; + _cachedAnisotropicFilteringLevel: number; + private _scene; + _texture: WebGLTexture; + constructor(scene: Scene); + getScene(): Scene; + getTextureMatrix(): Matrix; + getReflectionTextureMatrix(): Matrix; + getInternalTexture(): WebGLTexture; + isReady(): boolean; + getSize(): ISize; + getBaseSize(): ISize; + scale(ratio: number): void; + canRescale: boolean; + _removeFromCache(url: string, noMipmap: boolean): void; + _getFromCache(url: string, noMipmap: boolean, sampling?: number): WebGLTexture; + delayLoad(): void; + releaseInternalTexture(): void; + clone(): BaseTexture; + dispose(): void; + } +} + +declare module BABYLON { + class CubeTexture extends BaseTexture { + url: string; + coordinatesMode: number; + private _noMipmap; + private _extensions; + private _textureMatrix; + constructor(rootUrl: string, scene: Scene, extensions?: string[], noMipmap?: boolean); + clone(): CubeTexture; + delayLoad(): void; + getReflectionTextureMatrix(): Matrix; + } +} + +declare module BABYLON { + class DynamicTexture extends Texture { + private _generateMipMaps; + private _canvas; + private _context; + constructor(name: string, options: any, scene: Scene, generateMipMaps: boolean, samplingMode?: number); + canRescale: boolean; + scale(ratio: number): void; + getContext(): CanvasRenderingContext2D; + clear(): void; + update(invertY?: boolean): void; + drawText(text: string, x: number, y: number, font: string, color: string, clearColor: string, invertY?: boolean, update?: boolean): void; + clone(): DynamicTexture; + } +} + +declare module BABYLON { + class MirrorTexture extends RenderTargetTexture { + mirrorPlane: Plane; + private _transformMatrix; + private _mirrorMatrix; + private _savedViewMatrix; + constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean); + clone(): MirrorTexture; + } +} + +declare module BABYLON { + class RawTexture extends Texture { + format: number; + constructor(data: ArrayBufferView, width: number, height: number, format: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number); + update(data: ArrayBufferView): void; + static CreateLuminanceTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateLuminanceAlphaTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateAlphaTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateRGBTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateRGBATexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + } +} + +declare module BABYLON { + class RenderTargetTexture extends Texture { + renderList: AbstractMesh[]; + renderParticles: boolean; + renderSprites: boolean; + coordinatesMode: number; + onBeforeRender: () => void; + onAfterRender: () => void; + onAfterUnbind: () => void; + onClear: (engine: Engine) => void; + activeCamera: Camera; + customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray, beforeTransparents?: () => void) => void; + private _size; + _generateMipMaps: boolean; + private _renderingManager; + _waitingRenderList: string[]; + private _doNotChangeAspectRatio; + private _currentRefreshId; + private _refreshRate; + constructor(name: string, size: any, scene: Scene, generateMipMaps?: boolean, doNotChangeAspectRatio?: boolean, type?: number); + resetRefreshCounter(): void; + refreshRate: number; + _shouldRender(): boolean; + isReady(): boolean; + getRenderSize(): number; + canRescale: boolean; + scale(ratio: number): void; + resize(size: any, generateMipMaps?: boolean): void; + render(useCameraPostProcess?: boolean, dumpForDebug?: boolean): void; + clone(): RenderTargetTexture; + } +} + +declare module BABYLON { + class Texture extends BaseTexture { + static NEAREST_SAMPLINGMODE: number; + static BILINEAR_SAMPLINGMODE: number; + static TRILINEAR_SAMPLINGMODE: number; + static EXPLICIT_MODE: number; + static SPHERICAL_MODE: number; + static PLANAR_MODE: number; + static CUBIC_MODE: number; + static PROJECTION_MODE: number; + static SKYBOX_MODE: number; + static CLAMP_ADDRESSMODE: number; + static WRAP_ADDRESSMODE: number; + static MIRROR_ADDRESSMODE: number; + url: string; + uOffset: number; + vOffset: number; + uScale: number; + vScale: number; + uAng: number; + vAng: number; + wAng: number; + private _noMipmap; + _invertY: boolean; + private _rowGenerationMatrix; + private _cachedTextureMatrix; + private _projectionModeMatrix; + private _t0; + private _t1; + private _t2; + private _cachedUOffset; + private _cachedVOffset; + private _cachedUScale; + private _cachedVScale; + private _cachedUAng; + private _cachedVAng; + private _cachedWAng; + private _cachedCoordinatesMode; + _samplingMode: number; + private _buffer; + private _deleteBuffer; + constructor(url: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: () => void, onError?: () => void, buffer?: any, deleteBuffer?: boolean); + delayLoad(): void; + updateSamplingMode(samplingMode: number): void; + private _prepareRowForTextureGeneration(x, y, z, t); + getTextureMatrix(): Matrix; + getReflectionTextureMatrix(): Matrix; + clone(): Texture; + static CreateFromBase64String(data: string, name: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: () => void, onError?: () => void): Texture; + } +} + +declare module BABYLON { + class VideoTexture extends Texture { + video: HTMLVideoElement; + private _autoLaunch; + private _lastUpdate; + constructor(name: string, urls: string[], scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number); + update(): boolean; + } +} + +declare module BABYLON { + class CannonJSPlugin implements IPhysicsEnginePlugin { + checkWithEpsilon: (value: number) => number; + private _world; + private _registeredMeshes; + private _physicsMaterials; + initialize(iterations?: number): void; + private _checkWithEpsilon(value); + runOneStep(delta: number): void; + setGravity(gravity: Vector3): void; + registerMesh(mesh: AbstractMesh, impostor: number, options?: PhysicsBodyCreationOptions): any; + private _createSphere(radius, mesh, options?); + private _createBox(x, y, z, mesh, options?); + private _createPlane(mesh, options?); + private _createConvexPolyhedron(rawVerts, rawFaces, mesh, options?); + private _addMaterial(friction, restitution); + private _createRigidBodyFromShape(shape, mesh, mass, friction, restitution); + registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + private _unbindBody(body); + unregisterMesh(mesh: AbstractMesh): void; + applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + updateBodyPosition: (mesh: AbstractMesh) => void; + createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3): boolean; + dispose(): void; + isSupported(): boolean; + } +} + +declare module BABYLON { + class OimoJSPlugin implements IPhysicsEnginePlugin { + private _world; + private _registeredMeshes; + private _checkWithEpsilon(value); + initialize(iterations?: number): void; + setGravity(gravity: Vector3): void; + registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any; + registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + private _createBodyAsCompound(part, options, initialMesh); + unregisterMesh(mesh: AbstractMesh): void; + private _unbindBody(body); + /** + * Update the body position according to the mesh position + * @param mesh + */ + updateBodyPosition: (mesh: AbstractMesh) => void; + applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean; + dispose(): void; + isSupported(): boolean; + private _getLastShape(body); + runOneStep(time: number): void; + } +} + +declare module BABYLON { + class PostProcessRenderEffect { + private _engine; + private _postProcesses; + private _getPostProcess; + private _singleInstance; + private _cameras; + private _indicesForCamera; + private _renderPasses; + private _renderEffectAsPasses; + _name: string; + applyParameters: (postProcess: PostProcess) => void; + constructor(engine: Engine, name: string, getPostProcess: () => PostProcess, singleInstance?: boolean); + _update(): void; + addPass(renderPass: PostProcessRenderPass): void; + removePass(renderPass: PostProcessRenderPass): void; + addRenderEffectAsPass(renderEffect: PostProcessRenderEffect): void; + getPass(passName: string): void; + emptyPasses(): void; + _attachCameras(cameras: Camera): any; + _attachCameras(cameras: Camera[]): any; + _detachCameras(cameras: Camera): any; + _detachCameras(cameras: Camera[]): any; + _enable(cameras: Camera): any; + _enable(cameras: Camera[]): any; + _disable(cameras: Camera): any; + _disable(cameras: Camera[]): any; + getPostProcess(camera?: Camera): PostProcess; + private _linkParameters(); + private _linkTextures(effect); + } +} + +declare module BABYLON { + class PostProcessRenderPass { + private _enabled; + private _renderList; + private _renderTexture; + private _scene; + private _refCount; + _name: string; + constructor(scene: Scene, name: string, size: number, renderList: Mesh[], beforeRender: () => void, afterRender: () => void); + _incRefCount(): number; + _decRefCount(): number; + _update(): void; + setRenderList(renderList: Mesh[]): void; + getRenderTexture(): RenderTargetTexture; + } +} + +declare module BABYLON { + class PostProcessRenderPipeline { + private _engine; + private _renderEffects; + private _renderEffectsForIsolatedPass; + private _cameras; + _name: string; + private static PASS_EFFECT_NAME; + private static PASS_SAMPLER_NAME; + constructor(engine: Engine, name: string); + addEffect(renderEffect: PostProcessRenderEffect): void; + _enableEffect(renderEffectName: string, cameras: Camera): any; + _enableEffect(renderEffectName: string, cameras: Camera[]): any; + _disableEffect(renderEffectName: string, cameras: Camera): any; + _disableEffect(renderEffectName: string, cameras: Camera[]): any; + _attachCameras(cameras: Camera, unique: boolean): any; + _attachCameras(cameras: Camera[], unique: boolean): any; + _detachCameras(cameras: Camera): any; + _detachCameras(cameras: Camera[]): any; + _enableDisplayOnlyPass(passName: any, cameras: Camera): any; + _enableDisplayOnlyPass(passName: any, cameras: Camera[]): any; + _disableDisplayOnlyPass(cameras: Camera): any; + _disableDisplayOnlyPass(cameras: Camera[]): any; + _update(): void; + } +} + +declare module BABYLON { + class PostProcessRenderPipelineManager { + private _renderPipelines; + constructor(); + addPipeline(renderPipeline: PostProcessRenderPipeline): void; + attachCamerasToRenderPipeline(renderPipelineName: string, cameras: Camera, unique?: boolean): any; + attachCamerasToRenderPipeline(renderPipelineName: string, cameras: Camera[], unique?: boolean): any; + detachCamerasFromRenderPipeline(renderPipelineName: string, cameras: Camera): any; + detachCamerasFromRenderPipeline(renderPipelineName: string, cameras: Camera[]): any; + enableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera): any; + enableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera[]): any; + disableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera): any; + disableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera[]): any; + enableDisplayOnlyPassInPipeline(renderPipelineName: string, passName: string, cameras: Camera): any; + enableDisplayOnlyPassInPipeline(renderPipelineName: string, passName: string, cameras: Camera[]): any; + disableDisplayOnlyPassInPipeline(renderPipelineName: string, cameras: Camera): any; + disableDisplayOnlyPassInPipeline(renderPipelineName: string, cameras: Camera[]): any; + update(): void; + } +} + +declare module BABYLON { + class CustomProceduralTexture extends ProceduralTexture { + private _animate; + private _time; + private _config; + private _texturePath; + constructor(name: string, texturePath: any, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + private loadJson(jsonUrl); + isReady(): boolean; + render(useCameraPostProcess?: boolean): void; + updateTextures(): void; + updateShaderUniforms(): void; + animate: boolean; + } +} + +declare module BABYLON { + class ProceduralTexture extends Texture { + private _size; + _generateMipMaps: boolean; + isEnabled: boolean; + private _doNotChangeAspectRatio; + private _currentRefreshId; + private _refreshRate; + private _vertexBuffer; + private _indexBuffer; + private _effect; + private _vertexDeclaration; + private _vertexStrideSize; + private _uniforms; + private _samplers; + private _fragment; + _textures: Texture[]; + private _floats; + private _floatsArrays; + private _colors3; + private _colors4; + private _vectors2; + private _vectors3; + private _matrices; + private _fallbackTexture; + private _fallbackTextureUsed; + constructor(name: string, size: any, fragment: any, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + reset(): void; + isReady(): boolean; + resetRefreshCounter(): void; + setFragment(fragment: any): void; + refreshRate: number; + _shouldRender(): boolean; + getRenderSize(): number; + resize(size: any, generateMipMaps: any): void; + private _checkUniform(uniformName); + setTexture(name: string, texture: Texture): ProceduralTexture; + setFloat(name: string, value: number): ProceduralTexture; + setFloats(name: string, value: number[]): ProceduralTexture; + setColor3(name: string, value: Color3): ProceduralTexture; + setColor4(name: string, value: Color4): ProceduralTexture; + setVector2(name: string, value: Vector2): ProceduralTexture; + setVector3(name: string, value: Vector3): ProceduralTexture; + setMatrix(name: string, value: Matrix): ProceduralTexture; + render(useCameraPostProcess?: boolean): void; + clone(): ProceduralTexture; + dispose(): void; + } +} + +declare module BABYLON { + class WoodProceduralTexture extends ProceduralTexture { + private _ampScale; + private _woodColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + ampScale: number; + woodColor: Color3; + } + class FireProceduralTexture extends ProceduralTexture { + private _time; + private _speed; + private _autoGenerateTime; + private _fireColors; + private _alphaThreshold; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + render(useCameraPostProcess?: boolean): void; + static PurpleFireColors: Color3[]; + static GreenFireColors: Color3[]; + static RedFireColors: Color3[]; + static BlueFireColors: Color3[]; + fireColors: Color3[]; + time: number; + speed: Vector2; + alphaThreshold: number; + } + class CloudProceduralTexture extends ProceduralTexture { + private _skyColor; + private _cloudColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + skyColor: Color4; + cloudColor: Color4; + } + class GrassProceduralTexture extends ProceduralTexture { + private _grassColors; + private _herb1; + private _herb2; + private _herb3; + private _groundColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + grassColors: Color3[]; + groundColor: Color3; + } + class RoadProceduralTexture extends ProceduralTexture { + private _roadColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + roadColor: Color3; + } + class BrickProceduralTexture extends ProceduralTexture { + private _numberOfBricksHeight; + private _numberOfBricksWidth; + private _jointColor; + private _brickColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + numberOfBricksHeight: number; + numberOfBricksWidth: number; + jointColor: Color3; + brickColor: Color3; + } + class MarbleProceduralTexture extends ProceduralTexture { + private _numberOfTilesHeight; + private _numberOfTilesWidth; + private _amplitude; + private _marbleColor; + private _jointColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + numberOfTilesHeight: number; + numberOfTilesWidth: number; + jointColor: Color3; + marbleColor: Color3; + } +} diff --git a/backbone-relational/backbone-relational.d.ts b/backbone-relational/backbone-relational.d.ts index 4f4aa45cc..af8e4e31f 100644 --- a/backbone-relational/backbone-relational.d.ts +++ b/backbone-relational/backbone-relational.d.ts @@ -35,15 +35,15 @@ declare module Backbone { toJSON():any; - setup(); + static setup(); - build(attributes:any, options?:any); + static build(attributes:any, options?:any); - findOrCreate(attributes:string, options?:any); + static findOrCreate(attributes:string, options?:any); - findOrCreate(attributes:number, options?:any); + static findOrCreate(attributes:number, options?:any); - findOrCreate(attributes:any, options?:any); + static findOrCreate(attributes:any, options?:any); } export class Relation extends Model { @@ -147,13 +147,13 @@ declare module Backbone { resolveIdForItem(type:any, item:any):any; - find(type:any, item:string):RelationalModel; + static find(type:any, item:string):RelationalModel; - find(type:any, item:number):RelationalModel; + static find(type:any, item:number):RelationalModel; - find(type:any, item:RelationalModel):RelationalModel; + static find(type:any, item:RelationalModel):RelationalModel; - find(type:any, item:any):RelationalModel; + static find(type:any, item:any):RelationalModel; register(model:RelationalModel):void; @@ -169,3 +169,4 @@ declare module Backbone { } } + diff --git a/blissfuljs/blissfuljs-tests.ts b/blissfuljs/blissfuljs-tests.ts new file mode 100644 index 000000000..ea55c63a9 --- /dev/null +++ b/blissfuljs/blissfuljs-tests.ts @@ -0,0 +1,445 @@ +/// + +function test_overview() { + /*Bliss includes several static methods (on the Bliss or $ object). For example, to copy all properties of an object onto another object, you would + call $.extend():*/ + var yolo = $.extend({ foo: 1 }, { bar: 2 }); + + var element = $.create(); + + /*Many of Bliss’ methods take an element or an array of elements as their first argument. For example, to set both the width and padding of an element to 0, + you could use the $.style() method:*/ + $.style(element, { width: 0, padding: 0 }); + + /*These types of methods are also available on elements and arrays, for convenience. However, since adding convenience methods to elements and arrays directly + would be a JS Mortal Sin™, Bliss only adds a _ property on elements & arrays, on which it hangs all its methods, to avoid conflicts. The previous example would + be written as: */ + element._.style({ + "width": 0, + "padding": 0 + }); + + + var myArray = $$("div"); + /*The ._. sequence of characters that appears all too often when coding with Bliss is where Bliss gets its logo from. However, the property can be + customized to anything you want. + + Methods that are available on elements like this will have an ELEMENT tag in these docs. + + If you wanted to set the width and padding of multiple elements to 0, you could use an array:*/ + myArray._.style({ + "width": 0, + "padding": 0 + }); + + /*Methods that are available on arrays like this will have an ARRAY tag in these docs. + + /*For example, assume that in addition to these CSS changes you also wanted to add a hidden attribute to this element. Bliss methods that don’t return a value + return the element or array they are called on, so you could call more element methods on them, including native ones:*/ + element._.style({ + "width": 0, + "padding": 0 + }).setAttribute("hidden", ""); + + /*Now assume you also wanted to set a second attribute: The "class" attribute to "foo". The native setAttribute() method is not chainable, it returns undefined. + However, all native element methods are also available on the almighty _ property, and there they are also chainable:*/ + element._.style({ + "width": 0, + "padding": 0 + })._.setAttribute("hidden", "").setAttribute("class", "foo"); + + //This works, but it’s a bit unwieldy. Thankfully, Bliss offers an $.attributes() method for setting multiple attributes at once: + element._.style({ + "width": 0, + "padding": 0 + })._.attributes({ + "hidden": "", + "class": "foo" + }); + + //This is better and more readable, but still a bit awkward. Turns out there is a special $.set() method to do both at once: + element._.set({ + attributes: { + "hidden": "", + "class": "foo" + }, + style: { + "width": 0, + "padding": 0 + } + }); + + /*Because $.attributes() and $.style() are also available for $.set() parameters, they will have the special $.SET() tag in these docs. + Note that you don’t actually need attributes: {…} in $.set() at all: if there are any unrecognized properties in the parameter object, + Bliss will first check if there is a property with that name on the element and if not, + set an attribute. So you could rewrite the example above as:*/ + element._.set({ + "hidden": "", + "class": "foo", // or "className": "foo" to use the property + style: { + "width": 0, + "padding": 0 + } + }); + +} + + +function vanilla_test() { + var element = $.create(); + + element.classList.add("my-class"); + element.classList.remove("my-class"); + element.classList.toggle("my-class"); + element.classList.contains("my-class") + element.remove(); + //element.contains(otherElement) // Not working + //element.matches(selector) // Not working + //element.closest(selector) // Not working + element.nextElementSibling + //element.children // Not working + + $$("div")._.remove(); +} + +function $_test() { + // return the first element with a class of .foo + // that is inside the first element with a class of .bar + var ret = $(".foo", $(".bar")); + // Return the first element with a class of .foo + // that is inside any element with a class of .bar + var ret = $(".bar .foo"); + // Get the first element with a class of .foo + // and set its title attribute to "yolo" + // If there is no such element, this will throw an exception! + $(".foo").setAttribute("title", "yolo"); + + // Check if the .foo element exists + // and set an attribute by using a variable "foo" + // as a reference of the element + var foo = $(".foo"); + if (foo) { + foo.setAttribute("title", "yolo"); + } +} + +function $$_test() { + // Add an id to all

headings that don’t already have one + $$("h1:not([id])").forEach(function(h1){ + h1.id = h1.textContent.replace(/\W/g, ""); + }); + // Get an array with all ids on the page + var ids = $$("[id]").map(function(element){ + return element.id; + }); + // Get all of an element’s attributes starting with data-bliss- + var element = $.create("div"); + + $$(element.attributes).filter(function(attribute){ + return attribute.name.indexOf("data-bliss-") === 0; + }).map(function(attribute){ + return attribute.name; + }); +} + +function $_create_test() { + $.create("ul", { + className: "nav", + contents: [ + "Navigation: ", + {tag: "li", + contents: {tag: "a", + href: "index.html", + textContent: "Home" + } + }, + {tag: "li", + contents: {tag: "a", + href: "contact.html", + textContent: "Contact", + target: "_blank" + }} + ] + }); + + var paragraph = $.create("p"); + var div = $.create(); +} + +function $_set_test() { + $.set(document.createElement("nav"), { + style: { + color: "red" + }, + events: { + click: function(evt:Event) { + console.log("YOLO"); + } + }, + contents: ["Navigation: ", {tag: "ul", + className: "buttons", + delegate: { + click: { + li: function() { + console.log("A list item was clicked"); + } + } + }, + contents: [{tag: "li", + contents: {tag: "a", + href: "index.html", + textContent: "Home" + } + }, {tag: "li", + contents: {tag: "a", + href: "docs.html", + textContent: "Docs" + } + } + ] + }], + inside: $("body > header") + }); +} + +function $_contents_test() { + var nav = $.create(); + + nav._.contents(["Navigation: ", {tag: "ul", + className: "buttons", + delegate: { + click: { + li: function() { + console.log("A list item was clicked") + } + } + }, + contents: [{tag: "li", + contents: {tag: "a", + href: "index.html", + textContent: "Home" + } + }, {tag: "li", + contents: {tag: "a", + href: "docs.html", + textContent: "Docs" + } + } + ] + }]) +} + +function $_clone_test() { + var button = $("button"); + button.addEventListener("click", function() { console.log("Click from listener!"); }); + button.onclick = function() { console.log("Click from inline event!"); }; + var button2 = button._.clone(); + // If clicked, button2 will print both messages +} + +function $_after_test() { + var button = $("button"); + $.after(button, $(".selector")); +} + +function $_around_test() { + var button = $("button"); + $.around(button, $(".selector")); + + // Wrap headings with a link to their section + $$("section[id] > h1, article[id] > h1").forEach(function(h1){ + $.create("a", { + href: "#" + (h1.parentNode).id, + around: h1 + }); + }); +} + +function $_attributes_test() { + var button = $("button"); + $.attributes(button, { backgroundColor: "#FFFFFF" }); + + button._.attributes({color: "#000000"}); +} + +function $_before_test() { + var button = $("button"); + $.before(button, $(".selector")); + + button._.before($(".selector")); +} + +function $_inside_test() { + var button = $("button"); + $.inside(button, $(".selector")); + + button._.inside($(".selector")); +} + +function $_properties_test() { + document.createElement("button")._.properties({ + className: "continue", + textContent: "Next Step", + onclick: function() { /*MyApp.next()*/ } + }); +} + +function $_start_test() { + var button = $("button"); + $.start(button, $(".selector")); + + button._.start($(".selector")); +} + +function $_style_test() { + document.body._.style({ + color: "white", + backgroundColor: "red", + cssFloat: "left" + }); +} + +function $_transition_test() { + var element = $(".selector"); + + // Fade out an element then remove it from the DOM + $.transition(element, {opacity: 0}).then($.remove); + + // Fade out and shrink all
s on a page, + // then remove them from the DOM + Promise.all($$("div")._.transition({ + opacity: 0, + transform: "scale(0)" + })).then( (elts) => { + elts.forEach(elt => { + $.remove(elt); + }); + }); +} + +function $_delegate_test() { + var element = $(".selector"); + + $.delegate(element, "locationchange", ".selected", () => {}); + $.delegate(element, "locationchange", { + "callback1" : () => {} + }); + $.delegate(element, { + "locationchange" : { + "callback1" : () => {} + } + }); + + element._.delegate("locationchange", ".selected", () => {}); + element._.delegate( "locationchange", { + "callback1" : () => {} + }); + element._.delegate({ + "locationchange" : { + "callback1" : () => {} + } + }); +} + +function $_events_test() { + $$('input[type="range"]')._.events({ + "input change": function(evt) { this.title = this.value} + }); + + $$("input")._.addEventListener("input", function(){ /* ... */}); +} + +function $_fire_test() { + + var myMap = $(".myMap"); + var myInput = $(".myInput"); + + // Fire a custom event on a map widget + myMap._.fire("locationchange", { + location: [42.361667, -71.092751] + }); + // Fire a fake input event + myInput._.fire("input"); +} + +function $_once_test() { + $$('input[type="range"]')._.once({ + "input change": function(evt) { this.title = this.value} + }); +} + +function $_ready_test() { + // Add a red border to all divs on a page + $.ready().then(function(){ + $$("div")._.style({ border: "1px solid red" }); + }); +} + +function $_all_test() { + // Uppercase all strings in an array + ["Foo", "bar"]._.all("toUpperCase"); // Returns ["FOO", "BAR"] +} + +function $_class_test() { + var cls = $.Class({ + constructor: function() {/* ... */} + }); +} + +function $_each_test() { + var elt = {a:"a", b:"b"}; + + $.each(elt, function (name:string, value:any) { + /* ... */ + }, elt); +} + +function $_extend_test() { + var o1 = {foo: 1, bar:2} + var o2 = $.extend(o1, {foo: 3, baz: 4}); + // o2 is {foo: 3, bar: 2, baz: 4} + // Get typography-related computed style on + var type = $.extend({}, + getComputedStyle(document.body), + /^font|^lineHeight$/); +} + +function $_lazy_test() { + var x = {a:""}; + $.lazy(x, "foo", () => {return "bar";}); + + $.lazy(x, { + "foo" : function() { + return "bar" + } + }); +} + +function $_live_test() { + var x = {a:""}; + $.live(x, "foo", () => {return "bar";}); +} + +function $_type_test(...args: any[]) { + // Check if the second argument of a function is a regexp + if ($.type(args[1]) === "regexp") { + // ... + } +} + +function $_value_test() { + $.value(document, "body", "nodeType"); // 1 + $.value(document, "body", "foo", "bar", "baz"); // undefined, no errors + $.value("document", "body", "nodeType"); // 1, no root, starting from self +} + +function $_fetch_test() { + $.fetch("/api/create", { + method: "POST", + responseType: "json" + }).then(function(){ + alert("success!"); + }).catch(function(error){ + console.error(error); + }); +} \ No newline at end of file diff --git a/blissfuljs/blissfuljs.d.ts b/blissfuljs/blissfuljs.d.ts new file mode 100644 index 000000000..99ef63e7e --- /dev/null +++ b/blissfuljs/blissfuljs.d.ts @@ -0,0 +1,670 @@ +// Type definitions for bliss +// Project: http://blissfuljs.com/ +// Definitions by: François Skorzec +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface Element { + _: BlissNS.BlissBindedElement; +} + +interface Array { + _: BlissNS.BlissBindedArray & BlissNS.BlissCollectionArray; +} + +declare module BlissNS { + export type BlissDecoratedElement = Element & T; + export type BlissDecoratedArrayElement = Array & BlissNS.BlissCollectionArray; + + interface BlissStatic { + (selector: string, context?: Element): BlissDecoratedElement; + + classProps: Object; + + create(tag: "a"): HTMLAnchorElement; + create(tag: "applet"): HTMLAppletElement; + create(tag: "area"):HTMLAreaElement; + create(tag: "audio"): HTMLAudioElement; + create(tag: "base"): HTMLBaseElement; + create(tag: "basefont"): HTMLBaseFontElement; + create(tag: "blockquote"): HTMLBlockElement; + create(tag: "body"): HTMLBodyElement; + create(tag: "br"): HTMLBRElement; + create(tag: "button"): HTMLButtonElement; + create(tag: "canvas"): HTMLCanvasElement; + create(tag: "datalist"): HTMLDataListElement; + create(tag: "dd"): HTMLDDElement; + create(tag: "directory"): HTMLDirectoryElement; + create(tag: "div"): HTMLDivElement; + create(tag: "embeded"): HTMLEmbedElement; + create(tag: "fieldset"): HTMLFieldSetElement; + create(tag: "form"): HTMLFormElement; + create(tag: "frame"): HTMLFrameElement; + create(tag: "frameset"): HTMLFrameSetElement; + create(tag: "iframe"): HTMLDListElement; + create(tag: "image"): HTMLImageElement; + create(tag: "input"): HTMLInputElement; + create(tag: "i"): HTMLLIElement; + create(tag: "label"): HTMLLabelElement; + create(tag: "legend"): HTMLLegendElement; + create(tag: "li"): HTMLLIElement; + create(tag: "link"): HTMLLinkElement; + create(tag: "map"): HTMLMapElement; + create(tag: "mark"): HTMLMarqueeElement; + create(tag: "menu"): HTMLMenuElement; + create(tag: "meta"): HTMLMetaElement; + create(tag: "object"): HTMLObjectElement; + create(tag: "ol"): HTMLOListElement; + create(tag: "optgroup"): HTMLOptGroupElement; + create(tag: "option"): HTMLOptionElement; + create(tag: "p"): HTMLParagraphElement; + create(tag: "param"): HTMLParamElement; + create(tag: "pre"): HTMLPreElement; + create(tag: "progress"): HTMLProgressElement; + create(tag: "q"): HTMLQuoteElement; + create(tag: "script"): HTMLScriptElement; + create(tag: "select"): HTMLSelectElement; + create(tag: "source"): HTMLSourceElement; + create(tag: "span"): HTMLSpanElement; + create(tag: "style"): HTMLStyleElement; + create(tag: "table"): HTMLTableElement; + create(tag: "thead"): HTMLTableHeaderCellElement; + create(tag: "ul"): HTMLUListElement; + create(tag: "video"): HTMLVideoElement; + create(tag: string): BlissDecoratedElement; + + create(options: Object): BlissDecoratedElement; + + create(tag: "a", options: Object): HTMLAnchorElement; + create(tag: "applet", options: Object): HTMLAppletElement; + create(tag: "area", options: Object): HTMLAreaElement; + create(tag: "audio", options: Object): HTMLAudioElement; + create(tag: "base", options: Object): HTMLBaseElement; + create(tag: "basefont", options: Object): HTMLBaseFontElement; + create(tag: "blockquote", options: Object): HTMLBlockElement; + create(tag: "body", options: Object): HTMLBodyElement; + create(tag: "br", options: Object): HTMLBRElement; + create(tag: "button", options: Object): HTMLButtonElement; + create(tag: "canvas", options: Object): HTMLCanvasElement; + create(tag: "datalist", options: Object): HTMLDataListElement; + create(tag: "dd", options: Object): HTMLDDElement; + create(tag: "directory", options: Object): HTMLDirectoryElement; + create(tag: "div", options: Object): HTMLDivElement; + create(tag: "embeded", options: Object): HTMLEmbedElement; + create(tag: "fieldset", options: Object): HTMLFieldSetElement; + create(tag: "form", options: Object): HTMLFormElement; + create(tag: "frame", options: Object): HTMLFrameElement; + create(tag: "frameset", options: Object): HTMLFrameSetElement; + create(tag: "iframe", options: Object): HTMLDListElement; + create(tag: "image", options: Object): HTMLImageElement; + create(tag: "input", options: Object): HTMLInputElement; + create(tag: "i", options: Object): HTMLLIElement; + create(tag: "label", options: Object): HTMLLabelElement; + create(tag: "legend", options: Object): HTMLLegendElement; + create(tag: "li", options: Object): HTMLLIElement; + create(tag: "link", options: Object): HTMLLinkElement; + create(tag: "map", options: Object): HTMLMapElement; + create(tag: "mark", options: Object): HTMLMarqueeElement; + create(tag: "menu", options: Object): HTMLMenuElement; + create(tag: "meta", options: Object): HTMLMetaElement; + create(tag: "object", options: Object): HTMLObjectElement; + create(tag: "ol", options: Object): HTMLOListElement; + create(tag: "optgroup", options: Object): HTMLOptGroupElement; + create(tag: "option", options: Object): HTMLOptionElement; + create(tag: "p", options: Object): HTMLParagraphElement; + create(tag: "param", options: Object): HTMLParamElement; + create(tag: "pre", options: Object): HTMLPreElement; + create(tag: "progress", options: Object): HTMLProgressElement; + create(tag: "q", options: Object): HTMLQuoteElement; + create(tag: "script", options: Object): HTMLScriptElement; + create(tag: "select", options: Object): HTMLSelectElement; + create(tag: "source", options: Object): HTMLSourceElement; + create(tag: "span", options: Object): HTMLSpanElement; + create(tag: "style", options: Object): HTMLStyleElement; + create(tag: "table", options: Object): HTMLTableElement; + create(tag: "thead", options: Object): HTMLTableHeaderCellElement; + create(tag: "ul", options: Object): HTMLUListElement; + create(tag: "video", options: Object): HTMLVideoElement; + create(tag: string, options: Object): BlissDecoratedElement; + + create(...args:any[]): BlissDecoratedElement; + + set(subject: BlissDecoratedElement, options: Object): BlissDecoratedElement; + contents(subject: BlissDecoratedElement , elements: Object | Array | string | Number | Node): BlissDecoratedElement; + contents(subject: BlissDecoratedElement[], elements: Object | Array | string | Number | Node): BlissDecoratedElement[]; + clone(subject:BlissDecoratedElement) : BlissDecoratedElement; + after(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + around(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + attributes(subject:BlissDecoratedElement, attrs: Object) : BlissDecoratedElement; + attributes(subject:BlissDecoratedElement[], attrs: Object) : BlissDecoratedElement[]; + before(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + inside(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + properties(subject:BlissDecoratedElement, props: Object) : BlissDecoratedElement; + properties(subject:BlissDecoratedElement[], props: Object) : BlissDecoratedElement[]; + start(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + style(subject:BlissDecoratedElement, properties: Object) : BlissDecoratedElement; + style(subject:BlissDecoratedElement[], properties: Object) : BlissDecoratedElement[]; + transition(subject:BlissDecoratedElement | BlissDecoratedElement[], properties: Object, duration?: number) : Promise; + delegate(subject:BlissDecoratedElement , type: string, selector: string, callback: (event: Event) => void): BlissDecoratedElement; + delegate(subject: BlissDecoratedElement[], type: string, selector: string, callback: (event: Event) => void): BlissDecoratedElement[]; + delegate(subject:BlissDecoratedElement , type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissDecoratedElement; + delegate(subject:BlissDecoratedElement[], type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissDecoratedElement[]; + delegate(subject:BlissDecoratedElement , typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissDecoratedElement; + delegate(subject:BlissDecoratedElement[], typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissDecoratedElement[]; + events(subject:BlissDecoratedElement , handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + events(subject: BlissDecoratedElement[], handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement[]; + fire(subject:BlissDecoratedElement, type: string, properties?: {[propertyName: string] : any}): BlissDecoratedElement; + fire(subject:BlissDecoratedElement[], type: string, properties?: {[propertyName: string] : any}): BlissDecoratedElement[]; + once(subject:BlissDecoratedElement, handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + once(subject:BlissDecoratedElement[], handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement[]; + ready(context?: Document): Promise; + + remove(subject:Element | BlissStatic): void; + + all(array: Array, method: string, ...args: Array): Array; + all(array: Array, method: string, ...args: Array): Array; + + Class(options: { + constructor?: Function; + extends?: Function; + abstract?: boolean; + lazy?: Object; + live?: Object; + static?: Object; + [propertyName: string]:any; + }): T; + + Class(options: { + constructor?: Function; + extends?: Function; + abstract?: boolean; + lazy?: Object; + live?: Object; + static?: Object; + [propertyName: string]:any; + }): Object; + + each(obj: {[propertyName: string] : any}, callback: Function, ret?: Object): T; + each(obj: {[propertyName: string] : any}, callback: Function, ret?: Object): Object; + + extend(target: Object, source: any, whitelist? : string[] | string | Function | RegExp): Object; + extend(target: Object, source: any, whitelist? : string[] | string | Function | RegExp): T; + + lazy(object: Object, property: string, getter: () => any): Object; + lazy(object:Object, property: string, getter:() => any): T; + + lazy(object: Object, properties: {[propertyName:string]: () => any}): Object; + lazy(object: Object, properties: {[propertyName:string]: () => any}): T; + + live(object: Object, property: string, descriptor: Object | Function): Object; + live(object: Object, property: string, descriptor: Object | Function): T; + + live(object: Object, properties: {[propertyName: string]: Object | Function}): Object; + live(object: Object, properties: {[propertyName: string]: Object | Function}): T; + + type(object: Object): string; + + value(obj: Object, ...properties: string[]): any; + value(obj: Object, ...properties: string[]): T; + + value(property: string, ...properties: string[]): any; + value(property: string , ...properties: string[]): T; + + fetch(url: string, options?: { + method?: string; + data?: string; + headers?:{[key:string]:string}; + + onreadystatechange?: (ev: ProgressEvent) => any; + readyState?: number; + response?: any; + responseBody?: any; + responseText?: string; + responseType?: string; + responseXML?: any; + status?: number; + statusText?: string; + timeout?: number; + upload?: XMLHttpRequestUpload; + withCredentials?: boolean; + + [propertyName: string]: any; + }): Promise; + + include(condition: any, url: string ): Promise; + include(url: string ): Promise; + + add(name: string, callback: Function, on?: BlissStatic | BlissStaticCollection | Element | Array): void; + add(callbacks:{[callbackName: string]: Function}, on?: BlissStatic | BlissStaticCollection | Element | Array): void; + + hooks: { + add(name: string, callback: Function): void; + run(name: string, env: Object): void; + }; + } + + interface BlissStaticCollection extends BlissStatic { + (selector: string, context?: Element): BlissDecoratedArrayElement; + (expr: Object, context?: Element): Array; + (expr: Window, context?: Element): [Window]; + (expr: Node, context?: Element): [Node]; + } + + // Native methods added into "_" property, but methods that return "void" now return thi stype in order to be chainables + // Methods are All HTMLElement a ELement methods + interface BlissNativeExtentions { + blur(): T; + click(): T; + contains(child: HTMLElement): boolean; + dragDrop(): boolean; + focus(): T; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentHTML(where: string, html: string): T; + insertAdjacentText(where: string, text: string): T; + msGetInputContext(): MSInputMethodContext; + scrollIntoView(top?: boolean): T; + setActive(): T; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): T; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): T; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): T; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): T; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): T; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): T; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): T; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): T; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): T; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): T; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): T; + getAttribute(name?: string): string; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "circle"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "clippath"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "defs"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "desc"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "ellipse"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "feblend"): NodeListOf; + getElementsByTagName(name: "fecolormatrix"): NodeListOf; + getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(name: "fecomposite"): NodeListOf; + getElementsByTagName(name: "feconvolvematrix"): NodeListOf; + getElementsByTagName(name: "fediffuselighting"): NodeListOf; + getElementsByTagName(name: "fedisplacementmap"): NodeListOf; + getElementsByTagName(name: "fedistantlight"): NodeListOf; + getElementsByTagName(name: "feflood"): NodeListOf; + getElementsByTagName(name: "fefunca"): NodeListOf; + getElementsByTagName(name: "fefuncb"): NodeListOf; + getElementsByTagName(name: "fefuncg"): NodeListOf; + getElementsByTagName(name: "fefuncr"): NodeListOf; + getElementsByTagName(name: "fegaussianblur"): NodeListOf; + getElementsByTagName(name: "feimage"): NodeListOf; + getElementsByTagName(name: "femerge"): NodeListOf; + getElementsByTagName(name: "femergenode"): NodeListOf; + getElementsByTagName(name: "femorphology"): NodeListOf; + getElementsByTagName(name: "feoffset"): NodeListOf; + getElementsByTagName(name: "fepointlight"): NodeListOf; + getElementsByTagName(name: "fespecularlighting"): NodeListOf; + getElementsByTagName(name: "fespotlight"): NodeListOf; + getElementsByTagName(name: "fetile"): NodeListOf; + getElementsByTagName(name: "feturbulence"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "filter"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "foreignobject"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "g"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "image"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "line"): NodeListOf; + getElementsByTagName(name: "lineargradient"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marker"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "mask"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "metadata"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "path"): NodeListOf; + getElementsByTagName(name: "pattern"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "polygon"): NodeListOf; + getElementsByTagName(name: "polyline"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "radialgradient"): NodeListOf; + getElementsByTagName(name: "rect"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "stop"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "svg"): NodeListOf; + getElementsByTagName(name: "switch"): NodeListOf; + getElementsByTagName(name: "symbol"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "text"): NodeListOf; + getElementsByTagName(name: "textpath"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tspan"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "use"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "view"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): T; + msSetPointerCapture(pointerId: number): T; + msZoomTo(args: MsZoomToOptions): T; + releasePointerCapture(pointerId: number): T; + removeAttribute(name?: string): T; + removeAttributeNS(namespaceURI: string, localName: string): T; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): T; + requestPointerLock(): T; + setAttribute(name?: string, value?: string): T; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): T; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): T; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): T; + webkitRequestFullscreen(): T; + getElementsByClassName(classNames: string): NodeListOf; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): T; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): T; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): T; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): T; + } + + interface BlissBindedElement extends BlissNativeExtentions { + set(options: Object): BlissDecoratedElement + contents(elements: Object | Array | string | Number | Node): BlissDecoratedElement + clone(): BlissDecoratedElement; + after(element:Element) : BlissDecoratedElement; + around(element:Element) : BlissDecoratedElement; + attributes(attrs: Object) : BlissDecoratedElement; + before(element:Element) : BlissDecoratedElement; + inside(element:Element) : BlissDecoratedElement; + properties(props: Object) : BlissDecoratedElement; + start(element:Element) : BlissDecoratedElement; + style(properties: Object) : BlissDecoratedElement; + transition(properties: Object, duration?: number) : Promise; + delegate(type: string, selector: string, callback: (event: Event) => void): BlissDecoratedElement; + delegate(type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissDecoratedElement; + delegate(typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissDecoratedElement; + events(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + fire(type: string, properties?: {[propertyName: string] : any}): BlissDecoratedElement; + once(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + + remove(): BlissDecoratedElement; + } + + interface BlissBindedArray { + all(method: string, ...args: Array): Array; + all(method: string, ...args: Array): Array; + } + + interface BlissCollectionArray { + set(options: Object): BlissCollectionArray + contents(elements: Object | Array | string | Number | Node): BlissCollectionArray + clone(): BlissCollectionArray; + after(element:Element) : BlissCollectionArray; + around(element:Element) : BlissCollectionArray; + attributes(attrs: Object) : BlissCollectionArray; + before(element:Element) : BlissCollectionArray; + inside(element:Element) : BlissCollectionArray; + properties(props: Object) : BlissCollectionArray; + start(element:Element) : BlissCollectionArray; + style(properties: Object) : BlissCollectionArray; + transition(properties: Object, duration?: number) : Promise[]; + delegate(type: string, selector: string, callback: (event: Event) => void): BlissCollectionArray; + delegate(type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissCollectionArray; + delegate(typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissCollectionArray; + events(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissCollectionArray; + fire(type: string, properties?: {[propertyName: string] : any}): BlissCollectionArray; + once(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissCollectionArray; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): BlissCollectionArray; + + remove(): BlissCollectionArray; + } +} + +declare var Bliss: BlissNS.BlissStatic; +declare var $: BlissNS.BlissStatic; +declare var $$: BlissNS.BlissStaticCollection; diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 278b1d229..b1829c52e 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -766,6 +766,13 @@ func = Promise.promisify(f, obj); obj = Promise.promisifyAll(obj); anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback)); anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback)); +anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback), {multiArgs : true}); +anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); + +anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback)); +anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback)); +anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback), {multiArgs : true}); +anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index ea8bebe0c..023eab7aa 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -137,7 +137,8 @@ interface PromiseConstructor { /** * Returns a promise that is resolved by a node style callback function. */ - fromNode(resolver: (callback: (err: any, result?: any) => void) => void): Promise; + fromNode(resolver: (callback: (err: any, result?: any) => void) => void, options? : {multiArgs? : boolean}): Promise; + fromCallback(resolver: (callback: (err: any, result?: any) => void) => void, options? : {multiArgs? : boolean}): Promise; /** * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts index 2276f36e5..9d4cbcce3 100644 --- a/browser-sync/browser-sync.d.ts +++ b/browser-sync/browser-sync.d.ts @@ -34,7 +34,7 @@ declare module "browser-sync" { * Default: undefined * Note: requires at least version 2.6.0 */ - watchOptions?: ChokidarOptions; + watchOptions?: chokidar.WatchOptions; /** * Use the built-in static server for basic HTML/JS/CSS websites. * Default: false @@ -243,19 +243,13 @@ declare module "browser-sync" { * Note: requires at least version 1.6.2 */ socket?: SocketOptions; + middleware?: MiddlewareHandler | MiddlewareHandler[]; } interface Hash { [path: string]: T; } - interface ChokidarOptions { - interval?: number; - debounceDelay?: number; - mode?: string; - cwd?: string; - } - interface UIOptions { /** set the default port */ port?: number; diff --git a/camelcase/camelcase-tests.ts b/camelcase/camelcase-tests.ts new file mode 100644 index 000000000..bb2ce9282 --- /dev/null +++ b/camelcase/camelcase-tests.ts @@ -0,0 +1,12 @@ +/// + +import camelCase from 'camelcase'; + +camelCase('foo-bar'); +camelCase('foo_bar'); +camelCase('Foo-Bar'); +camelCase('--foo.bar'); +camelCase('__foo__bar__'); +camelCase('foo bar'); +camelCase('foo', 'bar'); +camelCase('__foo__', '--bar'); diff --git a/camelcase/camelcase.d.ts b/camelcase/camelcase.d.ts new file mode 100644 index 000000000..c13eab8a5 --- /dev/null +++ b/camelcase/camelcase.d.ts @@ -0,0 +1,8 @@ +// Type definitions for camelcase +// Project: https://github.com/sindresorhus/camelcase +// Definitions by: Sam Verschueren +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "camelcase" { + export default function camelcase(...args: string[]): string; +} diff --git a/chartjs/chart.d.ts b/chartjs/chart.d.ts index 62f393b8a..464655f78 100644 --- a/chartjs/chart.d.ts +++ b/chartjs/chart.d.ts @@ -136,6 +136,8 @@ interface BarChartOptions extends ChartOptions { barStrokeWidth?: number; barValueSpacing?: number; barDatasetSpacing?: number; + scaleShowHorizontalLines?: boolean; + scaleShowVerticalLines?: boolean; } interface RadarChartOptions extends ChartSettings { diff --git a/chrome/chrome-app-tests.ts b/chrome/chrome-app-tests.ts index 970e03517..466571107 100644 --- a/chrome/chrome-app-tests.ts +++ b/chrome/chrome-app-tests.ts @@ -316,3 +316,12 @@ function testSocketsTcpServerTypes(): void { socketInfo.localAddress = "192.168.0.2"; socketInfo.localPort = 8000; } + +function testSystemNetwork() { + chrome.system.network.getNetworkInterfaces((networkInterfaces) => { + var iface: chrome.system.network.NetworkInterface; + for (var i in networkInterfaces) { + iface = networkInterfaces[i]; + } + }); +} diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index f75f7dca6..d40fa3b2d 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -378,3 +378,16 @@ declare module chrome.sockets.tcpServer { var onAccept: Event; var onAcceptError: Event; } + +//////////////////// +// System - Network +//////////////////// +declare module chrome.system.network { + interface NetworkInterface { + name: string; + address: string; + prefixLength: number; + } + + export function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; +} diff --git a/commander/commander.d.ts b/commander/commander.d.ts index cf04591bb..d0efa6305 100644 --- a/commander/commander.d.ts +++ b/commander/commander.d.ts @@ -65,10 +65,11 @@ declare module commander { * * @param {String} name * @param {String} [desc] + * @param {Mixed} [opts] * @return {Command} the new command * @api public */ - command(name:string, desc?:string):ICommand; + command(name:string, desc?:string, opts?: any):ICommand; /** * Add an implicit `help [cmd]` subcommand diff --git a/commonmark/commonmark-tests.ts b/commonmark/commonmark-tests.ts new file mode 100644 index 000000000..4896c0464 --- /dev/null +++ b/commonmark/commonmark-tests.ts @@ -0,0 +1,47 @@ +/// + +import commonmark = require('commonmark'); + +function logNode(node: commonmark.Node) { + + console.log( + node.destination, + node.firstChild, + node.info, + node.isContainer, + node.lastChild, + node.level, + node.listDelimiter, + node.listStart, + node.listTight, + node.listType, + node.literal, + node.next, + node.onEnter, + node.onExit, + node.parent, + node.prev, + node.sourcepos, + node.title, + node.type); + +} + +var parser = new commonmark.Parser({ smart: true, time: true }); +var node = parser.parse('# a piece of _markdown_'); + + +let w = node.walker(); +let step = w.next(); +if (step.entering) { + logNode(step.node); +} + + +let xmlRenderer = new commonmark.XmlRenderer({ sourcepos: true, time: true }); +let xml = xmlRenderer.render(node); +console.log(xml); + +let htmlRenderer = new commonmark.HtmlRenderer({ safe: true, smart: true, sourcepos: true, time: true}); +let html = htmlRenderer.render(node); +console.log(html); \ No newline at end of file diff --git a/commonmark/commonmark.d.ts b/commonmark/commonmark.d.ts new file mode 100644 index 000000000..8f1271451 --- /dev/null +++ b/commonmark/commonmark.d.ts @@ -0,0 +1,214 @@ +// Type definitions for commonmark.js 0.22.1 +// Project: https://github.com/jgm/commonmark.js +// Definitions by: Nico Jansen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module commonmark { + + export interface NodeWalkingStep { + /** + * a boolean, which is true when we enter a Node from a parent or sibling, and false when we reenter it from a child + */ + entering: boolean; + /** + * The node belonging to this step + */ + node: Node; + } + + export interface NodeWalker { + /** + * Returns an object with properties entering and node. Returns null when we have finished walking the tree. + */ + next(): NodeWalkingStep; + /** + * Resets the iterator to resume at the specified node and setting for entering. (Normally this isn't needed unless you do destructive updates to the Node tree.) + */ + resumeAt(node: Node, entering?: boolean): void; + } + + export interface Position extends Array> { + } + + export interface ListData { + type?: string, + tight?: boolean, + delimiter?: string, + bulletChar?: string + } + + export class Node { + constructor(nodeType: string, sourcepos?: Position); + isContainer: boolean; + + /** + * (read-only): one of Text, Softbreak, Hardbreak, Emph, Strong, Html, Link, Image, Code, Document, Paragraph, BlockQuote, Item, List, Heading, CodeBlock, HtmlBlock ThematicBreak. + */ + type: string; + /** + * (read-only): a Node or null. + */ + firstChild: Node; + /** + * (read-only): a Node or null. + */ + lastChild: Node; + /** + * (read-only): a Node or null. + */ + next: Node; + /** + * (read-only): a Node or null. + */ + prev: Node; + /** + * (read-only): a Node or null. + */ + parent: Node; + /** + * (read-only): an Array with the following form: [[startline, startcolumn], [endline, endcolumn]] + */ + sourcepos: Position; + /** + * the literal String content of the node or null. + */ + literal: string; + /** + * link or image destination (String) or null. + */ + destination: string; + /** + * link or image title (String) or null. + */ + title: string; + /** + * fenced code block info string (String) or null. + */ + info: string; + /** + * heading level (Number). + */ + level: number; + /** + * either Bullet or Ordered (or undefined). + */ + listType: string; + /** + * true if list is tight + */ + listTight: boolean; + /** + * a Number, the starting number of an ordered list. + */ + listStart: number; + /** + * a String, either ) or . for an ordered list. + */ + listDelimiter: string; + /** + * used only for CustomBlock or CustomInline. + */ + onEnter: string; + /** + * used only for CustomBlock or CustomInline. + */ + onExit: string; + /** + * Append a Node child to the end of the Node's children. + */ + appendChild(child: Node): void; + /** + * Prepend a Node child to the beginning of the Node's children. + */ + prependChild(child: Node): void; + /** + * Remove the Node from the tree, severing its links with siblings and parents, and closing up gaps as needed. + */ + unlink(): void; + /** + * Insert a Node sibling after the Node. + */ + insertAfter(sibling: Node): void; + /** + * Insert a Node sibling before the Node. + */ + insertBefore(sibling: Node): void; + /** + * Returns a NodeWalker that can be used to iterate through the Node tree rooted in the Node + */ + walker(): NodeWalker; + /** + * Setting the backing object of listType, listTight, listStat and listDelimiter directly. + * Not needed unless creating list nodes directly. Should be fixed from v>0.22.1 + * https://github.com/jgm/commonmark.js/issues/74 + */ + _listData: ListData; + } + + /** + * Instead of converting Markdown directly to HTML, as most converters do, commonmark.js parses Markdown to an AST (abstract syntax tree), and then renders this AST as HTML. + * This opens up the possibility of manipulating the AST between parsing and rendering. For example, one could transform emphasis into ALL CAPS. + */ + export class Parser { + /** + * Constructs a new Parser + */ + constructor(options?: ParserOptions); + parse(input: string): Node; + } + + export interface ParserOptions { + /** + * if true, straight quotes will be made curly, -- will be changed to an en dash, --- will be changed to an em dash, and ... will be changed to ellipses. + */ + smart?: boolean; + time?: boolean; + } + + export interface HtmlRenderingOptions extends XmlRenderingOptions { + /** + * if true, raw HTML will not be passed through to HTML output (it will be replaced by comments), and potentially unsafe URLs in links and images (those beginning with javascript:, vbscript:, file:, and with a few exceptions data:) will be replaced with empty strings. + */ + safe?: boolean; + /** + * if true, straight quotes will be made curly, -- will be changed to an en dash, --- will be changed to an em dash, and ... will be changed to ellipses. + */ + smart?: boolean; + /** + * if true, source position information for block-level elements will be rendered in the data-sourcepos attribute (for HTML) or the sourcepos attribute (for XML). + */ + sourcepos?: boolean; + } + + export class HtmlRenderer { + constructor(options?: HtmlRenderingOptions) + render(root: Node): string; + /** + * Let's you override the softbreak properties of a renderer. So, to make soft breaks render as hard breaks in HTML: + * writer.softbreak = "
"; + */ + softbreak: string; + /** + * Override the function that will be used to escape (sanitize) the html output. Return value is used to add to the html output + * @param input the input to escape + * @param isAttributeValue indicates wheter or not the input value will be used as value of an html attribute. + */ + escape: (input: string, isAttributeValue: boolean) => string; + } + + export interface XmlRenderingOptions { + time?: boolean; + sourcepos?: boolean; + } + + export class XmlRenderer { + constructor(options?: XmlRenderingOptions) + render(root: Node): string; + } + +} + +declare module 'commonmark' { + export = commonmark; +} \ No newline at end of file diff --git a/console-stamp/console-stamp-tests.ts b/console-stamp/console-stamp-tests.ts new file mode 100644 index 000000000..e6ae6895b --- /dev/null +++ b/console-stamp/console-stamp-tests.ts @@ -0,0 +1,21 @@ +/// + +import consoleStamp = require("console-stamp"); + +consoleStamp(console); + +var options = {}; +consoleStamp(console, options); + +var options2 = { + metadata: function ():string { + return 'string'; + }, + colors: { + stamp: "yellow", + label: "white", + metadata: "green" + }, + label: true +}; +consoleStamp(console, options2); diff --git a/console-stamp/console-stamp.d.ts b/console-stamp/console-stamp.d.ts new file mode 100644 index 000000000..a798dc66c --- /dev/null +++ b/console-stamp/console-stamp.d.ts @@ -0,0 +1,46 @@ +// Type definitions for console-stamp 0.2.0 +// Project: https://github.com/starak/node-console-stamp +// Definitions by: Eric Byers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'console-stamp' { + + function consoleStamp(console:{}, options?: { + /** + * A string with date format based on Javascript Date Format + */ + pattern?: string + + /** + * If true it will show the label (LOG | INFO | WARN | ERROR) + */ + label?: boolean; + + /** + * An array containing the methods to include in the patch + */ + include?: any; + + /** + * An array containing the methods to exclude in the patch) + */ + exclude?: any; + + /** + * Types can be String, Object (interpreted with util.inspect), or Function. See the test-metadata.js for examples. + * Note that metadata can still be sent as the third parameter (as in vesion 1.6) as a backward compatibillity feature, but this is deprecated. + */ + metadata?: any; + + /** + * An object representing a color theme. More info https://www.npmjs.com/package/colors + */ + colors?: { + stamp?: any; + label?: any; + metadata?: any; + }; + }): void; + + export = consoleStamp; +} diff --git a/consolidate/consolidate-tests.ts b/consolidate/consolidate-tests.ts index bf4fea449..77fddb631 100644 --- a/consolidate/consolidate-tests.ts +++ b/consolidate/consolidate-tests.ts @@ -1,27 +1,168 @@ /// +import cons = require('consolidate'); -import consolidate = require('consolidate'); +var path: string = 'test/path'; +var options = {user: 'tobi'}; +var fn = function(err: Error, html: string) {}; + +cons.atpl(path); +cons.atpl(path, options); +cons.atpl(path, options, fn); + +cons.dot(path); +cons.dot(path, options); +cons.dot(path, options, fn); + +cons.dust(path); +cons.dust(path, options); +cons.dust(path, options, fn); + +cons.eco(path); +cons.eco(path, options); +cons.eco(path, options, fn); + +cons.ect(path); +cons.ect(path, options); +cons.ect(path, options, fn); + +cons.ejs(path); +cons.ejs(path, options); +cons.ejs(path, options, fn); + +cons.haml(path); +cons.haml(path, options); +cons.haml(path, options, fn); + +// TODO figure out how to type haml-coffee +// cons['haml-coffee'](path, options, fn); + +cons.hamlet(path); +cons.hamlet(path, options); +cons.hamlet(path, options, fn); + +cons.handlebars(path); +cons.handlebars(path, options); +cons.handlebars(path, options, fn); + +cons.hogan(path); +cons.hogan(path, options); +cons.hogan(path, options, fn); + +cons.htmling(path); +cons.htmling(path, options); +cons.htmling(path, options, fn); + +cons.jade(path); +cons.jade(path, options); +cons.jade(path, options, fn); + +cons.jazz(path); +cons.jazz(path, options); +cons.jazz(path, options, fn); + +cons.jqtpl(path); +cons.jqtpl(path, options); +cons.jqtpl(path, options, fn); + +cons.just(path); +cons.just(path, options); +cons.just(path, options, fn); + +cons.liquid(path); +cons.liquid(path, options); +cons.liquid(path, options, fn); + +cons.liquor(path); +cons.liquor(path, options); +cons.liquor(path, options, fn); + +cons.lodash(path); +cons.lodash(path, options); +cons.lodash(path, options, fn); + +cons.mote(path); +cons.mote(path, options); +cons.mote(path, options, fn); + +cons.mustache(path); +cons.mustache(path, options); +cons.mustache(path, options, fn); + +cons.nunjucks(path); +cons.nunjucks(path, options); +cons.nunjucks(path, options, fn); + +cons.qejs(path); +cons.qejs(path, options); +cons.qejs(path, options, fn); + +cons.ractive(path); +cons.ractive(path, options); +cons.ractive(path, options, fn); + +cons.react(path); +cons.react(path, options); +cons.react(path, options, fn); + +cons.swig(path); +cons.swig(path, options); +cons.swig(path, options, fn); + +cons.templayed(path); +cons.templayed(path, options); +cons.templayed(path, options, fn); + +cons.toffee(path); +cons.toffee(path, options); +cons.toffee(path, options, fn); + +cons.underscore(path); +cons.underscore(path, options); +cons.underscore(path, options, fn); + +cons.walrus(path); +cons.walrus(path, options); +cons.walrus(path, options, fn); + +cons.whiskers(path); +cons.whiskers(path, options); +cons.whiskers(path, options, fn); + +/** + * Examples from documentation + * https://github.com/tj/consolidate.js/ + */ +// Common use +cons.swig('views/page.html', { user: 'tobi' }, function(err, html) { + if (err) throw err; + console.log(html); +}); + +// Options object is optional +cons.swig('views/page.html', function(err, html) { + if (err) throw err; + console.log(html); +}); + +// To dynamically pass the engine, simply use the subscript operator and a variable: +cons['swig']('views/page.html', { user: 'tobi' }, function(err, html) { + if (err) throw err; + console.log(html); +}); + +// Returns a promise if no is callback passed in: +cons.swig('views/page.html', { user: 'tobi' }) + .then(function(html) { + console.log(html); + }) + .catch(function(err) { + throw err; + }); + +// Caching +cons.swig('views/page.html', { cache: false, user: 'tobi' }, function(err, html) { + if (err) throw err; + console.log(html); +}); -var path: string = null; -var options: any = null; -var fn: any = null; -consolidate.clearCache(); -consolidate.jade(path, options, fn); -consolidate.dust(path, options, fn); -consolidate.swig(path, options, fn); -consolidate.liquor(path, options, fn); -consolidate.ejs(path, options, fn); -consolidate.eco(path, options, fn); -consolidate.jazz(path, options, fn); -consolidate.jqtpl(path, options, fn); -consolidate.haml(path, options, fn); -consolidate.whiskers(path, options, fn); -//consolidate.'haml-coffee':Function; -consolidate.hogan(path, options, fn); -consolidate.handlebars(path, options, fn); -consolidate.underscore(path, options, fn); -consolidate.qejs(path, options, fn); -consolidate.walrus(path, options, fn); -consolidate.mustache(path, options, fn); -consolidate.dot(path, options, fn); diff --git a/consolidate/consolidate.d.ts b/consolidate/consolidate.d.ts index 3bfe35bf0..db23a3152 100644 --- a/consolidate/consolidate.d.ts +++ b/consolidate/consolidate.d.ts @@ -1,30 +1,75 @@ // Type definitions for consolidate // Project: https://github.com/visionmedia/consolidate.js -// Definitions by: Carlos Ballesteros Velasco +// Definitions by: Carlos Ballesteros Velasco , Theo Sherry // Definitions: https://github.com/borisyankov/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts /// +/// declare module "consolidate" { - export function clearCache(): void; - export var jade: (path: String, options: any, fn: any) => void; - export var dust: (path: String, options: any, fn: any) => void; - export var swig: (path: String, options: any, fn: any) => void; - export var liquor: (path: String, options: any, fn: any) => void; - export var ejs: (path: String, options: any, fn: any) => void; - export var eco: (path: String, options: any, fn: any) => void; - export var jazz: (path: String, options: any, fn: any) => void; - export var jqtpl: (path: String, options: any, fn: any) => void; - export var haml: (path: String, options: any, fn: any) => void; - export var whiskers: (path: String, options: any, fn: any) => void; - //export var 'haml-coffee':Function; - export var hogan: (path: String, options: any, fn: any) => void; - export var handlebars: (path: String, options: any, fn: any) => void; - export var underscore: (path: String, options: any, fn: any) => void; - export var qejs: (path: String, options: any, fn: any) => void; - export var walrus: (path: String, options: any, fn: any) => void; - export var mustache: (path: String, options: any, fn: any) => void; - export var dot: (path: String, options: any, fn: any) => void; + var cons: Consolidate; + + export = cons; + + interface Consolidate { + /** + * expose the instance of the engine + */ + requires: Object; + + /** + * Clear the cache. + * + * @api public + */ + clearCache(): void; + // template engines + atpl: RendererInterface; + dot: RendererInterface; + dust: RendererInterface; + eco: RendererInterface; + ejs: RendererInterface; + ect: RendererInterface; + haml: RendererInterface; + // TODO figure out how to do haml-coffee + hamlet: RendererInterface; + handlebars: RendererInterface; + hogan: RendererInterface; + htmling: RendererInterface; + jade: RendererInterface; + jazz: RendererInterface; + jqtpl: RendererInterface; + just: RendererInterface; + liquid: RendererInterface; + liquor: RendererInterface; + lodash: RendererInterface; + mote: RendererInterface; + mustache: RendererInterface; + nunjucks: RendererInterface; + qejs: RendererInterface; + ractive: RendererInterface; + react: RendererInterface; + swig: RendererInterface; + templayed: RendererInterface; + toffee: RendererInterface; + underscore: RendererInterface; + walrus: RendererInterface; + whiskers: RendererInterface; + } + + interface RendererInterface { + render(path: String, fn: (err: Error, html: String) => any): any; + + render(path: String, options: {cache?: boolean, [otherOptions: string]: any}, fn: (err: Error, html: String) => any): any; + + render(path: String, options?: { cache?: boolean, [otherOptions: string]: any }): Promise; + + (path: String, fn: (err: Error, html: String) => any): any; + + (path: String, options: { cache?: boolean, [otherOptions: string]: any }, fn: (err: Error, html: String) => any): any; + + (path: String, options?: { cache?: boolean, [otherOptions: string]: any }): Promise; + } } diff --git a/contentful-resolve-response/contentful-resolve-response-tests.ts b/contentful-resolve-response/contentful-resolve-response-tests.ts new file mode 100644 index 000000000..098641e7b --- /dev/null +++ b/contentful-resolve-response/contentful-resolve-response-tests.ts @@ -0,0 +1,20 @@ +/// +import resolveResponse = require('contentful-resolve-response'); + +var response = { + items: [ + { + someValue: 'wow', + someLink: {sys: {type: 'Link', linkType: 'Entry', id: 'suchId'}} + } + ], + includes: { + Entry: [ + {sys: {type: 'Entry', id: 'suchId'}, very: 'doge'} + ] + } +}; + +var items = resolveResponse(response) + +console.log(items); diff --git a/contentful-resolve-response/contentful-resolve-response.d.ts b/contentful-resolve-response/contentful-resolve-response.d.ts new file mode 100644 index 000000000..bd2daef9e --- /dev/null +++ b/contentful-resolve-response/contentful-resolve-response.d.ts @@ -0,0 +1,9 @@ +// Type definitions for contentful-resolve-response v0.1.2 +// Project: https://github.com/contentful/contentful-resolve-response +// Definitions by: Anton Karsten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'contentful-resolve-response' { + function resolveResponse(response: any): any; + export = resolveResponse; +} diff --git a/convict/convict-tests.ts b/convict/convict-tests.ts index 6cde3b38c..3bd64c592 100644 --- a/convict/convict-tests.ts +++ b/convict/convict-tests.ts @@ -6,6 +6,42 @@ import validator = require('validator'); // define a schema +// straight from the convict tests +const format : convict.Format = { + name: 'float-percent', + validate: function(val) { + if (val !== 0 && (!val || val > 1 || val < 0)) { + throw new Error('must be a float between 0 and 1, inclusive'); + } + }, + coerce: function(val) { + return +( val); + } +}; + + + + +convict.addFormat(format); +convict.addFormats({ + prime: { + validate: function(val) { + function isPrime(n: number) { + if (n <= 1) return false; // zero and one are not prime + for (var i=2; i*i <= n; i++) { + if (n % i === 0) return false; + } + return true; + } + if (!isPrime(val)) throw new Error('must be a prime number'); + }, + coerce: function(val) { + return parseInt(val, 10); + } + } + }); + + var conf = convict({ env: { doc: 'The applicaton environment.', @@ -46,7 +82,15 @@ var conf = convict({ env: 'PORT', arg: 'port', } - } + }, + primeNumber: { + format: 'prime', + default: 17 + }, + percentNumber: { + format: 'float-percent', + default: 0.5 + }, }); @@ -72,4 +116,10 @@ if (conf.has('key')) { } }); } + +conf.getSchema(); +conf.getProperties(); +conf.getSchemaString(); +conf.toString(); + // vim:et:sw=2:ts=2 diff --git a/convict/convict.d.ts b/convict/convict.d.ts index 74ed10038..14ecae8f8 100644 --- a/convict/convict.d.ts +++ b/convict/convict.d.ts @@ -4,30 +4,74 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "convict" { - function convict(schema: convict.Schema): convict.Config; + module convict { - module convict { - interface Schema { - [name: string]: convict.Schema | { - default: any; - doc?: string; - format?: any; - env?: string; - arg?: string; - }; - } + interface Format { + name?: string; + validate?: (val: any) => void; + coerce?: (val: any) => any; + } - interface Config { - get(name: string): any; - default(name: string): any; - has(name: string): boolean; - set(name: string, value: any): void; - load(conf: Object): void; - loadFile(file: string): void; - loadFile(files: string[]): void; - validate(): void; - } - } + interface Schema { + [name: string]: convict.Schema | { + default: any; + doc?: string; + /** + * From the implementation: + * + * format can be a: + * - predefine type, as seen below + * - an array of enumerated values, e.g. ["production", "development", "testing"] + * - built-in JavaScript type, i.e. Object, Array, String, Number, Boolean + * - or if omitted, the Object.prototype.toString.call of the default value + * + * The docs also state that any function that validates is ok too + */ + format?: string | Array | Function; + env?: string; + arg?: string; + }; + } - export = convict; + interface Config { + get(name: string): any; + default(name: string): any; + has(name: string): boolean; + set(name: string, value: any): void; + load(conf: Object): void; + loadFile(file: string): void; + loadFile(files: string[]): void; + validate(): void; + /** + * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} + * @returns {Object} A {JSON} compliant {Object} + */ + getProperties() : Object; + /** + * Exports the schema as a {JSON} {Object} + * @returns {Object} A {JSON} compliant {Object} + */ + getSchema() : Object; + + /** + * Exports all the properties (that is the keys and their current values) as a JSON string. + * @returns {String} a string representing this object + */ + toString() : string; + + /** + * Exports the schema as a JSON string. + * @returns {String} a string representing the schema of this {Config} + */ + getSchemaString() : string; + } + } + interface convict { + addFormat(format: convict.Format): void; + addFormats(formats: { [name: string]: convict.Format }): void; + (config: convict.Schema): convict.Config; + } + var convict : convict; + export = convict; } + diff --git a/cordova/plugins/Media.d.ts b/cordova/plugins/Media.d.ts index 21d1a17e3..b691013d8 100644 --- a/cordova/plugins/Media.d.ts +++ b/cordova/plugins/Media.d.ts @@ -37,8 +37,11 @@ interface Media { mediaError?: (error: MediaError) => void): void; /** Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1. */ getDuration(): number; - /** Starts or resumes playing an audio file. */ - play(): void; + /** + * Starts or resumes playing an audio file. + * @param iosPlayOptions: iOS options quirks + */ + play(iosPlayOptions?: IosPlayOptions): void; /** Pauses playing an audio file. */ pause(): void; /** @@ -71,3 +74,11 @@ interface Media { /** The duration of the media, in seconds. */ duration: number; } +/** + * iOS optional parameters for media.play + * See https://github.com/apache/cordova-plugin-media#ios-quirks + */ +interface IosPlayOptions { + numberOfLoops?: number; + playAudioWhenScreenIsLocked?: boolean; +} diff --git a/cordova/plugins/StatusBar.d.ts b/cordova/plugins/StatusBar.d.ts index 8b5299626..599408e7b 100644 --- a/cordova/plugins/StatusBar.d.ts +++ b/cordova/plugins/StatusBar.d.ts @@ -73,3 +73,5 @@ interface StatusBar { */ isVisible: boolean; } + +declare var StatusBar: StatusBar; diff --git a/couchbase/couchbase-tests.ts b/couchbase/couchbase-tests.ts index 4305300ee..a1a3ee6bb 100644 --- a/couchbase/couchbase-tests.ts +++ b/couchbase/couchbase-tests.ts @@ -1,21 +1,16 @@ /// import couchbase = require('couchbase'); -var db = new couchbase.Connection({ bucket: "default" }, function (err) { - if (err) throw err; +var cluster = new couchbase.Cluster('couchbase://127.0.0.1'); +var bucket = cluster.openBucket('default'); - // TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix - (db).set('testdoc', { name: 'Frank' }, function (err, result) { - if (err) throw err; +bucket.upsert('testdoc', { name: 'Frank' }, (error) => { + if (error) throw error; - var s: string = err.message; + bucket.get('testdoc', (err, result) => { + if (err) throw err; - // TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix - (db).get('testdoc', function (err, result) { - if (err) throw err; - - console.log(result.value); - // {name: Frank} - }); + console.log(result.value); + // {name: Frank} }); }); \ No newline at end of file diff --git a/couchbase/couchbase.d.ts b/couchbase/couchbase.d.ts index 3a8605b73..6afd3a781 100644 --- a/couchbase/couchbase.d.ts +++ b/couchbase/couchbase.d.ts @@ -1,729 +1,1129 @@ -// Type definitions for Couchbase Couchnode +// Type definitions for Couchbase Node.js SDK 2.1.2 // Project: https://github.com/couchbase/couchnode -// Definitions by: Basarat Ali Syed +// Definitions by: Marwan Aouida // Definitions: https://github.com/borisyankov/DefinitelyTyped /// + declare module 'couchbase' { - /** - * Enumeration of all error codes. See libcouchbase documentation - * for more details on what these errors represent. - * - * @global - * @readonly - * @enum {number} - */ - export var errors: { - /** Operation was successful **/ - success: number; + import events = require('events'); + /** + * Enumeration of all error codes. See libcouchbase documentation for more details on what these errors represent. + */ + enum errors { + /** Operation was successful. **/ + success, + /** Authentication should continue. **/ - authContinue: number; - + authContinue, + /** Error authenticating. **/ - authError: number; - + authError, + /** The passed incr/decr delta was invalid. **/ - deltaBadVal: number; - + deltaBadVal, + /** Object is too large to be stored on the cluster. **/ - objectTooBig: number; - + objectTooBig, + + /** Operation was successful. **/ + serverBusy, + /** Server is too busy to handle your request right now. **/ - serverBusy: number; - - /** Internal libcouchbase error. **/ - cLibInternal: number; - + cLibInternal, + /** An invalid arguement was passed. **/ - cLibInvalidArgument: number; - + cLinInvalidArgument, + /** The server is out of memory. **/ - cLibOutOfMemory: number; - + cLibOutOfMemory, + /** An invalid range was specified. **/ - invalidRange: number; - + invalidRange, + /** An unknown error occured within libcouchbase. **/ - cLibGenericError: number; - + cLibGenericError, + /** A temporary error occured. Try again. **/ - temporaryError: number; - + temporaryError, + /** The key already exists on the server. **/ - keyAlreadyExists: number; - + keyAlreadyExists, + /** The key does not exist on the server. **/ - keyNotFound: number; - + keyNotFound, + /** Failed to open library. **/ - failedToOpenLibrary: number; - + failedToOpenLibrary, + /** Failed to find expected symbol in library. **/ - failedToFindSymbol: number; - + failedToFindSymbol, + /** A network error occured. **/ - networkError: number; - + networkError, + /** Operations were performed on the incorrect server. **/ - wrongServer: number; - + wrongServer, + /** Operations were performed on the incorrect server. **/ - notMyVBucket: number; - - /** The document was not stored. */ - notStored: number; - + notMyVBucket, + + /** The document was not stored. **/ + notSorted, + /** An unsupported operation was sent to the server. **/ - notSupported: number; - + notSupported, + /** An unknown command was sent to the server. **/ - unknownCommand: number; - + unknownCommand, + /** An unknown host was specified. **/ - unknownHost: number; - + unknownHost, + /** A protocol error occured. **/ - protocolError: number; - + protocolError, + /** The operation timed out. **/ - timedOut: number; - + timedOut, + /** Error connecting to the server. **/ - connectError: number; - + connectError, + /** The bucket you request was not found. **/ - bucketNotFound: number; - + bukcketNotFound, + /** libcouchbase is out of memory. **/ - clientOutOfMemory: number; - + clientOutOfMemory, + /** A temporary error occured in libcouchbase. Try again. **/ - clientTemporaryError: number; - - /** A bad handle was passed. */ - badHandle: number; - + clientTemporaryError, + + /** A bad handle was passed. **/ + badHandle, + /** A server bug caused the operation to fail. **/ - serverBug: number; - + serverBug, + /** The host format specified is invalid. **/ - invalidHostFormat: number; - - /** Not enough nodes to meet the operations durability requirements. **/ - notEnoughNodes: number; - + invalidHostFormat, + + /** Not enough nodes to meet the operations durability requirements. **/ + notEnoughNodes, + /** Duplicate items. **/ - duplicateItems: number; - + duplicateItems, + /** Key mapping failed and could not match a server. **/ - noMatchingServerForKey: number; - + noMatchingServerForKey, + /** A bad environment variable was specified. **/ - badEnvironmentVariable: number; + badEnvironmentVariable, + /** Couchnode is out of memory. **/ - outOfMemory: number; - + outOfMemory, + /** Invalid arguements were passed. **/ - invalidArguments: number; - + invalidArguments, + /** An error occured while trying to schedule the operation. **/ - schedulingError: number; - + schedulingError, + /** Not all operations completed successfully. **/ - checkResults: number; - + checkResults, + /** A generic error occured in Couchnode. **/ - genericError: number; - + genericError, + /** The specified durability requirements could not be satisfied. **/ - durabilityFailed: number; - + durabilityFailed, + /** An error occured during a RESTful operation. **/ - restError: number; + restError } /** - * Enumeration of all value encoding formats. - * - * @global - * @readonly - * @enum {number} + * Represents a singular cluster containing your buckets. */ - export var format: { - /** Store as raw bytes. **/ - raw: number; + class Cluster { + /** + * Create a new instance of the Cluster class. + * @param cnstr The connection string for your cluster. + * @param options The options object. + */ + constructor(cnstr?: string, options?: ClusterConstructorOptions); - /** Store as JSON encoded string. **/ - json: number; + /** + * Creates a manager allowing the management of a Couchbase cluster. + */ + manager(): ClusterManager; - /** Store as UTF-8 encoded string. **/ - utf8: number; + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + */ + openBucket(name?: string): Bucket; - /** Automatically determine best storage format. **/ - auto: number; - }; - /** - * The *CAS* value is a special object which indicates the current state - * of the item on the server. Each time an object is mutated on the server, the - * value is changed. CAS objects can be used in conjunction with - * mutation operations to ensure that the value on the server matches the local - * value retrieved by the client. This is useful when doing document updates - * on the server as you can ensure no changes were applied by other clients - * while you were in the process of mutating the document locally. - * - * In Couchnode, this is an opaque value. As such, you cannot generate - * CAS objects, but should rather use the values returned from a - * {@link KeyCallback}. - * - * @typedef {object} CAS - */ - export interface CAS extends Object { + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + * @param password Password for the bucket. + */ + openBucket(name?: string, password?: string): Bucket; + + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + * @param callback Callback to invoke on connection success or failure. + */ + openBucket(name?: string, callback?: Function): Bucket; + + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + * @param password Password for the bucket. + * @param callback Callback to invoke on connection success or failure. + */ + openBucket(name?: string, password?: string, callback?: Function): Bucket; + } + + interface ClusterConstructorOptions { + /** + * The path to the certificate to use for SSL connections + */ + certpath: string; + } + + interface CreateBucketOptions { + /** + * The bucket name + */ + name?: string; + authType?: string, + bucketType?: string; + ramQuotaMB?: number; + replicaNumber?: number; } /** - * @class Result - * @classdesc - * The virtual class used for results of various operations. - * @private + * Class for performing management operations against a cluster. */ - export class Result { + interface ClusterManager { /** - * The CAS value for the document that was affected by the operation. - * @var {CAS} Result#cas + * + * @param name + * @param callback */ - cas: CAS; + createBucket(name: string, callback: Function): void; + /** - * The flags associate with the document. - * @var {integer} Result#flags + * + * @param name + * @param opts + * @param callback */ - flags: number; + createBucket(name: string, opts: any, callback: Function): void; + /** - * The resulting document from the retrieval operation that was executed. - * @var {Mixed} Result#value + * + * @param callback */ - value: any; + listBuckets(callback: Function): void; + + /** + * + * @param name + * @param callback + */ + removeBucket(name: string, callback: Function): void; } /** - * @class CouchbaseError - * @classdesc * The virtual class thrown for all Couchnode errors. - * @private - * @extends node#Error */ - export interface CouchbaseError extends Error { + interface CouchbaseError extends Error { /** * The error code for this error. - * @var {errors} Error#code */ - code: number; + code: errors; + } + + interface AppendOptions { + /** + * The CAS value to check. If the item on the server contains a different CAS value, the operation will fail. Note that if this option is undefined, no comparison will be performed. + */ + cas?: Bucket.CAS; /** - * The internal error that occured to cause this one. This is used to wrap - * low-level errors before throwing them from couchnode to simplify error - * handling. - * @var {(node#Error)} Error#innerError + * Ensures this operation is persisted to this many nodes. */ - innerError: Error; + persist_to?: number; /** - * A reason string describing the reason this error occured. This value is - * almost exclusively used for REST request errors. - * @var {string} Error#reason + * Ensures this operation is replicated to this many nodes. */ - reason: string; - } - - /** - * Connect callback - * This callback is invoked when a connection is successfully established. - * - * @typedef {function} ConnectCallback - * - * @param {undefined|Error} error - * The error that occurred while trying to connect to the cluster. - */ - export interface ConnectCallback { - (error: CouchbaseError): any; - } - - /** - * Design Document Management callbacks - * This callback is invoked by the *DesignDoc operations. - * - * @typedef {function} DDocCallback - * - * @param {undefined|Error} error - * An error indicator. Note that this error value may be ignored, but its - * absence is indicative that the response in the *result* parameter is ok. - * If it is set, then the request likely failed. - * @param {object} result - * The result returned from the server - */ - export interface DDocCallback { - (error: CouchbaseError, result: any): any; - } - - /** - * Single-Key callbacks. - * This callback is passed to all of the single key functions. - * - * A typical use pattern is to pass the result> parameter from the - * callback as the options parameter to one of the next operations. - * - * @typedef {function} KeyCallback - * - * @param {undefined|Error} error - * The error for the operation. This can either be an Error object - * or a false value. The error contains the following fields: - * @param {Result} result - * The result of the operation that was executed. - */ - export interface KeyCallback { - (error: CouchbaseError, result: Result): any; - } - - /** - * Multi-Key callbacks - * This callback is invoked by the *Multi operations. - * It differs from the in {@linkcode KeyCallback} that the - * response object is an object of {key: response} - * where each response object contains the response for that particular - * key. - * - * @typedef {function} MultiCallback - * - * @param {undefined|Error} error - * An error indicator. Note that this error - * value may be ignored, but its absence is indicative that each - * response in the results parameter is ok. If it - * is set, then at least one of the result objects failed - * @param {Object.} results - * The results of the operation as a dictionary of keys mapped to Result - * objects. - */ - export interface MultiCallback { - (error: CouchbaseError, result: { [key: string]: Result }): any; - } - - /** - * Query callback. - * This callback is invoked by the query operations. - * - * @typedef {function} QueryCallback - * - * @param {undefined|Error} error - * An error indicator. Note that this error - * value may be ignored, but its absence is indicative that the - * response in the results parameter is ok. If it - * is set, then the request failed. - * @param {object} results - * The results returned from the server - */ - export interface QueryCallback { - (error: CouchbaseError, result: any): any; - } - - /** - * @typedef {function} StatsCallback - * - * @param {Error} error - * @param {Object.} results - * An object containing per-server, per key entries - * - * @see Connection#stats - */ - export interface StatsCallback { - (error: CouchbaseError, result: any): any; - } - - - ///////////////////////// - // Various options structures - ///////////////////////// - - export interface ConnectionOptions { - host?: any; // string | string[] - bucket?: string; - password?: string; - } - - // Not comming up with a base interface system as that is not how the original code is written. - // Use a custom base interface system has the potential to become difficult to keep up to date. - - export interface AddOptions { - expiry?: number; - flags?: number; - format?: number - persist_to?: number; replicate_to?: number; } - export interface AddMultiOptionsForValue { - value: any; + interface PrependOptions extends AppendOptions { } + + interface RemoveOptions extends AppendOptions { } + + interface ReplaceOptions extends AppendOptions { + /** + * Set the initial expiration time for the document. A value of 0 represents never expiring. + */ expiry?: number; - flags?: number; - format?: number; } - export interface AddMultiOptions { - expiry?: number; - flags?: number; - format?: number + interface UpsertOptions extends ReplaceOptions { } + + interface TouchOptions { + /** + * Ensures this operation is persisted to this many nodes. + */ persist_to?: number; + + /** + * Ensures this operation is replicated to this many nodes. + */ replicate_to?: number; - - spooled?: boolean; } - export interface AppendOptions { - expiry?: number; - flags?: number; - format?: number; - persist_to?: number; - replicate_to?: number; - - cas: CAS; - } - - export interface AppendMultiOptionsForValue { - value: any; - cas?: CAS; - expiry?: number; - } - - export interface AppendMultiOptions { - expiry?: number; - persist_to?: number; - replicate_to?: number; - - spooled?: boolean; - } - - export interface DecrOptions { - offset?: number; + interface CounterOptions { + /** + * Sets the initial value for the document if it does not exist. Specifying a value of undefined will cause the operation to fail if the document does not exist, otherwise this value must be equal to or greater than 0. + */ initial?: number; + /** + * Set the initial expiration time for the document. A value of 0 represents never expiring. + */ expiry?: number; + + /** + * Ensures this operation is persisted to this many nodes + */ persist_to?: number; + + /** + * Ensures this operation is replicated to this many nodes + */ replicate_to?: number; } - export interface DecrMultiOptionsForValue { - offset?: number; - initial?: number; - - expiry?: number; + interface GetAndLockOptions { + lockTime?: number; } - export interface DecrMultiOptions { - spooled?: boolean; - } + interface GetReplicaOptions { - export interface GetOptions { - expiry?: number; - format?: number; - } - - export interface GetMultiOptions { - spooled?: boolean; - format?: number; - } - - export interface GetReplicaOptions { + /** + * The index for which replica you wish to retrieve this value from, or if undefined, use the value from the first server that replies. + */ index?: number; - format?: number; } - export interface GetReplicaMultiOptions { - spooled?: boolean; - format?: number; - } + interface InsertOptions { - export interface IncrOptions extends DecrOptions { } - - export interface IncrMultiOptionsForValue extends DecrMultiOptionsForValue { } - - export interface IncrMultiOptions extends DecrMultiOptions { } - - export interface LockOptions { - lockTime?: number - } - - export interface LockMultiOptions { - spooled?: boolean; - format?: number; - } - - export interface ObserveOptions { - cas: CAS; // verified not optional - } - - export interface ObserveMultiOptionsForValue { - cas: CAS; // verified not optional - } - - export interface ObserveMultiOptions { - spooled?: boolean; - } - - export interface PrependOptions { + /** + * Set the initial expiration time for the document. A value of 0 represents never expiring. + */ expiry?: number; - flags?: number; - format?: number; + + /** + * Ensures this operation is persisted to this many nodes. + */ persist_to?: number; + + /** + * Ensures this operation is replicated to this many nodes. + */ replicate_to?: number; - - cas?: CAS; - } - - export interface PrependMultiOptionsFoValue { - value: any; - cas: CAS; - expiry?: number; - } - - export interface PrependMultiOptions { - spooled?: boolean; - - expiry?: number; - persist_to?: number; - replicate_to?: number; - } - - export interface RemoveOptions { - cas?: CAS; - persist_to?: number; - replicate_to?: number; - } - - export interface RemoveMultiOptionsForValue { - cas?: CAS; - } - - export interface RemoveMultiOptions { - spooled?: boolean; - - persist_to?: number; - replicate_to?: number; - } - - // Options for Replace functions follow Set Options and this is mentioned explicitly in the documentation - - export interface ReplaceOptions extends SetOptions { } - - export interface ReplaceMultiOptionsForValue extends SetMultiOptionsForValue { } - - export interface ReplaceMultiOptions extends SetMultiOptions { } - - export interface SetOptions { - expiry?: number; - flags?: number; - format?: number; - persist_to?: number; - replicate_to?: number; - - cas?: CAS; - } - - export interface SetMultiOptionsForValue { - value: any; - cas?: CAS; - expiry?: number; - flags?: number; - format?: number; - } - - export interface SetMultiOptions { - expiry?: number; - flags?: number; - format?: number - persist_to?: number; - replicate_to?: number; - - spooled?: boolean; - } - - export interface TouchOptions { - expiry?: number; - persist_to?: number; - replicate_to?: number; - - cas?: CAS; - } - - export interface UnlockOptions { - cas: CAS; // verified not optional - } - - export interface UnlockMultiOptionsForValue { - cas: CAS; // verified not optional - } - - export interface UnlockMultiOptions { - spooled?: boolean; } /** - * @class - * A class representing a connection to a Couchbase cluster. - * Normally, your application should only need to create one of these per - * bucket and use it continuously. Operations are executed asynchronously - * and pipelined when possible. - * - * @desc - * Instantiate a new Connection object. Note that it is safe to perform - * operations before the connect callback is invoked. In this case, the - * operations are queued until the connection is ready (or an unrecoverable - * error has taken place). - * - * @param {Object} [options] - * A dictionary of options to use. You may pass - * other options than those defined below which correspond to the various - * options available on the Connection object (see their documentation). - * For example, it may be helpful to set timeout properties before connecting. - * @param {string|string[]} [options.host="localhost:8091"] - * A string or array of strings indicating the hosts to connect to. If the - * value is an array, all the hosts in the array will be tried until one of - * them succeeds. - * @param {string} [options.bucket="default"] - * The bucket to connect to. If not specified, the default is - * 'default'. - * @param {string} [options.password=""] - * The password for a password protected bucket. - * @param {ConnectCallback} callback - * A callback that will be invoked when the instance has completed connecting - * to the server. Note that this isn't required - however if the connection - * fails, an exception will be thrown if the callback is not provided. - * - * @example - * var couchbase = require('couchbase'); - * var db = new couchbase.Connection({}, function(err) { - * if (err) { - * console.log('Connection Error', err); - * } else { - * console.log('Connected!'); - * } - * }); + * A class for performing management operations against a bucket. This class should not be instantiated directly, but instead through the use of the Bucket#manager method instead. */ - export class Connection { - constructor(callback: ConnectCallback); - constructor(options: ConnectionOptions, callback: ConnectCallback); - - ///////////////////////// - // Members - ///////////////////////// + interface BucketManager { + + /** + * Flushes the cluster, deleting all data stored within this bucket. Note that this method requires the Flush permission to be enabled on the bucket from the management console before it will work. + * @param callback The callback function. + */ + flush(callback: Function): void; /** - * Get information about the Couchnode version (i.e. this library) as an array - * of [versionNumber, versionString]. - * - * @member {Mixed[]} Connection#clientVersion + * Retrieves a specific design document from this bucket. + * @param name + * @param callback The callback function. */ - clientVersion: any[]; + getDesignDocument(name: string, callback: Function): void; + /** + * Retrieves a list of all design documents registered to a bucket. + * @param callback The callback function. + */ + getDesignDocuments(callback: Function): void; + + /** + * Registers a design document to this bucket, failing if it already exists. + * @param name + * @param data + * @param callback The callback function. + * @returns {} + */ + insertDesignDocument(name: string, data: any, callback: Function): void; + + /** + * Unregisters a design document from this bucket. + * @param name + * @param callback The callback function. + * @returns {} + */ + removeDesignDocument(name: string, callback: Function): void; + + /** + * Registers a design document to this bucket, overwriting any existing design document that was previously registered. + * @param name + * @param data + * @param callback The callback function. + * @returns {} + */ + upsertDesignDocument(name: string, data: any, callback: Function): void; + } + + /** + * Class for dynamically construction of view queries. This class should never be constructed directly, instead you should use ViewQuery.from to construct this object. + */ + class ViewQuery { + /** + * Instantiates a ViewQuery object for the specified design document and view name. + * @param ddoc The design document to use. + * @param name The view to use. + */ + static from(ddoc: string, name: string): ViewQuery; + + /** + * Specifies the design document and view name to use for this query. + * @param ddoc The design document to use. + * @param name The view to use. + */ + from(ddoc: string, name: string): ViewQuery; + + /** + * Allows you to specify custom view options that may not be available though the fluent interface defined by this class. + * @param opts + */ + custom(opts: any): ViewQuery; + + /** + * Flag to request a view request accross all nodes in the case of a development view. + * @param full_set + */ + full_set(full_set: boolean): ViewQuery; + + /** + * Specifies whether to preform grouping during view execution. + * @param group + */ + group(group: boolean): ViewQuery; + + /** + * Specifies the level at which to perform view grouping. + * @param group_level + */ + group_level(group_level: number): ViewQuery; + + /** + * Specifies a range of document id's to retrieve from the index. + * @param start + * @param end + */ + id_range(start: any, end: any): ViewQuery; + + /** + * Flag to request a view request include the full document value. + * @param include_docs + */ + include_docs(include_docs: boolean): ViewQuery; + + /** + * Specifies a specified key to retrieve from the index. + * @param key + */ + key(key: any): ViewQuery; + + /** + * Specifies a list of keys you wish to retrieve from the index. + * @param keys + */ + keys(key: any[]): ViewQuery; + + /** + * Specifies the maximum number of results to return. + * @param limit + */ + limit(limit: number): ViewQuery; + + /** + * Sets the error handling mode for this query. + * @param mode + */ + on_error(mode: ViewQuery.ErrorMode): ViewQuery; + + /** + * Specifies the desired ordering for the results. + * @param order + */ + order(order: ViewQuery.Order): ViewQuery; + + /** + * Specifies a range of keys to retrieve from the index. You may specify both a start and an end point and additionally specify whether or not the end value is inclusive or exclusive. + * @param start + * @param end + * @param inclusive_end + */ + range(start: any | any[], end: any | any[], inclusive_end?: boolean): ViewQuery; + + /** + * Specifies whether to execute the map-reduce reduce step. + * @param reduce + */ + reduce(reduce: boolean): ViewQuery; + + /** + * Specifies how many results to skip from the beginning of the result set. + * @param skip + */ + skip(skip: number): ViewQuery; + + /** + * Specifies how this query will affect view indexing, both before and after the query is executed. + * @param stale + */ + stale(stale: ViewQuery.Update): ViewQuery; + } + + module ViewQuery { + /** + * Enumeration for specifying on_error behaviour. + */ + enum ErrorMode { + /** + * Continues querying when an error occurs. + */ + CONTINUE, + + /** + * Stops and errors query when an error occurs. + */ + STOP + } + + /** + * Enumeration for specifying view result ordering. + */ + enum Order { + /** + * Orders with lower values first and higher values last. + */ + ASCENDING, + + /** + * Orders with higher values first and lower values last. + */ + DESCENDING + } + + /** + * Enumeration for specifying view update semantics. + */ + enum Update { + /** + * Causes the view to be fully indexed before results are retrieved. + */ + BEFORE, + + /** + * Allows the index to stay in whatever state it is already in prior retrieval of the query results. + */ + NONE, + + /** + * Forces the view to be indexed after the results of this query has been fetched. + */ + AFTER + } + } + + /** + * Class for dynamically construction of N1QL queries. This class should never be constructed directly, instead you should use the N1qlQuery.fromString static method to instantiate a N1qlStringQuery. + */ + class N1qlQuery { + /** + * Creates a query object directly from the passed query string. + * @param str + */ + static fromString(str: string): N1qlStringQuery; + + /** + * Returns the fully prepared string representation of this query. + */ + toString(): string; + } + + module N1qlQuery { + /** + * Enumeration for specifying N1QL consistency semantics. + */ + enum Consistency { + /** + * This is the default (for single-statement requests). + */ + NOT_BOUND, + + /** + * This implements strong consistency per request. + */ + REQUEST_PLUS, + + /** + * This implements strong consistency per statement. + */ + STATEMENT_PLUS + } + } + + /** + * Class for holding a explicitly defined N1QL query string. + */ + class N1qlStringQuery extends N1qlQuery { + /** + * Specifies whether this query is adhoc or should be prepared. + * @param adhoc + */ + adhoc(adhoc: boolean): N1qlStringQuery; + + /** + * Specify the consistency level for this query. + * @param val + */ + consistency(val: N1qlQuery.Consistency): N1qlStringQuery; + + /** + * Returns the fully prepared object representation of this query. + */ + toObject(): any; + + /** + * Returns the fully prepared string representation of this query. + */ + toString(): string; + } + + /** + * Class for dynamically construction of spatial queries. This class should never be constructed directly, instead you should use SpatialQuery.from to construct this object. + */ + class SpatialQuery { + /** + * Instantiates a SpatialQuery object for the specified design document and view name. + * @param ddoc The design document to use. + * @param name The view to use. + */ + static from(ddoc: string, name: string): SpatialQuery; + + /** + * Specifies the design document and view name to use for this query. + * @param ddoc + * @param name + */ + from(ddoc: string, name: string): SpatialQuery; + + /** + * Specifies a bounding box to query the index for. This value must be an array of exactly 4 numbers which represents the left, top, right and bottom edges of the bounding box (in that order). + * @param bbox + */ + bbox(bbox: number[]): SpatialQuery; + + /** + * Allows you to specify custom view options that may not be available though the fluent interface defined by this class. + * @param opts + */ + custom(opts: any): SpatialQuery; + + /** + * Specifies the maximum number of results to return. + * @param limit + */ + limit(limit: number): SpatialQuery; + + /** + * Specifies how many results to skip from the beginning of the result set. + * @param skip + */ + skip(skip: number): SpatialQuery; + + /** + * Specifies how this query will affect view indexing, both before and after the query is executed. + * @param stale + */ + stale(stale: SpatialQuery.Update): SpatialQuery; + } + + module SpatialQuery { + /** + * Enumeration for specifying view update semantics. + */ + enum Update { + /** + * Causes the view to be fully indexed before results are retrieved. + */ + BEFORE, + + /** + * Allows the index to stay in whatever state it is already in prior retrieval of the query results. + */ + NONE, + + /** + * Forces the view to be indexed after the results of this query has been fetched. + */ + AFTER + } + } + + /** + * The Bucket class represents a connection to a Couchbase bucket. Never instantiate this class directly. Instead use the Cluster#openBucket method instead. + */ + interface Bucket { + /** + * Returns the version of the Node.js library as a string. + */ + clientVersion: string; + + /** + * Gets or sets the config throttling in milliseconds. The config throttling is the time that Bucket will wait before forcing a configuration refresh. If no refresh occurs before this period while a configuration is marked invalid, an update will be triggered. + */ + configThrottle: number; + + /** + * Sets or gets the connection timeout in milliseconds. This is the timeout value used when connecting to the configuration port during the initial connection (in this case, use this as a key in the 'options' parameter in the constructor) and/or when Bucket attempts to reconnect in-situ (if the current connection has failed). + */ connectionTimeout: number; - lcbVersion: any[]; + /** + * Gets or sets the durability interval in milliseconds. The durability interval is the time that Bucket will wait between requesting new durability information during a durability poll. + */ + durabilityInterval: number; + /** + * Gets or sets the durability timeout in milliseconds. The durability timeout is the time that Bucket will wait for a response from the server in regards to a durability request. If there are no responses received within this time frame, the request fails with an error. + */ + durabilityTimeout: number; + + /** + * Returns the libcouchbase version as a string. This information will usually be in the format of 2.4.0-fffffff representing the major, minor, patch and git-commit that the built libcouchbase is based upon. + */ + lcbVersion: string; + + /** + * Gets or sets the management timeout in milliseconds. The management timeout is the time that Bucket will wait for a response from the server for a management request. If the response is not received within this time frame, the request is failed out with an error. + */ + managementTimeout: number; + + /** + * Sets or gets the node connection timeout in msecs. This value is similar to Bucket#connectionTimeout, but defines the time to wait for a particular node to respond before trying the next one. + */ + nodeConnectionTimeout: number; + + /** + * Gets or sets the operation timeout in milliseconds. The operation timeout is the time that Bucket will wait for a response from the server for a CRUD operation. If the response is not received within this time frame, the operation is failed with an error. + */ operationTimeout: number; - serverNodes: string[]; + /** + * Gets or sets the view timeout in milliseconds. The view timeout is the time that Bucket will wait for a response from the server for a view request. If the response is not received within this time frame, the request fails with an error. + */ + viewTimeout: number; - ///////////////////////// - // Methods - ///////////////////////// + /** + * Similar to Bucket#upsert, but instead of setting a new key, it appends data to the existing key. Note that this function only makes sense when the stored data is a string; 'appending' to a JSON document may result in parse errors when the document is later retrieved. + * @param key The target document key. + * @param fragment The document's contents to append. + * @param callback The callback function. + */ + append(key: any | Buffer, fragment: any, callback: Bucket.OpCallback): void; - // TODO: not sure if these methods return void. Docmentation mentions nothing. - // TODO: For "multi" key methods the documentation says callback can be either KeyCallback | MultiCallback. Sticking with MultiCallback. - // TODO: Verify that kv is not a key value and indeed is string[] e.g. getMulti , getReplicaMulti, lockMulti + /** + * + * @param key The target document key. + * @param fragment The document's contents to append. + * @param options The options object. + * @param callback The callback function. + */ + append(key: any | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void; - add(key: string, value: any, callback: KeyCallback): void; - add(key: string, value: any, options: AddOptions, callback: KeyCallback): void; - addMulti(kv: { [key: string]: AddMultiOptionsForValue }, options: AddMultiOptions, callback: MultiCallback): void; + /** + * Increments or decrements a key's numeric value. + * Note that JavaScript does not support 64-bit integers (while libcouchbase and the server do). You might receive an inaccurate value if the number is greater than 53-bits (JavaScript's maximum integer precision). + * @param key The target document key. + * @param delta The amount to add or subtract from the counter value. This value may be any non-zero integer. + * @param callback The callback function. + */ + counter(key: any | Buffer, delta: number, callback: Bucket.OpCallback): void; + + /** + * + * @param key The target document key. + * @param delta The amount to add or subtract from the counter value. This value may be any non-zero integer. + * @param options The options object. + * @param callback The callback function. + */ + counter(key: any | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void; - append(key: string, fragment: string, callback: KeyCallback): void; - append(key: string, fragment: string, options: AppendOptions, callback: KeyCallback): void; - append(key: string, fragment: Buffer, callback: KeyCallback): void; - append(key: string, fragment: Buffer, options: AppendOptions, callback: KeyCallback): void; - appendMulti(kv: { [key: string]: AppendMultiOptionsForValue }, options: AppendMultiOptions, callback: MultiCallback): void; + /** + * Shuts down this connection. + */ + disconnect(): void; - decr(key: string, callback: KeyCallback): void; - decr(key: string, options: DecrOptions, callback: KeyCallback): void; - decrMulti(kv: { [key: string]: DecrMultiOptionsForValue }, options: DecrMultiOptions, callback: MultiCallback): void; + /** + * Enables N1QL support on the client. A cbq-server URI must be passed. This method will be deprecated in the future in favor of automatic configuration through the connected cluster. + * @param hosts An array of host/port combinations which are N1QL servers attached to this cluster. + */ + enableN1ql(hosts: string | string[]): void; - get(key: string, callback: KeyCallback): void; - get(key: string, options: GetOptions, callback: KeyCallback): void; - getMulti(kv: string[], options: { [key: string]: GetMultiOptions }, callback:MultiCallback): void; + /** + * Retrieves a document. + * @param key The target document key. + * @param callback The callback function. + */ + get(key: any | Buffer, callback: Bucket.OpCallback): void; - getDesignDoc(name: string, callback: DDocCallback): void; + /** + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + */ + get(key: any | Buffer, options: any, callback: Bucket.OpCallback): void; - getReplica(key: string, callback: KeyCallback): void; - getReplica(key: string, options: GetReplicaOptions, callback: KeyCallback): void; - getReplicaMulti(kv: string[], options: GetReplicaMultiOptions, callback: MultiCallback): void; + /** + * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. + * This function behaves identically to Bucket#get in that it will return the value. It differs in that the document is also locked. This ensures that attempts by other client instances to access this document while the lock is held will fail. + * Once locked, a document can be unlocked either by explicitly calling Bucket#unlock or by performing a storage operation (e.g. Bucket#upsert, Bucket#replace, Bucket::append) with the current CAS value. Note that any other lock operations on this key will fail while a document is locked. + * @param key The target document key. + * @param callback The callback function. + */ + getAndLock(key: any, callback: Bucket.OpCallback): void; - incr(key: string, callback: KeyCallback): void; - incr(key: string, options: IncrOptions, callback: KeyCallback): void; - incrMulti(kv: { [key: string]: IncrMultiOptionsForValue }, options: IncrMultiOptions, callback: MultiCallback): void; + /** + * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. + * This function behaves identically to Bucket#get in that it will return the value. It differs in that the document is also locked. This ensures that attempts by other client instances to access this document while the lock is held will fail. + * Once locked, a document can be unlocked either by explicitly calling Bucket#unlock or by performing a storage operation (e.g. Bucket#upsert, Bucket#replace, Bucket::append) with the current CAS value. Note that any other lock operations on this key will fail while a document is locked. + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + * @returns {} + */ + getAndLock(key: any, options: GetAndLockOptions, callback: Bucket.OpCallback): void; - lock(key: string, callback: KeyCallback): void; - lock(key: string, options: LockOptions, callback: KeyCallback): void; - lockMulti(kv: string[], options: { [key: string]: LockMultiOptions }, callback: MultiCallback): void; + /** + * Retrieves a document and updates the expiry of the item at the same time. + * @param key The target document key. + * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). + * @param options The options object. + * @param callback The callback function. + */ + getAndTouch(key: any | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void; + + /** + * Retrieves a document and updates the expiry of the item at the same time. + * @param key The target document key. + * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). + * @param callback The callback function. + */ + getAndTouch(key: any | Buffer, expiry: number, callback: Bucket.OpCallback): void; - observe(key: string, options: ObserveOptions, callback: KeyCallback): void; - observeMulti(kv: { [key: string]: ObserveMultiOptionsForValue }, options: { [key: string]: ObserveMultiOptions }, callback: MultiCallback): void; + /** + * Retrieves a list of keys + * @param keys The target document keys. + * @param callback The callback function. + */ + getMulti(key: any[] | Buffer[], callback: Bucket.MultiGetCallback): void; - on(event: string, listener: Function): void; - on(event: 'connect', listener: (err: Error) => any): void; - on(event: 'error', listener: (err: Error) => any): void; + /** + * Get a document from a replica server in your cluster. + * @param key The target document key. + * @param callback The callback function. + */ + getReplica(key: any | Buffer, callback: Bucket.OpCallback): void; - prepend(key: string, fragment: string, callback: KeyCallback): void; - prepend(key: string, fragment: string, options: PrependOptions, callback: KeyCallback): void; - prepend(key: string, fragment: Buffer, callback: KeyCallback): void; - prepend(key: string, fragment: Buffer, options: PrependOptions, callback: KeyCallback): void; - prependMulti(kv: { [key: string]: PrependMultiOptionsFoValue }, options: { [key: string]: PrependMultiOptions }, callback: MultiCallback): void; + /** + * Get a document from a replica server in your cluster. + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + */ + getReplica(key: any | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void; - remove(key: string, callback: KeyCallback): void; - remove(key: string, options: RemoveOptions, callback: KeyCallback): void; - removeMulti(kv: { [key: string]: RemoveMultiOptionsForValue }, options: RemoveMultiOptions, callback: MultiCallback): void; - removeMulti(kv: string[], options: RemoveMultiOptions, callback: MultiCallback): void; + /** + * Identical to Bucket#upsert but will fail if the document already exists. + * @param key The target document key. + * @param value The document's contents. + * @param callback The callback function. + */ + insert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + + /** + * Identical to Bucket#upsert but will fail if the document already exists. + * @param key The target document key. + * @param value The document's contents. + * @param options The options object. + * @param callback The callback function. + */ + insert(key: any | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void; - removeDesignDoc(name: string, callback: DDocCallback): void; + /** + * Returns an instance of a BuckerManager for performing management operations against a bucket. + */ + manager(): BucketManager; - replace(key: string, value: any, callback: KeyCallback): void; - replace(key: string, value: any, options: ReplaceOptions, callback: KeyCallback): void; - replaceMulti(kv: { [key: string]: ReplaceMultiOptionsForValue }, options: ReplaceMultiOptions, callback: MultiCallback): void; + /** + * Like Bucket#append, but prepends data to the existing value. + * @param key The target document key. + * @param fragment The document's contents to prepend. + * @param callback The callback function. + */ + prepend(key: any, fragment: any, callback: Bucket.OpCallback): void; - set(key: string, value: any, callback: KeyCallback): void; - set(key: string, value: any, options: SetOptions, callback: KeyCallback): void; - setMulti(kv: { [key: string]: SetMultiOptionsForValue }, options: SetMultiOptions, callback: MultiCallback): void; + /** + * Like Bucket#append, but prepends data to the existing value. + * @param key The target document key. + * @param fragment The document's contents to prepend. + * @param options The options object. + * @param callback The callback function. + */ + prepend(key: any, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void; - setDesignDoc(name: string, data: any, callback: DDocCallback): void; + /** + * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. + * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * @param query The query to execute. + * @param callback The callback function. + */ + query(query: ViewQuery | N1qlQuery, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; - shutdown(): void; + /** + * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. + * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * @param query The query to execute. + * @param params A list or map to do replacements on a N1QL query. + * @param callback The callback function. + */ + query(query: ViewQuery | N1qlQuery, params: Object | Array, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; - stats(callback: StatsCallback): void; - stats(key: string, callback: StatsCallback): void; + /** + * Deletes a document on the server. + * @param key The target document key. + * @param callback The callback function. + */ + remove(key: any | Buffer, callback: Bucket.OpCallback): void; - strError(code: number): string; + /** + * Deletes a document on the server. + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + */ + remove(key: any | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void; - touch(key: string, callback: KeyCallback): void; - touch(key: string, options: TouchOptions, callback: KeyCallback): void; + /** + * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). + * @param key The target document key. + * @param value The document's contents. + * @param callback The callback function. + */ + replace(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; - unlock(key: string, options: UnlockOptions, callback: KeyCallback): void; - unlockMulti(kv: { [key: string]: UnlockMultiOptionsForValue }, options: { [key: string]: UnlockMultiOptions }, callback: UnlockMultiOptions): void; + /** + * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). + * @param key The target document key. + * @param value The document's contents. + * @param options The options object. + * @param callback The callback function. + */ + replace(key: any | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void; - view(ddoc: string, name: string): ViewQuery; - view(ddoc: string, name: string, query: any): ViewQuery; + /** + * Configures a custom set of transcoder functions for encoding and decoding values that are being stored or retreived from the server. + * @param encoder The function for encoding. + * @param decoder The function for decoding. + */ + setTranscoder(encoder: Bucket.EncoderFunction, decoder: Bucket.DecoderFunction): void; + + /** + * Update the document expiration time. + * @param key The target document key. + * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). Values larger than 302460*60 seconds (30 days) are interpreted as absolute times (from the epoch). + * @param options The options object. + * @param callback The callback function. + */ + touch(key: any | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void; + + /** + * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. + * @param key The target document key. + * @param cas The CAS value returned when the key was locked. This operation will fail if the CAS value provided does not match that which was the result of the original lock operation. + * @param callback The callback function. + */ + unlock(key: any | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void; + + /** + * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. + * @param key The target document key. + * @param cas The CAS value returned when the key was locked. This operation will fail if the CAS value provided does not match that which was the result of the original lock operation. + * @param options The options object. + * @param callback The callback function. + */ + unlock(key: any | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void; + + /** + * Stores a document to the bucket. + * @param key The target document key. + * @param value The document's contents. + * @param callback The callback function. + */ + upsert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + + /** + * Stores a document to the bucket. + * @param key The target document key. + * @param value The document's contents. + * @param options The options object. + * @param callback The callback function. + */ + upsert(key: any | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void; } - export class ViewQuery { - firstPage(q: any, callback: Function): void; - query(q: any, callback: Function): void; - } + module Bucket { + + /** + * his is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + */ + interface QueryCallback { + /** + * @param error The error for the operation. This can either be an Error object or a falsy value. + * @param rows The rows returned from the query. + * @param meta The metadata returned by the query. + */ + (error: CouchbaseError, rows: any[], meta: Bucket.ViewQueryResponse.Meta): void; + } -} + /** + * Single-Key callbacks. + * This callback is passed to all of the single key functions. + * It returns a result objcet containing a combination of a CAS and a value, depending on which operation was invoked. + */ + interface OpCallback { + /** + * @param error The error for the operation. This can either be an Error object or a value which evaluates to false (null, undefined, 0 or false). + * @param result The result of the operation that was executed. This usually contains at least a cas property, and on some operations will contain a value property as well. + */ + (error: CouchbaseError | number, result: any): void; + } + + /** + * Multi-Get Callback. + * This callback is used to return results from a getMulti operation. + */ + interface MultiGetCallback { + /** + * @param error The number of keys that failed to be retrieved. The precise errors are available by checking the error property of the individual documents. + * @param results This is a map of keys to results. The result for each key will optionally contain an error if one occured, or if no error occured will contain the CAS and value of the document. + */ + (error: number, results: any[]): void; + } + + /** + * Transcoder Encoding Function. + * This function will receive a value when a storage operation is invoked that needs to encode user-provided data for storage into Couchbase. It expects to be returned a Buffer object to store along with an integer representing any flag metadata relating to how to decode the key later using the matching DecoderFunction. + */ + interface EncoderFunction { + /** + * Transcoder Encoding Function. + * This function will receive a value when a storage operation is invoked that needs to encode user-provided data for storage into Couchbase. It expects to be returned a Buffer object to store along with an integer representing any flag metadata relating to how to decode the key later using the matching DecoderFunction. + * @param value The value needing encoding. + */ + (value: any): Bucket.TranscoderDoc; + } + + /** + * Transcoder Decoding Function. + * This function will receive an object containing a Buffer value and an integer value representing any flags metadata whenever a retrieval operation is executed. It is expected that this function will return a value representing the original value stored and encoded with its matching EncoderFunction. + */ + interface DecoderFunction { + /** + * + * @param doc The data from Couchbase to decode. + */ + (doc: Bucket.TranscoderDoc): any + } + + /** + * The CAS value is a special object that indicates the current state of the item on the server. Each time an object is mutated on the server, the value is changed. CAS objects can be used in conjunction with mutation operations to ensure that the value on the server matches the local value retrieved by the client. This is useful when doing document updates on the server as you can ensure no changes were applied by other clients while you were in the process of mutating the document locally. + * In the Node.js SDK, the CAS is represented as an opaque value. As such,y ou cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback. + */ + interface CAS { + + } + + /** + * An event emitter allowing you to bind to various query result set events. + */ + interface N1qlQueryResponse extends events.EventEmitter { + + } + + module N1qlQueryResponse { + /** + * The meta-information available from a view query response. + */ + interface Meta { + /** + * The identifier for this query request. + */ + requestID: number; + } + } + + /** + * A class used in relation to transcoders. + */ + class TranscoderDoc { + value: Buffer; + flags: number; + } + + /** + * An event emitter allowing you to bind to various query result set events. + */ + interface ViewQueryResponse extends events.EventEmitter { + + } + + module ViewQueryResponse { + /** + * The meta-information available from a view query response. + */ + interface Meta { + /** + * The total number of rows available in the index of the view that was queried. + */ + total_rows: number; + } + } + } +} \ No newline at end of file diff --git a/dagre/dagre.d.ts b/dagre/dagre.d.ts index fb5bd95d9..d16df5216 100644 --- a/dagre/dagre.d.ts +++ b/dagre/dagre.d.ts @@ -31,3 +31,7 @@ declare module Dagre{ } declare var dagre: Dagre.DagreFactory; + +declare module "dagre" { + export = dagre; +} diff --git a/del/del-tests.ts b/del/del-tests.ts index 867781d63..d3c45c965 100644 --- a/del/del-tests.ts +++ b/del/del-tests.ts @@ -35,3 +35,5 @@ paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); paths = del.sync("tmp/*.js"); paths = del.sync("tmp/*.js", {force: true}); + +paths = del.sync("tmp/*.js", {dryRun: true}); diff --git a/del/del.d.ts b/del/del.d.ts index 060861d8a..88316f4f2 100644 --- a/del/del.d.ts +++ b/del/del.d.ts @@ -1,6 +1,6 @@ -// Type definitions for del v1.2.0 +// Type definitions for del v2.2.0 // Project: https://github.com/sindresorhus/del -// Definitions by: Asana +// Definitions by: Asana , Aya Morisawa // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -20,7 +20,8 @@ declare module "del" { function sync(patterns: string[], options?: Options): string[]; interface Options extends glob.IOptions { - force?: boolean + force?: boolean; + dryRun?: boolean; } } diff --git a/dot-prop/dot-prop-tests.ts b/dot-prop/dot-prop-tests.ts new file mode 100644 index 000000000..605a72de3 --- /dev/null +++ b/dot-prop/dot-prop-tests.ts @@ -0,0 +1,12 @@ +/// + +import * as dotProp from 'dot-prop'; + +dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar'); +dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep'); +dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot'); + +const obj = {foo: {bar: 'a'}}; +dotProp.set(obj, 'foo.bar', 'b'); +dotProp.set(obj, 'foo.baz', 'x'); +dotProp.set(obj, 'foo.dot\\.dot', 'unicorn'); diff --git a/dot-prop/dot-prop.d.ts b/dot-prop/dot-prop.d.ts new file mode 100644 index 000000000..c2f52c162 --- /dev/null +++ b/dot-prop/dot-prop.d.ts @@ -0,0 +1,9 @@ +// Type definitions for dot-prop +// Project: https://github.com/sindresorhus/dot-prop +// Definitions by: Sam Verschueren +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "dot-prop" { + export function get(object: any, path: string): any; + export function set(object: any, path: string, value: any): void; +} diff --git a/dropzone/dropzone-tests.ts b/dropzone/dropzone-tests.ts index e15d6e038..3893f7c1a 100644 --- a/dropzone/dropzone-tests.ts +++ b/dropzone/dropzone-tests.ts @@ -131,6 +131,13 @@ dropzoneWithOptionsVariations = new Dropzone(".test", { clickable: ["test", document.getElementById("test")] }); +dropzoneWithOptionsVariations = new Dropzone(".test", { + success: (file:DropzoneFile, response:Object) => console.log(file, response) +}); +dropzoneWithOptionsVariations = new Dropzone(".test", { + success: (file:DropzoneFile, response:string) => console.log(file, response) +}); + const dropzone = new Dropzone(".test"); dropzone.enable(); diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index 93f9ca25b..5588ac48d 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -96,7 +96,7 @@ interface DropzoneOptions { sending?(file:DropzoneFile, xhr:XMLHttpRequest, formData:{}):void; sendingmultiple?(files:DropzoneFile[], xhr:XMLHttpRequest, formData:{}):void; - success?(file:DropzoneFile, responseText:string):void; + success?(file: DropzoneFile, response: Object|string): void; successmultiple?(files:DropzoneFile[], responseText:string):void; canceled?(file:DropzoneFile):void; diff --git a/easystarjs/easystarjs.d.ts b/easystarjs/easystarjs.d.ts index 7640b1a8b..4c16236db 100755 --- a/easystarjs/easystarjs.d.ts +++ b/easystarjs/easystarjs.d.ts @@ -3,10 +3,10 @@ // Definitions by: Magnus Gustafsson // Definitions: https://github.com/borisyankov/DefinitelyTyped /* -easystarjs.d.ts may be freely distributed under the MIT license. -*/ + easystarjs.d.ts may be freely distributed under the MIT license. + */ -declare module "easystarjs" +declare module easystarjs { class js { @@ -31,4 +31,6 @@ declare module "easystarjs" } } - \ No newline at end of file +declare module "easystarjs" { + export = easystarjs; +} \ No newline at end of file diff --git a/express-handlebars/express-handlebars-tests.ts b/express-handlebars/express-handlebars-tests.ts index 3fa6ef31d..982ff2367 100644 --- a/express-handlebars/express-handlebars-tests.ts +++ b/express-handlebars/express-handlebars-tests.ts @@ -6,9 +6,8 @@ import express = require('express'); import exphbs = require('express-handlebars'); var app = express(); -var hbs: Exphbs = exphbs.create({defaultLayout: 'main'}); -app.engine('handlebars', hbs.engine); +app.engine('handlebars', exphbs({defaultLayout: 'main'})); app.set('view engine', 'handlebars'); app.listen(1337); diff --git a/express-handlebars/express-handlebars.d.ts b/express-handlebars/express-handlebars.d.ts index 04eb07162..1f24f5ea4 100644 --- a/express-handlebars/express-handlebars.d.ts +++ b/express-handlebars/express-handlebars.d.ts @@ -1,6 +1,6 @@ // Type definitions for express-handlebars // Project: https://github.com/ericf/express-handlebars -// Definitions by: Sam Saint-Pettersen +// Definitions by: Sam Saint-Pettersen , Igor Dultsev // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -40,7 +40,12 @@ interface Exphbs { renderView(viewPath: string, optionsOrCallback: any, callback?: () => string): void; } +interface ExpressHandlebars { + (options?: ExphbsOptions): Function; + create (options?: ExphbsOptions): Exphbs; +} + declare module "express-handlebars" { - var exphbs: Exphbs; + var exphbs: ExpressHandlebars; export = exphbs; } diff --git a/extend/extend.d.ts b/extend/extend.d.ts index 39b5d1a04..b73ccc00d 100644 --- a/extend/extend.d.ts +++ b/extend/extend.d.ts @@ -5,5 +5,6 @@ declare module "extend" { function extend(deepOrObject:boolean | Object, ...objectN: Object[]): any; + namespace extend {} export = extend; -} \ No newline at end of file +} diff --git a/extended-listbox/extended-listbox-tests.ts b/extended-listbox/extended-listbox-tests.ts new file mode 100644 index 000000000..cc4eba3fe --- /dev/null +++ b/extended-listbox/extended-listbox-tests.ts @@ -0,0 +1,77 @@ +/// + + +var $test = $("#test"); + +// Create Listbox with defaults +var rootElement: any = $test.listbox(); + + +// Create with options +var options = {}; +options.multiple = true; +options.onItemsChanged = (items: ListboxItem[]): void => { + console.log(items); +}; +options.getItems = function (): any[] { + return ["Test1"]; +}; +options.searchBar = false; +options.searchBarWatermark = "Search"; +options.onFilterChanged = (filter): void => { + console.log(filter); +}; +options.onValueChanged = function (value: any): void { + console.log(value); +}; +options.searchBarButton = { icon: "fa fa-search", visible: true, onClick: function () { alert(); } }; + +rootElement = $test.listbox(options); + + +// Add string item +rootElement.listbox("addItem", "Test2"); + + +// Add item +var item: ListboxItem = {}; +item.selected = true; +item.disabled = false; +item.childItems = ["Test4"]; +item.groupHeader = false; +item.id = "ouetioreit"; +item.index = 0; +item.text = "Test3"; +var id: string = rootElement.listbox("addItem", item); + + +// Remove item +rootElement.listbox("removeItem", id); + + +// Get item +var i: ListboxItem = rootElement.listbox("getItem", id); + + +// Get items +var allItems: ListboxItem[] = rootElement.listbox("getItems"); + + +// Move item up +var newIndex: number = rootElement.listbox("moveItemUp", i.id); + + +// Move item down +newIndex = rootElement.listbox("moveItemDown", i.id); + + +// Clear selection +newIndex = rootElement.listbox("clearSelection"); + + +// Enable +newIndex = rootElement.listbox("enable", false); + + +// Destroy +newIndex = rootElement.listbox("destroy"); diff --git a/extended-listbox/extended-listbox.d.ts b/extended-listbox/extended-listbox.d.ts new file mode 100644 index 000000000..d3f8341f0 --- /dev/null +++ b/extended-listbox/extended-listbox.d.ts @@ -0,0 +1,85 @@ +// Type definitions for extended-listbox 1.0.6 +// Project: https://github.com/code-chris/extended-listbox +// Definitions by: Christian Kotzbauer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface ListboxItem { + /** display text */ + text?: string; + + /** unique identifier, if not set it will be generated */ + id?: string; + + /** index position from the item in the list; only used for manual addItem api calls */ + index?: number; + + /** determines if the item should be clickable */ + disabled?: boolean; + + /** determines if the item is selected */ + selected?: boolean; + + /** determines if the item has childItems */ + groupHeader?: boolean; + + /** display text or id of the parent; only used for manual addItem api calls */ + parentGroupId?: string; + + /** list of childItems */ + childItems?: any[]; +} + +interface ListboxSearchBarButtonOptions { + /** determines if the button is visible */ + visible?: boolean; + + /** css class for the i-tag of the button */ + icon?: string; + + /** callback for button click */ + onClick?: () => void; +} + +interface ListBoxOptions { + /** determines if the searchBar is visible */ + searchBar?: boolean; + + /** watermark (placeholder) for the searchBar */ + searchBarWatermark?: string; + + /** settings for the searchBar button */ + searchBarButton?: ListboxSearchBarButtonOptions; + + /** determines if multiple items can be selected */ + multiple?: boolean; + + /** function which returns a array of items */ + getItems?: () => any; + + /** callback for selection changes */ + onValueChanged?: (value: ListboxItem|ListboxItem[]) => void; + + /** callback for searchBar text changes */ + onFilterChanged?: (value: string) => void; + + /** callback for item changes (item added, item removed, item order) */ + onItemsChanged?: (value: ListboxItem[]) => void; +} + +interface JQuery { + listbox(): JQuery; + listbox(methodName: 'addItem'): string; + listbox(methodName: 'removeItem'): void; + listbox(methodName: 'destroy'): void; + listbox(methodName: 'getItem'): ListboxItem; + listbox(methodName: 'getItems'): ListboxItem[]; + listbox(methodName: 'moveItemUp'): number; + listbox(methodName: 'moveItemDown'): number; + listbox(methodName: 'clearSelection'): void; + listbox(methodName: 'enable'): void; + listbox(methodName: string): any; + listbox(methodName: string, methodParameter: any): any; + listbox(options: ListBoxOptions): JQuery; +} diff --git a/field/field-test.ts b/field/field-test.ts new file mode 100644 index 000000000..4a3daf8dd --- /dev/null +++ b/field/field-test.ts @@ -0,0 +1,29 @@ +// From https://github.com/jprichardson/field/blob/e968fd979ba1a06e35571695ddfdad513e516eae/README.md + +/// +import * as field from 'field'; + +// get + +const config = { + environment: { + production: { + port: 80 + } + } +} + +console.log(field.get(config, 'environment:production:port')) +// => 80 + +// set + +var database: any = {} + +console.log(field.get(database, 'production.port')) +// => undefined + +// will return undefined since it never existed before +field.set(database, 'production.port', 27017) +console.log(database.production.port) +// => 27017 diff --git a/field/field.d.ts b/field/field.d.ts new file mode 100644 index 000000000..75b1c8d39 --- /dev/null +++ b/field/field.d.ts @@ -0,0 +1,9 @@ +// Type definitions for field 1.0.1 +// Project: https://www.npmjs.com/package/field +// Definitions by: Leo Liang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'field' { + export function get(topObj: any, fields: string): any; + export function set(topObj: any, fields: string, value: any): any; +} diff --git a/filesystem/filesystem.d.ts b/filesystem/filesystem.d.ts index 1b76846b4..d99105f0b 100644 --- a/filesystem/filesystem.d.ts +++ b/filesystem/filesystem.d.ts @@ -161,7 +161,7 @@ interface Entry { * A move of a file on top of an existing file must attempt to delete and replace that file. * A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. */ - moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string; + moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void; /** * Copy an entry to a different location on the file system. It is an error to try to: @@ -178,7 +178,7 @@ interface Entry { * * Directory copies are always recursive--that is, they copy all contents of the directory. */ - copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string; + copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void; /** * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists. diff --git a/fixed-data-table/fixed-data-table-tests.tsx b/fixed-data-table/fixed-data-table-tests.tsx index 1f10a9fdb..2c8e04a7d 100644 --- a/fixed-data-table/fixed-data-table-tests.tsx +++ b/fixed-data-table/fixed-data-table-tests.tsx @@ -161,3 +161,27 @@ class MyTable4 extends React.Component<{}, MyTable4State> { ); } } + +// Listen for events +class MyTable5 extends React.Component<{}, {}> { + render(): React.ReactElement { + return ( + {}} + onScrollEnd={(x: number, y: number) => {}} + onContentHeightChange={(newHeight: number) => {}} + onRowClick={(event: React.SyntheticEvent, rowIndex: number) => {}} + onRowDoubleClick={(event: React.SyntheticEvent, rowIndex: number) => {}} + onRowMouseDown={(event: React.SyntheticEvent, rowIndex: number) => {}} + onRowMouseEnter={(event: React.SyntheticEvent, rowIndex: number) => {}} + onRowMouseLeave={(event: React.SyntheticEvent, rowIndex: number) => {}} + onColumnResizeEndCallback={(newColumnWidth: number, columnKey: string) => {}}> + // add columns +
+ ); + } +} diff --git a/fixed-data-table/fixed-data-table.d.ts b/fixed-data-table/fixed-data-table.d.ts index 219b7e39f..843eb458e 100644 --- a/fixed-data-table/fixed-data-table.d.ts +++ b/fixed-data-table/fixed-data-table.d.ts @@ -187,13 +187,13 @@ declare module FixedDataTable { * Callback that is called when scrolling starts with * current horizontal and vertical scroll values. */ - onScrollStart?: (horizontalScroll: number, verticalScroll: number) => void; + onScrollStart?: (x: number, y: number) => void; /** * Callback that is called when scrolling ends or stops with * new horizontal and vertical scroll values. */ - onScrollEnd?: (horizontalScroll: number, verticalScroll: number) => void; + onScrollEnd?: (x: number, y: number) => void; /** * Callback that is called when rowHeightGetter returns a @@ -201,35 +201,35 @@ declare module FixedDataTable { * is necessary because initially table estimates heights * of some parts of the content. */ - onContentHeightChange?: (height: number) => void; + onContentHeightChange?: (newHeight: number) => void; /** * Callback that is called when a row is clicked. */ - onRowClick?: (index: number) => void; + onRowClick?: (event: __React.SyntheticEvent, rowIndex: number) => void; /** * Callback that is called when a row is double clicked. */ - onRowDoubleClick?: (index: number) => void; + onRowDoubleClick?: (event: __React.SyntheticEvent, rowIndex: number) => void; /** * Callback that is called when a mouse-down event happens * on a row. */ - onRowMouseDown?: (index: number) => void; + onRowMouseDown?: (event: __React.SyntheticEvent, rowIndex: number) => void; /** * Callback that is called when a mouse-enter event happens * on a row. */ - onRowMouseEnter?: (index: number) => void; + onRowMouseEnter?: (event: __React.SyntheticEvent, rowIndex: number) => void; /** * Callback that is called when a mouse-leave event happens * on a row. */ - onRowMouseLeave?: (index: number) => void; + onRowMouseLeave?: (event: __React.SyntheticEvent, rowIndex: number) => void; /** * Callback that is called when resizer has been released diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-sites-tests.ts similarity index 97% rename from foundation-sites/foundation-tests.ts rename to foundation-sites/foundation-sites-tests.ts index 225f3c0fa..678945265 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-sites-tests.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// +/// $(document).foundation(); $(document).foundation('method5'); diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation-sites.d.ts similarity index 87% rename from foundation-sites/foundation.d.ts rename to foundation-sites/foundation-sites.d.ts index a6dd7682d..55070df14 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation-sites.d.ts @@ -1,15 +1,20 @@ -// Type definitions for Foundation Sites v6.0.4 +// Type definitions for Foundation Sites v6.1.1 // Project: http://foundation.zurb.com/ // Definitions by: Sam Vloeberghs // Definitions: https://github.com/borisyankov/DefinitelyTyped +// please also see the typings project and prefer to use it! +// typings project: https://github.com/typings/typings +// typings: https://github.com/samvloeberghs/foundation-sites-typings + /// declare module FoundationSites { // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference interface Abide { - requiredChedck(element:Object): boolean; + requiredChecked(element:Object): boolean; + findFormError($el:Object): Object; findLabel(element:Object): boolean; addErrorClasses(element:Object): void; removeErrorClasses(element:Object): void; @@ -17,7 +22,9 @@ declare module FoundationSites { validateForm(element:Object): void; validateText(element:Object): boolean; validateRadio(group:string): boolean; + matchValidation($el:Object, validators:string, required:boolean): boolean; resetForm($form:Object): void; + destroy(): void; } interface IAbidePatterns { @@ -40,9 +47,13 @@ declare module FoundationSites { } interface IAbideOptions { - slideSpeed?: number; - multiOpen?: boolean; - patters?: IAbidePatterns; + validateOn?: string; + labelErrorClass?: string; + inputErrorClass?: string; + formErrorSelector?: string; + formErrorClass?: string; + liveValidate?: boolean; + validators?:any; } // http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference @@ -56,10 +67,12 @@ declare module FoundationSites { interface IAccordionOptions { slideSpeed?: number multiOpen?: boolean; + allowAllClosed?: boolean; } // http://foundation.zurb.com/sites/docs/accordion-menu.html#javascript-reference interface AccordionMenu { + hideAll(): void; toggle($target:JQuery): void; down($target:JQuery, firstTime:boolean): void; up($target:JQuery): void; @@ -73,7 +86,8 @@ declare module FoundationSites { // http://foundation.zurb.com/sites/docs/drilldown-menu.html#javascript-reference interface Drilldown { - _hideAll($elem:JQuery): void; + _hideAll(): void; + _back($elem:JQuery): void; _show($elem:JQuery): void; _hide($elem:JQuery): void; destroy(): void; @@ -97,11 +111,13 @@ declare module FoundationSites { interface IDropdownOptions { hoverDelay?: number; hover?: boolean; + hoverPane?: boolean; vOffset?: number; hOffset?: number; positionClass?: string; trapFocus?: boolean; autoFocus?: boolean; + closeOnClick?: boolean; } // http://foundation.zurb.com/sites/docs/dropdown-menu.html#javascript-reference @@ -115,21 +131,26 @@ declare module FoundationSites { hoverDelay?: number; clickOpen?: boolean; closingTime?: number; - alignments?: string; - verticalClasss?: string; - rightClasss?: string; + alignment?: string; + closeOnClick?:boolean; + verticalClass?: string; + rightClass?: string; + forceFollow?: boolean; } // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference interface Equalizer { getHeights(element:Object): Array; - applyHeight($eqParent:Object, heights:Array): void; + getHeightsByRow(cb:Function): void; + applyHeight(heights:Array): void; + applyHeightByRow(groups:Array):void; destroy(): void; } interface IEqualizerOptions { equalizeOnStack?: boolean; - throttleInterval?: number; + equalizeByRow?: boolean; + equalizeOn?:string; } // http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference @@ -155,13 +176,15 @@ declare module FoundationSites { threshold?: number; activeClass?: string; deepLinking?: boolean; + barOffset?: number; } // http://foundation.zurb.com/sites/docs/offcanvas.html#javascript-reference interface OffCanvas { + reveal(isRevealed:boolean): void; open(event:Object, trigger:JQuery): void; - toggle(event:Object, trigger:JQuery): void; close(): void; + toggle(event:Object, trigger:JQuery): void; destroy(): void; } @@ -178,8 +201,8 @@ declare module FoundationSites { // http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference interface Orbit { - changeSlide(isLTR:boolean, chosenSlide?:Object, idx?:number): void; geoSync(): void; + changeSlide(isLTR:boolean, chosenSlide?:Object, idx?:number): void; destroy(): void; } @@ -201,6 +224,7 @@ declare module FoundationSites { boxOfBullets?: string; nextClass?: string; prevClass?: string; + useMUI?: boolean; } // http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference @@ -254,7 +278,7 @@ declare module FoundationSites { _pauseListeners(scrollListener:string): void; _calc(checkSizes:boolean, scroll:number): void; destroy(): void; - emCalc(number:any): void; + emCalc(Number:number): void; } interface IStickyOptions { @@ -279,7 +303,11 @@ declare module FoundationSites { } interface ITabsOptions { - animate?: boolean; + autoFocus?: boolean; + wrapOnKeys?: boolean; + matchHeight?: boolean; + linkClass?: string; + panelClass?: string; } // http://foundation.zurb.com/sites/docs/toggler.html#javascript-reference @@ -328,14 +356,15 @@ declare module FoundationSites { interface KeyBoard { parseKey(event:any): string; + handleKey(event:any, component:any, functions:any):void; findFocusable($element:Object): Object; } interface MediaQuery { get(size:string): string; atLeast(size:string): boolean; - queries:Array; - current:any; + queries:Array; + current:string; } interface Motion { @@ -348,9 +377,8 @@ declare module FoundationSites { } interface Nest { - // TODO - //Feather: function(menu, type) - // Burn: function(menu, type){ + Feather(menu:any, type:any):void; + Burn(menu:any, type:any):void; } interface Timer { @@ -374,6 +402,7 @@ declare module FoundationSites { plugin(plugin:Object, name:string): void; registerPlugin(plugin:Object): void; unregisterPlugin(plugin:Object): void; + reInit(plugins:Array):void; GetYoDigits(length:number, namespace?:string): string; reflow(elem:Object, plugins?:Array|string): void; getFnName(fn:string): string; @@ -382,7 +411,6 @@ declare module FoundationSites { util : { throttle(func:(...args:any[]) => any, delay:number): (...args:any[]) => any; }; - onImagesLoaded(images:Object, cb:Function): void; Abide(element:Object, options?:IAbideOptions): Abide; Accordion(element:Object, options?:IAccordionOptions): Accordion; diff --git a/fullname/fullname-tests.ts b/fullname/fullname-tests.ts new file mode 100644 index 000000000..a037f2634 --- /dev/null +++ b/fullname/fullname-tests.ts @@ -0,0 +1,5 @@ +/// + +import fullname = require("fullname"); + +fullname().then(function(name) { name === "string"; }); diff --git a/fullname/fullname.d.ts b/fullname/fullname.d.ts new file mode 100644 index 000000000..a1d44f167 --- /dev/null +++ b/fullname/fullname.d.ts @@ -0,0 +1,11 @@ +// Type definitions for fullname v2.1.0 +// Project: https://www.npmjs.com/package/fullname +// Definitions by: Klaus Reimer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "fullname" { + function fullname(): Promise; + export = fullname; +} diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 8a0d4125f..fd7437a89 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -249,9 +249,21 @@ contentTracing.startRecording('*', contentTracing.DEFAULT_OPTIONS, () => { // dialog // https://github.com/atom/electron/blob/master/docs/api/dialog.md -console.log(dialog.showOpenDialog({ +// variant without browserWindow +var openDialogResult: string[] = dialog.showOpenDialog({ + title: 'Testing showOpenDialog', + defaultPath: '/var/log/syslog', + filters: [{name: '', extensions: ['']}], properties: ['openFile', 'openDirectory', 'multiSelections'] -})); +}); + +// variant with browserWindow +openDialogResult = dialog.showOpenDialog(win, { + title: 'Testing showOpenDialog', + defaultPath: '/var/log/syslog', + filters: [{name: '', extensions: ['']}], + properties: ['openFile', 'openDirectory', 'multiSelections'] +}); // global-shortcut // https://github.com/atom/electron/blob/master/docs/api/global-shortcut.md @@ -275,12 +287,12 @@ globalShortcut.unregisterAll(); // ipcMain // https://github.com/atom/electron/blob/master/docs/api/ipc-main-process.md -ipcMain.on('asynchronous-message', (event: any, arg: any) => { +ipcMain.on('asynchronous-message', (event: GitHubElectron.IPCMainEvent, arg: any) => { console.log(arg); // prints "ping" event.sender.send('asynchronous-reply', 'pong'); }); -ipcMain.on('synchronous-message', (event: any, arg: any) => { +ipcMain.on('synchronous-message', (event: GitHubElectron.IPCMainEvent, arg: any) => { console.log(arg); // prints "ping" event.returnValue = 'pong'; }); diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 37dd60222..290bf06aa 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1157,11 +1157,11 @@ declare module GitHubElectron { browserWindow?: BrowserWindow, options?: OpenDialogOptions, callback?: (fileNames: string[]) => void - ): void; + ): string[]; export function showOpenDialog( options?: OpenDialogOptions, callback?: (fileNames: string[]) => void - ): void; + ): string[]; interface OpenDialogOptions { title?: string; @@ -1193,8 +1193,12 @@ declare module GitHubElectron { /** * File types that can be displayed, see dialog.showOpenDialog for an example. */ - filters?: string[]; - }, callback?: (fileName: string) => void): void; + + filters?: { + name: string; + extensions: string[]; + }[] + }, callback?: (fileName: string) => void): string; /** * Shows a message box. It will block until the message box is closed. It returns . @@ -1464,6 +1468,24 @@ declare module GitHubElectron { sendToHost(channel: string, ...args: any[]): void; } + class IPCMain implements NodeJS.EventEmitter { + addListener(event: string, listener: Function): IPCMain; + once(event: string, listener: Function): IPCMain; + removeListener(event: string, listener: Function): IPCMain; + removeAllListeners(event?: string): IPCMain; + setMaxListeners(n: number): IPCMain; + getMaxListeners(): number; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + listenerCount(type: string): number; + on(event: string, listener: (event: IPCMainEvent, ...args: any[]) => any): IPCMain; + } + + interface IPCMainEvent { + returnValue?: any; + sender: WebContents; + } + interface Remote extends CommonElectron { /** * @returns The object returned by require(module) in the main process. @@ -1761,7 +1783,7 @@ declare module GitHubElectron { BrowserWindow: typeof GitHubElectron.BrowserWindow; contentTracing: GitHubElectron.ContentTracing; dialog: GitHubElectron.Dialog; - ipcMain: NodeJS.EventEmitter; + ipcMain: GitHubElectron.IPCMain; globalShortcut: GitHubElectron.GlobalShortcut; Menu: typeof GitHubElectron.Menu; MenuItem: typeof GitHubElectron.MenuItem; diff --git a/gulp-autoprefixer/gulp-autoprefixer-tests.ts b/gulp-autoprefixer/gulp-autoprefixer-tests.ts index 9fca0fa69..1b3ba0d53 100644 --- a/gulp-autoprefixer/gulp-autoprefixer-tests.ts +++ b/gulp-autoprefixer/gulp-autoprefixer-tests.ts @@ -1,7 +1,7 @@ /// /// -import gulp = require("gulp"); -import autoprefixer = require("gulp-autoprefixer"); +import * as gulp from "gulp"; +import * as autoprefixer from "gulp-autoprefixer"; gulp.src("test.css") .pipe(autoprefixer()) @@ -17,4 +17,4 @@ gulp.src("test.css") gulp.src("test.css") .pipe(autoprefixer({remove: false})) - .pipe(gulp.dest("build")); \ No newline at end of file + .pipe(gulp.dest("build")); diff --git a/gulp-autoprefixer/gulp-autoprefixer.d.ts b/gulp-autoprefixer/gulp-autoprefixer.d.ts index 5abfdc628..d372358eb 100644 --- a/gulp-autoprefixer/gulp-autoprefixer.d.ts +++ b/gulp-autoprefixer/gulp-autoprefixer.d.ts @@ -6,13 +6,15 @@ /// declare module "gulp-autoprefixer" { - interface Options { - browsers?: string[]; - cascade?: boolean; - remove?: boolean; + namespace autoPrefixer { + interface Options { + browsers?: string[]; + cascade?: boolean; + remove?: boolean; + } } - function autoPrefixer(opts?: Options): NodeJS.ReadWriteStream; + function autoPrefixer(opts?: autoPrefixer.Options): NodeJS.ReadWriteStream; export = autoPrefixer; } diff --git a/gulp-csso/gulp-csso-tests.ts b/gulp-csso/gulp-csso-tests.ts index 5f61d4871..0ddf457c7 100644 --- a/gulp-csso/gulp-csso-tests.ts +++ b/gulp-csso/gulp-csso-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require('gulp'); -import csso = require('gulp-csso'); +import * as gulp from 'gulp'; +import * as csso from 'gulp-csso'; gulp.task('default', () => gulp.src('./main.css') diff --git a/gulp-csso/gulp-csso.d.ts b/gulp-csso/gulp-csso.d.ts index d5d338c4a..c2b58777a 100644 --- a/gulp-csso/gulp-csso.d.ts +++ b/gulp-csso/gulp-csso.d.ts @@ -7,6 +7,6 @@ declare module 'gulp-csso' { function csso(structureMinimization?: boolean): NodeJS.ReadWriteStream; - + namespace csso {} export = csso; } diff --git a/gulp-debug/gulp-debug-tests.ts b/gulp-debug/gulp-debug-tests.ts index e6485d8da..970107410 100644 --- a/gulp-debug/gulp-debug-tests.ts +++ b/gulp-debug/gulp-debug-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require('gulp'); -import debug = require('gulp-debug'); +import * as gulp from 'gulp'; +import * as debug from 'gulp-debug'; gulp.task('default', () => gulp.src('foo.js') diff --git a/gulp-debug/gulp-debug.d.ts b/gulp-debug/gulp-debug.d.ts index 743f5f5eb..d7ade91ac 100644 --- a/gulp-debug/gulp-debug.d.ts +++ b/gulp-debug/gulp-debug.d.ts @@ -13,5 +13,7 @@ declare module 'gulp-debug' { function debug(options?: IOptions): NodeJS.ReadWriteStream; + namespace debug {} + export = debug; } diff --git a/gulp-dtsm/gulp-dtsm-tests.ts b/gulp-dtsm/gulp-dtsm-tests.ts index f97f8705e..1eb505738 100644 --- a/gulp-dtsm/gulp-dtsm-tests.ts +++ b/gulp-dtsm/gulp-dtsm-tests.ts @@ -2,10 +2,9 @@ /// /// -import dtsm = require('gulp-dtsm'); -import gulp = require('gulp'); +import * as dtsm from 'gulp-dtsm'; +import * as gulp from 'gulp'; var stream: NodeJS.WritableStream = dtsm(); gulp.task('dtsm', () => gulp.src('./dtsm.json').pipe(dtsm())); - diff --git a/gulp-dtsm/gulp-dtsm.d.ts b/gulp-dtsm/gulp-dtsm.d.ts index a8fe7878f..63f01e1f5 100644 --- a/gulp-dtsm/gulp-dtsm.d.ts +++ b/gulp-dtsm/gulp-dtsm.d.ts @@ -8,6 +8,7 @@ declare module "gulp-dtsm" { function dtsm(): NodeJS.WritableStream; + namespace dtsm {} + export = dtsm; } - diff --git a/gulp-filter/gulp-filter-tests.ts b/gulp-filter/gulp-filter-tests.ts new file mode 100644 index 000000000..a542ef548 --- /dev/null +++ b/gulp-filter/gulp-filter-tests.ts @@ -0,0 +1,71 @@ +/// +/// +/// +/// +/// + +import * as gulp from 'gulp'; +import * as uglify from 'gulp-uglify'; +import * as less from 'gulp-less'; +import * as concat from 'gulp-concat'; +import * as filter from 'gulp-filter'; + +// Filter only +gulp.task('default', () => { + // create filter instance inside task function + const f = filter(['*', '!src/vendor']); + + return gulp.src('src/*.js') + // filter a subset of the files + .pipe(f) + // run them through a plugin + .pipe(uglify()) + .pipe(gulp.dest('dist')); +}); + +// Restoring filtered files +gulp.task('default', () => { + // create filter instance inside task function + const f = filter(['*', '!src/vendor'], {restore: true}); + + return gulp.src('src/*.js') + // filter a subset of the files + .pipe(f) + // run them through a plugin + .pipe(uglify()) + // bring back the previously filtered out files (optional) + .pipe(f.restore) + .pipe(gulp.dest('dist')); +}); + +// Multiple filters +gulp.task('default', () => { + const jsFilter = filter('**/*.js', {restore: true}); + const lessFilter = filter('**/*.less', {restore: true}); + + return gulp.src('assets/**') + .pipe(jsFilter) + .pipe(concat('bundle.js')) + .pipe(jsFilter.restore) + .pipe(lessFilter) + .pipe(less()) + .pipe(lessFilter.restore) + .pipe(gulp.dest('out/')); +}); + +// Restore as a file source +gulp.task('default', () => { + const f = filter(['*', '!src/vendor'], {restore: true, passthrough: false}); + + const stream = gulp.src('src/*.js') + // filter a subset of the files + .pipe(f) + // run them through a plugin + .pipe(uglify()) + .pipe(gulp.dest('dist')); + + // use filtered files as a gulp file source + f.restore.pipe(gulp.dest('vendor-dist')); + + return stream; +}); diff --git a/gulp-filter/gulp-filter.d.ts b/gulp-filter/gulp-filter.d.ts new file mode 100644 index 000000000..2e37f3bcb --- /dev/null +++ b/gulp-filter/gulp-filter.d.ts @@ -0,0 +1,33 @@ +// Type definitions for gulp-filter v3.0.1 +// Project: https://github.com/sindresorhus/gulp-filter +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module 'gulp-filter' { + import File = require('vinyl'); + import * as Minimatch from 'minimatch'; + + namespace filter { + interface FileFunction { + (file: File): boolean; + } + + interface Options extends Minimatch.IOptions { + restore?: boolean; + passthrough?: boolean; + } + + // A transform stream with a .restore object + interface Filter extends NodeJS.ReadWriteStream { + restore: NodeJS.ReadWriteStream + } + } + + function filter(pattern: string | string[] | filter.FileFunction, options?: filter.Options): filter.Filter; + + export = filter; +} diff --git a/gulp-flatten/gulp-flatten-tests.ts b/gulp-flatten/gulp-flatten-tests.ts index ee5622564..5a476195d 100644 --- a/gulp-flatten/gulp-flatten-tests.ts +++ b/gulp-flatten/gulp-flatten-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import flatten = require("gulp-flatten"); +import * as gulp from "gulp"; +import * as flatten from "gulp-flatten"; gulp.task("flatten:simple", () => { gulp.src(["files/**/*.txt"]) diff --git a/gulp-flatten/gulp-flatten.d.ts b/gulp-flatten/gulp-flatten.d.ts index ccd9cedf1..2992aff4f 100644 --- a/gulp-flatten/gulp-flatten.d.ts +++ b/gulp-flatten/gulp-flatten.d.ts @@ -13,5 +13,7 @@ declare module "gulp-flatten" { function flatten(options?: IOptions): NodeJS.ReadWriteStream; + namespace flatten {} + export = flatten; } diff --git a/gulp-gh-pages/gulp-gh-pages-tests.ts b/gulp-gh-pages/gulp-gh-pages-tests.ts index a8633c051..0d12c7329 100644 --- a/gulp-gh-pages/gulp-gh-pages-tests.ts +++ b/gulp-gh-pages/gulp-gh-pages-tests.ts @@ -1,7 +1,7 @@ /// /// -import gulp = require("gulp"); -import ghPages = require("gulp-gh-pages"); +import * as gulp from "gulp"; +import * as ghPages from "gulp-gh-pages"; gulp.src("test.css") .pipe(ghPages()); @@ -22,4 +22,4 @@ gulp.src("test.css") .pipe(ghPages({push: false})); gulp.src("test.css") - .pipe(ghPages({message: "master"})); \ No newline at end of file + .pipe(ghPages({message: "master"})); diff --git a/gulp-gh-pages/gulp-gh-pages.d.ts b/gulp-gh-pages/gulp-gh-pages.d.ts index ef7146564..228589914 100644 --- a/gulp-gh-pages/gulp-gh-pages.d.ts +++ b/gulp-gh-pages/gulp-gh-pages.d.ts @@ -17,5 +17,7 @@ declare module "gulp-gh-pages" { function ghPages(opts?: Options): NodeJS.ReadWriteStream; + namespace ghPages {} + export = ghPages; } diff --git a/gulp-inject/gulp-inject-tests.ts b/gulp-inject/gulp-inject-tests.ts index 804e6f9b5..4f535c8d6 100644 --- a/gulp-inject/gulp-inject-tests.ts +++ b/gulp-inject/gulp-inject-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import inject = require("gulp-inject"); +import * as gulp from "gulp"; +import * as inject from "gulp-inject"; gulp.task("inject:simple", () => { gulp.src("src/index.html") diff --git a/gulp-inject/gulp-inject.d.ts b/gulp-inject/gulp-inject.d.ts index fb2668a1f..5e72e0673 100644 --- a/gulp-inject/gulp-inject.d.ts +++ b/gulp-inject/gulp-inject.d.ts @@ -35,5 +35,7 @@ declare module "gulp-inject" { function inject(sources: NodeJS.ReadableStream, options?: IOptions): NodeJS.ReadWriteStream; + namespace inject {} + export = inject; } diff --git a/gulp-less/gulp-less-tests.ts b/gulp-less/gulp-less-tests.ts index a0671e766..ba9758649 100644 --- a/gulp-less/gulp-less-tests.ts +++ b/gulp-less/gulp-less-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import less = require("gulp-less"); +import * as gulp from "gulp"; +import * as less from "gulp-less"; // Without options gulp.task("less", () => { diff --git a/gulp-less/gulp-less.d.ts b/gulp-less/gulp-less.d.ts index 84adca370..daab47637 100644 --- a/gulp-less/gulp-less.d.ts +++ b/gulp-less/gulp-less.d.ts @@ -11,9 +11,12 @@ declare module "gulp-less" { modifyVars?: {}; paths?: string[]; plugins?: any[]; + relativeUrls?: boolean; } function less(options?: IOptions): NodeJS.ReadWriteStream; + namespace less {} + export = less; } diff --git a/gulp-load-plugins/gulp-load-plugins-tests.ts b/gulp-load-plugins/gulp-load-plugins-tests.ts index f479be00c..50930358f 100644 --- a/gulp-load-plugins/gulp-load-plugins-tests.ts +++ b/gulp-load-plugins/gulp-load-plugins-tests.ts @@ -3,9 +3,9 @@ /// /// -import gulp = require('gulp'); -import gulpConcat = require('gulp-concat'); -import gulpLoadPlugins = require('gulp-load-plugins'); +import * as gulp from 'gulp'; +import * as gulpConcat from 'gulp-concat'; +import * as gulpLoadPlugins from 'gulp-load-plugins'; interface GulpPlugins extends IGulpPlugins { concat: typeof gulpConcat; @@ -29,8 +29,8 @@ gulp.task('taskName', () => { }); /* - * From 0.8.0, you can pass in an object of mappings for renaming plugins. For example, - * imagine you want to load the gulp-ruby-sass plugin, but want to refer to it as just + * From 0.8.0, you can pass in an object of mappings for renaming plugins. For example, + * imagine you want to load the gulp-ruby-sass plugin, but want to refer to it as just * sass : */ plugins = gulpLoadPlugins({ @@ -39,9 +39,9 @@ plugins = gulpLoadPlugins({ } }); /* - * gulp-load-plugins comes with npm scope support. The major difference is that scoped - * plugins are accessible through an object on plugins that represents the scope. For - * example, if the plugin is @myco/gulp-test-plugin then you can access the plugin as + * gulp-load-plugins comes with npm scope support. The major difference is that scoped + * plugins are accessible through an object on plugins that represents the scope. For + * example, if the plugin is @myco/gulp-test-plugin then you can access the plugin as * shown in the following example: */ interface GulpPlugins { @@ -49,5 +49,5 @@ interface GulpPlugins { testPlugin(): NodeJS.ReadWriteStream; } } - + plugins.myco.testPlugin(); diff --git a/gulp-load-plugins/gulp-load-plugins.d.ts b/gulp-load-plugins/gulp-load-plugins.d.ts index c8a11091d..d72ca87c4 100644 --- a/gulp-load-plugins/gulp-load-plugins.d.ts +++ b/gulp-load-plugins/gulp-load-plugins.d.ts @@ -7,7 +7,7 @@ /** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */ declare module 'gulp-load-plugins' { - + interface IOptions { /** the glob(s) to search for, default ['gulp-*', 'gulp.*'] */ pattern?: string[]; @@ -24,14 +24,16 @@ declare module 'gulp-load-plugins' { /** a mapping of plugins to rename, the key being the NPM name of the package, and the value being an alias you define */ rename?: IPluginNameMappings; } - + interface IPluginNameMappings { [npmPackageName: string]: string } - + /** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */ function gulpLoadPlugins(options?: IOptions): T; - + + namespace gulpLoadPlugins {} + export = gulpLoadPlugins; } diff --git a/gulp-minify-css/gulp-minify-css-tests.ts b/gulp-minify-css/gulp-minify-css-tests.ts index 1375042dd..d8ac4d9df 100644 --- a/gulp-minify-css/gulp-minify-css-tests.ts +++ b/gulp-minify-css/gulp-minify-css-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import minifyCSS = require("gulp-minify-css"); +import * as gulp from "gulp"; +import * as minifyCSS from "gulp-minify-css"; gulp.task("minify-css", () => { gulp.src("css/**/*.css") diff --git a/gulp-minify-css/gulp-minify-css.d.ts b/gulp-minify-css/gulp-minify-css.d.ts index be6d45b8b..bc990a6e0 100644 --- a/gulp-minify-css/gulp-minify-css.d.ts +++ b/gulp-minify-css/gulp-minify-css.d.ts @@ -27,5 +27,7 @@ declare module "gulp-minify-css" { function minifyCSS(options?: IOptions): NodeJS.ReadWriteStream; + namespace minifyCSS {} + export = minifyCSS; } diff --git a/gulp-minify-html/gulp-minify-html-tests.ts b/gulp-minify-html/gulp-minify-html-tests.ts index 9714818f5..2ec41e556 100644 --- a/gulp-minify-html/gulp-minify-html-tests.ts +++ b/gulp-minify-html/gulp-minify-html-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require('gulp'); -import minifyHtml = require('gulp-minify-html'); +import * as gulp from 'gulp'; +import * as minifyHtml from 'gulp-minify-html'; minifyHtml(); minifyHtml({conditionals: true, loose: true}); diff --git a/gulp-minify-html/gulp-minify-html.d.ts b/gulp-minify-html/gulp-minify-html.d.ts index 747104084..11ce298a4 100644 --- a/gulp-minify-html/gulp-minify-html.d.ts +++ b/gulp-minify-html/gulp-minify-html.d.ts @@ -31,5 +31,7 @@ declare module 'gulp-minify-html' { function minifyHtml(options?: IOptions): NodeJS.ReadWriteStream; + namespace minifyHtml {} + export = minifyHtml; } diff --git a/gulp-mocha/gulp-mocha-tests.ts b/gulp-mocha/gulp-mocha-tests.ts index 09f62b83d..8d3eda4ea 100644 --- a/gulp-mocha/gulp-mocha-tests.ts +++ b/gulp-mocha/gulp-mocha-tests.ts @@ -1,9 +1,9 @@ /// /// -import gulp = require("gulp"); -import mocha = require("gulp-mocha"); +import * as gulp from "gulp"; +import * as mocha from "gulp-mocha"; gulp.task('default', function () { return gulp.src('test.js', {read: false}) .pipe(mocha({reporter: 'nyan'})); -}); \ No newline at end of file +}); diff --git a/gulp-mocha/gulp-mocha.d.ts b/gulp-mocha/gulp-mocha.d.ts index 8d21b1323..b63714b77 100644 --- a/gulp-mocha/gulp-mocha.d.ts +++ b/gulp-mocha/gulp-mocha.d.ts @@ -8,5 +8,6 @@ declare module "gulp-mocha" { function mocha(setupOptions?: MochaSetupOptions): NodeJS.ReadWriteStream; + namespace mocha {} export = mocha; -} \ No newline at end of file +} diff --git a/gulp-replace/gulp-replace-tests.ts b/gulp-replace/gulp-replace-tests.ts index a914bfd44..8e043d774 100644 --- a/gulp-replace/gulp-replace-tests.ts +++ b/gulp-replace/gulp-replace-tests.ts @@ -1,11 +1,11 @@ /// /// -import gulp = require("gulp"); -import replace = require("gulp-replace"); +import * as gulp from "gulp"; +import * as replace from "gulp-replace"; gulp.task('templates', function(){ gulp.src(['file.txt']) .pipe(replace("test", "foo")) .pipe(replace(/foo(.{3})/g, '$1foo')) .pipe(gulp.dest('build/file.txt')); -}); \ No newline at end of file +}); diff --git a/gulp-replace/gulp-replace.d.ts b/gulp-replace/gulp-replace.d.ts index cf6ef7164..f32e33bbe 100644 --- a/gulp-replace/gulp-replace.d.ts +++ b/gulp-replace/gulp-replace.d.ts @@ -17,5 +17,7 @@ declare module "gulp-replace" { function replace(pattern: string, replacement: string | Replacer, opts?: Options): NodeJS.ReadWriteStream; function replace(pattern: RegExp, replacement: string | Replacer, opts?: Options): NodeJS.ReadWriteStream; + namespace replace {} + export = replace; -} \ No newline at end of file +} diff --git a/gulp-rev-replace/gulp-rev-replace-tests.ts b/gulp-rev-replace/gulp-rev-replace-tests.ts index e7c5d9c18..7610183d8 100644 --- a/gulp-rev-replace/gulp-rev-replace-tests.ts +++ b/gulp-rev-replace/gulp-rev-replace-tests.ts @@ -3,10 +3,10 @@ /// /// -import gulp = require('gulp'); -import revReplace = require('gulp-rev-replace'); -import rev = require('gulp-rev'); -import useref = require('gulp-useref'); +import * as gulp from 'gulp'; +import * as revReplace from 'gulp-rev-replace'; +import * as rev from 'gulp-rev'; +import * as useref from 'gulp-useref'; gulp.task("index", () => { return gulp.src("src/index.html") diff --git a/gulp-rev-replace/gulp-rev-replace.d.ts b/gulp-rev-replace/gulp-rev-replace.d.ts index 3e683d183..6c258573d 100644 --- a/gulp-rev-replace/gulp-rev-replace.d.ts +++ b/gulp-rev-replace/gulp-rev-replace.d.ts @@ -6,16 +6,18 @@ /// declare module 'gulp-rev-replace' { - interface IOptions { - canonicalUris?: boolean; - replaceInExtensions?: Array; - prefix?: string; - manifest?: NodeJS.ReadWriteStream; - modifyUnreved?: Function; - modifyReved?: Function; + namespace revReplace { + interface Options { + canonicalUris?: boolean; + replaceInExtensions?: Array; + prefix?: string; + manifest?: NodeJS.ReadWriteStream; + modifyUnreved?: Function; + modifyReved?: Function; } + } - function revReplace(options?: IOptions): NodeJS.ReadWriteStream; + function revReplace(options?: revReplace.Options): NodeJS.ReadWriteStream; - export = revReplace; + export = revReplace; } diff --git a/gulp-ruby-sass/gulp-ruby-sass-tests.ts b/gulp-ruby-sass/gulp-ruby-sass-tests.ts index cba0c4c60..5237527a4 100644 --- a/gulp-ruby-sass/gulp-ruby-sass-tests.ts +++ b/gulp-ruby-sass/gulp-ruby-sass-tests.ts @@ -1,7 +1,7 @@ /// /// -import gulp = require("gulp"); -import sass = require("gulp-ruby-sass"); +import * as gulp from "gulp"; +import * as sass from "gulp-ruby-sass"; gulp.task('sass', function () { sass('./scss/*.scss') diff --git a/gulp-ruby-sass/gulp-ruby-sass.d.ts b/gulp-ruby-sass/gulp-ruby-sass.d.ts index bb0c56328..2b0d26fdf 100644 --- a/gulp-ruby-sass/gulp-ruby-sass.d.ts +++ b/gulp-ruby-sass/gulp-ruby-sass.d.ts @@ -64,5 +64,7 @@ declare module "gulp-ruby-sass" { */ function sass(source: string, options?: Options): NodeJS.ReadableStream; + namespace sass {} + export = sass; } diff --git a/gulp-shell/gulp-shell.d.ts b/gulp-shell/gulp-shell.d.ts index d88f27ed6..4d18d610c 100644 --- a/gulp-shell/gulp-shell.d.ts +++ b/gulp-shell/gulp-shell.d.ts @@ -10,7 +10,7 @@ declare module "gulp-shell" { namespace shell { interface Shell { (commands: string|string[], options?: Option): NodeJS.ReadWriteStream; - task(commands: string|string[], options?: Option): () => NodeJS.ReadWriteStream; + task(commands: string|string[], options?: Option): (done: Function) => NodeJS.ReadWriteStream; } interface Option { diff --git a/gulp-size/gulp-size-tests.ts b/gulp-size/gulp-size-tests.ts index bfa2c6a04..8981960f2 100644 --- a/gulp-size/gulp-size-tests.ts +++ b/gulp-size/gulp-size-tests.ts @@ -2,9 +2,9 @@ /// /// -import gulp = require('gulp'); -import size = require('gulp-size'); -import debug = require('gulp-debug'); +import * as gulp from 'gulp'; +import * as size from 'gulp-size'; +import * as debug from 'gulp-debug'; gulp.task('default', () => gulp.src('fixture.js') diff --git a/gulp-size/gulp-size.d.ts b/gulp-size/gulp-size.d.ts index d25f6ed94..ba13c55a2 100644 --- a/gulp-size/gulp-size.d.ts +++ b/gulp-size/gulp-size.d.ts @@ -6,18 +6,20 @@ /// declare module 'gulp-size' { - interface IOptions { - showFiles?: boolean; - gzip?: boolean; - title?: string; + namespace size { + interface Options { + showFiles?: boolean; + gzip?: boolean; + title?: string; + } + + interface SizeStream extends NodeJS.ReadWriteStream { + size: number; + prettySize: string; + } } - interface ISizeStream extends NodeJS.ReadWriteStream { - size: number; - prettySize: string; - } - - function size(options?: IOptions): ISizeStream; + function size(options?: size.Options): size.SizeStream; export = size; } diff --git a/gulp-sort/gulp-sort-tests.ts b/gulp-sort/gulp-sort-tests.ts index 12685c085..d94f5cfdc 100644 --- a/gulp-sort/gulp-sort-tests.ts +++ b/gulp-sort/gulp-sort-tests.ts @@ -3,9 +3,9 @@ /// /// -import gulp = require('gulp'); -import sort = require('gulp-sort'); -import gulpUtil = require('gulp-util'); +import * as gulp from 'gulp'; +import * as sort from 'gulp-sort'; +import * as gulpUtil from 'gulp-util'; // default sort gulp.src('./src/js/**/*.js') @@ -38,7 +38,7 @@ gulp.src('./src/js/**/*.js') } })) .pipe(gulp.dest('./build/js')); - + function customComparator(file1: gulpUtil.File, file2: gulpUtil.File) { if (file1.path.indexOf('build') > -1) { return 1; @@ -47,4 +47,4 @@ function customComparator(file1: gulpUtil.File, file2: gulpUtil.File) { return -1; } return 0; -} \ No newline at end of file +} diff --git a/gulp-sort/gulp-sort.d.ts b/gulp-sort/gulp-sort.d.ts index c06b9c3e0..d4e740fc5 100644 --- a/gulp-sort/gulp-sort.d.ts +++ b/gulp-sort/gulp-sort.d.ts @@ -8,11 +8,11 @@ /** Sort files in stream by path or any custom sort comparator */ declare module 'gulp-sort' { - + import gulpUtil = require('gulp-util'); - + interface IOptions { - /** + /** * A function to compare two files. * Returns: * -1 if file1 should be before file2, @@ -23,9 +23,9 @@ declare module 'gulp-sort' { /** Whether to sort in ascending order, default is true */ asc?: boolean; } - + interface IComparatorFunction { - /** + /** * A function to compare two files. * Returns: * -1 if file1 should be before file2, @@ -34,11 +34,13 @@ declare module 'gulp-sort' { */ (file1: gulpUtil.File, file2: gulpUtil.File): number; } - + /** Sort files in stream by path or any custom sort comparator */ function gulpSort(): NodeJS.ReadWriteStream; function gulpSort(comparator: IComparatorFunction): NodeJS.ReadWriteStream; function gulpSort(options: IOptions): NodeJS.ReadWriteStream; - + + namespace gulpSort {} + export = gulpSort; } diff --git a/gulp-tsd/gulp-tsd-tests.ts b/gulp-tsd/gulp-tsd-tests.ts index a7c20519c..734db65e8 100644 --- a/gulp-tsd/gulp-tsd-tests.ts +++ b/gulp-tsd/gulp-tsd-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import tsd = require("gulp-tsd"); +import * as gulp from "gulp"; +import * as tsd from "gulp-tsd"; gulp.task("tsd", () => { gulp.src("gulp_tsd.json") diff --git a/gulp-tsd/gulp-tsd.d.ts b/gulp-tsd/gulp-tsd.d.ts index 816d50d25..4e9380ebf 100644 --- a/gulp-tsd/gulp-tsd.d.ts +++ b/gulp-tsd/gulp-tsd.d.ts @@ -18,5 +18,7 @@ declare module "gulp-tsd" { function tsd(opts?: IOptions, callback?: gulp.TaskCallback): NodeJS.ReadWriteStream; + namespace tsd {} + export = tsd; } diff --git a/gulp-watch/gulp-watch-tests.ts b/gulp-watch/gulp-watch-tests.ts index dd237dccc..d912199fd 100644 --- a/gulp-watch/gulp-watch-tests.ts +++ b/gulp-watch/gulp-watch-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require('gulp'); -import watch = require('gulp-watch'); +import * as gulp from 'gulp'; +import * as watch from 'gulp-watch'; gulp.task('stream', () => gulp.src('css/**/*.css') diff --git a/gulp-watch/gulp-watch.d.ts b/gulp-watch/gulp-watch.d.ts index 35fb7de95..74af52547 100644 --- a/gulp-watch/gulp-watch.d.ts +++ b/gulp-watch/gulp-watch.d.ts @@ -22,6 +22,6 @@ declare module 'gulp-watch' { } function watch(glob: string | Array, options?: IOptions, callback?: Function): IWatchStream; - + namespace watch {} export = watch; } diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index 0df86dfc6..e2d4a8c52 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -107,7 +107,7 @@ interface HammerManager emit( event:string, data:any ):void; get( recogniser:Recognizer ):Recognizer; get( recogniser:string ):Recognizer; - off( events:string, handler:( event:HammerInput ) => void ):void; + off( events:string, handler?:( event:HammerInput ) => void ):void; on( events:string, handler:( event:HammerInput ) => void ):void; recognize( inputData:any ):void; remove( recogniser:Recognizer ):HammerManager; diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index 54dc7e9ae..95dd5cc79 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -6,6 +6,7 @@ declare module Handlebars { export function registerHelper(name: string, fn: Function, inverse?: boolean): void; + export function registerHelper(name: Object): void; export function registerPartial(name: string, str: any): void; export function unregisterHelper(name: string): void; export function unregisterPartial(name: string): void; diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index b31c24b16..aa814fcc3 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -395,21 +395,19 @@ declare module "hapi" { 'required'authentication is required. 'optional'authentication is optional (must be valid if present). 'try'same as 'optional' but allows for invalid authentication. */ - mode: string; + mode?: string; /** a string array of strategy names in order they should be attempted.If only one strategy is used, strategy can be used instead with the single string value.Defaults to the default authentication strategy which is available only when a single strategy is configured. */ - strategies: string | Array; + strategies?: string | Array; /** if set, the payload (in requests other than 'GET' and 'HEAD') is authenticated after it is processed.Requires a strategy with payload authentication support (e.g.Hawk).Cannot be set to a value other than 'required' when the scheme sets the options.payload to true.Available values: falseno payload authentication.This is the default value. 'required'payload authentication required.This is the default value when the scheme sets options.payload to true. 'optional'payload authentication performed only when the client includes payload authentication information (e.g.hash attribute in Hawk). */ payload?: string; - /** the application scope required to access the route.Value can be a scope string or an array of scope strings.The authenticated credentials object scope property must contain at least one of the scopes defined to access the route.Set to false to remove scope requirements.Defaults to no scope required. */ - scope?: string|Array|boolean; - /** the required authenticated entity type.If set, must match the entity value of the authentication credentials.Available values: - anythe authentication can be on behalf of a user or application.This is the default value. - userthe authentication must be on behalf of a user. - appthe authentication must be on behalf of an application. */ - entity?: string; + /** + * an object or array of objects specifying the route access rules. Each rule is evaluated against an incoming + * request and access is granted if at least one rule matches. Each rule object must include at least one of: + */ + access?: IRouteAdditionalConfigurationAuthAccess | IRouteAdditionalConfigurationAuthAccess[]; }; /** an object passed back to the provided handler (via this) when called. */ bind?: any; @@ -640,6 +638,29 @@ declare module "hapi" { */ tags?: string[] } + + /** + * specifying the route access rules. Each rule is evaluated against an incoming request and access is granted if at least one rule matches + */ + export interface IRouteAdditionalConfigurationAuthAccess { + /** + * the application scope required to access the route. Value can be a scope string or an array of scope strings. + * The authenticated credentials object scope property must contain at least one of the scopes defined to access the route. + * If a scope string begins with a + character, that scope is required. If a scope string begins with a ! character, + * that scope is forbidden. For example, the scope ['!a', '+b', 'c', 'd'] means the incoming request credentials' + * scope must not include 'a', must include 'b', and must include on of 'c' or 'd'. You may also access properties + * on the request object (query and params} to populate a dynamic scope by using {} characters around the property name, + * such as 'user-{params.id}'. Defaults to false (no scope requirements). + */ + scope?: string|Array|boolean; + /** the required authenticated entity type. If set, must match the entity value of the authentication credentials. Available values: + * any - the authentication can be on behalf of a user or application. This is the default value. + * user - the authentication must be on behalf of a user which is identified by the presence of a user attribute in the credentials object returned by the authentication strategy. + * app - the authentication must be on behalf of an application which is identified by the lack of presence of a user attribute in the credentials object returned by the authentication strategy. + */ + entity?: string; + } + /** server.realm http://hapijs.com/api#serverrealm The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). diff --git a/helmet/helmet-tests.ts b/helmet/helmet-tests.ts index d2509a022..83fd224a7 100644 --- a/helmet/helmet-tests.ts +++ b/helmet/helmet-tests.ts @@ -15,11 +15,45 @@ function helmetTest() { /** * @summary Test for {@see helmet#xssFilter} function. */ -function contentSecurityPolicyTest() { +function xssFilterTest() { app.use(helmet.xssFilter()); app.use(helmet.xssFilter({ setOnOldIE: true })); } +/** + * @summary Test for {@see helmet#csp} function + */ + +function contentSecurityPolicyTest() { + + // taken directly from helmet-csp docs + const config = { + // Specify directives as normal. + directives: { + defaultSrc: ["'self'", 'default.com'], + scriptSrc: ["'self'", "'unsafe-inline'"], + styleSrc: ['style.com'], + imgSrc: ['img.com', 'data:'], + sandbox: ['allow-forms', 'allow-scripts'], + reportUri: '/report-violation', + + objectSrc: ["'self'"], // An empty array allows nothing through + }, + + // Set to true if you only want browsers to report errors, not block them + reportOnly: false, + + // Set to true if you want to blindly set all headers: Content-Security-Policy, + // X-WebKit-CSP, and X-Content-Security-Policy. + setAllHeaders: false, + + // Set to true if you want to disable CSP on Android where it can be buggy. + disableAndroid: false + } + app.use(helmet.csp()); + app.use(helmet.contentSecurityPolicy(config)); +} + /** * @summary Test for {@see helmet#frameguard} function. */ diff --git a/helmet/helmet.d.ts b/helmet/helmet.d.ts index 35d9bf3ae..4d07730db 100644 --- a/helmet/helmet.d.ts +++ b/helmet/helmet.d.ts @@ -7,7 +7,24 @@ declare module "helmet" { import express = require("express"); - + + interface IHelmetCspDirectives { + defaultSrc? : string[]; + scriptSrc? : string[]; + styleSrc? : string[]; + imgSrc? : string[]; + sandbox? : string[]; + reportUri? : string; + objectSrc? : string[]; + } + + interface IHelmetCspConfiguration { + reportOnly? : boolean; + setAllHeaders? : boolean; + disableAndroid? : boolean; + directives? : IHelmetCspDirectives + } + /** * @summary Interface for helmet class. * @interface @@ -70,6 +87,19 @@ declare module "helmet" { * @param {Object} options The options. */ xssFilter(options ?: Object):express.RequestHandler; + + /** + * @summary Set policy around third-party content via headers + * @return {RequestHandler} The Request handler + * @param {Object} options The options + */ + csp(options ?: IHelmetCspConfiguration): express.RequestHandler; + + /** + * @see csp + */ + contentSecurityPolicy(options ?: IHelmetCspConfiguration): express.RequestHandler; + } var helmet: Helmet; diff --git a/icepick/icepick-tests.ts b/icepick/icepick-tests.ts new file mode 100644 index 000000000..350e5f2dc --- /dev/null +++ b/icepick/icepick-tests.ts @@ -0,0 +1,177 @@ +/// +/// + + +import i = require("icepick"); + +"use strict"; // so attempted modifications of frozen objects will throw errors + +// freeze(collection) +{ + let coll = { + a: "foo", + b: [1, 2, 3], + c: { + d: "bar" + } + }; + + i.freeze(coll); +} + +// thaw(collection) +class Foo {} + +{ + let coll = i.freeze({ a: "foo", b: [1, 2, 3], c: { d: "bar" }, e: new Foo() }); + let thawed = i.thaw(coll); +} + +// assoc(collection, key, value) +{ + let coll = { a: 1, b: 2 }; + let newColl = i.assoc(coll, "b", 3); // {a: 1, b: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.assoc(arr, 2, "d"); // ["a", "b", "d"] +} + +// alias: set(collection, key, value) +{ + let coll = { a: 1, b: 2 }; + let newColl = i.set(coll, "b", 3); // {a: 1, b: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.set(arr, 2, "d"); // ["a", "b", "d"] +} + +// dissoc(collection, key) +{ + let coll = { a: 1, b: 2, c: 3 }; + let newColl = i.dissoc(coll, "b"); // {a: 1, c: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.dissoc(arr, 2); // ["a", , "c"] +} + +// alias: unset(collection, key) +{ + let coll = { a: 1, b: 2, c: 3 }; + let newColl = i.unset(coll, "b"); // {a: 1, c: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.unset(arr, 2); // ["a", , "c"] +} + +// assocIn(collection, path, value) +{ + let coll = { + a: "foo", + b: [1, 2, 3], + c: { + d: "bar" + } + }; + + let newColl = i.assocIn(coll, ["c", "d"], "baz"); + + let coll2 = {}; + let newColl2 = i.assocIn(coll2, ["a", "b", "c"], 1); +} + +// alias: setIn(collection, path, value) +{ + let coll = { + a: "foo", + b: [1, 2, 3], + c: { + d: "bar" + } + }; + + let newColl = i.setIn(coll, ["c", "d"], "baz"); + + let coll2 = {}; + let newColl2 = i.setIn(coll2, ["a", "b", "c"], 1); +} + +// getIn(collection, path) +{ + let coll = i.freeze([ + { a: 1 }, + { b: 2 } + ]); + + let result = i.getIn(coll, [1, "b"]); // 2 +} + +// updateIn(collection, path, callback) +{ + let coll = i.freeze([ + { a: 1 }, + { b: 2 } + ]); + + let newColl = i.updateIn(coll, [1, "b"], function(val: number) { + return val * 2; + }); // [ {a: 1}, {b: 4} ] +} + +// assign(coll1, coll2, ...) +{ + let obj1 = { a: 1, b: 2, c: 3 }; + let obj2 = { c: 4, d: 5 }; + + let result = i.assign(obj1, obj2); // {a: 1, b: 2, c: 4, d: 5} +} + +// merge(target, source) +{ + let defaults = { a: 1, c: { d: 1, e: [1, 2, 3], f: { g: 1 } } }; + let obj = { c: { d: 2, e: [2], f: null as any } }; + + let result1 = i.merge(defaults, obj); // {a: 1, c: {d: 2, e: [2]}, f: null} + + let obj2 = { c: { d: 2 } }; + let result2 = i.merge(result1, obj2); + + (result1 === result2); // true +} + +// arrays +{ + var a = [1]; + a = i.push(a, 2); // [1, 2]; + a = i.unshift(a, 0); // [0, 1, 2]; + a = i.pop(a); // [0, 1]; + a = i.shift(a); // [1]; +} +{ + i.map(function(v) { return v * 2 }, [1, 2, 3]); // [2, 4, 6] + + var removeEvens = _.partial(i.filter, function(v: number) { return v % 2; }); + + removeEvens([1, 2, 3]); // [1, 3] +} +{ + var arr = i.freeze([{ a: 1 }, { b: 2 }]); + + //ECMAScript 2015 + //arr.find(function(item) { return item.b != null; }); // {b: 2} +} + +// chain(coll) - not defined +{ + let o = { + a: [1, 2, 3], + b: { c: 1 }, + d: 4 + }; + + let result = i.chain(o) + .assocIn(["a", 2], 4) + .merge({ b: { c: 2, c2: 3 } }) + .assoc("e", 2) + .dissoc("d") + .value(); +} diff --git a/icepick/icepick.d.ts b/icepick/icepick.d.ts new file mode 100644 index 000000000..85bbf0ae3 --- /dev/null +++ b/icepick/icepick.d.ts @@ -0,0 +1,72 @@ +// Type definitions for icepick v1.1.0 +// Project: https://github.com/aearly/icepick +// Definitions by: Nathan Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "icepick" { + export function freeze(collection: T): T; + export function thaw(collection: T): T; + export function assoc(collection: T, key: number | string, value: any): T; + export function dissoc(collection: T, key: number | string): T; + export function assocIn(collection: T, path: Array, value: any): T; + export function getIn(collection: any, path: Array): Result; + export function updateIn(collection: T, path: Array, callback: (value: V) => V): T; + + export {assoc as set}; + export {dissoc as unset}; + export {assocIn as setIn}; + + export function assign(target: T): T; + export function assign(target: T, source1: S1): (T & S1); + export function assign(target: T, s1: S1, s2: S2): (T & S1 & S2); + export function assign(target: T, s1: S1, s2: S2, s3: S3): (T & S1 & S2 & S3); + export function assign(target: T, s1: S1, s2: S2, s3: S3, s4: S4): (T & S1 & S2 & S3 & S4); + + export {assign as extend}; + + export function merge(target: T, source: S1): (T & S1); + + export function push(array: T[], element: T): T[]; + export function pop(array: T[]): T[]; + export function shift(array: T[]): T[]; + export function unshift(array: T[], element: T): T[]; + export function reverse(array: T[]): T[]; + export function sort(array: T[], compareFunction?: (a:T, b:T) => number): T[]; + export function splice(array: T[], start: number, deleteCount: number, ...items: T[]): T[]; + export function slice(array: T[], begin?: number, end?: number): T[]; + + export function map(fn: (value: T) => U, array: T[]): U[]; + export function filter(fn: (value: T) => boolean, array: T[]): T[]; + + interface IcepickWrapper { + value(): T; + + freeze(): IcepickWrapper; + thaw(): IcepickWrapper; + + assoc(key: number | string, value: any): IcepickWrapper; + set(key: number | string, value: any): IcepickWrapper; + + dissoc(key: number | string): IcepickWrapper; + unset(key: number | string): IcepickWrapper; + + assocIn(path: Array, value: any): IcepickWrapper; + setIn(path: Array, value: any): IcepickWrapper; + + getIn(collection: any, path: Array): IcepickWrapper; + updateIn(collection: T, path: Array, callback: (value: V) => V): IcepickWrapper; + + assign(source1: S1): IcepickWrapper; + assign(s1: S1, s2: S2): IcepickWrapper; + assign(s1: S1, s2: S2, s3: S3): IcepickWrapper; + assign(s1: S1, s2: S2, s3: S3, s4: S4): IcepickWrapper; + extend(source1: S1): IcepickWrapper; + extend(s1: S1, s2: S2): IcepickWrapper; + extend(s1: S1, s2: S2, s3: S3): IcepickWrapper; + extend(s1: S1, s2: S2, s3: S3, s4: S4): IcepickWrapper; + + merge(source: S1): IcepickWrapper; + } + + export function chain(target: T): IcepickWrapper; +} diff --git a/istanbul/istanbul-tests.ts b/istanbul/istanbul-tests.ts new file mode 100644 index 000000000..b283e2dcc --- /dev/null +++ b/istanbul/istanbul-tests.ts @@ -0,0 +1,27 @@ +/// + +import * as istanbul from 'istanbul'; + +// Instrument code +var instrumenter = new istanbul.Instrumenter(); + +var generatedCode = instrumenter.instrumentSync('function meaningOfLife() { return 42; }', + 'filename.js'); + + +// Generate reports given a bunch of coverage JSON objects +var collector = new istanbul.Collector(), + reporter = new istanbul.Reporter(), + sync = false; + +var obj1 = {}, + obj2 = {}; + +collector.add(obj1); +collector.add(obj2); //etc. + +reporter.add('text'); +reporter.addAll([ 'lcov', 'clover' ]); +reporter.write(collector, sync, function () { + console.log('All reports generated'); +}); diff --git a/istanbul/istanbul.d.ts b/istanbul/istanbul.d.ts new file mode 100644 index 000000000..026ad8b00 --- /dev/null +++ b/istanbul/istanbul.d.ts @@ -0,0 +1,73 @@ +// Type definitions for Istanbul v0.4.0 +// Project: https://github.com/gotwarlost/istanbul +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'istanbul' { + namespace istanbul { + interface Istanbul { + new (options?: any): Istanbul; + Collector: Collector; + config: Config; + ContentWriter: ContentWriter; + FileWriter: FileWriter; + hook: Hook; + Instrumenter: Instrumenter; + Report: Report; + Reporter: Reporter; + Store: Store; + utils: ObjectUtils; + VERSION: string; + Writer: Writer; + } + + interface Collector { + new (options?: any): Collector; + add(coverage: any, testName?: string): void; + } + + interface Config { + } + + interface ContentWriter { + } + + interface FileWriter { + } + + interface Hook { + } + + interface Instrumenter { + new (options?: any): Instrumenter; + instrumentSync(code: string, filename: string): string; + } + + interface Report { + } + + interface Configuration { + new (obj: any, overrides: any): Configuration; + } + + interface Reporter { + new (cfg?: Configuration, dir?: string): Reporter; + add(fmt: string): void; + addAll(fmts: Array): void; + write(collector: Collector, sync: boolean, callback: Function): void; + } + + interface Store { + } + + interface ObjectUtils { + } + + interface Writer { + } + } + + var istanbul: istanbul.Istanbul; + + export = istanbul; +} diff --git a/jasmine-node/jasmine-node-tests.ts b/jasmine-node/jasmine-node-tests.ts new file mode 100644 index 000000000..2ec424da4 --- /dev/null +++ b/jasmine-node/jasmine-node-tests.ts @@ -0,0 +1,31 @@ +// Type definitions for jasmine-node v1.14.5 +// Project: https://github.com/mhevery/jasmine-node +// Definitions by: Sven Reglitzki +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +it("should have a timeout parameter", () => {}, 1000); +it("should have an optional timeout parameter", () => {}); + +import jasmine = require("jasmine-node"); + +jasmine.loadHelpersInFolder("root", /\.helper\.ts/); + +jasmine.executeSpecsInFolder({ + specFolders: [], + onComplete: (runner) => {console.log(runner.results().failedCount)}, + isVerbose: true, + showColors: true, + teamcity: false, + useRequireJs: false, + regExpSpec: /\.spec\.ts/, + junitreport: { + report: false, + savePath : "./reports/", + useDotNotation: true, + consolidate: true + }, + includeStackTrace: true, + growl: false +}); diff --git a/jasmine-node/jasmine-node.d.ts b/jasmine-node/jasmine-node.d.ts new file mode 100644 index 000000000..aa06eb920 --- /dev/null +++ b/jasmine-node/jasmine-node.d.ts @@ -0,0 +1,37 @@ +// Type definitions for jasmine-node v1.14.5 +// Project: https://github.com/mhevery/jasmine-node +// Definitions by: Sven Reglitzki +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare function it(expectation:string, assertion:(done:(err?:any) => void) => void, timeout?:number):void; + +declare module "jasmine-node" { + interface ExecuteSpecsOptions { + specFolders: string[], + onComplete?: (runner:jasmine.Runner) => void, + isVerbose?: boolean, + showColors?: boolean, + teamcity?: string | boolean, + useRequireJs?: boolean, + regExpSpec: RegExp, + junitreport?: { + report: boolean, + savePath: string, + useDotNotation: boolean, + consolidate: boolean + }, + includeStackTrace?: boolean, + growl?: boolean + } + + interface JasmineNode { + executeSpecsInFolder(options:ExecuteSpecsOptions): void; + loadHelpersInFolder(path:string, pattern:RegExp): void; + } + + var jasmine:JasmineNode; + + export = jasmine; +} diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 46a1937f4..b17c68d8b 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -290,6 +290,7 @@ declare module jasmine { toBeFalsy(expectationFailOutput?: any): boolean; toHaveBeenCalled(): boolean; toHaveBeenCalledWith(...params: any[]): boolean; + toHaveBeenCalledTimes(expected: number): boolean; toContain(expected: any, expectationFailOutput?: any): boolean; toBeLessThan(expected: number, expectationFailOutput?: any): boolean; toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean; diff --git a/jointjs/jointjs.d.ts b/jointjs/jointjs.d.ts index 1c7e91571..cbabf0095 100644 --- a/jointjs/jointjs.d.ts +++ b/jointjs/jointjs.d.ts @@ -60,12 +60,12 @@ declare module joint { } interface IOptions { - width: number; - height: number; - gridSize: number; - perpendicularLinks: boolean; - elementView: ElementView; - linkView: LinkView; + width?: number; + height?: number; + gridSize?: number; + perpendicularLinks?: boolean; + elementView?: ElementView; + linkView?: LinkView; } class Paper extends Backbone.View { diff --git a/jquery-mockjax/jquery-mockjax-tests.ts b/jquery-mockjax/jquery-mockjax-tests.ts new file mode 100644 index 000000000..6fae52eb0 --- /dev/null +++ b/jquery-mockjax/jquery-mockjax-tests.ts @@ -0,0 +1,172 @@ +/// +/// +/// + +class Tests { + private _noErrorCallbackExpected: (jqXHR: JQueryXHR, textStatus: string, errorThrown: string) => any; + private _defaultMockjaxSettings: MockJaxSettings; + + run(): void { + const self = this; + + var t = QUnit.test; + + QUnit.begin(() => { + + self._noErrorCallbackExpected = (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any => { + QUnit.assert.ok(false, 'Error callback executed'); + }; + + // Speed up our tests + $.mockjaxSettings.responseTime = 0; + $.mockjaxSettings.logging = false; + self._defaultMockjaxSettings = $.mockjaxSettings; + }); + + QUnit.testDone(() => { + $.mockjax.clear(); + $.mockjaxSettings = self._defaultMockjaxSettings; + }); + + QUnit.module('Core'); + + t('Return XMLHttpRequest object from $.ajax', (assert) => { + $.mockjax({ + url: '/xmlhttprequest', + responseText: 'Hello Word' + }); + + var xhr = $.ajax({ + url: '/xmlhttprequest', + complete: () => { } + }); + + if (xhr && xhr.abort) { + xhr.abort(); + } + + assert.ok(xhr, 'XHR object is not null or undefined'); + assert.ok(xhr.done && xhr.fail, 'Got Promise methods'); + }); + + t('Intercept synchronized proxy calls and return synchronously', (assert) => { + $.mockjax({ + url: '/proxy', + proxy: 'test_proxy.json' + }); + + $.ajax({ + url: '/proxy', + dataType: 'json', + async: false, + success: (json) => { + assert.ok(json && json.proxy, 'Proxy callback request succeeded'); + }, + error: self._noErrorCallbackExpected + }); + }); + + t('Intercept asynchronized proxy calls', (assert) => { + var done = assert.async(); + $.mockjax({ + url: '/proxy', + proxy: 'test_proxy.json' + }); + + $.ajax({ + url: '/proxy', + dataType: 'json', + success: (json) => { + assert.ok(json && json.proxy, 'Proxy callback request succeeded'); + done(); + }, + error: self._noErrorCallbackExpected + }); + }); + + t('Intercept and proxy (sub-ajax request)', (assert) => { + var done = assert.async(); + + $.mockjax({ + url: '/proxy', + proxy: 'test_proxy.json' + }); + + $.ajax({ + url: '/proxy', + dataType: 'json', + success: (json) => { + assert.ok(json && json.proxy, 'Proxy request succeeded'); + }, + error: self._noErrorCallbackExpected, + complete: done + }); + }); + + t('Proxy type specification', (assert) => { + var done = assert.async(); + + $.mockjax({ + url: '/proxy', + proxy: 'test_proxy.json', + proxyType: 'GET' + }); + + $.ajax({ + url: '/proxy', + error: self._noErrorCallbackExpected, + dataType: 'json', + success: (json) => { + assert.ok(json && json.proxy, 'Proxy request succeeded'); + }, + complete: done + }); + }); + + t('Support 1.5 $.ajax(url, settings) signature.', (assert) => { + var done = assert.async(); + + $.mockjax({ + url: '/resource', + responseText: 'Hello World' + }); + + $.ajax('/resource', { + success: (response) => { + assert.equal(response, 'Hello World'); + }, + error: self._noErrorCallbackExpected, + complete: done + }); + }); + + t('Dynamic response callback', (assert) => { + var done = assert.async(); + + var settings: MockJaxSettings = { + url: '/response-callback', + response: (settings) => { + settings.responseText = settings.data.response + ' 2'; + } + }; + + $.mockjax(settings); + + $.ajax({ + url: '/response-callback', + dataType: 'text', + data: { + response: 'Hello world' + }, + error: self._noErrorCallbackExpected, + complete: (xhr) => { + assert.equal(xhr.responseText, 'Hello world 2', 'Response Text matches'); + done(); + } + }); + }); + } +} + +var tests = new Tests(); +tests.run(); diff --git a/jquery-mockjax/jquery-mockjax.d.ts b/jquery-mockjax/jquery-mockjax.d.ts new file mode 100644 index 000000000..a86bd856c --- /dev/null +++ b/jquery-mockjax/jquery-mockjax.d.ts @@ -0,0 +1,47 @@ +// Type definitions for jQuery Mockjax 2.0.1 +// Project: https://github.com/jakerella/jquery-mockjax +// Definitions by: Laszlo Jakab , Vladimir Đokić +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface MockJaxSettingsHeaders { + [key: string]: string; +} + +interface MockJaxSettings { + url?: string | RegExp; + data?: any; + type?: string; + headers?: MockJaxSettingsHeaders; + logging?: boolean; + status?: number; + statusText?: string; + responseTime?: number; + isTimeout?: boolean; + contentType?: string; + response?: (settings: any) => void; + responseText?: string | Object; + responseXml?: string; + proxy?: string; + proxyType?: string; + lastModified?: string; + etag?: string; + onAfterSuccess?: Function; + onAfterError?: Function; + onAfterComplete?: Function; +} + +interface MockJaxStatic { + (options: MockJaxSettings): number; + handler(id?: number): any; + clear(id?: number): void; + mockedAjaxCalls(): any[]; + unfiredHandlers(): any[]; + unmockedAjaxCalls(): any[]; +} + +interface JQueryStatic { + mockjax: MockJaxStatic; + mockjaxSettings: MockJaxSettings; +} diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 27eea1c81..08e66551a 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -1710,6 +1710,20 @@ function test_focusout() { }); } +function test_easing() { + const easing = jQuery.easing; + + function test_easing_function( name: string, fn: JQueryEasingFunction ) { + const step = Math.pow( 2, -3 ); // use power of 2 to prevent floating point rounding error + for( let i = 0; i <= 1; i += step ) { + console.log( `$.easing.${name}(${i}): ${fn.call(easing, i)}` ); + } + } + + test_easing_function( "linear", easing.linear ); + test_easing_function( "swing", easing.swing ); +} + function test_fx() { jQuery.fx.interval = 100; $("input").click(function () { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 29b7697b2..ff259e7fb 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -607,6 +607,16 @@ interface JQueryAnimationOptions { specialEasing?: Object; } +interface JQueryEasingFunction { + ( percent: number ): number; +} + +interface JQueryEasingFunctions { + [ name: string ]: JQueryEasingFunction; + linear: JQueryEasingFunction; + swing: JQueryEasingFunction; +} + /** * Static members of jQuery (those on $ and jQuery themselves) */ @@ -889,6 +899,9 @@ interface JQueryStatic { /** * Effects */ + + easing: JQueryEasingFunctions; + fx: { tick: () => void; /** diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index bc84cb475..e9f402380 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1441,6 +1441,7 @@ function test_dialog() { $(".selector").dialog({ buttons: [ { text: "Ok", click: function () { $(this).dialog("close"); } } ] } ); $(".selector").dialog({ closeOnEscape: false }); $(".selector").dialog({ closeText: "hide" }); + $(".selector").dialog({ appendTo: "appendTo" }); $(".selector").dialog({ dialogClass: "alert" }); $(".selector").dialog({ disabled: true }); $(".selector").dialog({ draggable: false }); @@ -1471,6 +1472,7 @@ function test_menu() { $(".selector").menu({ position: { my: "left top", at: "right-5 top+5" } }); $(".selector").menu({ role: null }); $(".selector").menu("option", { disabled: true }); + $(".selector").menu({ select: (e, ui) => { } }); } @@ -1489,7 +1491,8 @@ function test_slider() { value: 123, range: "min", animate: true, - orientation: "vertical" + orientation: "vertical", + highlight: true }); $("#slider-range").slider({ range: true, @@ -1818,3 +1821,45 @@ function test_widget() { $(".selector").jQuery.Widget("option", "disabled", true); $(".selector").jQuery.Widget("option", { disabled: true }); } + +function test_easing() { + const easing = jQuery.easing; + + function test_easing_function( name: string, fn: JQueryEasingFunction ) { + const step = Math.pow( 2, -3 ); // use power of 2 to prevent floating point rounding error + for( let i = 0; i <= 1; i += step ) { + console.log( `$.easing.${name}(${i}): ${fn.call(easing, i)}` ); + } + } + + test_easing_function("easeInQuad", easing.easeInQuad); + test_easing_function("easeOutQuad", easing.easeOutQuad); + test_easing_function("easeInOutQuad", easing.easeInOutQuad); + test_easing_function("easeInCubic", easing.easeInCubic); + test_easing_function("easeOutCubic", easing.easeOutCubic); + test_easing_function("easeInOutCubic", easing.easeInOutCubic); + test_easing_function("easeInQuart", easing.easeInQuart); + test_easing_function("easeOutQuart", easing.easeOutQuart); + test_easing_function("easeInOutQuart", easing.easeInOutQuart); + test_easing_function("easeInQuint", easing.easeInQuint); + test_easing_function("easeOutQuint", easing.easeOutQuint); + test_easing_function("easeInOutQuint", easing.easeInOutQuint); + test_easing_function("easeInExpo", easing.easeInExpo); + test_easing_function("easeOutExpo", easing.easeOutExpo); + test_easing_function("easeInOutExpo", easing.easeInOutExpo); + test_easing_function("easeInSine", easing.easeInSine); + test_easing_function("easeOutSine", easing.easeOutSine); + test_easing_function("easeInOutSine", easing.easeInOutSine); + test_easing_function("easeInCirc", easing.easeInCirc); + test_easing_function("easeOutCirc", easing.easeOutCirc); + test_easing_function("easeInOutCirc", easing.easeInOutCirc); + test_easing_function("easeInElastic", easing.easeInElastic); + test_easing_function("easeOutElastic", easing.easeOutElastic); + test_easing_function("easeInOutElastic", easing.easeInOutElastic); + test_easing_function("easeInBack", easing.easeInBack); + test_easing_function("easeOutBack", easing.easeOutBack); + test_easing_function("easeInOutBack", easing.easeInOutBack); + test_easing_function("easeInBounce", easing.easeInBounce); + test_easing_function("easeOutBounce", easing.easeOutBounce); + test_easing_function("easeInOutBounce", easing.easeInOutBounce); +} diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index ade8eb735..b3edd5954 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -345,6 +345,7 @@ declare module JQueryUI { buttons?: { [buttonText: string]: (event?: Event) => void } | DialogButtonOptions[]; closeOnEscape?: boolean; closeText?: string; + appendTo?: string; dialogClass?: string; disabled?: boolean; draggable?: boolean; @@ -498,7 +499,7 @@ declare module JQueryUI { // Menu ////////////////////////////////////////////////// - interface MenuOptions { + interface MenuOptions extends MenuEvents { disabled?: boolean; icons?: any; menus?: string; @@ -507,6 +508,7 @@ declare module JQueryUI { } interface MenuUIParams { + item?: JQuery; } interface MenuEvent { @@ -520,7 +522,7 @@ declare module JQueryUI { select?: MenuEvent; } - interface Menu extends Widget, MenuOptions, MenuEvents { + interface Menu extends Widget, MenuOptions { } @@ -634,6 +636,7 @@ declare module JQueryUI { step?: number; value?: number; values?: number[]; + highlight?: boolean; } interface SliderUIParams { @@ -1804,3 +1807,36 @@ interface JQueryStatic { widget: JQueryUI.Widget; Widget: JQueryUI.Widget; } + +interface JQueryEasingFunctions { + easeInQuad: JQueryEasingFunction; + easeOutQuad: JQueryEasingFunction; + easeInOutQuad: JQueryEasingFunction; + easeInCubic: JQueryEasingFunction; + easeOutCubic: JQueryEasingFunction; + easeInOutCubic: JQueryEasingFunction; + easeInQuart: JQueryEasingFunction; + easeOutQuart: JQueryEasingFunction; + easeInOutQuart: JQueryEasingFunction; + easeInQuint: JQueryEasingFunction; + easeOutQuint: JQueryEasingFunction; + easeInOutQuint: JQueryEasingFunction; + easeInExpo: JQueryEasingFunction; + easeOutExpo: JQueryEasingFunction; + easeInOutExpo: JQueryEasingFunction; + easeInSine: JQueryEasingFunction; + easeOutSine: JQueryEasingFunction; + easeInOutSine: JQueryEasingFunction; + easeInCirc: JQueryEasingFunction; + easeOutCirc: JQueryEasingFunction; + easeInOutCirc: JQueryEasingFunction; + easeInElastic: JQueryEasingFunction; + easeOutElastic: JQueryEasingFunction; + easeInOutElastic: JQueryEasingFunction; + easeInBack: JQueryEasingFunction; + easeOutBack: JQueryEasingFunction; + easeInOutBack: JQueryEasingFunction; + easeInBounce: JQueryEasingFunction; + easeOutBounce: JQueryEasingFunction; + easeInOutBounce: JQueryEasingFunction; +} diff --git a/jsurl/jsurl-tests.ts b/jsurl/jsurl-tests.ts new file mode 100644 index 000000000..a10d0a763 --- /dev/null +++ b/jsurl/jsurl-tests.ts @@ -0,0 +1,80 @@ +/// + +interface UModel extends UrlQuery { + a: any; + b: string; +} + +interface U2Model extends UrlQuery { + a: any; +} + +interface U3Model extends UrlQuery { + foo: string; +} + +var u = new Url(); // curent document URL will be used +// or we can instantiate as +var u2 = new Url("http://example.com/some/path?a=b&c=d#someAnchor"); +// it should support relative URLs also +var u3 = new Url("/my/site/doc/path?foo=bar#baz"); + +// get the value of some query string parameter +alert(u2.query.a); +// or +alert(u3.query["foo"]); + +// Manupulating query string parameters +u.query.a = [1, 2, 3]; // adds/replaces in query string params a=1&a=2&a=3 +u.query.b = 'woohoo'; // adds/replaces in query string param b=woohoo + +if (u.query.a instanceof Array) { // the way to add a parameter + u.query.a.push(4); // now it's "a=1&a=2&a=3&a=4&b=woohoo" +} + +else { // if not an array but scalar value here is a way how to convert to array + u.query.a = [u.query.a]; + u.query.a.push(8) +} + + +// The way to remove the parameter: +delete u.query.a +// or: +delete u.query["a"] + +// If you need to remove all query string params: +u.query.clear(); +alert(u); + +// Lookup URL parts: +alert( + 'protocol = ' + u.protocol + '\n' + + 'user = ' + u.user + '\n' + + 'pass = ' + u.pass + '\n' + + 'host = ' + u.host + '\n' + + 'port = ' + u.port + '\n' + + 'path = ' + u.path + '\n' + + 'query = ' + u.query + '\n' + + 'hash = ' + u.hash +); + +// Manipulating URL parts +u.path = '/some/new/path'; // the way to change URL path +u.protocol = 'https' // the way to force https protocol on the source URL + +// inject into string +var str = 'My Cool Link'; + +// or use in DOM context +var a = document.createElement('a'); +a.href = u.toString(); +a.innerHTML = 'test'; +document.body.appendChild(a); + +// Stringify +var su1 = u + ''; +var su2 = String(u); +var su3 = u.toString(); +// NOTE, that usually it will be done automatically, so only in special +// cases direct stringify is required \ No newline at end of file diff --git a/jsurl/jsurl.d.ts b/jsurl/jsurl.d.ts new file mode 100644 index 000000000..cbe985851 --- /dev/null +++ b/jsurl/jsurl.d.ts @@ -0,0 +1,23 @@ +// Type definitions for jsurl 1.2.7 +// Project: https://github.com/Mikhus/jsurl +// Definitions by: Alexey Gorshkov +// Definitions: https://github.com/agorshkov23/DefinitelyTyped + +interface UrlQuery { + clear: () => void; +} + +declare class Url { + constructor(); + constructor(url: string); + query: T; + protocol: string; + user: string; + pass: string; + host: string; + port: string; + path: string; + hash: string; + href: string; + toString: () => string; +} \ No newline at end of file diff --git a/karma-coverage/karma-coverage-tests.ts b/karma-coverage/karma-coverage-tests.ts new file mode 100644 index 000000000..8ca9edc63 --- /dev/null +++ b/karma-coverage/karma-coverage-tests.ts @@ -0,0 +1,220 @@ +/// + +import * as karma from 'karma-coverage'; + + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/README.md#basic +module.exports = function(config: karma.Config) { + config.set({ + files: [ + 'src/**/*.js', + 'test/**/*.js' + ], + + // coverage reporter generates the coverage + reporters: ['progress', 'coverage'], + + preprocessors: { + // source files, that you wanna generate coverage for + // do not include tests or libraries + // (these files will be instrumented by Istanbul) + 'src/**/*.js': ['coverage'] + }, + + // optionally, configure the reporter + coverageReporter: { + type : 'html', + dir : 'coverage/' + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/README.md#advanced-multiple-reporters +module.exports = function(config: karma.Config) { + config.set({ + files: [ + 'src/**/*.js', + 'test/**/*.js' + ], + reporters: ['progress', 'coverage'], + preprocessors: { + 'src/**/*.js': ['coverage'] + }, + coverageReporter: { + // specify a common output directory + dir: 'build/reports/coverage', + reporters: [ + // reporters not supporting the `file` property + { type: 'html', subdir: 'report-html' }, + { type: 'lcov', subdir: 'report-lcov' }, + // reporters supporting the `file` property, use `subdir` to directly + // output them in the `dir` directory + { type: 'cobertura', subdir: '.', file: 'cobertura.txt' }, + { type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' }, + { type: 'teamcity', subdir: '.', file: 'teamcity.txt' }, + { type: 'text', subdir: '.', file: 'text.txt' }, + { type: 'text-summary', subdir: '.', file: 'text-summary.txt' }, + ] + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/README.md#dont-minify-instrumenter-output +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + instrumenterOptions: { + istanbul: { noCompact: true } + } + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#subdir +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + dir: 'coverage', + subdir: '.' + // Would output the results into: .'/coverage/' + } + }); +}; + +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + dir: 'coverage', + subdir: 'report' + // Would output the results into: .'/coverage/report/' + } + }); +}; + +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + dir: 'coverage', + subdir: function(browser) { + // normalization process to keep a consistent browser name accross different + // OS + return browser.toLowerCase().split(/[ /-]/)[0]; + } + // Would output the results into: './coverage/firefox/' + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#file +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + type : 'text', + dir : 'coverage/', + file : 'coverage.txt' + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#check +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + check: { + global: { + statements: 50, + branches: 50, + functions: 50, + lines: 50, + excludes: [ + 'foo/bar/**/*.js' + ] + }, + each: { + statements: 50, + branches: 50, + functions: 50, + lines: 50, + excludes: [ + 'other/directory/**/*.js' + ], + overrides: { + 'baz/component/**/*.js': { + statements: 98 + } + } + } + } + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#watermarks +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + watermarks: { + statements: [ 50, 75 ], + functions: [ 50, 75 ], + branches: [ 50, 75 ], + lines: [ 50, 75 ] + } + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#sourcestore +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + type : 'text', + dir : 'coverage/', + file : 'coverage.txt', + sourceStore : require('istanbul').Store.create('fslookup') + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#reporters +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + reporters:[ + {type: 'html', dir:'coverage/'}, + {type: 'teamcity'}, + {type: 'text-summary'} + ], + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#instrumenter +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + instrumenters: { ibrik : require('ibrik') }, + instrumenter: { + '**/*.coffee': 'ibrik' + }, + // ... + } + }); +}; + +var to5Options = { experimental: true }; + +// [...] + +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + instrumenters: { isparta : require('isparta') }, + instrumenter: { + '**/*.js': 'isparta' + }, + instrumenterOptions: { + isparta: { to5 : to5Options } + } + } + }); +}; diff --git a/karma-coverage/karma-coverage.d.ts b/karma-coverage/karma-coverage.d.ts new file mode 100644 index 000000000..7b78a36de --- /dev/null +++ b/karma-coverage/karma-coverage.d.ts @@ -0,0 +1,42 @@ +// Type definitions for karma-coverage v0.5.3 +// Project: https://github.com/karma-runner/karma-coverage +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module 'karma-coverage' { + import * as karma from 'karma'; + import * as istanbul from 'istanbul'; + + namespace karmaCoverage { + interface Karma extends karma.Karma {} + + interface Config extends karma.Config { + set: (config: ConfigOptions) => void; + } + + interface ConfigOptions extends karma.ConfigOptions { + /** + * See https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md + */ + coverageReporter?: (Reporter|Reporter[]); + } + + interface Reporter { + type?: string; + dir?: string; + subdir?: string | ((browser: string) => string); + check?: any; + watermarks?: any; + includeAllSources?: boolean; + sourceStore?: istanbul.Store; + instrumenter?: any; + } + } + + var karmaCoverage: karmaCoverage.Karma; + + export = karmaCoverage; +} diff --git a/karma/karma.d.ts b/karma/karma.d.ts index c489535eb..87d05843d 100644 --- a/karma/karma.d.ts +++ b/karma/karma.d.ts @@ -82,8 +82,8 @@ declare module 'karma' { interface ServerCallback { (exitCode: number): void; } - - interface Config { + + interface Config { set: (config: ConfigOptions) => void; LOG_DISABLE: string; LOG_ERROR: string; @@ -91,7 +91,7 @@ declare module 'karma' { LOG_INFO: string; LOG_DEBUG: string; } - + interface ConfigFile { configFile: string; } diff --git a/kefir/kefir-tests.ts b/kefir/kefir-tests.ts index a0d0a9618..94300550b 100644 --- a/kefir/kefir-tests.ts +++ b/kefir/kefir-tests.ts @@ -30,7 +30,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke let stream10: Stream = Kefir.stream(emitter => { let count = 0; emitter.emit(count); - + let intervalId = setInterval(() => { count++; if (count < 4) { @@ -39,7 +39,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke emitter.end(); } }, 1000); - + return () => clearInterval(intervalId); }); } @@ -77,6 +77,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke let observable01: Stream = Kefir.sequentially(100, [1, 2, 3]).map(x => x + 1); let observable02: Stream = Kefir.sequentially(100, [1, 2, 3]).filter(x => x > 1); let observable03: Stream = Kefir.sequentially(100, [1, 2, 3]).take(2); + let observable29: Stream = Kefir.sequentially(100, [1, 2, 3]).takeErrors(2); let observable04: Stream = Kefir.sequentially(100, [1, 2, 3]).takeWhile(x => x < 3); let observable05: Stream = Kefir.sequentially(100, [1, 2, 3]).last(); let observable06: Stream = Kefir.sequentially(100, [1, 2, 3]).skip(2); @@ -103,14 +104,16 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke }).endOnError(); let observable22: Stream = Kefir.sequentially(100, [0, -1, 2, -3]).valuesToErrors(x => { return {convert: x < 0, error: x}; - }).skipValues(); + }).ignoreValues(); let observable23: Stream = Kefir.sequentially(100, [0, -1, 2, -3]).valuesToErrors(x => { return {convert: x < 0, error: x}; - }).skipErrors(); - let observable24: Stream = Kefir.sequentially(100, [1, 2, 3]).skipEnd(); + }).ignoreErrors(); + let observable24: Stream = Kefir.sequentially(100, [1, 2, 3]).ignoreEnd(); let ovservable25: Stream = Kefir.sequentially(100, [1, 2, 3]).beforeEnd(() => 0); let observable26: Stream = Kefir.sequentially(100, [1, 2, 3, 4, 5]).slidingWindow(3, 2) let observable27: Stream = Kefir.sequentially(100, [1, 2, 3, 4, 5]).bufferWhile(x => x !== 3); + let observable30: Stream = Kefir.sequentially(100, [1, 2, 3, 4, 5]).bufferWithCount(2); + let observable31: Stream = Kefir.sequentially(100, [1, 2, 3, 4, 5]).bufferWithTimeOrCount(330, 10); { var myTransducer: any; let observable28: Stream = Kefir.sequentially(100, [1, 2, 3, 4, 5, 6]).transduce(myTransducer); diff --git a/kefir/kefir.d.ts b/kefir/kefir.d.ts index 9e3303f01..a95b12a88 100644 --- a/kefir/kefir.d.ts +++ b/kefir/kefir.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kefir 2.8.1 +// Type definitions for Kefir 3.2.0 // Project: http://rpominov.github.io/kefir/ // Definitions by: Aya Morisawa // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,7 +6,7 @@ /// declare module "kefir" { - + export interface Observable { // Subscribe / add side effects onValue(callback: (value: T) => void): void; @@ -19,12 +19,14 @@ declare module "kefir" { offAny(callback: (event: Event) => void): void; log(name?: string): void; offLog(name?: string): void; + flatten(transformer?: (value: T) => U[]): Stream; toPromise(PromiseConstructor?: any): any; + toESObservable(): any; } - + export interface Stream extends Observable { toProperty(getCurrent?: () => T): Property; - + // Modify an stream map(fn: (value: T) => U): Stream; filter(predicate?: (value: T) => boolean): Stream; @@ -36,24 +38,26 @@ declare module "kefir" { skipDuplicates(comparator?: (a: T, b: T) => boolean): Stream; diff(fn?: (prev: T, next: T) => T, seed?: T): Stream; scan(fn: (prev: T, next: T) => T, seed?: T): Stream; - flatten(transformer?: (value: T) => U[]): Stream; delay(wait: number): Stream; - throttle(wait: number, options?: {leading: boolean, trailing: boolean}): Stream; + throttle(wait: number, options?: {leading?: boolean, trailing?: boolean}): Stream; debounce(wait: number, options?: {immediate: boolean}): Stream; valuesToErrors(handler?: (value: T) => {convert: boolean, error: U}): Stream; errorsToValues(handler?: (error: S) => {convert: boolean, value: U}): Stream; mapErrors(fn: (error: S) => U): Stream; filterErrors(predicate?: (error: S) => boolean): Stream; endOnError(): Stream; - skipValues(): Stream; - skipErrors(): Stream; - skipEnd(): Stream; + takeErrors(n: number): Stream; + ignoreValues(): Stream; + ignoreErrors(): Stream; + ignoreEnd(): Stream; beforeEnd(fn: () => U): Stream; slidingWindow(max: number, mix?: number): Stream; bufferWhile(predicate: (value: T) => boolean): Stream; + bufferWithCount(count: number, options?: {flushOnEnd: boolean}): Stream; + bufferWithTimeOrCount(interval: number, count: number, options?: {flushOnEnd: boolean}): Stream; transduce(transducer: any): Stream; withHandler(handler: (emitter: Emitter, event: Event) => void): Stream; - + // Combine streams combine(otherObs: Stream, combinator?: (value: T, ...values: U[]) => W): Stream; zip(otherObs: Stream, combinator?: (value: T, ...values: U[]) => W): Stream; @@ -65,20 +69,20 @@ declare module "kefir" { flatMapConcat(fn: (value: T) => Stream): Stream; flatMapConcurLimit(fn: (value: T) => Stream, limit: number): Stream; flatMapErrors(transform: (error: S) => Stream): Stream; - + // Combine two streams filterBy(otherObs: Observable): Stream; sampledBy(otherObs: Observable, combinator?: (a: T, b: U) => W): Stream; skipUntilBy(otherObs: Observable): Stream; takeUntilBy(otherObs: Observable): Stream; bufferBy(otherObs: Observable, options?: {flushOnEnd: boolean}): Stream; - bufferWhileBy(otherObs: Observable): Stream; + bufferWhileBy(otherObs: Observable, options?: {flushOnEnd?: boolean, flushOnChange?: boolean}): Stream; awaiting(otherObs: Observable): Stream; } - + export interface Property extends Observable { changes(): Stream; - + // Modify an property map(fn: (value: T) => U): Property; filter(predicate?: (value: T) => boolean): Property; @@ -90,24 +94,26 @@ declare module "kefir" { skipDuplicates(comparator?: (a: T, b: T) => boolean): Property; diff(fn?: (prev: T, next: T) => T, seed?: T): Property; scan(fn: (prev: T, next: T) => T, seed?: T): Property; - flatten(transformer?: (value: T) => U[]): Property; delay(wait: number): Property; - throttle(wait: number, options?: {leading: boolean, trailing: boolean}): Property; + throttle(wait: number, options?: {leading?: boolean, trailing?: boolean}): Property; debounce(wait: number, options?: {immediate: boolean}): Property; valuesToErrors(handler?: (value: T) => {convert: boolean, error: U}): Property; errorsToValues(handler?: (error: S) => {convert: boolean, value: U}): Property; mapErrors(fn: (error: S) => U): Property; filterErrors(predicate?: (error: S) => boolean): Property; endOnError(): Property; - skipValues(): Property; - skipErrors(): Property; - skipEnd(): Property; + takeErrors(n: number): Stream; + ignoreValues(): Property; + ignoreErrors(): Property; + ignoreEnd(): Property; beforeEnd(fn: () => U): Property; slidingWindow(max: number, mix?: number): Property; bufferWhile(predicate: (value: T) => boolean): Property; + bufferWithCount(count: number, options?: {flushOnEnd: boolean}): Property; + bufferWithTimeOrCount(interval: number, count: number, options?: {flushOnEnd: boolean}): Property; transduce(transducer: any): Property; withHandler(handler: (emitter: Emitter, event: Event) => void): Property; - + // Combine properties combine(otherObs: Property, combinator?: (value: T, ...values: U[]) => W): Property; zip(otherObs: Property, combinator?: (value: T, ...values: U[]) => W): Property; @@ -119,35 +125,34 @@ declare module "kefir" { flatMapConcat(fn: (value: T) => Property): Property; flatMapConcurLimit(fn: (value: T) => Property, limit: number): Property; flatMapErrors(transform: (error: S) => Property): Property; - + // Combine two properties filterBy(otherObs: Observable): Property; sampledBy(otherObs: Observable, combinator?: (a: T, b: U) => W): Property; skipUntilBy(otherObs: Observable): Property; takeUntilBy(otherObs: Observable): Property; bufferBy(otherObs: Observable, options?: {flushOnEnd: boolean}): Property; - bufferWhileBy(otherObs: Observable): Property; + bufferWhileBy(otherObs: Observable, options?: {flushOnEnd?: boolean, flushOnChange?: boolean}): Property; awaiting(otherObs: Observable): Property; } - + export interface ObservablePool extends Observable { plug(obs: Observable): void; unPlug(obs: Observable): void; } - + export interface Event { type: string; value: T; - current: boolean; } - + export interface Emitter { emit(value: T): void; error(error: S): void; end(): void; emitEvent(event: {type: string, value: T | S}): void; } - + // Create a stream export function never(): Stream; export function later(wait: number, value: T): Stream; @@ -159,12 +164,13 @@ declare module "kefir" { export function fromNodeCallback(fn: (callback: (error: S, result: T) => void) => void): Stream; export function fromEvents(target: EventTarget | NodeJS.EventEmitter | { on: Function, off: Function }, eventName: string, transform?: (value: T) => S): Stream; export function stream(subscribe: (emitter: Emitter) => Function | void): Stream; - + export function fromESObservable(observable: any): Stream + // Create a property export function constant(value: T): Property; export function constantError(error: T): Property; export function fromPromise(promise: any): Property; - + // Combine observables export function combine(obss: Observable[], passiveObss: Observable[], combinator?: (...values: T[]) => U): Observable; export function combine(obss: Observable[], combinator?: (...values: T[]) => U): Observable; diff --git a/kii-cloud-sdk/kii-cloud-sdk-tests.ts b/kii-cloud-sdk/kii-cloud-sdk-tests.ts index f92642538..ed5bb2966 100644 --- a/kii-cloud-sdk/kii-cloud-sdk-tests.ts +++ b/kii-cloud-sdk/kii-cloud-sdk-tests.ts @@ -46,4 +46,15 @@ function main() { object.set("foo", 1); object.save(); + + KiiGroup.registerGroupWithID("Group ID", "Group Name", [user], { + success: function(theSavedGroup: KiiGroup) { + theSavedGroup.saveWithOwner("user ID"); + }, + failure: function(theGroup: KiiGroup, + anErrorString: String, + addMembersArray: KiiUser[], + removeMembersArray: KiiUser[]) { + } + }); } diff --git a/kii-cloud-sdk/kii-cloud-sdk.d.ts b/kii-cloud-sdk/kii-cloud-sdk.d.ts index 57c8f50b1..6f14d47bb 100644 --- a/kii-cloud-sdk/kii-cloud-sdk.d.ts +++ b/kii-cloud-sdk/kii-cloud-sdk.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kii Cloud SDK v2.3.0 +// Type definitions for Kii Cloud SDK v2.4.0 // Project: http://en.kii.com/ // Definitions by: Kii Consortium // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -83,6 +83,11 @@ declare module KiiCloud { */ _lot?: string; + /** + * product name given by thing vendor. + */ + _productName?: string; + /** * arbitrary string field. */ @@ -1028,6 +1033,65 @@ declare module KiiCloud { */ groupWithID(group: string): KiiGroup; + /** + * Register new group own by specified user on Kii Cloud with specified ID. + * This method can be used only by app admin. + * + *

If the group that has specified id already exists, registration will be failed. + * + * @param groupID ID of the KiiGroup + * @param groupName Name of the KiiGroup + * @param user id of owner + * @param members An array of KiiUser objects to add to the group + * @param callbacks + * + * @return return promise object. + *
    + *
  • fulfill callback function: function(theSavedGroup). theSavedGroup is KiiGroup instance.
  • + *
  • reject callback function: function(error). error is an Error instance. + *
      + *
    • error.target is the KiiGroup instance which this method was called on.
    • + *
    • error.message
    • + *
    • error.addMembersArray is array of KiiUser to be added as memebers of this group.
    • + *
    • error.removeMembersArray is array of KiiUser to be removed from the memebers list of this group.
    • + *
    + *
  • + *
+ * + * @example + * // example to use callbacks directly + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * var members = []; + * members.push(KiiUser.userWithID("Member User Id")); + * adminContext.registerGroupWithOwnerAndID("Group ID", "Group Name", "Owner User ID", members, { + * success: function(theSavedGroup) { + * // do something with the saved group + * }, + * failure: function(theGroup, anErrorString, addMembersArray, removeMembersArray) { + * // do something with the error response + * } + * }); + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + * // example to use Promise + * Kii.authenticateAsAppAdmin("client-id", "client-secret").then( + * function(adminContext) { + * var members = []; + * members.push(KiiUser.userWithID("Member User Id")); + * return adminContext.registerGroupWithOwnerAndID("Group ID", "Group Name", "Owner User ID", members); + * } + * ).then( + * function(group) { + * // do something with the saved group + * } + * ); + */ + registerGroupWithOwnerAndID(groupID: string, groupName: string, user: string, members: KiiUser[], callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise; + /** * Creates a reference to a group operated by app admin using group's URI. *

@@ -1362,7 +1426,7 @@ declare module KiiCloud { * Register user/group as owner of specified thing by app admin. * * @param thingID The ID of thing - * @param owner to be registered as owner. + * @param owner instnce of KiiUser/KiiGroup to be registered as owner. * @param callbacks object holds callback functions. * * @return return promise object. @@ -1415,7 +1479,7 @@ declare module KiiCloud { * Register user/group as owner of specified thing by app admin. * * @param vendorThingID The vendor thing ID of thing - * @param owner to be registered as owner. + * @param owner instance of KiiUser/KiiGroupd to be registered as owner. * @param callbacks object holds callback functions. * * @return return promise object. @@ -2205,6 +2269,58 @@ declare module KiiCloud { */ objectURI(): string; + /** + * Register new group own by current user on Kii Cloud with specified ID. + * + *

If the group that has specified id already exists, registration will be failed. + * + * @param groupID ID of the KiiGroup + * @param groupName Name of the KiiGroup + * @param members An array of KiiUser objects to add to the group + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
    + *
  • fulfill callback function: function(theSavedGroup). theSavedGroup is KiiGroup instance.
  • + *
  • reject callback function: function(error). error is an Error instance. + *
      + *
    • error.target is the KiiGroup instance which this method was called on.
    • + *
    • error.message
    • + *
    • error.addMembersArray is array of KiiUser to be added as memebers of this group.
    • + *
    • error.removeMembersArray is array of KiiUser to be removed from the memebers list of this group.
    • + *
    + *
  • + *
+ * + * @example + * // example to use callbacks directly + * var members = []; + * members.push(KiiUser.userWithID("Member User Id")); + * KiiGroup.registerGroupWithID("Group ID", "Group Name", members, { + * success: function(theSavedGroup) { + * // do something with the saved group + * }, + * failure: function(theGroup, anErrorString, addMembersArray, removeMembersArray) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var members = []; + * members.push(KiiUser.userWithID("Member User Id")); + * KiiGroup.registerGroupWithID("Group ID", "Group Name", members).then( + * function(theSavedGroup) { + * // do something with the saved group + * }, + * function(error) { + * var theGroup = error.target; + * var anErrorString = error.message; + * var addMembersArray = error.addMembersArray; + * // do something with the error response + * }); + */ + static registerGroupWithID(groupID: string, groupName: string, members: KiiUser[], callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise; + /** * Creates a reference to a bucket for this group * @@ -2420,6 +2536,65 @@ declare module KiiCloud { */ save(callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise; + /** + * Saves the latest group values to the server with specified owner. + * This method can be used only by the group owner or app admin. + * + *

If the group does not yet exist, it will be created. If the group already exists, the members and owner that have changed will be updated accordingly. If the group already exists and there is no updates of members and owner, it will allways succeed but does not execute update. To change the name of group, use {@link #changeGroupName}. + * + * @param user id of owner + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
    + *
  • fulfill callback function: function(theSavedGroup). theSavedGroup is KiiGroup instance.
  • + *
  • reject callback function: function(error). error is an Error instance. + *
      + *
    • error.target is the KiiGroup instance which this method was called on.
    • + *
    • error.message
    • + *
    • error.addMembersArray is array of KiiUser to be added as memebers of this group.
    • + *
    • error.removeMembersArray is array of KiiUser to be removed from the memebers list of this group.
    • + *
    + *
  • + *
+ * + * @example + * // example to use callbacks directly + * var group = . . .; // a KiiGroup + * group.saveWithOwner("UserID of owner", { + * success: function(theSavedGroup) { + * // do something with the saved group + * }, + * + * failure: function(theGroup, anErrorString, addMembersArray, removeMembersArray) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var group = . . .; // a KiiGroup + * group.saveWithOwner("UserID of owner", { + * success: function(theSavedGroup) { + * // do something with the saved group + * }, + * + * failure: function(theGroup, anErrorString, addMembersArray, removeMembersArray) { + * // do something with the error response + * } + * }).then( + * function(theSavedGroup) { + * // do something with the saved group + * }, + * function(error) { + * var theGroup = error.target; + * var anErrorString = error.message; + * var addMembersArray = error.addMembersArray; + * var removeMembersArray = error.removeMembersArray; + * // do something with the error response + * }); + */ + saveWithOwner(user: string, callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise; + /** * Updates the local group's data with the group data on the server * @@ -2735,14 +2910,14 @@ declare module KiiCloud { /** * Get the application-defined type name of the object * - * @return + * @return type of this object. null or undefined if none exists */ getObjectType(): string; /** * Get the body content-type. * It will be updated after the success of {@link KiiObject#uploadBody} and {@link KiiObject#downloadBody} - * returns null when this object doesn't have body content-type information. + * returns null or undefined when this object doesn't have body content-type information. * * @return content-type of object body */ @@ -2751,15 +2926,18 @@ declare module KiiCloud { /** * Sets a key/value pair to a KiiObject * - *

If the key already exists, its value will be written over. If the object is of invalid type, it will return false and a KiiError will be thrown (quietly). Accepted types are any JSON-encodable objects. + *

If the key already exists, its value will be written over. *
NOTE: Before involving floating point value, please consider using integer instead. For example, use percentage, permil, ppm, etc.
* The reason is: *
  • Will dramatically improve the performance of bucket query.
  • *
  • Bucket query does not support the mixed result of integer and floating point. * ex.) If you use same key for integer and floating point and inquire object with the integer value, objects which has floating point value with the key would not be evaluated in the query. (and vice versa)
  • * - * @param key The key to set. The key must not be a system key (created, metadata, modified, type, uuid) or begin with an underscore (_) - * @param value The value to be set. Object must be of a JSON-encodable type (Ex: dictionary, array, string, number, etc) + * @param key The key to set. + * if null, empty string or string prefixed with '_' is specified, silently ignored and have no effect. + * We don't check if actual type is String or not. If non-string type is specified, it will be encoded as key by JSON.stringify() + * @param value The value to be set. Object must be JSON-encodable type (dictionary, array, string, number, boolean) + * We don't check actual type of the value. It will be encoded as value by JSON.stringify() * * @example * var obj = . . .; // a KiiObject @@ -2772,7 +2950,7 @@ declare module KiiCloud { * * @param key The key to retrieve * - * @return The object associated with the key. null if none exists + * @return The object associated with the key. null or undefined if none exists * * @example * var obj = . . .; // a KiiObject @@ -4665,6 +4843,11 @@ declare module KiiCloud { * '_thingID', '_created', '_accessToken'
    * Following properties are readonly after creation and will be ignored on {@link #update} of thing.
    * '_vendorThingID', '_password'
    + * As Property prefixed with '_' is reserved by Kii Cloud, + * properties other than ones described in the parameter secion + * and '_layoutPosition' are ignored on creation/{@link #update} of thing.
    + * Those ignored properties won't be removed from fields object passed as argument. + * However it won't be reflected to fields object property of created/updated Thing. * * @param fields of the thing to be registered. * @param callbacks object holds callback functions. @@ -5007,7 +5190,7 @@ declare module KiiCloud { * API is authorized by app admin.
    * * @param thingID The ID of thing - * @param owner to be registered as owner. + * @param owner instance of KiiUser/KiiGroup to be registered as owner. * @param callbacks object holds callback functions. * * @return return promise object. @@ -5059,7 +5242,7 @@ declare module KiiCloud { * API is authorized by app admin.
    * * @param vendorThingID The vendor thing ID of thing - * @param owner to be registered as owner. + * @param owner instance of KiiUser/KiiGroup to be registered as owner. * @param callbacks object holds callback functions. * * @return return promise object. @@ -5850,7 +6033,7 @@ declare module KiiCloud { * * @param key The key to retrieve * - * @return The object associated with the key. null if none exists + * @return The object associated with the key. null or undefined if none exists * * @example * var user = . . .; // a KiiUser diff --git a/leaflet.fullscreen/leaflet.fullscreen-tests.ts b/leaflet.fullscreen/leaflet.fullscreen-tests.ts new file mode 100644 index 000000000..d74a19dcb --- /dev/null +++ b/leaflet.fullscreen/leaflet.fullscreen-tests.ts @@ -0,0 +1,23 @@ +/// + +var map: L.Map; + +// Defaults +var icon: L.Control.Fullscreen = L.control.fullscreen({ + position: 'topleft', + title: 'Full Screen', + titleCancel: 'Exit Full Screen', + forceSeparateButton: false, + forcePseudoFullscreen: false +}); + +icon.addTo(map); + + +// My Usage + +L.control.fullscreen({ + position: 'topleft', + content: '', + forceSeparateButton: true, +}).addTo(map); diff --git a/leaflet.fullscreen/leaflet.fullscreen.d.ts b/leaflet.fullscreen/leaflet.fullscreen.d.ts new file mode 100644 index 000000000..864817f22 --- /dev/null +++ b/leaflet.fullscreen/leaflet.fullscreen.d.ts @@ -0,0 +1,32 @@ +// Type definitions for Leaflet.fullscreen v1.3.0 +// Project: https://github.com/brunob/leaflet.fullscreen +// Definitions by: William Comartin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module L { + + namespace Control { + + export interface Fullscreen extends L.Control {} + + export interface FullscreenOptions { + content?: string, + position?: string, + title?: string, + titleCancel?: string, + forceSeparateButton?: boolean, + forcePseudoFullscreen?: boolean + } + } + + namespace control { + + /** + * Creates a fullscreen control. + */ + export function fullscreen(options?: Control.FullscreenOptions): L.Control.Fullscreen; + + } +} diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 77a20e2e2..4dfaa33f1 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -632,68 +632,179 @@ module TestFirst { result = _(list).first(); } -result = >_.flatten([[1, 2], [3, 4]]); -result = >_.flatten([[1, 2], [3, 4], 5, 6]); -result = >>>_.flatten([1, [2], [3, [[4]]]]); +// _.flatten +module TestFlatten { + { + let result: string[]; -result = >_.flatten([1, [2], [[3]]], true); -result = >_.flatten([1, [2], [3, [[4]]]], true); -result = >_.flatten([1, [2], [3, [[false]]]], true); + result = _.flatten('abc'); + } -result = <_.LoDashImplicitArrayWrapper>_([[1, 2], [3, 4], 5, 6]).flatten(); -result = <_.LoDashImplicitArrayWrapper>>>_([1, [2], [3, [[4]]]]).flatten(); + { + let result: number[]; -result = <_.LoDashImplicitArrayWrapper>_([1, [2], [3, [[4]]]]).flatten(true); + result = _.flatten([1, 2, 3]); + result = _.flatten([1, [2, 3]]); + result = _.flatten([1, [2, [3]]], true); + result = _.flatten([1, [2, [3]], [[4]]], true); + + result = _.flatten({0: 1, 1: 2, 2: 3, length: 3}); + result = _.flatten({0: 1, 1: [2, 3], length: 2}); + result = _.flatten({0: 1, 1: [2, [3]], length: 2}, true); + result = _.flatten({0: 1, 1: [2, [3]], 2: [[4]], length: 3}, true); + } + + { + let result: _.RecursiveArray; + + result = _.flatten([1, [2, [3]]]); + result = _.flatten([1, [2, [3]], [[4]]]); + + result = _.flatten({0: 1, 1: [2, [3]], length: 2}); + result = _.flatten({0: 1, 1: [2, [3]], 2: [[4]], length: 3}); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _('abc').flatten(); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _([1, 2, 3]).flatten(); + result = _([1, [2, 3]]).flatten(); + result = _([1, [2, [3]]]).flatten(true); + result = _([1, [2, [3]], [[4]]]).flatten(true); + + result = _({0: 1, 1: 2, 2: 3, length: 3}).flatten(); + result = _({0: 1, 1: [2, 3], length: 2}).flatten(); + result = _({0: 1, 1: [2, [3]], length: 2}).flatten(true); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flatten(true); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _([1, [2, [3]]]).flatten(); + result = _([1, [2, [3]], [[4]]]).flatten(); + + result = _({0: 1, 1: [2, [3]], length: 2}).flatten(); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flatten(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _('abc').chain().flatten(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _([1, 2, 3]).chain().flatten(); + result = _([1, [2, 3]]).chain().flatten(); + result = _([1, [2, [3]]]).chain().flatten(true); + result = _([1, [2, [3]], [[4]]]).chain().flatten(true); + + result = _({0: 1, 1: 2, 2: 3, length: 3}).chain().flatten(); + result = _({0: 1, 1: [2, 3], length: 2}).chain().flatten(); + result = _({0: 1, 1: [2, [3]], length: 2}).chain().flatten(true); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flatten(true); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _([1, [2, [3]]]).chain().flatten(); + result = _([1, [2, [3]], [[4]]]).chain().flatten(); + + result = _({0: 1, 1: [2, [3]], length: 2}).chain().flatten(); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flatten(); + } +} // _.flattenDeep module TestFlattenDeep { - interface RecursiveArray extends Array> {} - interface ListOfRecursiveArraysOrValues extends _.List> {} - interface RecursiveList extends _.List> { } - - let recursiveArray: RecursiveArray; - let listOfMaybeRecursiveArraysOrValues: ListOfRecursiveArraysOrValues; - let recursiveList: RecursiveList; - { - let result: TResult[]; + let result: string[]; - result = _.flattenDeep(recursiveArray); - result = _.flattenDeep(listOfMaybeRecursiveArraysOrValues); + result = _.flattenDeep('abc'); } { - let result: any[]; + let result: number[]; - result = _.flattenDeep(recursiveList); + result = _.flattenDeep([1, 2, 3]); + result = _.flattenDeep([1, [2, 3]]); + result = _.flattenDeep([1, [2, [3]]]); + result = _.flattenDeep([1, [2, [3]], [[4]]]); + + result = _.flattenDeep({0: 1, 1: 2, 2: 3, length: 3}); + result = _.flattenDeep({0: 1, 1: [2, 3], length: 2}); + result = _.flattenDeep({0: 1, 1: [2, [3]], length: 2}); + result = _.flattenDeep({0: 1, 1: [2, [3]], 2: [[4]], length: 3}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(recursiveArray).flattenDeep(); - - result = _(listOfMaybeRecursiveArraysOrValues).flattenDeep(); + result = _('abc').flattenDeep(); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(recursiveList).flattenDeep(); + result = _([1, 2, 3]).flattenDeep(); + result = _([1, [2, 3]]).flattenDeep(); + result = _([1, [2, [3]]]).flattenDeep(); + result = _([1, [2, [3]], [[4]]]).flattenDeep(); + + result = _({0: 1, 1: 2, 2: 3, length: 3}).flattenDeep(); + result = _({0: 1, 1: [2, 3], length: 2}).flattenDeep(); + result = _({0: 1, 1: [2, [3]], length: 2}).flattenDeep(); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flattenDeep(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(recursiveArray).chain().flattenDeep(); + result = _([1, [2, [3]]]).flattenDeep(); + result = _([1, [2, [3]], [[4]]]).flattenDeep(); - result = _(listOfMaybeRecursiveArraysOrValues).chain().flattenDeep(); + result = _({0: 1, 1: [2, [3]], length: 2}).flattenDeep(); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flattenDeep(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(recursiveList).chain().flattenDeep(); + result = _('abc').chain().flattenDeep(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _([1, 2, 3]).chain().flattenDeep(); + result = _([1, [2, 3]]).chain().flattenDeep(); + result = _([1, [2, [3]]]).chain().flattenDeep(); + result = _([1, [2, [3]], [[4]]]).chain().flattenDeep(); + + result = _({0: 1, 1: 2, 2: 3, length: 3}).chain().flattenDeep(); + result = _({0: 1, 1: [2, 3], length: 2}).chain().flattenDeep(); + result = _({0: 1, 1: [2, [3]], length: 2}).chain().flattenDeep(); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flattenDeep(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _([1, [2, [3]]]).chain().flattenDeep(); + result = _([1, [2, [3]], [[4]]]).chain().flattenDeep(); + + result = _({0: 1, 1: [2, [3]], length: 2}).chain().flattenDeep(); + result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flattenDeep(); } } @@ -3241,13 +3352,138 @@ module TestContains { } } -result = <_.Dictionary>_.countBy([4.3, 6.1, 6.4], function (num) { return Math.floor(num); }); -result = <_.Dictionary>_.countBy([4.3, 6.1, 6.4], function (num) { return this.floor(num); }, Math); -result = <_.Dictionary>_.countBy(['one', 'two', 'three'], 'length'); +// _.countBy +module TestCountBy { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; + let numericDictionary: _.NumericDictionary; -result = <_.LoDashImplicitObjectWrapper<_.Dictionary>>_([4.3, 6.1, 6.4]).countBy(function (num) { return Math.floor(num); }); -result = <_.LoDashImplicitObjectWrapper<_.Dictionary>>_([4.3, 6.1, 6.4]).countBy(function (num) { return this.floor(num); }, Math); -result = <_.LoDashImplicitObjectWrapper<_.Dictionary>>_(['one', 'two', 'three']).countBy('length'); + let stringIterator: (value: string, index: number, collection: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; + let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary) => any; + + { + let result: _.Dictionary; + + result = _.countBy(''); + result = _.countBy('', stringIterator); + result = _.countBy('', stringIterator, any); + + result = _.countBy(array); + result = _.countBy(array, listIterator); + result = _.countBy(array, listIterator, any); + result = _.countBy(array, ''); + result = _.countBy(array, '', any); + result = _.countBy<{a: number}, TResult>(array, {a: 42}); + result = _.countBy(array, {a: 42}); + + result = _.countBy(list); + result = _.countBy(list, listIterator); + result = _.countBy(list, listIterator, any); + result = _.countBy(list, ''); + result = _.countBy(list, '', any); + result = _.countBy<{a: number}, TResult>(list, {a: 42}); + result = _.countBy(list, {a: 42}); + + result = _.countBy(dictionary); + result = _.countBy(dictionary, dictionaryIterator); + result = _.countBy(dictionary, dictionaryIterator, any); + result = _.countBy(dictionary, ''); + result = _.countBy(dictionary, '', any); + result = _.countBy<{a: number}, TResult>(dictionary, {a: 42}); + result = _.countBy(dictionary, {a: 42}); + + result = _.countBy(numericDictionary); + result = _.countBy(numericDictionary, numericDictionaryIterator); + result = _.countBy(numericDictionary, numericDictionaryIterator, any); + result = _.countBy(numericDictionary, ''); + result = _.countBy(numericDictionary, '', any); + result = _.countBy<{a: number}, TResult>(numericDictionary, {a: 42}); + result = _.countBy(numericDictionary, {a: 42}); + } + + { + let resutl: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _('').countBy(); + result = _('').countBy(stringIterator); + result = _('').countBy(stringIterator, any); + + result = _(array).countBy(); + result = _(array).countBy(listIterator); + result = _(array).countBy(listIterator, any); + result = _(array).countBy(''); + result = _(array).countBy('', any); + result = _(array).countBy<{a: number}>({a: 42}); + result = _(array).countBy({a: 42}); + + result = _(list).countBy(); + result = _(list).countBy(listIterator); + result = _(list).countBy(listIterator, any); + result = _(list).countBy(''); + result = _(list).countBy('', any); + result = _(list).countBy<{a: number}>({a: 42}); + result = _(list).countBy({a: 42}); + + result = _(dictionary).countBy(); + result = _(dictionary).countBy(dictionaryIterator); + result = _(dictionary).countBy(dictionaryIterator, any); + result = _(dictionary).countBy(''); + result = _(dictionary).countBy('', any); + result = _(dictionary).countBy<{a: number}>({a: 42}); + result = _(dictionary).countBy({a: 42}); + + result = _(numericDictionary).countBy(); + result = _(numericDictionary).countBy(numericDictionaryIterator); + result = _(numericDictionary).countBy(numericDictionaryIterator, any); + result = _(numericDictionary).countBy(''); + result = _(numericDictionary).countBy('', any); + result = _(numericDictionary).countBy<{a: number}>({a: 42}); + result = _(numericDictionary).countBy({a: 42}); + } + + { + let resutl: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _('').chain().countBy(); + result = _('').chain().countBy(stringIterator); + result = _('').chain().countBy(stringIterator, any); + + result = _(array).chain().countBy(); + result = _(array).chain().countBy(listIterator); + result = _(array).chain().countBy(listIterator, any); + result = _(array).chain().countBy(''); + result = _(array).chain().countBy('', any); + result = _(array).chain().countBy<{a: number}>({a: 42}); + result = _(array).chain().countBy({a: 42}); + + result = _(list).chain().countBy(); + result = _(list).chain().countBy(listIterator); + result = _(list).chain().countBy(listIterator, any); + result = _(list).chain().countBy(''); + result = _(list).chain().countBy('', any); + result = _(list).chain().countBy<{a: number}>({a: 42}); + result = _(list).chain().countBy({a: 42}); + + result = _(dictionary).chain().countBy(); + result = _(dictionary).chain().countBy(dictionaryIterator); + result = _(dictionary).chain().countBy(dictionaryIterator, any); + result = _(dictionary).chain().countBy(''); + result = _(dictionary).chain().countBy('', any); + result = _(dictionary).chain().countBy<{a: number}>({a: 42}); + result = _(dictionary).chain().countBy({a: 42}); + + result = _(numericDictionary).chain().countBy(); + result = _(numericDictionary).chain().countBy(numericDictionaryIterator); + result = _(numericDictionary).chain().countBy(numericDictionaryIterator, any); + result = _(numericDictionary).chain().countBy(''); + result = _(numericDictionary).chain().countBy('', any); + result = _(numericDictionary).chain().countBy<{a: number}>({a: 42}); + result = _(numericDictionary).chain().countBy({a: 42}); + } +} // _.detect module TestDetect { @@ -4154,9 +4390,150 @@ module TestIncludes { } } -result = <_.Dictionary>_.indexBy(keys, 'dir'); -result = <_.Dictionary>_.indexBy(keys, function (key) { return String.fromCharCode(key.code); }); -result = <_.Dictionary>_.indexBy(keys, function (key) { this.fromCharCode(key.code); }, String); +// _.indexBy +module TestIndexBy { + type SampleObject = {a: number; b: string; c: boolean;}; + + let array: SampleObject[]; + let list: _.List; + let dictionary: _.Dictionary; + let numericDictionary: _.NumericDictionary; + + let stringIterator: (value: string, index: number, collection: string) => any; + let listIterator: (value: SampleObject, index: number, collection: _.List) => any; + let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary) => any; + let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary) => any; + + { + let result: _.Dictionary; + + result = _.indexBy('abcd'); + result = _.indexBy('abcd', stringIterator); + result = _.indexBy('abcd', stringIterator, any); + } + + { + let result: _.Dictionary; + + result = _.indexBy(array); + result = _.indexBy(array, listIterator); + result = _.indexBy(array, listIterator, any); + result = _.indexBy(array, 'a'); + result = _.indexBy(array, 'a', any); + result = _.indexBy<{a: number}, SampleObject>(array, {a: 42}); + result = _.indexBy(array, {a: 42}); + + result = _.indexBy(list); + result = _.indexBy(list, listIterator); + result = _.indexBy(list, listIterator, any); + result = _.indexBy(list, 'a'); + result = _.indexBy(list, 'a', any); + result = _.indexBy<{a: number}, SampleObject>(list, {a: 42}); + result = _.indexBy(list, {a: 42}); + + result = _.indexBy(numericDictionary); + result = _.indexBy(numericDictionary, numericDictionaryIterator); + result = _.indexBy(numericDictionary, numericDictionaryIterator, any); + result = _.indexBy(numericDictionary, 'a'); + result = _.indexBy(numericDictionary, 'a', any); + result = _.indexBy<{a: number}, SampleObject>(numericDictionary, {a: 42}); + result = _.indexBy(numericDictionary, {a: 42}); + + result = _.indexBy(dictionary); + result = _.indexBy(dictionary, dictionaryIterator); + result = _.indexBy(dictionary, dictionaryIterator, any); + result = _.indexBy(dictionary, 'a'); + result = _.indexBy(dictionary, 'a', any); + result = _.indexBy<{a: number}, SampleObject>(dictionary, {a: 42}); + result = _.indexBy(dictionary, {a: 42}); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _('abcd').indexBy(); + result = _('abcd').indexBy(stringIterator); + result = _('abcd').indexBy(stringIterator, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(array).indexBy(); + result = _(array).indexBy(listIterator); + result = _(array).indexBy(listIterator, any); + result = _(array).indexBy('a'); + result = _(array).indexBy('a', any); + result = _(array).indexBy<{a: number}>({a: 42}); + + result = _(list).indexBy(); + result = _(list).indexBy(listIterator); + result = _(list).indexBy(listIterator, any); + result = _(list).indexBy('a'); + result = _(list).indexBy('a', any); + result = _(list).indexBy<{a: number}, SampleObject>({a: 42}); + result = _(list).indexBy({a: 42}); + + result = _(numericDictionary).indexBy(); + result = _(numericDictionary).indexBy(numericDictionaryIterator); + result = _(numericDictionary).indexBy(numericDictionaryIterator, any); + result = _(numericDictionary).indexBy('a'); + result = _(numericDictionary).indexBy('a', any); + result = _(numericDictionary).indexBy<{a: number}, SampleObject>({a: 42}); + result = _(numericDictionary).indexBy({a: 42}); + + result = _(dictionary).indexBy(); + result = _(dictionary).indexBy(dictionaryIterator); + result = _(dictionary).indexBy(dictionaryIterator, any); + result = _(dictionary).indexBy('a'); + result = _(dictionary).indexBy('a', any); + result = _(dictionary).indexBy<{a: number}, SampleObject>({a: 42}); + result = _(dictionary).indexBy({a: 42}); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _('abcd').chain().indexBy(); + result = _('abcd').chain().indexBy(stringIterator); + result = _('abcd').chain().indexBy(stringIterator, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(array).chain().indexBy(); + result = _(array).chain().indexBy(listIterator); + result = _(array).chain().indexBy(listIterator, any); + result = _(array).chain().indexBy('a'); + result = _(array).chain().indexBy('a', any); + result = _(array).chain().indexBy<{a: number}>({a: 42}); + + result = _(list).chain().indexBy(); + result = _(list).chain().indexBy(listIterator); + result = _(list).chain().indexBy(listIterator, any); + result = _(list).chain().indexBy('a'); + result = _(list).chain().indexBy('a', any); + result = _(list).chain().indexBy<{a: number}, SampleObject>({a: 42}); + result = _(list).chain().indexBy({a: 42}); + + result = _(numericDictionary).chain().indexBy(); + result = _(numericDictionary).chain().indexBy(numericDictionaryIterator); + result = _(numericDictionary).chain().indexBy(numericDictionaryIterator, any); + result = _(numericDictionary).chain().indexBy('a'); + result = _(numericDictionary).chain().indexBy('a', any); + result = _(numericDictionary).chain().indexBy<{a: number}, SampleObject>({a: 42}); + result = _(numericDictionary).chain().indexBy({a: 42}); + + result = _(dictionary).chain().indexBy(); + result = _(dictionary).chain().indexBy(dictionaryIterator); + result = _(dictionary).chain().indexBy(dictionaryIterator, any); + result = _(dictionary).chain().indexBy('a'); + result = _(dictionary).chain().indexBy('a', any); + result = _(dictionary).chain().indexBy<{a: number}, SampleObject>({a: 42}); + result = _(dictionary).chain().indexBy({a: 42}); + } +} result = _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); result = _.invoke([123, 456], String.prototype.split, ''); @@ -4857,18 +5234,98 @@ result = _.sortByAll(stoogesAges, function(stooge) { return Math. result = _.sortByAll(stoogesAges, ['name', 'age']); result = _.sortByAll(stoogesAges, 'name', function(stooge) { return Math.sin(stooge.age); }); -result = _.sortByOrder(stoogesAges, [function(stooge) { return Math.sin(stooge.age); }, function(stooge) { return stooge.name.slice(1); }]); -result = _.sortByOrder(stoogesAges, ['name', 'age']); -result = _.sortByOrder(stoogesAges, ['name', function(stooge) { return Math.sin(stooge.age); }]); -result = _.sortByOrder(stoogesAges, [function(stooge) { return Math.sin(stooge.age); }, function(stooge) { return stooge.name.slice(1); }], ['asc', 'desc']); -result = _.sortByOrder(stoogesAges, ['name', 'age'], ['asc', 'desc']); -result = _.sortByOrder(stoogesAges, ['name', function(stooge) { return Math.sin(stooge.age); }], ['asc', 'desc']); -result = _.sortByOrder(stoogesAges, [function(stooge) { return Math.sin(stooge.age); }, function(stooge) { return stooge.name.slice(1); }], [true, false]); -result = _.sortByOrder(stoogesAges, ['name', 'age'], [true, false]); -result = _.sortByOrder(stoogesAges, ['name', function(stooge) { return Math.sin(stooge.age); }], [true, false]); - result = _(foodsOrganic).sortByAll('organic', (food) => food.name, { organic: true }).value(); +// _.sortByOrder +module TestSortByOrder { + type SampleObject = {a: number; b: string; c: boolean}; + + let array: SampleObject[]; + let list: _.List; + let numericDictionary: _.NumericDictionary; + let dictionary: _.Dictionary; + let orders: boolean|string|(boolean|string)[]; + + { + let iteratees: (value: string) => any|((value: string) => any)[]; + let result: string[]; + + result = _.sortByOrder('acbd', iteratees); + result = _.sortByOrder('acbd', iteratees, orders); + } + + { + let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[]; + let result: SampleObject[]; + + result = _.sortByOrder<{a: number}, SampleObject>(array, iteratees); + result = _.sortByOrder<{a: number}, SampleObject>(array, iteratees, orders); + result = _.sortByOrder(array, iteratees); + result = _.sortByOrder(array, iteratees, orders); + + result = _.sortByOrder<{a: number}, SampleObject>(list, iteratees); + result = _.sortByOrder<{a: number}, SampleObject>(list, iteratees, orders); + result = _.sortByOrder(list, iteratees); + result = _.sortByOrder(list, iteratees, orders); + + result = _.sortByOrder<{a: number}, SampleObject>(numericDictionary, iteratees); + result = _.sortByOrder<{a: number}, SampleObject>(numericDictionary, iteratees, orders); + result = _.sortByOrder(numericDictionary, iteratees); + result = _.sortByOrder(numericDictionary, iteratees, orders); + + result = _.sortByOrder<{a: number}, SampleObject>(dictionary, iteratees); + result = _.sortByOrder<{a: number}, SampleObject>(dictionary, iteratees, orders); + result = _.sortByOrder(dictionary, iteratees); + result = _.sortByOrder(dictionary, iteratees, orders); + } + + { + let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[]; + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).sortByOrder<{a: number}>(iteratees); + result = _(array).sortByOrder<{a: number}>(iteratees, orders); + + result = _(list).sortByOrder<{a: number}, SampleObject>(iteratees); + result = _(list).sortByOrder<{a: number}, SampleObject>(iteratees, orders); + result = _(list).sortByOrder(iteratees); + result = _(list).sortByOrder(iteratees, orders); + + result = _(numericDictionary).sortByOrder<{a: number}, SampleObject>(iteratees); + result = _(numericDictionary).sortByOrder<{a: number}, SampleObject>(iteratees, orders); + result = _(numericDictionary).sortByOrder(iteratees); + result = _(numericDictionary).sortByOrder(iteratees, orders); + + result = _(dictionary).sortByOrder<{a: number}, SampleObject>(iteratees); + result = _(dictionary).sortByOrder<{a: number}, SampleObject>(iteratees, orders); + result = _(dictionary).sortByOrder(iteratees); + result = _(dictionary).sortByOrder(iteratees, orders); + } + + { + let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[]; + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().sortByOrder<{a: number}>(iteratees); + result = _(array).chain().sortByOrder<{a: number}>(iteratees, orders); + + result = _(list).chain().sortByOrder<{a: number}, SampleObject>(iteratees); + result = _(list).chain().sortByOrder<{a: number}, SampleObject>(iteratees, orders); + result = _(list).chain().sortByOrder(iteratees); + result = _(list).chain().sortByOrder(iteratees, orders); + + result = _(numericDictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees); + result = _(numericDictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees, orders); + result = _(numericDictionary).chain().sortByOrder(iteratees); + result = _(numericDictionary).chain().sortByOrder(iteratees, orders); + + result = _(dictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees); + result = _(dictionary).chain().sortByOrder<{a: number}, SampleObject>(iteratees, orders); + result = _(dictionary).chain().sortByOrder(iteratees); + result = _(dictionary).chain().sortByOrder(iteratees, orders); + } +} + result = _.where(stoogesCombined, { 'age': 40 }); result = _.where(stoogesCombined, { 'quotes': ['Poifect!'] }); @@ -5016,16 +5473,87 @@ module TestBefore { } } -var funcBind = function(greeting: string, punctuation: string) { return greeting + ' ' + this.user + punctuation; }; -var funcBound1: (punctuation: string) => any = _.bind(funcBind, { 'name': 'moe' }, 'hi'); -funcBound1('!'); +// _.bind +module TestBind { + type SampleFunc = (a: number, b: string) => boolean; -var funcBound2: (punctuation: string) => any = _(funcBind).bind({ 'name': 'moe' }, 'hi').value(); -funcBound2('!'); + let func: SampleFunc -var addTwoNumbers = function (x: number, y: number) { return x + y }; -var plusTwo = _.bind(addTwoNumbers, null, 2); -plusTwo(100); + { + type SampleResult = (a: number, b: string) => boolean; + + let result: SampleResult; + + result = _.bind(func, any); + result = _.bind(func, any); + } + + { + type SampleResult = (b: string) => boolean; + + let result: SampleResult; + + result = _.bind(func, any, 42); + result = _.bind(func, any, 42); + } + + { + type SampleResult = () => boolean; + + let result: SampleResult; + + result = _.bind(func, any, 42, ''); + result = _.bind(func, any, 42, ''); + } + + { + type SampleResult = (a: number, b: string) => boolean; + + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).bind(any); + } + + { + type SampleResult = (b: string) => boolean; + + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).bind(any, 42); + } + + { + type SampleResult = () => boolean; + + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).bind(any, 42, ''); + } + + { + type SampleResult = (a: number, b: string) => boolean; + + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().bind(any); + } + + { + type SampleResult = (b: string) => boolean; + + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().bind(any, 42); + } + + { + type SampleResult = () => boolean; + + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().bind(any, 42, ''); + } +} // _.bindAll module TestBindAll { @@ -5065,24 +5593,87 @@ module TestBindAll { } } -var objectBindKey = { - 'name': 'moe', - 'greet': function (greeting: string) { - return greeting + ' ' + this.name; +// _.bindKey +module TestBindKey { + let object: { + foo: (a: number, b: string) => boolean; } -}; -var funcBindKey: Function = _.bindKey(objectBindKey, 'greet', 'hi'); -funcBindKey(); + { + type SampleResult = (a: number, b: string) => boolean; -objectBindKey.greet = function (greeting) { - return greeting + ', ' + this.name + '!'; -}; + let result: SampleResult; -funcBindKey(); + result = _.bindKey(object, 'foo'); + result = _.bindKey(object, 'foo'); + } -funcBindKey = _(objectBindKey).bindKey('greet', 'hi').value(); -funcBindKey(); + { + type SampleResult = (b: string) => boolean; + + let result: SampleResult; + + result = _.bindKey(object, 'foo', 42); + result = _.bindKey(object, 'foo', 42); + } + + { + type SampleResult = () => boolean; + + let result: SampleResult; + + result = _.bindKey(object, 'foo', 42, ''); + result = _.bindKey(object, 'foo', 42, ''); + } + + { + type SampleResult = (a: number, b: string) => boolean; + + let result: _.LoDashImplicitObjectWrapper; + + result = _(object).bindKey('foo'); + } + + { + type SampleResult = (b: string) => boolean; + + let result: _.LoDashImplicitObjectWrapper; + + result = _(object).bindKey('foo', 42); + } + + { + type SampleResult = () => boolean; + + let result: _.LoDashImplicitObjectWrapper; + + result = _(object).bindKey('foo', 42, ''); + } + + { + type SampleResult = (a: number, b: string) => boolean; + + let result: _.LoDashExplicitObjectWrapper; + + result = _(object).chain().bindKey('foo'); + } + + { + type SampleResult = (b: string) => boolean; + + let result: _.LoDashExplicitObjectWrapper; + + result = _(object).chain().bindKey('foo', 42); + } + + { + type SampleResult = () => boolean; + + let result: _.LoDashExplicitObjectWrapper; + + result = _(object).chain().bindKey('foo', 42, ''); + } +} // _.compose module TestCompose { @@ -5525,12 +6116,31 @@ module TestRestParam { } //_.spread -var testSpreadFn = (who: string, what: string) => who + ' says ' + what; -interface TestSpreadResultFn { - (args: string[]): string; +module TestSpread { + type SampleFunc = (args: (number|string)[]) => boolean; + type SampleResult = (a: number, b: string) => boolean; + + let func: SampleFunc; + + { + let result: SampleResult; + + result = _.spread(func); + result = _.spread(func); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).spread(); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().spread(); + } } -result = (_.spread(testSpreadFn))(['fred', 'hello']); -result = (_(testSpreadFn).spread().value())(['fred', 'hello']); // _.throttle module TestThrottle { @@ -5576,11 +6186,89 @@ module TestThrottle { } } -var helloWrap = function (name: string) { return 'hello ' + name; }; -var helloWrap2 = _.wrap(helloWrap, function (func) { - return 'before, ' + func('moe') + ', after'; -}); -helloWrap2(); +// _.wrap +module TestWrap { + type SampleValue = {a: number; b: string; c: boolean} + type SampleResult = (arg2: number, arg3: string) => boolean; + + { + type SampleWrapper = (arg1: SampleValue, arg2: number, arg3: string) => boolean; + + let value: SampleValue; + let wrapper: SampleWrapper; + let result: SampleResult; + + result = _.wrap(value, wrapper); + result = _.wrap(value, wrapper); + result = _.wrap(value, wrapper); + } + + { + type SampleWrapper = (arg1: number, arg2: number, arg3: string) => boolean; + + let value: number; + let wrapper: SampleWrapper; + let result: _.LoDashImplicitObjectWrapper; + + result = _(value).wrap(wrapper); + result = _(value).wrap(wrapper); + } + + { + type SampleWrapper = (arg1: number[], arg2: number, arg3: string) => boolean; + + let value: number[]; + let wrapper: SampleWrapper; + let result: _.LoDashImplicitObjectWrapper; + + result = _(value).wrap(wrapper); + result = _(value).wrap(wrapper); + } + + { + type SampleWrapper = (arg1: SampleValue, arg2: number, arg3: string) => boolean; + + let value: SampleValue; + let wrapper: SampleWrapper; + let result: _.LoDashImplicitObjectWrapper; + + result = _(value).wrap(wrapper); + result = _(value).wrap(wrapper); + } + + { + type SampleWrapper = (arg1: number, arg2: number, arg3: string) => boolean; + + let value: number; + let wrapper: SampleWrapper; + let result: _.LoDashExplicitObjectWrapper; + + result = _(value).chain().wrap(wrapper); + result = _(value).chain().wrap(wrapper); + } + + { + type SampleWrapper = (arg1: number[], arg2: number, arg3: string) => boolean; + + let value: number[]; + let wrapper: SampleWrapper; + let result: _.LoDashExplicitObjectWrapper; + + result = _(value).chain().wrap(wrapper); + result = _(value).chain().wrap(wrapper); + } + + { + type SampleWrapper = (arg1: SampleValue, arg2: number, arg3: string) => boolean; + + let value: SampleValue; + let wrapper: SampleWrapper; + let result: _.LoDashExplicitObjectWrapper; + + result = _(value).chain().wrap(wrapper); + result = _(value).chain().wrap(wrapper); + } +} /******** * Lang * @@ -5736,21 +6424,34 @@ module TestGte { } // _.isArguments -result = _.isArguments(any); -result = _(1).isArguments(); -result = _([]).isArguments(); -result = _({}).isArguments(); -{ - let value: IArguments|number = 42; - if (_.isArguments(value)) { - let length: number = value.length; - // compile error - // let i: number = value + 1; - } else { - let i: number = value + 1; - // compile error - // let length: number = value.length; - } +module TestisArguments { + { + let value: number|IArguments; + + if (_.isArguments(value)) { + let result: IArguments = value; + } + else { + let result: number = value; + } + } + + { + let result: boolean; + + result = _.isArguments(any); + result = _(1).isArguments(); + result = _([]).isArguments(); + result = _({}).isArguments(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isArguments(); + result = _([]).chain().isArguments(); + result = _({}).chain().isArguments(); + } } // _.isArray @@ -5906,17 +6607,47 @@ module TestIsEqual { } // _.isError -result = _.isError(any); -result = _(1).isError(); -result = _([]).isError(); -result = _({}).isError(); -{ - let value: Error|string = "error"; - if (_.isError(value)) { - let message: string = value.message; - } else { - let message: string = value; - } +module TestIsError { + { + let value: number|Error; + + if (_.isError(value)) { + let result: Error = value; + } + else { + let result: number = value; + } + } + + { + class CustomError extends Error {} + + let value: number|CustomError; + + if (_.isError(value)) { + let result: CustomError = value; + } + else { + let result: number = value; + } + } + + { + let result: boolean; + + result = _.isError(any); + result = _(1).isError(); + result = _([]).isError(); + result = _({}).isError(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isError(); + result = _([]).chain().isError(); + result = _({}).chain().isError(); + } } // _.isFinite @@ -6106,10 +6837,24 @@ module TestIsObject { } // _.isPlainObject -result = _.isPlainObject(any); -result = _(1).isPlainObject(); -result = _([]).isPlainObject(); -result = _({}).isPlainObject(); +module TestIsPlainObject { + { + let result: boolean; + + result = _.isPlainObject(any); + result = _(1).isPlainObject(); + result = _([]).isPlainObject(); + result = _({}).isPlainObject(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isPlainObject(); + result = _([]).chain().isPlainObject(); + result = _({}).chain().isPlainObject(); + } +} // _.isRegExp module TestIsRegExp { @@ -6255,15 +7000,13 @@ module TestToArray { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; + let numericDictionary: _.NumericDictionary; { let result: string[]; + result = _.toArray(''); result = _.toArray(''); - - result = (function (a: string) {return _.toArray(arguments);})(''); - - result = _((function (a: string) {return arguments;})('')).toArray().value(); } { @@ -6272,22 +7015,38 @@ module TestToArray { result = _.toArray(array); result = _.toArray(list); result = _.toArray(dictionary); + result = _.toArray(numericDictionary); - result = _(array).toArray().value(); - result = _(list).toArray().value(); - result = _(dictionary).toArray().value(); + result = _.toArray(array); + result = _.toArray(list); + result = _.toArray(dictionary); + result = _.toArray(numericDictionary); } { let result: any[]; result = _.toArray(); - result = _.toArray(42); - result = _.toArray(true); + result = _.toArray(42); + result = _.toArray(true); + } - result = _('').toArray().value(); - result = _(42).toArray().value(); - result = _(true).toArray().value(); + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).toArray(); + result = _(list).toArray(); + result = _(dictionary).toArray(); + result = _(numericDictionary).toArray(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().toArray(); + result = _(list).chain().toArray(); + result = _(dictionary).chain().toArray(); + result = _(numericDictionary).chain().toArray(); } } @@ -6774,23 +7533,34 @@ module TestAssign { } // _.create -interface TestCreateProto { - a: number; +module TestCreate { + type SampleProto = {a: number}; + type SampleProps = {b: string}; + + let prototype: SampleProto; + let properties: SampleProps; + + { + let result: {a: number; b: string}; + + result = _.create(prototype, properties); + result = _.create(prototype, properties); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: number; b: string}>; + + result = _(prototype).create(properties); + result = _(prototype).create(properties); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: number; b: string}>; + + result = _(prototype).chain().create(properties); + result = _(prototype).chain().create(properties); + } } -interface TestCreateProps { - b: string; -} -interface TestCreateTResult extends TestCreateProto, TestCreateProps {} -var testCreateProto: TestCreateProto; -var testCreateProps: TestCreateProps; -result = <{}>_.create(testCreateProto); -result = <{}>_.create(testCreateProto, testCreateProps); -result = _.create(testCreateProto); -result = _.create(testCreateProto, testCreateProps); -result = <{}>_(testCreateProto).create().value(); -result = <{}>_(testCreateProto).create(testCreateProps).value(); -result = _(testCreateProto).create().value(); -result = _(testCreateProto).create(testCreateProps).value(); // _.defaults module TestDefaults { @@ -7618,48 +8388,96 @@ module TestMapKeys { // _.merge module TestMerge { - let customizer: (value: any, srcValue: any, key?: string, object?: {}, source?: {}) => any; - let result: TResult; + type InitialValue = { a : number }; + type MergingValue = { b : string }; - result = _.merge<{}, {}, TResult>({}, {}); - result = _.merge<{}, {}, TResult>({}, {}, customizer); - result = _.merge<{}, {}, TResult>({}, {}, customizer, any); + var initialValue = { a : 1 }; + var mergingValue = { b : "hi" }; - result = _.merge<{}, {}, {}, TResult>({}, {}, {}); - result = _.merge<{}, {}, {}, TResult>({}, {}, {}, customizer); - result = _.merge<{}, {}, {}, TResult>({}, {}, {}, customizer, any); + type ExpectedResult = { a: number, b: string }; + let result: ExpectedResult; - result = _.merge<{}, {}, {}, {}, TResult>({}, {}, {}, {}); - result = _.merge<{}, {}, {}, {}, TResult>({}, {}, {}, {}, customizer); - result = _.merge<{}, {}, {}, {}, TResult>({}, {}, {}, {}, customizer, any); + let customizer: (value: any, srcValue: any, key?: string, object?: InitialValue, source?: MergingValue) => any; - result = _.merge<{}, {}, {}, {}, {}, TResult>({}, {}, {}, {}, {}); - result = _.merge<{}, {}, {}, {}, {}, TResult>({}, {}, {}, {}, {}, customizer); - result = _.merge<{}, {}, {}, {}, {}, TResult>({}, {}, {}, {}, {}, customizer, any); + // Test for basic merging - result = _.merge<{}, TResult>({}, {}, {}, {}, {}, {}); - result = _.merge<{}, TResult>({}, {}, {}, {}, {}, {}, customizer); - result = _.merge<{}, TResult>({}, {}, {}, {}, {}, {}, customizer, any); + result = _.merge(initialValue, mergingValue); + result = _.merge(initialValue, mergingValue, customizer); + result = _.merge(initialValue, mergingValue, customizer, any); - result = _({}).merge<{}, TResult>({}).value(); - result = _({}).merge<{}, TResult>({}, customizer).value(); - result = _({}).merge<{}, TResult>({}, customizer, any).value(); + result = _.merge(initialValue, {}, mergingValue); + result = _.merge(initialValue, {}, mergingValue, customizer); + result = _.merge(initialValue, {}, mergingValue, customizer, any); - result = _({}).merge<{}, {}, TResult>({}, {}).value(); - result = _({}).merge<{}, {}, TResult>({}, {}, customizer).value(); - result = _({}).merge<{}, {}, TResult>({}, {}, customizer, any).value(); + result = _.merge(initialValue, {}, {}, mergingValue); + result = _.merge(initialValue, {}, {}, mergingValue, customizer); + result = _.merge(initialValue, {}, {}, mergingValue, customizer, any); - result = _({}).merge<{}, {}, {}, TResult>({}, {}, {}).value(); - result = _({}).merge<{}, {}, {}, TResult>({}, {}, {}, customizer).value(); - result = _({}).merge<{}, {}, {}, TResult>({}, {}, {}, customizer, any).value(); + result = _.merge(initialValue, {}, {}, {}, mergingValue); + result = _.merge(initialValue, {}, {}, {}, mergingValue, customizer); + result = _.merge(initialValue, {}, {}, {}, mergingValue, customizer, any); - result = _({}).merge<{}, {}, {}, {}, TResult>({}, {}, {}, {}).value(); - result = _({}).merge<{}, {}, {}, {}, TResult>({}, {}, {}, {}, customizer).value(); - result = _({}).merge<{}, {}, {}, {}, TResult>({}, {}, {}, {}, customizer, any).value(); + // Once we get to the varargs version, you have to specify the result explicitly + result = _.merge(initialValue, {}, {}, {}, {}, mergingValue); + result = _.merge(initialValue, {}, {}, {}, {}, mergingValue, customizer); + result = _.merge(initialValue, {}, {}, {}, {}, mergingValue, customizer, any); + + // Test for multiple combinations of many types + + type ComplicatedExpectedType = { a: number, b: string, c: {}, d: number[], e: boolean }; + + var complicatedResult: ComplicatedExpectedType = _.merge({ a: 1 }, + { b: "string" }, + { c: {} }, + { d: [1] }, + { e: true }); + // Test for type overriding + + type ExpectedTypeAfterOverriding = { a: boolean }; + + var overriddenResult: ExpectedTypeAfterOverriding = _.merge({ a: 1 }, + { a: "string" }, + { a: {} }, + { a: [1] }, + { a: true }); + + // Tests for basic chaining with merge + + result = _(initialValue).merge(mergingValue).value(); + result = _(initialValue).merge(mergingValue, customizer).value(); + result = _(initialValue).merge(mergingValue, customizer, any).value(); + + result = _(initialValue).merge({}, mergingValue).value(); + result = _(initialValue).merge({}, mergingValue, customizer).value(); + result = _(initialValue).merge({}, mergingValue, customizer, any).value(); + + result = _(initialValue).merge({}, {}, mergingValue).value(); + result = _(initialValue).merge({}, {}, mergingValue, customizer).value(); + result = _(initialValue).merge({}, {}, mergingValue, customizer, any).value(); + + result = _(initialValue).merge({}, {}, {}, mergingValue).value(); + result = _(initialValue).merge({}, {}, {}, mergingValue, customizer).value(); + result = _(initialValue).merge({}, {}, {}, mergingValue, customizer, any).value(); + + // Once we get to the varargs version, you have to specify the result explicitly + result = _(initialValue).merge({}, {}, {}, {}, mergingValue).value(); + result = _(initialValue).merge({}, {}, {}, {}, mergingValue, customizer).value(); + result = _(initialValue).merge({}, {}, {}, {}, mergingValue, customizer, any).value(); + + // Test complex multiple combinations with chaining + + var complicatedResult: ComplicatedExpectedType = _({ a: 1 }).merge({ b: "string" }, + { c: {} }, + { d: [1] }, + { e: true }).value(); + + // Test for type overriding with chaining + + var overriddenResult: ExpectedTypeAfterOverriding = _({ a: 1 }).merge({ a: "string" }, + { a: {} }, + { a: [1] }, + { a: true }).value(); - result = _({}).merge({}, {}, {}, {}, {}).value(); - result = _({}).merge({}, {}, {}, {}, {}, customizer).value(); - result = _({}).merge({}, {}, {}, {}, {}, customizer, any).value(); } // _.methods diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c45ec90ee..5f0c07777 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1138,47 +1138,72 @@ declare module _ { first(): TResult; } - interface MaybeNestedList extends List> { } - interface RecursiveArray extends Array> { } - interface ListOfRecursiveArraysOrValues extends List> { } - interface RecursiveList extends List> { } + interface RecursiveArray extends Array> {} + interface ListOfRecursiveArraysOrValues extends List> {} //_.flatten interface LoDashStatic { /** - * Flattens a nested array a single level. - * - * _.flatten(x) is equivalent to _.flatten(x, false); - * - * @param array The array to flatten. - * @return `array` flattened. - **/ - flatten(array: MaybeNestedList): T[]; - - /** - * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it is only + * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only * flattened a single level. * - * If you know whether or not this should be recursively at compile time, you typically want to use a - * version without a boolean parameter (i.e. `_.flatten(x)` or `_.flattenDeep(x)`). - * * @param array The array to flatten. - * @param deep Specify a deep flatten. - * @return `array` flattened. - **/ - flatten(array: RecursiveList, isDeep: boolean): List | RecursiveList; + * @param isDeep Specify a deep flatten. + * @return Returns the new flattened array. + */ + flatten(array: ListOfRecursiveArraysOrValues, isDeep: boolean): T[]; + + /** + * @see _.flatten + */ + flatten(array: List): T[]; + + /** + * @see _.flatten + */ + flatten(array: ListOfRecursiveArraysOrValues): RecursiveArray; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatten + */ + flatten(): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { /** * @see _.flatten - **/ - flatten(): LoDashImplicitArrayWrapper; + */ + flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; + } + interface LoDashImplicitObjectWrapper { /** * @see _.flatten - **/ - flatten(isShallow: boolean): LoDashImplicitArrayWrapper; + */ + flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatten + */ + flatten(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.flatten + */ + flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flatten + */ + flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; } //_.flattenDeep @@ -1189,17 +1214,14 @@ declare module _ { * @param array The array to recursively flatten. * @return Returns the new flattened array. */ - flattenDeep(array: RecursiveArray): T[]; - - /** - * @see _.flattenDeep - */ flattenDeep(array: ListOfRecursiveArraysOrValues): T[]; + } + interface LoDashImplicitWrapper { /** * @see _.flattenDeep */ - flattenDeep(array: RecursiveList): any[]; + flattenDeep(): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { @@ -1216,6 +1238,13 @@ declare module _ { flattenDeep(): LoDashImplicitArrayWrapper; } + interface LoDashExplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashExplicitArrayWrapper; + } + interface LoDashExplicitArrayWrapper { /** * @see _.flattenDeep @@ -4913,87 +4942,193 @@ declare module _ { //_.countBy interface LoDashStatic { /** - * Creates an object composed of keys generated from the results of running each element - * of collection through the callback. The corresponding value of each key is the number - * of times the key was returned by the callback. The callback is bound to thisArg and - * invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for callback the created "_.pluck" style callback will - * return the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will return - * true for elements that have the properties of the given object, else false. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return Returns the composed aggregate object. - **/ - countBy( - collection: Array, - callback?: ListIterator, - thisArg?: any): Dictionary; - - /** - * @see _.countBy - * @param callback Function name - **/ + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The + * iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ countBy( collection: List, - callback?: ListIterator, - thisArg?: any): Dictionary; + iteratee?: ListIterator, + thisArg?: any + ): Dictionary; /** - * @see _.countBy - * @param callback Function name - **/ + * @see _.countBy + */ countBy( collection: Dictionary, - callback?: DictionaryIterator, - thisArg?: any): Dictionary; + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.countBy - * @param callback Function name - **/ + * @see _.countBy + */ countBy( - collection: Array, - callback: string, - thisArg?: any): Dictionary; + collection: NumericDictionary, + iteratee?: NumericDictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.countBy - * @param callback Function name - **/ + * @see _.countBy + */ countBy( - collection: List, - callback: string, - thisArg?: any): Dictionary; + collection: List|Dictionary|NumericDictionary, + iteratee?: string, + thisArg?: any + ): Dictionary; /** - * @see _.countBy - * @param callback Function name - **/ + * @see _.countBy + */ + countBy( + collection: List|Dictionary|NumericDictionary, + iteratee?: W + ): Dictionary; + + /** + * @see _.countBy + */ countBy( - collection: Dictionary, - callback: string, - thisArg?: any): Dictionary; + collection: List|Dictionary|NumericDictionary, + iteratee?: Object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; } interface LoDashImplicitArrayWrapper { /** - * @see _.countBy - **/ + * @see _.countBy + */ countBy( - callback?: ListIterator, - thisArg?: any): LoDashImplicitObjectWrapper>; + iteratee?: ListIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; /** - * @see _.countBy - * @param callback Function name - **/ + * @see _.countBy + */ countBy( - callback: string, - thisArg?: any): LoDashImplicitObjectWrapper>; + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; } //_.detect @@ -6575,65 +6710,207 @@ declare module _ { //_.indexBy interface LoDashStatic { /** - * Creates an object composed of keys generated from the results of running each element - * of the collection through the given callback. The corresponding value of each key is - * the last element responsible for generating the key. The callback is bound to thisArg - * and invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for callback the created "_.pluck" style callback will - * return the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will return - * true for elements that have the properties of the given object, else false. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return Returns the composed aggregate object. - **/ - indexBy( - list: Array, - iterator: ListIterator, - context?: any): Dictionary; - - /** - * @see _.indexBy - **/ - indexBy( - list: List, - iterator: ListIterator, - context?: any): Dictionary; - - /** - * @see _.indexBy - * @param pluckValue _.pluck style callback - **/ - indexBy( - collection: Array, - pluckValue: string): Dictionary; - - /** - * @see _.indexBy - * @param pluckValue _.pluck style callback - **/ + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the last element responsible for generating the key. The + * iteratee function is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ indexBy( collection: List, - pluckValue: string): Dictionary; + iteratee?: ListIterator, + thisArg?: any + ): Dictionary; /** - * @see _.indexBy - * @param whereValue _.where style callback - **/ - indexBy( - collection: Array, - whereValue: W): Dictionary; + * @see _.indexBy + */ + indexBy( + collection: NumericDictionary, + iteratee?: NumericDictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.indexBy - * @param whereValue _.where style callback - **/ - indexBy( - collection: List, - whereValue: W): Dictionary; + * @see _.indexBy + */ + indexBy( + collection: Dictionary, + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; + + /** + * @see _.indexBy + */ + indexBy( + collection: List|NumericDictionary|Dictionary, + iteratee?: string, + thisArg?: any + ): Dictionary; + + /** + * @see _.indexBy + */ + indexBy( + collection: List|NumericDictionary|Dictionary, + iteratee?: W + ): Dictionary; + + /** + * @see _.indexBy + */ + indexBy( + collection: List|NumericDictionary|Dictionary, + iteratee?: Object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.indexBy + */ + indexBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.indexBy + */ + indexBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.indexBy + */ + indexBy( + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: Object + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.indexBy + */ + indexBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.indexBy + */ + indexBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.indexBy + */ + indexBy( + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.indexBy + */ + indexBy( + iteratee?: Object + ): LoDashExplicitObjectWrapper>; } //_.invoke @@ -8315,66 +8592,211 @@ declare module _ { //_.sortByOrder interface LoDashStatic { /** - * This method is like "_.sortByAll" except that it allows specifying the sort orders of the - * iteratees to sort by. If orders is unspecified, all values are sorted in ascending order. - * Otherwise, a value is sorted in ascending order if its corresponding order is "asc", and - * descending if "desc". - * - * If a property name is provided for an iteratee the created "_.property" style callback - * returns the property value of the given element. - * - * If an object is provided for an iteratee the created "_.matches" style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return A new array of sorted elements. - **/ - sortByOrder( - collection: Array, - iteratees: (ListIterator|string|Object)[], - orders?: boolean[]): T[]; + * This method is like _.sortByAll except that it allows specifying the sort orders of the iteratees to sort + * by. If orders is unspecified, all values are sorted in ascending order. Otherwise, a value is sorted in + * ascending order if its corresponding order is "asc", and descending if "desc". + * + * If a property name is provided for an iteratee the created _.property style callback returns the property + * value of the given element. + * + * If an object is provided for an iteratee the created _.matches style callback returns true for elements + * that have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratees The iteratees to sort by. + * @param orders The sort orders of iteratees. + * @return Returns the new sorted array. + */ + sortByOrder( + collection: List, + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; /** - * @see _.sortByOrder - **/ + * @see _.sortByOrder + */ sortByOrder( collection: List, - iteratees: (ListIterator|string|Object)[], - orders?: boolean[]): T[]; + iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; /** - * @see _.sortByOrder - **/ - sortByOrder( - collection: Array, - iteratees: (ListIterator|string|Object)[], - orders?: string[]): T[]; + * @see _.sortByOrder + */ + sortByOrder( + collection: NumericDictionary, + iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; /** - * @see _.sortByOrder - **/ + * @see _.sortByOrder + */ sortByOrder( - collection: List, - iteratees: (ListIterator|string|Object)[], - orders?: string[]): T[]; + collection: NumericDictionary, + iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.sortByOrder + */ + sortByOrder( + collection: Dictionary, + iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.sortByOrder + */ + sortByOrder( + collection: Dictionary, + iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: ListIterator|string|(ListIterator|string)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { /** - * @see _.sortByOrder - **/ - sortByOrder( - iteratees: (ListIterator|string|Object)[], - orders?: boolean[]): LoDashImplicitArrayWrapper; + * @see _.sortByOrder + */ + sortByOrder( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; /** - * @see _.sortByOrder - **/ + * @see _.sortByOrder + */ + sortByOrder( + iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortByOrder + */ sortByOrder( - iteratees: (ListIterator|string|Object)[], - orders?: string[]): LoDashImplicitArrayWrapper; + iteratees: ListIterator|string|(ListIterator|string)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortByOrder + */ + sortByOrder( + iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; } //_.where @@ -8561,28 +8983,58 @@ declare module _ { } //_.bind - interface LoDashStatic { - /** - * Creates a function that, when called, invokes func with the this binding of thisArg - * and prepends any additional bind arguments to those provided to the bound function. - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param args Arguments to be partially applied. - * @return The new bound function. - **/ - bind( + interface FunctionBind { + placeholder: any; + + ( + func: T, + thisArg: any, + ...partials: any[] + ): TResult; + + ( func: Function, thisArg: any, - ...args: any[]): (...args: any[]) => any; + ...partials: any[] + ): TResult; + } + + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind + * arguments to those provided to the bound function. + * + * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for + * partially applied arguments. + * + * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. + * + * @param func The function to bind. + * @param thisArg The this binding of func. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bind: FunctionBind; } interface LoDashImplicitObjectWrapper { /** - * @see _.bind - **/ - bind( + * @see _.bind + */ + bind( thisArg: any, - ...args: any[]): LoDashImplicitObjectWrapper<(...args: any[]) => any>; + ...partials: any[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.bind + */ + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitObjectWrapper; } //_.bindAll @@ -8620,30 +9072,59 @@ declare module _ { } //_.bindKey + interface FunctionBindKey { + placeholder: any; + + ( + object: T, + key: any, + ...partials: any[] + ): TResult; + + ( + object: Object, + key: any, + ...partials: any[] + ): TResult; + } + interface LoDashStatic { /** - * Creates a function that, when called, invokes the method at object[key] and prepends any - * additional bindKey arguments to those provided to the bound function. This method differs - * from _.bind by allowing bound functions to reference methods that will be redefined or don't - * yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern. - * @param object The object the method belongs to. - * @param key The key of the method. - * @param args Arguments to be partially applied. - * @return The new bound function. - **/ - bindKey( - object: T, - key: string, - ...args: any[]): Function; + * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments + * to those provided to the bound function. + * + * This method differs from _.bind by allowing bound functions to reference methods that may be redefined + * or don’t yet exist. See Peter Michaux’s article for more details. + * + * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder + * for partially applied arguments. + * + * @param object The object the method belongs to. + * @param key The key of the method. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bindKey: FunctionBindKey; } interface LoDashImplicitObjectWrapper { /** - * @see _.bindKey - **/ - bindKey( - key: string, - ...args: any[]): LoDashImplicitObjectWrapper; + * @see _.bindKey + */ + bindKey( + key: any, + ...partials: any[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.bindKey + */ + bindKey( + key: any, + ...partials: any[] + ): LoDashExplicitObjectWrapper; } //_.compose @@ -9405,19 +9886,33 @@ declare module _ { /** * Creates a function that invokes func with the this binding of the created function and an array of arguments * much like Function#apply. + * + * Note: This method is based on the spread operator. + * * @param func The function to spread arguments over. * @return Returns the new function. */ - spread(func: Function): TResult; + spread(func: F): T; + + /** + * @see _.spread + */ + spread(func: Function): T; } interface LoDashImplicitObjectWrapper { /** * @see _.spread */ - spread(): LoDashImplicitObjectWrapper; + spread(): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.spread + */ + spread(): LoDashExplicitObjectWrapper; + } //_.throttle interface ThrottleSettings { @@ -9479,16 +9974,106 @@ declare module _ { //_.wrap interface LoDashStatic { /** - * Creates a function that provides value to the wrapper function as its first argument. - * Additional arguments provided to the function are appended to those provided to the - * wrapper function. The wrapper is executed with the this binding of the created function. - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return The new function. - **/ - wrap( + * Creates a function that provides value to the wrapper function as its first argument. Any additional + * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is + * invoked with the this binding of the created function. + * + * @param value The value to wrap. + * @param wrapper The wrapper function. + * @return Returns the new function. + */ + wrap( + value: V, + wrapper: W + ): R; + + /** + * @see _.wrap + */ + wrap( + value: V, + wrapper: Function + ): R; + + /** + * @see _.wrap + */ + wrap( value: any, - wrapper: (func: Function, ...args: any[]) => any): Function; + wrapper: Function + ): R; + } + + interface LoDashImplicitWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashImplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashImplicitObjectWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashImplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashImplicitObjectWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashImplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashExplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashExplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashExplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashExplicitObjectWrapper; } /******** @@ -9721,6 +10306,7 @@ declare module _ { interface LoDashStatic { /** * Checks if value is classified as an arguments object. + * * @param value The value to check. * @return Returns true if value is correctly classified, else false. */ @@ -9734,6 +10320,13 @@ declare module _ { isArguments(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.isArguments + */ + isArguments(): LoDashExplicitWrapper; + } + //_.isArray interface LoDashStatic { /** @@ -9911,6 +10504,7 @@ declare module _ { /** * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError * object. + * * @param value The value to check. * @return Returns true if value is an error object, else false. */ @@ -9924,6 +10518,13 @@ declare module _ { isError(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.isError + */ + isError(): LoDashExplicitWrapper; + } + //_.isFinite interface LoDashStatic { /** @@ -10154,6 +10755,13 @@ declare module _ { isPlainObject(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * see _.isPlainObject + */ + isPlainObject(): LoDashExplicitWrapper; + } + //_.isRegExp interface LoDashStatic { /** @@ -10320,12 +10928,7 @@ declare module _ { * @param value The value to convert. * @return Returns the converted array. */ - toArray(value: string): string[]; - - /** - * @see _.toArray - */ - toArray(value: List|Dictionary): T[]; + toArray(value: List|Dictionary|NumericDictionary): T[]; /** * @see _.toArray @@ -10335,12 +10938,7 @@ declare module _ { /** * @see _.toArray */ - toArray(value: TValue): any[]; - - /** - * @see _.toArray - */ - toArray(value?: any): any[]; + toArray(value?: any): TResult[]; } interface LoDashImplicitWrapper { @@ -10364,6 +10962,27 @@ declare module _ { toArray(): LoDashImplicitArrayWrapper; } + interface LoDashExplicitWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + //_.toPlainObject interface LoDashStatic { /** @@ -11155,18 +11774,29 @@ declare module _ { /** * Creates an object that inherits from the given prototype object. If a properties object is provided its own * enumerable properties are assigned to the created object. + * * @param prototype The object to inherit from. * @param properties The properties to assign to the object. * @return Returns the new object. */ - create(prototype: Object, properties?: Object): TResult; + create( + prototype: T, + properties?: U + ): T & U; } interface LoDashImplicitObjectWrapper { /** * @see _.create */ - create(properties?: Object): LoDashImplicitObjectWrapper; + create(properties?: U): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.create + */ + create(properties?: U): LoDashExplicitObjectWrapper; } //_.defaults @@ -12347,40 +12977,40 @@ declare module _ { * @param thisArg The this binding of customizer. * @return Returns object. */ - merge( + merge( object: TObject, source: TSource, customizer?: MergeCustomizer, thisArg?: any - ): TResult; + ): TObject & TSource; /** * @see _.merge */ - merge( + merge( object: TObject, source1: TSource1, source2: TSource2, customizer?: MergeCustomizer, thisArg?: any - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see _.merge */ - merge( + merge( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer?: MergeCustomizer, thisArg?: any - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see _.merge */ - merge( + merge( object: TObject, source1: TSource1, source2: TSource2, @@ -12388,13 +13018,13 @@ declare module _ { source4: TSource4, customizer?: MergeCustomizer, thisArg?: any - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.merge */ - merge( - object: TObject, + merge( + object: any, ...otherArgs: any[] ): TResult; } @@ -12403,44 +13033,44 @@ declare module _ { /** * @see _.merge */ - merge( + merge( source: TSource, customizer?: MergeCustomizer, thisArg?: any - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.merge */ - merge( + merge( source1: TSource1, source2: TSource2, customizer?: MergeCustomizer, thisArg?: any - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.merge */ - merge( + merge( source1: TSource1, source2: TSource2, source3: TSource3, customizer?: MergeCustomizer, thisArg?: any - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.merge */ - merge( + merge( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer?: MergeCustomizer, thisArg?: any - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.merge diff --git a/log4js/log4js.d.ts b/log4js/log4js.d.ts index 4888b9f51..ab172a122 100644 --- a/log4js/log4js.d.ts +++ b/log4js/log4js.d.ts @@ -8,6 +8,19 @@ declare module "log4js" { import express = require('express'); + /** + * Replaces the console + * @param logger + * @returns void + */ + export function replaceConsole(logger?: Logger): void; + + /** + * Restores the console + * @returns void + */ + export function restoreConsole(): void; + /** * Get a logger instance. Instance is cached on categoryName level. * @@ -137,7 +150,7 @@ declare module "log4js" { } export interface ConsoleAppenderConfig extends AppenderConfigBase {} - + export interface FileAppenderConfig extends AppenderConfigBase { filename: string; } @@ -156,24 +169,24 @@ declare module "log4js" { pattern: string; alwaysIncludePattern: boolean; } - + export interface SmtpAppenderConfig extends AppenderConfigBase { /** Comma separated list of email recipients */ recipients: string; - + /** Sender of all emails (defaults to transport user) */ sender: string; - + /** Subject of all email messages (defaults to first event's message)*/ subject: string; - + /** * The time in seconds between sending attempts (defaults to 0). * All events are buffered and sent in one email during this time. * If 0 then every event sends an email */ sendInterval: number; - + SMTP: { host: string; secure: boolean; @@ -190,14 +203,14 @@ declare module "log4js" { backup: number; pollInterval: number; } - + export interface GelfAppenderConfig extends AppenderConfigBase { host: string; hostname: string; port: string; facility: string; } - + export interface MultiprocessAppenderConfig extends AppenderConfigBase { mode: string; loggerPort: number; @@ -205,25 +218,25 @@ declare module "log4js" { facility: string; appender?: AppenderConfig; } - + export interface LogglyAppenderConfig extends AppenderConfigBase { /** Loggly customer token - https://www.loggly.com/docs/api-sending-data/ */ token: string; - + /** Loggly customer subdomain (use 'abc' for abc.loggly.com) */ subdomain: string; - + /** an array of strings to help segment your data & narrow down search results in Loggly */ tags: string[]; - + /** Enable JSON logging by setting to 'true' */ json: boolean; } - + export interface ClusteredAppenderConfig extends AppenderConfigBase { appenders?: AppenderConfig[]; } - + type CoreAppenderConfig = ConsoleAppenderConfig | FileAppenderConfig | DateFileAppenderConfig @@ -233,11 +246,10 @@ declare module "log4js" { | MultiprocessAppenderConfig | LogglyAppenderConfig | ClusteredAppenderConfig - + interface CustomAppenderConfig extends AppenderConfigBase { [prop: string]: any; } type AppenderConfig = CoreAppenderConfig | CustomAppenderConfig; } - diff --git a/lwip/lwip.d.ts b/lwip/lwip.d.ts index 63d2c701b..0f40c63d2 100644 --- a/lwip/lwip.d.ts +++ b/lwip/lwip.d.ts @@ -12,6 +12,10 @@ declare module "lwip" { interface ImageCallback { (err: any, image: Image): void; } + + interface BufferCallback { + (err: any, buffer: Buffer): void; + } /** * Open an image @@ -386,7 +390,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "jpg", callback: ImageCallback): void; + toBuffer(format: "jpg", callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -396,7 +400,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + toBuffer(format: "jpg", params: JpegBufferParams, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -405,7 +409,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "png", callback: ImageCallback): void; + toBuffer(format: "png", callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -415,7 +419,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "png", params: PngBufferParams, callback: ImageCallback): void; + toBuffer(format: "png", params: PngBufferParams, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -424,7 +428,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "gif", callback: ImageCallback): void; + toBuffer(format: "gif", callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -434,7 +438,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "gif", params: GifBufferParams, callback: ImageCallback): void; + toBuffer(format: "gif", params: GifBufferParams, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -443,7 +447,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: string, callback: ImageCallback): void; + toBuffer(format: string, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -453,7 +457,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: BufferCallback): void; /** * Write encoded binary image data directly to a file. @@ -848,7 +852,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "jpg", callback: ImageCallback): void; + toBuffer(format: "jpg", callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -858,7 +862,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + toBuffer(format: "jpg", params: JpegBufferParams, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -867,7 +871,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "png", callback: ImageCallback): void; + toBuffer(format: "png", callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -877,7 +881,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "png", params: PngBufferParams, callback: ImageCallback): void; + toBuffer(format: "png", params: PngBufferParams, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -886,7 +890,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "gif", callback: ImageCallback): void; + toBuffer(format: "gif", callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -896,7 +900,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "gif", params: GifBufferParams, callback: ImageCallback): void; + toBuffer(format: "gif", params: GifBufferParams, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -905,7 +909,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: string, callback: ImageCallback): void; + toBuffer(format: string, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -915,7 +919,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: BufferCallback): void; /** * Execute batch and write to file diff --git a/maker.js/makerjs-tests.ts b/maker.js/makerjs-tests.ts index 4b6b5f80e..e314f0966 100644 --- a/maker.js/makerjs-tests.ts +++ b/maker.js/makerjs-tests.ts @@ -42,7 +42,19 @@ function test() { makerjs.exporter.toDXF(model); makerjs.exporter.toOpenJsCad(model); makerjs.exporter.toSTL(model); - makerjs.exporter.toSVG(model); + makerjs.exporter.toSVG(model, + { + annotate: true, + fontSize: '', + origin: [], + scale: 9.9, + stroke: '', + strokeWidth: '', + svgAttrs: {}, + units: '', + useSvgPathOnly: false, + viewBox: false + }); makerjs.exporter.tryGetModelUnits(model); } @@ -51,6 +63,7 @@ function test() { makerjs.kit.getParameterValues(null); ({}).max; ({}).metaParameters; + ({}).notes; } function testMeasure() { @@ -83,6 +96,7 @@ function test() { makerjs.model.rotate(makerjs.model.scale(model, 6), 45, [0,0]); makerjs.model.scale(model, 7); makerjs.model.walkPaths(model, (modelContext: MakerJs.IModel, pathId: string, pathContext: MakerJs.IPath) => {}); + model.exporterOptions = { foo: 'bar' }; } function testModels(): MakerJs.IModel[] { diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index cb217adb4..b45a1ceff 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -345,6 +345,12 @@ declare module MakerJs { * Optional layer of this model. */ layer?: string; + /** + * Optional exporter options for this model. + */ + exporterOptions?: { + [exporterName: string]: any; + }; } /** * Callback signature for model.walkPaths(). @@ -412,6 +418,10 @@ declare module MakerJs { * Each element of the array corresponds to a parameter of the constructor, in order. */ metaParameters?: IMetaParameter[]; + /** + * Information about this kit, in plain text or markdown format. + */ + notes?: string; } } declare module MakerJs.angle { @@ -1225,12 +1235,36 @@ declare module MakerJs.exporter { * Optional size of curve facets. */ facetSize?: number; + /** + * Optional override of function name, default is "main". + */ + functionName?: string; + /** + * Optional options applied to specific first-child models by model id. + */ + modelMap?: IOpenJsCadOptionsMap; + } + interface IOpenJsCadOptionsMap { + [modelId: string]: IOpenJsCadOptions; } } declare module MakerJs.exporter { function toSVG(modelToExport: IModel, options?: ISVGRenderOptions): string; function toSVG(pathsToExport: IPath[], options?: ISVGRenderOptions): string; function toSVG(pathToExport: IPath, options?: ISVGRenderOptions): string; + /** + * Map of MakerJs unit system to SVG unit system + */ + interface svgUnitConversion { + [unitType: string]: { + svgUnitType: string; + scaleConversion: number; + }; + } + /** + * Map of MakerJs unit system to SVG unit system + */ + var svgUnit: svgUnitConversion; /** * SVG rendering options. */ @@ -1239,6 +1273,10 @@ declare module MakerJs.exporter { * Optional attributes to add to the root svg tag. */ svgAttrs?: IXmlTagAttrs; + /** + * SVG font size and font size units. + */ + fontSize?: string; /** * SVG stroke width of paths. This may have a unit type suffix, if not, the value will be in the same unit system as the units property. */ @@ -1246,27 +1284,27 @@ declare module MakerJs.exporter { /** * SVG color of the rendered paths. */ - stroke: string; + stroke?: string; /** * Scale of the SVG rendering. */ - scale: number; + scale?: number; /** * Indicate that the id's of paths should be rendered as SVG text elements. */ - annotate: boolean; + annotate?: boolean; /** * Rendered reference origin. */ - origin: IPoint; + origin?: IPoint; /** * Use SVG < path > elements instead of < line >, < circle > etc. */ - useSvgPathOnly: boolean; + useSvgPathOnly?: boolean; /** * Flag to use SVG viewbox. */ - viewBox: boolean; + viewBox?: boolean; } } declare module MakerJs.models { diff --git a/marked/marked-tests.ts b/marked/marked-tests.ts index 44be0f0e8..efb671548 100644 --- a/marked/marked-tests.ts +++ b/marked/marked-tests.ts @@ -14,7 +14,8 @@ var options: MarkedOptions = { return ''; }, langPrefix: 'lang-', - smartypants: false + smartypants: false, + renderer: new marked.Renderer() }; function callback() { diff --git a/marked/marked.d.ts b/marked/marked.d.ts index 198cd2626..85103b020 100644 --- a/marked/marked.d.ts +++ b/marked/marked.d.ts @@ -3,7 +3,6 @@ // Definitions by: William Orr // Definitions: https://github.com/borisyankov/DefinitelyTyped - interface MarkedStatic { /** * Compiles markdown to HTML. @@ -60,6 +59,43 @@ interface MarkedStatic { * @param options Hash of options */ setOptions(options: MarkedOptions): MarkedStatic; + + Renderer: { + new(): MarkedRenderer; + } + + Parser: { + new(options: MarkedOptions): MarkedParser; + } +} + +interface MarkedRenderer { + code(code: string, language: string): string; + blockquote(quote: string): string; + html(html: string): string; + heading(text: string, level: number): string; + hr(): string; + list(body: string, ordered: boolean): string; + listitem(text: string): string; + paragraph(text: string): string; + table(header: string, body: string): string; + tablerow(content: string): string; + tablecell(content: string, flags: { + header: boolean, + align: string + }): string; + strong(text: string): string; + em(text: string): string; + codespan(code: string): string; + br(): string; + del(text: string): string; + link(href: string, title: string, text: string): string; + image(href: string, title: string, text: string): string; + text(text: string): string; +} + +interface MarkedParser { + parse(source: any[]): string } interface MarkedOptions { @@ -68,7 +104,7 @@ interface MarkedOptions { * * An object containing functions to render tokens to HTML. */ - renderer?: Object; + renderer?: MarkedRenderer; /** * Enable GitHub flavored markdown. diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx index 84fdad401..b5875f76d 100644 --- a/material-ui/material-ui-tests.tsx +++ b/material-ui/material-ui-tests.tsx @@ -18,11 +18,11 @@ import RaisedButton = require("material-ui/lib/raised-button"); import FloatingActionButton = require("material-ui/lib/floating-action-button"); import Card = require("material-ui/lib/card/card"); import CardHeader = require("material-ui/lib/card/card-header"); -import DatePicker = require("material-ui/lib/date-picker/date-picker"); import CardText = require("material-ui/lib/card/card-text"); import CardActions = require("material-ui/lib/card/card-actions"); import Dialog = require("material-ui/lib/dialog"); import DropDownMenu = require("material-ui/lib/drop-down-menu"); +import DatePicker = require("material-ui/lib/date-picker/date-picker"); import RadioButtonGroup = require("material-ui/lib/radio-button-group"); import RadioButton = require("material-ui/lib/radio-button"); import Toggle = require("material-ui/lib/toggle"); @@ -187,6 +187,7 @@ class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implemen ; // "http://material-ui.com/#/components/date-picker" + element = ; element = ; element = boolean; showYearSelector?: boolean; + style?: React.CSSProperties; textFieldStyle?: React.CSSProperties; } export class DatePicker extends React.Component { diff --git a/meteor-roles/meteor-roles-tests.ts b/meteor-roles/meteor-roles-tests.ts new file mode 100644 index 000000000..dae900800 --- /dev/null +++ b/meteor-roles/meteor-roles-tests.ts @@ -0,0 +1,150 @@ +/// +/// +/// + +/** + * All code below was copied from the examples at https://github.com/alanning/meteor-roles/. + * When necessary, code was added to make the examples work (e.g. declaring a variable + * that was assumed to have been declared earlier) + */ + +var joesUserId = '1234'; +Roles.addUsersToRoles(joesUserId, ['manage-team','schedule-game'], 'manchester-united.com') +Roles.addUsersToRoles(joesUserId, ['player','goalie'], 'real-madrid.com') + +Roles.userIsInRole(joesUserId, 'manage-team', 'manchester-united.com') // => true +Roles.userIsInRole(joesUserId, 'manage-team', 'real-madrid.com') // => false + +Roles.addUsersToRoles(joesUserId, 'super-admin', Roles.GLOBAL_GROUP) + +var bobsUserId = '1234'; +Roles.addUsersToRoles(bobsUserId, ['manage-team','schedule-game']) +// internal representation - no groups +// user.roles = ['manage-team','schedule-game'] + +Roles.addUsersToRoles(joesUserId, ['manage-team','schedule-game'], 'manchester-united.com') +Roles.addUsersToRoles(joesUserId, ['player','goalie'], 'real-madrid.com') +// internal representation - groups +// NOTE: MongoDB uses periods to represent hierarchy so periods in group names +// are converted to underscores. +// +// user.roles = { +// 'manchester-united_com': ['manage-team','schedule-game'], +// 'real-madrid_com': ['player','goalie'] +// } + +Meteor.roles.find({}); + + + +var users = [ + {name:"Normal User",email:"normal@example.com",roles:[]}, + {name:"View-Secrets User",email:"view@example.com",roles:['view-secrets']}, + {name:"Manage-Users User",email:"manage@example.com",roles:['manage-users']}, + {name:"Admin User",email:"admin@example.com",roles:['admin']} +]; + +_.each(users, function (user) { + var id : string; + + id = Accounts.createUser({ + email: user.email, + password: "apple1", + profile: { name: user.name } + }); + + if (user.roles.length > 0) { + // Need _id of existing user record so this call must come + // after `Accounts.createUser` or `Accounts.onCreate` + Roles.addUsersToRoles(id, user.roles, 'default-group'); + } + +}); + + + +// server/publish.js + +// Give authorized users access to sensitive data by group +Meteor.publish('secrets', function (group : string) { + if (Roles.userIsInRole(this.userId, ['view-secrets','admin'], group)) { + +// return Meteor.secrets.find({group: group}); + + } else { + + // user not authorized. do not publish secrets + this.stop(); + return; + + } +}); + + +Accounts.validateNewUser(function (user : Meteor.User) { + var loggedInUser = Meteor.user(); + + if (Roles.userIsInRole(loggedInUser, ['admin','manage-users'])) { + // NOTE: This example assumes the user is not using groups. + return true; + } + + throw new Meteor.Error('403', "Not authorized to create new users"); +}); + + +// server/userMethods.js + +Meteor.methods({ + /** + * delete a user from a specific group + * + * @method deleteUser + * @param {String} targetUserId _id of user to delete + * @param {String} group Company to update permissions for + */ + deleteUser: function (targetUserId : string, group : string) { + var loggedInUser = Meteor.user() + + if (!loggedInUser || + !Roles.userIsInRole(loggedInUser, + ['manage-users', 'support-staff'], group)) { + throw new Meteor.Error('403', "Access denied") + } + + // remove permissions for target group + Roles.setUserRoles(targetUserId, [], group) + + // do other actions required when a user is removed... + } +}) + + + +// server/userMethods.js + +Meteor.methods({ + /** + * update a user's permissions + * + * @param {Object} targetUserId Id of user to update + * @param {Array} roles User's new permissions + * @param {String} group Company to update permissions for + */ + updateRoles: function (targetUserId : string, roles : string[], group : string) { + var loggedInUser = Meteor.user() + + if (!loggedInUser || + !Roles.userIsInRole(loggedInUser, + ['manage-users', 'support-staff'], group)) { + throw new Meteor.Error('403', "Access denied") + } + + Roles.setUserRoles(targetUserId, roles, group) + } +}) + + + + + diff --git a/meteor-roles/meteor-roles.d.ts b/meteor-roles/meteor-roles.d.ts new file mode 100644 index 000000000..487300b82 --- /dev/null +++ b/meteor-roles/meteor-roles.d.ts @@ -0,0 +1,264 @@ +// Type definitions for Meteor Roles 1.2.14 +// Project: https://github.com/alanning/meteor-roles/ +// Definitions by: Robbie Van Gorkom +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/** + * Provides functions related to user authorization. Compatible with built-in Meteor accounts packages. + * + * @module Roles + */ +declare module Roles { + /** + * Constant used to reference the special 'global' group that + * can be used to apply blanket permissions across all groups. + * + * @example + * Roles.addUsersToRoles(user, 'admin', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'admin') // => true + * + * Roles.setUserRoles(user, 'support-staff', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'support-staff') // => true + * Roles.userIsInRole(user, 'admin') // => false + * + * @property GLOBAL_GROUP + * @type String + * @static + * @final + */ + var GLOBAL_GROUP : string; + + /** + * Subscription handle for the currently logged in user's permissions. + * + * NOTE: The corresponding publish function, `_roles`, depends on + * `this.userId` so it will automatically re-run when the currently + * logged-in user changes. + * + * @example + * + * `Roles.subscription.ready()` // => `true` if user roles have been loaded + * + * @property subscription + * @type Object + * @for Roles + */ + var subscription : Subscription; + + /** + * Add users to roles. Will create roles as needed. + * + * NOTE: Mixing grouped and non-grouped roles for the same user + * is not supported and will throw an error. + * + * Makes 2 calls to database: + * 1. retrieve list of all existing roles + * 2. update users' roles + * + * @example + * Roles.addUsersToRoles(userId, 'admin') + * Roles.addUsersToRoles(userId, ['view-secrets'], 'example.com') + * Roles.addUsersToRoles([user1, user2], ['user','editor']) + * Roles.addUsersToRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.addUsersToRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method addUsersToRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$' or numbers. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function addUsersToRoles( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Create a new role. Whitespace will be trimmed. + * + * @method createRole + * @param {String} role Name of role + * @return {String} id of new role + */ + function createRole(role : string) : string; + + /** + * Delete an existing role. Will throw "Role in use" error if any users + * are currently assigned to the target role. + * + * @method deleteRole + * @param {String} role Name of role + */ + function deleteRole (role : string) : void; + + /** + * Retrieve set of all existing roles + * + * @method getAllRoles + * @return {Cursor} cursor of existing roles + */ + function getAllRoles() : Mongo.Cursor; + + /** + * Retrieve users groups, if any + * + * @method getGroupsForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [role] Optional name of roles to restrict groups to. + * + * @return {Array} Array of user's groups, unsorted. Roles.GLOBAL_GROUP will be omitted + */ + function getGroupsForUser( + user : string|Object, + role? : string + ) : string[]; + + /** + * Retrieve users roles + * + * @method getRolesForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be included. + * @return {Array} Array of user's roles, unsorted. + */ + function getRolesForUser( + user : string|Object, + group? : string + ) : Role[]; + + /** + * Retrieve all users who are in target role. + * + * NOTE: This is an expensive query; it performs a full collection scan + * on the users collection since there is no index set on the 'roles' field. + * This is by design as most queries will specify an _id so the _id index is + * used automatically. + * + * @method getUsersInRole + * @param {Array|String} role Name of role/permission. If array, users + * returned will have at least one of the roles + * specified but need not have _all_ roles. + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be checked. + * @param {Object} [options] Optional options which are passed directly + * through to `Meteor.users.find(query, options)` + * @return {Cursor} cursor of users in role + */ + function getUsersInRole( + role : string|string[], + group? : string, + options? : { + sort?: Mongo.SortSpecifier; + skip?: number; + limit?: number; + fields?: Mongo.FieldSpecifier; + reactive?: boolean; + transform?: Function; + }) : Mongo.Cursor; + + /** + * Remove users from roles + * + * @example + * Roles.removeUsersFromRoles(users.bob, 'admin') + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor']) + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor', 'user']) + * Roles.removeUsersFromRoles(users.eve, ['user'], 'group1') + * + * @method removeUsersFromRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles to add users to + * @param {String} [group] Optional. Group name. If supplied, only that + * group will have roles removed. + */ + function removeUsersFromRoles( + user : string|string[]|Object|Object[], + roles? : string[], + group? : string + ) : void; + + /** + * Set a users roles/permissions. + * + * @example + * Roles.setUserRoles(userId, 'admin') + * Roles.setUserRoles(userId, ['view-secrets'], 'example.com') + * Roles.setUserRoles([user1, user2], ['user','editor']) + * Roles.setUserRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.setUserRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method setUserRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$'. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function setUserRoles ( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Check if user has specified permissions/roles + * + * @example + * // non-group usage + * Roles.userIsInRole(user, 'admin') + * Roles.userIsInRole(user, ['admin','editor']) + * Roles.userIsInRole(userId, 'admin') + * Roles.userIsInRole(userId, ['admin','editor']) + * + * // per-group usage + * Roles.userIsInRole(user, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], Roles.GLOBAL_GROUP) + * + * // this format can also be used as short-hand for Roles.GLOBAL_GROUP + * Roles.userIsInRole(user, 'admin') + * + * @method userIsInRole + * @param {String|Object} user User Id or actual user object + * @param {String|Array} roles Name of role/permission or Array of + * roles/permissions to check against. If array, + * will return true if user is in _any_ role. + * @param {String} [group] Optional. Name of group. If supplied, limits check + * to just that group. + * The user's Roles.GLOBAL_GROUP will always be checked + * whether group is specified or not. + * @return {Boolean} true if user is in _any_ of the target roles + */ + function userIsInRole( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : boolean; + + interface Role { + name : string; + } +} // module + +declare module Meteor { + var roles : Mongo.Collection; +} diff --git a/minilog/minilog-tests.ts b/minilog/minilog-tests.ts index 3a9bb0f4d..477c646fa 100644 --- a/minilog/minilog-tests.ts +++ b/minilog/minilog-tests.ts @@ -12,10 +12,10 @@ var log = Minilog('app'); Minilog.enable(); log - .debug('debug message') - .info('info message') + .debug('debug message 1', 'debug message 2') + .info('info message', [1, 2, 3]) .warn('warning') - .error('this is an error message'); + .error('this is an error message', new Error()); Minilog.pipe(Minilog.backends.console.formatWithStack) .pipe(Minilog.backends.console); diff --git a/minilog/minilog.d.ts b/minilog/minilog.d.ts index d9d1695bf..b8301277a 100644 --- a/minilog/minilog.d.ts +++ b/minilog/minilog.d.ts @@ -5,11 +5,11 @@ //These type definitions are not complete, although basic usage should be typed. interface Minilog { - debug(msg: any): Minilog; - info(msg: any): Minilog; - log(msg: any): Minilog; - warn(msg: any): Minilog; - error(msg: any): Minilog; + debug(...msg: any[]): Minilog; + info(...msg: any[]): Minilog; + log(...msg: any[]): Minilog; + warn(...msg: any[]): Minilog; + error(...msg: any[]): Minilog; } declare function Minilog(namespace: string): Minilog; @@ -47,8 +47,8 @@ declare module Minilog { test(name:any, level:any): boolean; /** - * specifies the behavior when a log line doesn't match either the whitelist or the blacklist. - The default is true (= "allow by default") - lines that do not match the whitelist or the blacklist are not filtered (e.g. ). + * specifies the behavior when a log line doesn't match either the whitelist or the blacklist. + The default is true (= "allow by default") - lines that do not match the whitelist or the blacklist are not filtered (e.g. ). If you want to flip the default so that lines are filtered unless they are on the whitelist, set this to false (= "deny by default"). */ defaultResult: boolean; @@ -58,7 +58,7 @@ declare module Minilog { */ enabled: boolean; } - + export interface MinilogBackends { array: any; @@ -95,4 +95,8 @@ declare module Minilog { mixin(dest: any): void; } -} \ No newline at end of file +} + +declare module 'minilog' { + export = Minilog; +} diff --git a/minimist/minimist-tests.ts b/minimist/minimist-tests.ts index 2266d2739..efd3076aa 100644 --- a/minimist/minimist-tests.ts +++ b/minimist/minimist-tests.ts @@ -19,6 +19,9 @@ opts.boolean = strArr; opts.alias = { foo: strArr }; +opts.alias = { + foo: str +}; opts.default = { foo: str }; @@ -29,7 +32,7 @@ opts.unknown = (arg: string) => { if(/xyz/.test(arg)){ return true; } - + return false; }; opts.stopEarly = true; diff --git a/minimist/minimist.d.ts b/minimist/minimist.d.ts index abbc5f028..de767fa4c 100644 --- a/minimist/minimist.d.ts +++ b/minimist/minimist.d.ts @@ -9,20 +9,17 @@ declare module 'minimist' { module minimist { export interface Opts { // a string or array of strings argument names to always treat as strings - // string?: string; string?: string|string[]; // a string or array of strings to always treat as booleans - // boolean?: string; boolean?: boolean|string|string[]; // an object mapping string names to strings or arrays of string argument names to use - // alias?: {[key:string]: string}; - alias?: {[key:string]: string[]}; + alias?: {[key:string]: string|string[]}; // an object mapping string argument names to default values default?: {[key:string]: any}; // when true, populate argv._ with everything after the first non-option stopEarly?: boolean; // a function which is invoked with a command line parameter not defined in the opts configuration object. - // If the function returns false, the unknown option is not added to argv + // If the function returns false, the unknown option is not added to argv unknown?: (arg: string) => boolean; // when true, populate argv._ with everything before the -- and argv['--'] with everything after the -- '--'?: boolean; diff --git a/mmmagic/mmmagic-tests.ts b/mmmagic/mmmagic-tests.ts new file mode 100644 index 000000000..afe93ff09 --- /dev/null +++ b/mmmagic/mmmagic-tests.ts @@ -0,0 +1,30 @@ +/// + +import Magic = require("mmmagic"); + +// get general description of a file +var magic: Magic.Magic; + +magic = new Magic.Magic(); +magic.detectFile('node_modules/mmmagic/build/Release/magic.node', function(err: Error, result: string) { + if (err) throw err; + console.log(result); + // output on Windows with 32-bit node: +}); + +// get mime type for a file +magic = new Magic.Magic(Magic.MAGIC_MIME_TYPE); +magic.detectFile('node_modules/mmmagic/build/Release/magic.node', function(err: Error, result: string) { + if (err) throw err; + console.log(result); +}); + +// get mime type and mime encoding for a file +magic = new Magic.Magic(); +var buf = new Buffer('import Options\nfrom os import unlink, symlink'); + +magic.detect(buf, function(err: Error, result: string) { + if (err) throw err; + console.log(result); + // output: Python script, ASCII text executable +}); \ No newline at end of file diff --git a/mmmagic/mmmagic.d.ts b/mmmagic/mmmagic.d.ts new file mode 100644 index 000000000..b286c9331 --- /dev/null +++ b/mmmagic/mmmagic.d.ts @@ -0,0 +1,37 @@ +// Type definitions for mmmagic v0.4.1 +// Project: https://github.com/mscdex/mmmagic +// Definitions by: Andrei Sebastian Cîmpean +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "mmmagic" { + export type bitmask = number; + export class Magic { + constructor(magicPath?: string, mask?: bitmask); + constructor(mask?: bitmask); + detectFile(path: string, callback: (err: Error, result: string) => void): void; + detect(data: Buffer, callback: (err: Error, result: string) => void): void; + } + export var MAGIC_NONE: bitmask; // no flags set + export var MAGIC_DEBUG: bitmask; // turn on debugging + export var MAGIC_SYMLINK: bitmask; // follow symlinks (default for non-Windows) + export var MAGIC_DEVICES: bitmask; // look at the contents of devices + export var MAGIC_MIME_TYPE: bitmask; // return the MIME type + export var MAGIC_CONTINUE: bitmask; // return all matches (returned as an array of strings) + export var MAGIC_CHECK: bitmask; // print warnings to stderr + export var MAGIC_PRESERVE_ATIME: bitmask; // restore access time on exit + export var MAGIC_RAW: bitmask; // don't translate unprintable chars + export var MAGIC_MIME_ENCODING: bitmask; // return the MIME encoding + export var MAGIC_MIME: bitmask; // (export var MAGIC_MIME_TYPE | export var MAGIC_MIME_ENCODING) + export var MAGIC_APPLE: bitmask; // return the Apple creator and type + export var MAGIC_NO_CHECK_TAR: bitmask; // don't check for tar files + export var MAGIC_NO_CHECK_SOFT: bitmask; // don't check magic entries + export var MAGIC_NO_CHECK_APPTYPE: bitmask; // don't check application type + export var MAGIC_NO_CHECK_ELF: bitmask; // don't check for elf details + export var MAGIC_NO_CHECK_TEXT: bitmask; // don't check for text files + export var MAGIC_NO_CHECK_CDF: bitmask; // don't check for cdf files + export var MAGIC_NO_CHECK_TOKENS: bitmask; // don't check tokens + export var MAGIC_NO_CHECK_ENCODING: bitmask // don't check text encodings + +} \ No newline at end of file diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 3471a8fc3..a11fad1dc 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -1,10 +1,12 @@ -// Type definitions for Moment.js 2.10.5 +// Type definitions for Moment.js 2.11.1 // Project: https://github.com/timrwood/moment -// Definitions by: Michael Lakerveld , Aaron King , Hiroki Horiuchi , Dick van den Brink , Adi Dahiya , Matt Brooks +// Definitions by: Michael Lakerveld , Aaron King , Hiroki Horiuchi , Dick van den Brink , Adi Dahiya , Matt Brooks , Gal Talmor // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module moment { + type MomentComparable = Moment | string | number | Date | number[]; + interface MomentDateObject { years?: number; /* One digit */ @@ -115,6 +117,18 @@ declare module moment { toJSON(): string; } + interface MomentLocale { + ordinal(n: number): string; + } + + interface MomentCreationData { + input?: string, + format?: string, + locale: MomentLocale, + isUTC: boolean, + strict?: boolean + } + interface Moment { format(format: string): string; format(): string; @@ -259,8 +273,8 @@ declare module moment { dayOfYear(): number; dayOfYear(d: number): Moment; - from(f: Moment | string | number | Date | number[], suffix?: boolean): string; - to(f: Moment | string | number | Date | number[], suffix?: boolean): string; + from(f: MomentComparable, suffix?: boolean): string; + to(f: MomentComparable, suffix?: boolean): string; toNow(withoutPrefix?: boolean): string; diff(b: Moment): number; @@ -284,15 +298,22 @@ declare module moment { isDST(): boolean; isBefore(): boolean; - isBefore(b: Moment | string | number | Date | number[], granularity?: string): boolean; + isBefore(b: MomentComparable, granularity?: string): boolean; isAfter(): boolean; - isAfter(b: Moment | string | number | Date | number[], granularity?: string): boolean; + isAfter(b: MomentComparable, granularity?: string): boolean; - isSame(b: Moment | string | number | Date | number[], granularity?: string): boolean; - isBetween(a: Moment | string | number | Date | number[], b: Moment | string | number | Date | number[], granularity?: string): boolean; + isSame(b: MomentComparable, granularity?: string): boolean; + isBetween(a: MomentComparable, b: MomentComparable, granularity?: string): boolean; - // Deprecated as of 2.8.0. + /** + * @since 2.10.7+ + */ + isSameOrBefore(b: MomentComparable, granularity?: string): boolean; + + /** + * @deprecated since version 2.8.0 + */ lang(language: string): Moment; lang(reset: boolean): Moment; lang(): MomentLanguage; @@ -305,11 +326,15 @@ declare module moment { localeData(reset: boolean): Moment; localeData(): MomentLanguage; - // Deprecated as of 2.7.0. + /** + * @deprecated since version 2.7.0 + */ max(date: Moment | string | number | Date | any[]): Moment; max(date: string, format: string): Moment; - // Deprecated as of 2.7.0. + /** + * @deprecated since version 2.7.0 + */ min(date: Moment | string | number | Date | any[]): Moment; min(date: string, format: string): Moment; @@ -317,9 +342,16 @@ declare module moment { set(unit: string, value: number): Moment; set(objectLiteral: MomentInput): Moment; - /*This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.*/ - //Works with version 2.10.5+ + /** + * This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds. + * @since 2.10.5+ + */ toObject(): MomentDateObject; + + /** + * @since 2.10.7+ + */ + creationData(): MomentCreationData; } type formatFunction = () => string; @@ -426,7 +458,9 @@ declare module moment { isDuration(): boolean; isDuration(d: any): boolean; - // Deprecated in 2.8.0. + /** + * @deprecated since version 2.8.0 + */ lang(language?: string): string; lang(language?: string, definition?: MomentLanguage): string; @@ -479,6 +513,11 @@ declare module moment { relativeTimeThreshold(threshold: string): number | boolean; relativeTimeThreshold(threshold: string, limit: number): boolean; + /** + * @since 2.10.7+ + */ + now(): number; + /** * Constant used to enable explicit ISO_8601 format parsing. */ diff --git a/mongodb/mongodb.d.ts b/mongodb/mongodb.d.ts index 38037f003..2458dbdf2 100644 --- a/mongodb/mongodb.d.ts +++ b/mongodb/mongodb.d.ts @@ -13,8 +13,8 @@ declare module "mongodb" { export class MongoClient{ constructor(serverConfig: any, options: any); - static connect(uri: string, options: any, callback: (err: Error, db: Db) => void): void; - static connect(uri: string, callback: (err: Error, db: Db) => void): void; + static connect(uri: string, callback?: (err: Error, db: Db) => void): void; + static connect(uri: string, options: any, callback?: (err: Error, db: Db) => void): void; } // Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/server.html @@ -30,22 +30,22 @@ declare module "mongodb" { public db(dbName: string): Db; - public open(callback: (err : Error, db : Db) => void ): void; + public open(callback?: (err : Error, db : Db) => void ): void; public close(forceClose?: boolean, callback?: (err: Error, result: any) => void ): void; - public admin(callback: (err: Error, result: any) => void ): any; + public admin(callback?: (err: Error, result: any) => void ): any; public collectionsInfo(collectionName: string, callback?: (err: Error, result: any) => void ): void; public collectionNames(collectionName: string, options: any, callback?: (err: Error, result: any) => void ): void; public collection(collectionName: string): Collection; - public collection(collectionName: string, callback: (err: Error, collection: Collection) => void ): Collection; - public collection(collectionName: string, options: MongoCollectionOptions, callback: (err: Error, collection: Collection) => void ): Collection; + public collection(collectionName: string, callback?: (err: Error, collection: Collection) => void ): Collection; + public collection(collectionName: string, options: MongoCollectionOptions, callback?: (err: Error, collection: Collection) => void ): Collection; - public collections(callback: (err: Error, collections: Collection[]) => void ): void; + public collections(callback?: (err: Error, collections: Collection[]) => void ): void; public eval(code: any, parameters: any[], options?: any, callback?: (err: Error, result: any) => void ): void; - //public dereference(dbRef: DbRef, callback: (err: Error, result: any) => void): void; + //public dereference(dbRef: DbRef, callback?: (err: Error, result: any) => void): void; + public logout(callback?: (err: Error, result: any) => void ): void; public logout(options: any, callback?: (err: Error, result: any) => void ): void; - public logout(callback: (err: Error, result: any) => void ): void; public authenticate(userName: string, password: string, callback?: (err: Error, result: any) => void ): void; public authenticate(userName: string, password: string, options: any, callback?: (err: Error, result: any) => void ): void; @@ -65,8 +65,8 @@ declare module "mongodb" { public dropCollection(collectionName: string, callback?: (err: Error, result: any) => void ): void; public renameCollection(fromCollection: string, toCollection: string, callback?: (err: Error, result: any) => void ): void; - public lastError(options: Object, connectionOptions: any, callback: (err: Error, result: any) => void ): void; - public previousError(options: Object, callback: (err: Error, result: any) => void ): void; + public lastError(options: Object, connectionOptions: any, callback?: (err: Error, result: any) => void ): void; + public previousError(options: Object, callback?: (err: Error, result: any) => void ): void; // error = lastError // lastStatus = lastError @@ -80,28 +80,28 @@ declare module "mongodb" { public resetErrorHistory(callback?: (err: Error, result: any) => void ): void; public resetErrorHistory(options: any, callback?: (err: Error, result: any) => void ): void; - public createIndex(collectionName: any, fieldOrSpec: any, options: IndexOptions, callback: Function): void; - public ensureIndex(collectionName: any, fieldOrSpec: any, options: IndexOptions, callback: Function): void; + public createIndex(collectionName: any, fieldOrSpec: any, options: IndexOptions, callback?: Function): void; + public ensureIndex(collectionName: any, fieldOrSpec: any, options: IndexOptions, callback?: Function): void; - public cursorInfo(options: any, callback: Function): void; + public cursorInfo(options: any, callback?: Function): void; - public dropIndex(collectionName: string, indexName: string, callback: Function): void; - public reIndex(collectionName: string, callback: Function): void; - public indexInformation(collectionName: string, options: any, callback: Function): void; - public dropDatabase(callback: (err: Error, result: any) => void ): void; + public dropIndex(collectionName: string, indexName: string, callback?: Function): void; + public reIndex(collectionName: string, callback?: Function): void; + public indexInformation(collectionName: string, options: any, callback?: Function): void; + public dropDatabase(callback?: (err: Error, result: any) => void ): void; - public stats(options: any, callback: Function): void; - public _registerHandler(db_command: any, raw: any, connection: any, exhaust: any, callback: Function): void; - public _reRegisterHandler(newId: any, object: any, callback: Function): void; + public stats(options: any, callback?: Function): void; + public _registerHandler(db_command: any, raw: any, connection: any, exhaust: any, callback?: Function): void; + public _reRegisterHandler(newId: any, object: any, callback?: Function): void; public _callHandler(id: any, document: any, err: any): any; public _hasHandler(id: any): any; public _removeHandler(id: any): any; - public _findHandler(id: any): { id: string; callback: Function; }; - public __executeQueryCommand(self: any, db_command: any, options: any, callback: any): void; + public _findHandler(id: any): { id: string; callback?: Function; }; + public __executeQueryCommand(self: any, db_command: any, options: any, callback?: any): void; public DEFAULT_URL: string; - public connect(url: string, options: { uri_decode_auth?: boolean; }, callback: (err: Error, result: any) => void ): void; + public connect(url: string, options: { uri_decode_auth?: boolean; }, callback?: (err: Error, result: any) => void ): void; public addListener(event: string, handler:(param: any) => any): any; } @@ -127,11 +127,11 @@ declare module "mongodb" { // Creates an ObjectID from a hex string representation of an ObjectID. // hexString – create a ObjectID from a passed in 24 byte hexstring. public static createFromHexString(hexString: string): ObjectID; - + // Checks if a value is a valid bson ObjectId // id - Value to be checked public static isValid(id: string): Boolean; - + // Generate a 12 byte id string used in ObjectID's // time - optional parameter allowing to pass in a second based timestamp public generate(time?: number): string; @@ -308,16 +308,16 @@ declare module "mongodb" { * @deprecated use insertOne or insertMany * Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert */ - insert(query: any, callback: (err: Error, result: any) => void): void; - insert(query: any, options: { safe?: any; continueOnError?: boolean; keepGoing?: boolean; serializeFunctions?: boolean; }, callback: (err: Error, result: any) => void): void; + insert(query: any, callback?: (err: Error, result: any) => void): void; + insert(query: any, options: { safe?: any; continueOnError?: boolean; keepGoing?: boolean; serializeFunctions?: boolean; }, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insertOne - insertOne(doc:any, callback: (err: Error, result: any) => void) :void; - insertOne(doc: any, options: { w?: any; wtimeout?: number; j?: boolean; serializeFunctions?: boolean; forceServerObjectId?: boolean }, callback: (err: Error, result: any) => void): void; + insertOne(doc:any, callback?: (err: Error, result: any) => void) :void; + insertOne(doc: any, options: { w?: any; wtimeout?: number; j?: boolean; serializeFunctions?: boolean; forceServerObjectId?: boolean }, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insertMany - insertMany(docs: any, callback: (err: Error, result: any) => void): void; - insertMany(docs: any, options: { w?: any; wtimeout?: number; j?: boolean; serializeFunctions?: boolean; forceServerObjectId?: boolean }, callback: (err: Error, result: any) => void): void; + insertMany(docs: any, callback?: (err: Error, result: any) => void): void; + insertMany(docs: any, options: { w?: any; wtimeout?: number; j?: boolean; serializeFunctions?: boolean; forceServerObjectId?: boolean }, callback?: (err: Error, result: any) => void): void; /** * @deprecated use deleteOne or deleteMany * Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove @@ -326,12 +326,12 @@ declare module "mongodb" { remove(selector: Object, options: { safe?: any; single?: boolean; }, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#deleteOne - deleteOne(filter: any, callback: (err: Error, result: any) => void): void; - deleteOne(filter: any, options: { w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void; + deleteOne(filter: any, callback?: (err: Error, result: any) => void): void; + deleteOne(filter: any, options: { w?: any; wtimeout?: number; j?: boolean;}, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#deleteMany - deleteMany(filter: any, callback: (err: Error, result: any) => void): void; - deleteMany(filter: any, options: { w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void; + deleteMany(filter: any, callback?: (err: Error, result: any) => void): void; + deleteMany(filter: any, options: { w?: any; wtimeout?: number; j?: boolean;}, callback?: (err: Error, result: any) => void): void; rename(newName: String, callback?: (err: Error, result: any) => void): void; @@ -342,30 +342,30 @@ declare module "mongodb" { * Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update */ update(selector: Object, document: any, callback?: (err: Error, result: any) => void): void; - update(selector: Object, document: any, options: { safe?: boolean; upsert?: any; multi?: boolean; serializeFunctions?: boolean; }, callback: (err: Error, result: any) => void): void; + update(selector: Object, document: any, options: { safe?: boolean; upsert?: any; multi?: boolean; serializeFunctions?: boolean; }, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#updateOne - updateOne(filter: Object, update: any, callback: (err: Error, result: any) => void): void; - updateOne(filter: Object, update: any, options: { upsert?: boolean; w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void; + updateOne(filter: Object, update: any, callback?: (err: Error, result: any) => void): void; + updateOne(filter: Object, update: any, options: { upsert?: boolean; w?: any; wtimeout?: number; j?: boolean;}, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#updateMany - updateMany(filter: Object, update: any, callback: (err: Error, result: any) => void): void; - updateMany(filter: Object, update: any, options: { upsert?: boolean; w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void; + updateMany(filter: Object, update: any, callback?: (err: Error, result: any) => void): void; + updateMany(filter: Object, update: any, options: { upsert?: boolean; w?: any; wtimeout?: number; j?: boolean;}, callback?: (err: Error, result: any) => void): void; - distinct(key: string, query: Object, callback: (err: Error, result: any) => void): void; - distinct(key: string, query: Object, options: { readPreference: string; }, callback: (err: Error, result: any) => void): void; + distinct(key: string, query: Object, callback?: (err: Error, result: any) => void): void; + distinct(key: string, query: Object, options: { readPreference: string; }, callback?: (err: Error, result: any) => void): void; - count(callback: (err: Error, result: any) => void): void; - count(query: Object, callback: (err: Error, result: any) => void): void; - count(query: Object, options: { readPreference: string; }, callback: (err: Error, result: any) => void): void; + count(callback?: (err: Error, result: any) => void): void; + count(query: Object, callback?: (err: Error, result: any) => void): void; + count(query: Object, options: { readPreference: string; }, callback?: (err: Error, result: any) => void): void; drop(callback?: (err: Error, result: any) => void): void; /** * @deprecated use findOneAndUpdate, findOneAndReplace or findOneAndDelete * Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findAndModify */ - findAndModify(query: Object, sort: any[], doc: Object, callback: (err: Error, result: any) => void): void; - findAndModify(query: Object, sort: any[], doc: Object, options: { safe?: any; remove?: boolean; upsert?: boolean; new?: boolean; }, callback: (err: Error, result: any) => void): void; + findAndModify(query: Object, sort: any[], doc: Object, callback?: (err: Error, result: any) => void): void; + findAndModify(query: Object, sort: any[], doc: Object, options: { safe?: any; remove?: boolean; upsert?: boolean; new?: boolean; }, callback?: (err: Error, result: any) => void): void; /** * @deprecated use findOneAndDelete * Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findAndRemove @@ -374,16 +374,16 @@ declare module "mongodb" { findAndRemove(query : Object, sort? : any[], options?: { safe: any; }, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findOneAndDelete - findOneAndDelete(filter: any, callback: (err: Error, result: any) => void): void; - findOneAndDelete(filter: any, options: { projection?: any; sort?: any; maxTimeMS?: number; }, callback: (err: Error, result: any) => void): void; + findOneAndDelete(filter: any, callback?: (err: Error, result: any) => void): void; + findOneAndDelete(filter: any, options: { projection?: any; sort?: any; maxTimeMS?: number; }, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findOneAndReplace - findOneAndReplace(filter: any, replacement: any, callback: (err: Error, result: any) => void): void; - findOneAndReplace(filter: any, replacement: any, options: { projection?: any; sort?: any; maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean }, callback: (err: Error, result: any) => void): void; + findOneAndReplace(filter: any, replacement: any, callback?: (err: Error, result: any) => void): void; + findOneAndReplace(filter: any, replacement: any, options: { projection?: any; sort?: any; maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean }, callback?: (err: Error, result: any) => void): void; // Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findOneAndUpdate - findOneAndUpdate(filter: any, update: any, callback: (err: Error, result: any) => void): void; - findOneAndUpdate(filter: any, update: any, options: { projection?: any; sort?: any; maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean }, callback: (err: Error, result: any) => void): void; + findOneAndUpdate(filter: any, update: any, callback?: (err: Error, result: any) => void): void; + findOneAndUpdate(filter: any, update: any, options: { projection?: any; sort?: any; maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean }, callback?: (err: Error, result: any) => void): void; find(callback?: (err: Error, result: Cursor) => void): Cursor; find(selector: Object, callback?: (err: Error, result: Cursor) => void): Cursor; @@ -401,32 +401,32 @@ declare module "mongodb" { findOne(selector: Object, fields: any, skip: number, limit: number, callback?: (err: Error, result: any) => void): Cursor; findOne(selector: Object, fields: any, skip: number, limit: number, timeout: number, callback?: (err: Error, result: any) => void): Cursor; - createIndex(fieldOrSpec: any, callback: (err: Error, indexName: string) => void): void; - createIndex(fieldOrSpec: any, options: IndexOptions, callback: (err: Error, indexName: string) => void): void; + createIndex(fieldOrSpec: any, callback?: (err: Error, indexName: string) => void): void; + createIndex(fieldOrSpec: any, options: IndexOptions, callback?: (err: Error, indexName: string) => void): void; - ensureIndex(fieldOrSpec: any, callback: (err: Error, indexName: string) => void): void; - ensureIndex(fieldOrSpec: any, options: IndexOptions, callback: (err: Error, indexName: string) => void): void; + ensureIndex(fieldOrSpec: any, callback?: (err: Error, indexName: string) => void): void; + ensureIndex(fieldOrSpec: any, options: IndexOptions, callback?: (err: Error, indexName: string) => void): void; - indexInformation(options: any, callback: Function): void; - dropIndex(name: string, callback: Function): void; - dropAllIndexes(callback: Function): void; + indexInformation(options: any, callback?: Function): void; + dropIndex(name: string, callback?: Function): void; + dropAllIndexes(callback?: Function): void; // dropIndexes = dropAllIndexes - reIndex(callback: Function): void; - mapReduce(map: Function, reduce: Function, options: MapReduceOptions, callback: Function): void; - group(keys: Object, condition: Object, initial: Object, reduce: Function, finalize: Function, command: boolean, options: {readPreference: string}, callback: Function): void; - options(callback: Function): void; - isCapped(callback: Function): void; - indexExists(indexes: string, callback: Function): void; - geoNear(x: number, y: number, callback: Function): void; - geoNear(x: number, y: number, options: Object, callback: Function): void; - geoHaystackSearch(x: number, y: number, callback: Function): void; - geoHaystackSearch(x: number, y: number, options: Object, callback: Function): void; - indexes(callback: Function): void; - aggregate(pipeline: any[], callback: (err: Error, results: any) => void): void; - aggregate(pipeline: any[], options: {readPreference: string}, callback: (err: Error, results: any) => void): void; - stats(options: {readPreference: string; scale: number}, callback: (err: Error, results: CollStats) => void): void; - stats(callback: (err: Error, results: CollStats) => void): void; + reIndex(callback?: Function): void; + mapReduce(map: Function, reduce: Function, options: MapReduceOptions, callback?: Function): void; + group(keys: Object, condition: Object, initial: Object, reduce: Function, finalize: Function, command: boolean, options: {readPreference: string}, callback?: Function): void; + options(callback?: Function): void; + isCapped(callback?: Function): void; + indexExists(indexes: string, callback?: Function): void; + geoNear(x: number, y: number, callback?: Function): void; + geoNear(x: number, y: number, options: Object, callback?: Function): void; + geoHaystackSearch(x: number, y: number, callback?: Function): void; + geoHaystackSearch(x: number, y: number, options: Object, callback?: Function): void; + indexes(callback?: Function): void; + aggregate(pipeline: any[], callback?: (err: Error, results: any) => void): void; + aggregate(pipeline: any[], options: {readPreference: string}, callback?: (err: Error, results: any) => void): void; + stats(callback?: (err: Error, results: CollStats) => void): void; + stats(options: {readPreference: string; scale: number}, callback?: (err: Error, results: CollStats) => void): void; hint: any; } @@ -468,9 +468,9 @@ declare module "mongodb" { // constructor(db: Db, collection: Collection, selector, fields, options); rewind() : Cursor; - toArray(callback: (err: Error, results: any[]) => any) : void; - each(callback: (err: Error, item: any) => void) : void; - count(applySkipLimit: boolean, callback: (err: Error, count: number) => void) : void; + toArray(callback?: (err: Error, results: any[]) => any) : void; + each(callback?: (err: Error, item: any) => void) : void; + count(applySkipLimit: boolean, callback?: (err: Error, count: number) => void) : void; sort(keyOrList: any, callback? : (err: Error, result: any) => void): Cursor; @@ -481,12 +481,12 @@ declare module "mongodb" { skip(skip: number, callback?: (err: Error, result: any) => void): Cursor; batchSize(batchSize: number, callback?: (err: Error, result: any) => void): Cursor; - nextObject(callback: (err: Error, doc: any) => void) : void; - explain(callback: (err: Error, result: any) => void) : void; + nextObject(callback?: (err: Error, doc: any) => void) : void; + explain(callback?: (err: Error, result: any) => void) : void; stream(): CursorStream; - close(callback: (err: Error, result: any) => void) : void; + close(callback?: (err: Error, result: any) => void) : void; isClosed(): boolean; public static INIT: number; diff --git a/mongoose/mongoose-tests.ts b/mongoose/mongoose-tests.ts index 4ccc9b72d..806272f45 100644 --- a/mongoose/mongoose-tests.ts +++ b/mongoose/mongoose-tests.ts @@ -41,6 +41,16 @@ var schema: mongoose.Schema = new Schema({ name: String }, { collection: 'actor' schema.set('collection', 'actor'); var Model = mongoose.model('Actor', schema, 'actor'); +interface IZip extends mongoose.Document { + _id: string; +} +interface IPerson extends mongoose.Document { + _id: mongoose.Types.ObjectId; +} +interface IThing extends mongoose.Document { + _id: number; +} + var names: string[] = mongoose.modelNames(); var names: string[] = db.modelNames(); mongoose.plugin((schema: mongoose.Schema) => { @@ -195,8 +205,8 @@ Model.findOneAndRemove({ type: 'iphone' }, { select: 'name' }, (err: any, res: I Model.findOneAndRemove({ type: 'iphone' }, { select: 'name' }).exec((err: any, res: IActor) => {}); Model.findOneAndUpdate({ type: 'iphone' }, { $set: { name: 'jason borne' }}, { upsert: true }, (err: any, res: IActor) => {}); -Model.geoNear([1, 3], { maxDistance : 5, spherical : true }, (err: any, res: IActor[]) => {}); -Model.geoNear({ type : "Point", coordinates : [9,9] }, { maxDistance : 5, spherical : true }, (err: any, res: IActor[]) => {}); +Model.geoNear([1, 3], { maxDistance : 5, spherical : true }, (err: any, res: IActor[], stats: any) => {}); +Model.geoNear({ type : "Point", coordinates : [9,9] }, { maxDistance : 5, spherical : true }, (err: any, res: IActor[], stats: any) => {}); Model.geoSearch({ type : "house" }, { near: [10, 10], maxDistance: 5 }, (err: any, res: IActor[]) => {}); var o = { diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index e840d8e05..6871dc344 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -212,8 +212,8 @@ declare module "mongoose" { findOneAndUpdate(cond: Object, update: Object, callback?: (err: any, res: T) => void): Query; findOneAndUpdate(cond: Object, update: Object, options: FindAndUpdateOption, callback?: (err: any, res: T) => void): Query; - geoNear(point: { type: string; coordinates: number[] }, options: Object, callback?: (err: any, res: T[]) => void): Query; - geoNear(point: number[], options: Object, callback?: (err: any, res: T[]) => void): Query; + geoNear(point: { type: string; coordinates: number[] }, options: Object, callback?: (err: any, res: T[], stats: any) => void): Query; + geoNear(point: number[], options: Object, callback?: (err: any, res: T[], stats: any) => void): Query; geoSearch(cond: Object, options: GeoSearchOption, callback?: (err: any, res: T[]) => void): Query; increment(): T; mapReduce(options: MapReduceOption, callback?: (err: any, res: MapReduceResult[]) => void): Promise[]>; @@ -423,7 +423,7 @@ declare module "mongoose" { export interface Document { id?: string; - _id: Types.ObjectId; + _id: any; equals(doc: Document): boolean; get(path: string, type?: new(...args: any[]) => any): any; diff --git a/morgan/morgan-tests.ts b/morgan/morgan-tests.ts index 00e67f875..4a0df9902 100644 --- a/morgan/morgan-tests.ts +++ b/morgan/morgan-tests.ts @@ -23,7 +23,9 @@ morgan('combined', { buffer: true, immediate: true, skip: function (req, res) { return res.statusCode < 400 }, - stream: (str: string) => { - console.log(str); + stream: { + write: (str: string) => { + console.log(str); + } } }); diff --git a/morgan/morgan.d.ts b/morgan/morgan.d.ts index b889bc7be..048fce3d4 100644 --- a/morgan/morgan.d.ts +++ b/morgan/morgan.d.ts @@ -12,6 +12,13 @@ declare module "morgan" { export function token(name: string, callback: (req: express.Request, res: express.Response) => T): express.RequestHandler; + export interface StreamOptions { + /** + * Output stream for writing log lines + */ + write: (str: string) => void; + } + /*** * Morgan accepts these properties in the options object. */ @@ -36,7 +43,7 @@ declare module "morgan" { * Output stream for writing log lines, defaults to process.stdout. * @param str */ - stream?: (str: string) => void; + stream?: StreamOptions; } } diff --git a/navigation/navigation-tests.ts b/navigation/navigation-tests.ts index d3676e82e..0d663483a 100644 --- a/navigation/navigation-tests.ts +++ b/navigation/navigation-tests.ts @@ -78,10 +78,20 @@ module NavigationTests { // State Handler class LogStateHandler extends Navigation.StateHandler { + getNavigationLink(state: Navigation.State, data: any): string { + console.log('get navigation link'); + return super.getNavigationLink(state, data, { ids: [] }); + } getNavigationData(state: Navigation.State, url: string): any { console.log('get navigation data'); - super.getNavigationData(state, url); + super.getNavigationData(state, url, {}); } + urlEncode(state: Navigation.State, key: string, val: string, queryString: boolean): string { + return queryString ? val.replace(/\s/g, '+') : super.urlEncode(state, key, val, queryString); + } + urlDecode(state: Navigation.State, key: string, val: string, queryString: boolean): string { + return queryString ? val.replace(/\+/g, ' ') : super.urlDecode(state, key, val, queryString); + } } homePage.stateHandler = new LogStateHandler(); personList.stateHandler = new LogStateHandler(); diff --git a/navigation/navigation.d.ts b/navigation/navigation.d.ts index 418cec8a4..a9f2e1e0e 100644 --- a/navigation/navigation.d.ts +++ b/navigation/navigation.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Navigation 1.2.0 +// Type definitions for Navigation 1.3.0 // Project: http://grahammendick.github.io/navigation/ // Definitions by: Graham Mendick // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -529,6 +529,14 @@ declare module Navigation { * @returns The navigation link */ getNavigationLink(state: State, data: any): string; + /** + * Gets a link that navigates to the state passing the data + * @param state The State to navigate to + * @param data The data to pass when navigating + * @param queryStringData The query string array data + * @returns The navigation link + */ + getNavigationLink(state: State, data: any, queryStringData: { [index: string]: string[]; }): string; /** * Navigates to the url * @param oldState The current State @@ -543,6 +551,30 @@ declare module Navigation { * @returns The navigation data */ getNavigationData(state: State, url: string): any; + /** + * Gets the data parsed from the url + * @param state The State navigated to + * @param url The current url + * @param queryStringData Stores query string keys + * @returns The navigation data + */ + getNavigationData(state: State, url: string, queryStringData: any): any; + /** + * Encodes the Url value + * @param state The State navigated to + * @param key The key of the navigation data item + * @param val The Url value of the navigation data item + * @param queryString A value indicating the Url value's location + */ + urlEncode?(state: State, key: string, val: string, queryString: boolean): string; + /** + * Decodes the Url value + * @param state The State navigated to + * @param key The key of the navigation data item + * @param val The Url value of the navigation data item + * @param queryString A value indicating the Url value's location + */ + urlDecode?(state: State, key: string, val: string, queryString: boolean): string; /** * Truncates the crumb trail * @param The State navigated to @@ -642,6 +674,11 @@ declare module Navigation { * navigating back or refreshing and combineCrumbTrail is false */ trackAllPreviousData: boolean; + /** + * Gets or sets a value indicating whether arrays should be stored in + * a single query string parameter + */ + combineArray: boolean; } /** @@ -919,6 +956,14 @@ declare module Navigation { * @returns The navigation link */ getNavigationLink(state: State, data: any): string; + /** + * Gets a link that navigates to the state passing the data + * @param state The State to navigate to + * @param data The data to pass when navigating + * @param queryStringData The query string array data + * @returns The navigation link + */ + getNavigationLink(state: State, data: any, queryStringData: { [index: string]: string[]; }): string; /** * Navigates to the url * @param oldState The current State @@ -933,6 +978,30 @@ declare module Navigation { * @returns The navigation data */ getNavigationData(state: State, url: string): any; + /** + * Gets the data parsed from the url + * @param state The State navigated to + * @param url The current url + * @param queryStringData Stores query string keys + * @returns The navigation data + */ + getNavigationData(state: State, url: string, queryStringData: any): any; + /** + * Encodes the Url value + * @param state The State navigated to + * @param key The key of the navigation data item + * @param val The Url value of the navigation data item + * @param queryString A value indicating the Url value's location + */ + urlEncode(state: State, key: string, val: string, queryString: boolean): string; + /** + * Decodes the Url value + * @param state The State navigated to + * @param key The key of the navigation data item + * @param val The Url value of the navigation data item + * @param queryString A value indicating the Url value's location + */ + urlDecode(state: State, key: string, val: string, queryString: boolean): string; /** * Truncates the crumb trail whenever a repeated or initial State is * encountered @@ -1043,6 +1112,13 @@ declare module Navigation { * @returns The matched data or null if there's no match */ match(path: string): any; + /** + * Gets the matching data for the path + * @param path The path to match + * @param urlDecode The function that decodes the Url value + * @returns The matched data or null if there's no match + */ + match(path: string, urlDecode: (route: Route, name: string, val: string) => string): any; /** * Gets the route populated with default values * @returns The built route @@ -1050,10 +1126,17 @@ declare module Navigation { build(): string; /** * Gets the route populated with data and default values - * @param The data for the route parameters + * @param data The data for the route parameters * @returns The built route */ build(data: any): string; + /** + * Gets the route populated with data and default values + * @param data The data for the route parameters + * @param urlEncode The function that encodes the Url value + * @returns The built route + */ + build(data: any, urlEncode: (route: Route, name: string, val: string) => string): string; } /** @@ -1075,10 +1158,17 @@ declare module Navigation { addRoute(path: string, defaults: any): Route; /** * Gets the matching route and data for the path - * @param route The path to match + * @param path The path to match * @returns The matched route and data */ match(path: string): { route: Route; data: any; }; + /** + * Gets the matching route and data for the path + * @param path The path to match + * @param urlDecode The function that decodes the Url value + * @returns The matched route and data + */ + match(path: string, urlDecode: (route: Route, name: string, val: string) => string): { route: Route; data: any; }; /** * Sorts the routes by the comparer * @param compare The route comparer function diff --git a/ng-file-upload/ng-file-upload-tests.ts b/ng-file-upload/ng-file-upload-tests.ts index 6ff440402..f7fdcf101 100644 --- a/ng-file-upload/ng-file-upload-tests.ts +++ b/ng-file-upload/ng-file-upload-tests.ts @@ -1,53 +1,88 @@ /// -module controllers { +"use strict"; - "use strict"; +let controllerId = "upload"; - var controllerId = "upload"; +class UploadController { + static $inject = ["Upload"]; - class Upload { + constructor(private Upload: angular.angularFileUpload.IUploadService) { + this.Upload.setDefaults({ + ngfAccept: "image/*", + ngfAllowDir: true, + ngfEnableFirefoxPaste: true, + ngfHideOnDropNotAvailable: true, + ngfMaxDuration: 20, + ngfMaxFiles: 10, + ngfMaxSize: "10MB", + ngfMaxTotalSize: "10MB", + ngfMinDuration: "10s", + ngfMinRatio: "8:10,1.6", + ngfMinSize: "9MB", + ngfMultiple: true, + ngfRatio: "8:10,1.6", + ngfStopPropagation: true, + ngfValidateForce: true + }); + } + + onFileSelect(files: Array) { - static $inject = ["$upload"]; - constructor( - private $upload: angular.angularFileUpload.IUploadService - ) { - } + this.Upload + .upload({ + url: "/api/upload", + method: "POST", + data: { + media: files, + extraData: { + test: true + } + } + }).abort().xhr((evt: any) => { + console.log("xhr"); + }).progress((evt: angular.angularFileUpload.IFileProgressEvent) => { + let percent = parseInt((100.0 * evt.loaded / evt.total).toString(), 10); + console.log("upload progress: " + percent + "% for " + evt.config.data.media[0]); + }).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.IFileUploadConfigFile) => { + // file is uploaded successfully + console.log("Success!", data, status, headers, config); + }); - onFileSelect($files: File[]) { - // $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]; - 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: 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.IFileUploadConfigFile) => { - // file is uploaded successfully - console.log("Success!", data, status, headers, config); - }); + this.Upload + .base64DataUrl(files[0]) + .then((file: string) => { + console.log(file); + }) - } - } - } + this.Upload + .dataUrl(files[0], true) + .then((result: string) => { + console.log(result); + }); - angular.module("app").controller(controllerId, Upload); + this.Upload + .imageDimensions(files[0]) + .then((imageDimensions) => { + console.log(imageDimensions.height + " " + imageDimensions.width); + }); + + this.Upload.isResizeSupported(); + this.Upload.isResumeSupported(); + this.Upload.isUploadInProgress(); + + let json = this.Upload.json({ test: true }), + jsonBlob = this.Upload.jsonBlob({ test: true }), + fileWithNewName = this.Upload.rename(files[0], "newName.jpg"); + + this.Upload + .resize(files[0], 1024, 1024, 0.7, 'image/jpeg', 0.9, true) + .then((resizedFile) => { + console.log(resizedFile); + }); + } } + +angular.module("app").controller("UploadController", UploadController); diff --git a/ng-file-upload/ng-file-upload.d.ts b/ng-file-upload/ng-file-upload.d.ts index 79b1a91f1..ae646b516 100644 --- a/ng-file-upload/ng-file-upload.d.ts +++ b/ng-file-upload/ng-file-upload.d.ts @@ -1,43 +1,280 @@ -// Type definitions for Angular File Upload 4.2.1 +// Type definitions for Angular File Upload 11.1.1 // Project: https://github.com/danialfarid/ng-file-upload // Definitions by: John Reilly // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +declare module "ng-file-upload" { + let angularFileUploadDefaultExport: string; + export = angularFileUploadDefaultExport; +} + declare module angular.angularFileUpload { + interface ImageDimensions { + height: number; + width: number; + } + + interface FileUploadOptions { + /** + * Standard HTML accept attr, browser specific select popup window + * @type {string} + */ + ngfAccept?: string; + /** + * Default true, allow dropping files only for Chrome webkit browser + * @type {boolean} + */ + ngfAllowDir?: boolean; + /** + * Default false, enable firefox image paste by making element contenteditable + * @type {boolean} + */ + ngfEnableFirefoxPaste?: boolean; + /** + * Default false, hides element if file drag&drop is not + * @type {boolean} + */ + ngfHideOnDropNotAvailable?: boolean; + /** + * Validate error name: minDuration + * @type {(number|string)} + */ + ngfMinDuration: number | string; + ngfMinSize?: number | string; + /** + * Validate error name: minRatio + * @type {(number|string)} + */ + ngfMinRatio?: number | string; + /** + * Validate error name: maxDuration + * @type {(number|string)} + */ + ngfMaxDuration?: number | string; + /** + * Maximum number of files allowed to be selected or dropped, validate error name: maxFiles + * @type {number} + */ + ngfMaxFiles?: number; + /** + * Validate error name: maxSize + * @type {(number|string)} + */ + ngfMaxSize?: number | string; + /** + * Validate error name: maxTotalSize + * @type {(number|string)} + */ + ngfMaxTotalSize?: number | string; + /** + * Allows selecting multiple files + * @type {boolean} + */ + ngfMultiple?: boolean; + /** + * List of comma separated valid aspect ratio of images in float or 2:3 format + * @type {string} + */ + ngfRatio?: string; + /** + * Default false, whether to propagate drag/drop events. + * @type {boolean} + */ + ngfStopPropagation?: boolean; + /** + * Default false, if true file.$error will be set if the dimension or duration + * values for validations cannot be calculated for example image load error or unsupported video by the browser. + * By default it would assume the file is valid if the duration or dimension cannot be calculated by the browser. + * @type {boolean} + */ + ngfValidateForce?: boolean; + } interface IUploadService { - + /** + * Convert a single file or array of files to a single or array of + * base64 data url representation of the file(s). + * Could be used to send file in base64 format inside json to the databases + * + * @param {Array} + * @return {angular.IPromise} + */ + base64DataUrl(files: File | Array): angular.IPromise | string>; + /** + * Convert the file to blob url object or base64 data url based on boolean disallowObjectUrl value + * + * @param {File} file + * @param {boolean} [disallowObjectUrl] + * @return {angular.IPromise} + */ + dataUrl(file: File, disallowObjectUrl?: boolean): angular.IPromise; + /** + * Alternative way of uploading, send the file binary with the file's content-type. + * Could be used to upload files to CouchDB, imgur, etc... html5 FileReader is needed. + * This is equivalent to angular $http() but allow you to listen to the progress event for HTML5 browsers. + * + * @param {IRequestConfig} config + * @return {angular.IPromise} + */ http(config: IRequestConfig): IUploadPromise; - upload(config: IFileUploadConfigFiles|IFileUploadConfigFile): IUploadPromise; + /** + * Get image file dimensions + * + * @param {File} file + * @return {angular.IPromise} + */ + imageDimensions(file: File): angular.IPromise; + /** + * Returns boolean showing if image resize is supported by this browser + * + * @return {boolean} + */ + isResizeSupported(): boolean; + /** + * Returns boolean showing if resumable upload is supported by this browser + * + * @return {boolean} + */ + isResumeSupported(): boolean; + /** + * Returns true if there is an upload in progress. Can be used to prompt user before closing browser tab + * + * @return {boolean} + */ + isUploadInProgress(): boolean; + /** + * Converts the value to json to send data as json string. Same as angular.toJson(obj) + * + * @param {Object} obj + * @return {string} + */ + json(obj: Object): string; + /** + * Converts the object to a Blob object with application/json content type + * for jsob byte streaming support + * + * @param {Object} obj + * @return {Blob} + */ + jsonBlob(obj: Object): Blob; + /** + * Returns a file which will be uploaded with the newName instead of original file name + * + * @param {File} file + * @param {string} newName + * @return {File} + */ + rename(file: File, newName: string): File; + /** + * Resizes an image. Returns a promise + * + * @param {File} file + * @param {number} [width] + * @param {number} [height] + * @param {number} [quality] + * @param {string} [type] + * @param {number} [ratio] + * @param {boolean} [centerCrop] + * @return {angular.IPromise} + */ + resize(file: File, width?: number, height?: number, quality?: number, type?: string, + ratio?: number | string, centerCrop?: boolean): angular.IPromise; + /** + * Set the default values for ngf-select and ngf-drop directives + * + * @param {FileUploadOptions} defaultFileUploadOptions + */ + setDefaults(defaultFileUploadOptions: FileUploadOptions): void; + /** + * Upload a file. Returns a Promise, + * + * @param {IFileUploadConfigFile} config + * @return {IUploadPromise} + */ + upload(config: IFileUploadConfigFile): IUploadPromise; } interface IUploadPromise extends IHttpPromise { + /** + * Cancel/abort the upload in progress. + * + * @return {IUploadPromise} + */ abort(): IUploadPromise; progress(callback: IHttpPromiseCallback): IUploadPromise; + /** + * Access or attach event listeners to the underlying XMLHttpRequest + * + * @param {IHttpPromiseCallback} + * @return {IUploadPromise} + */ xhr(callback: IHttpPromiseCallback): IUploadPromise; } interface IFileUploadConfigFile extends IRequestConfig { - - file: File; - fileName?: string; - } - - interface IFileUploadConfigFiles extends IRequestConfig { - - file: File[]; - fileName?: string; - } - - interface IFilesProgressEvent extends ProgressEvent { - - config: IFileUploadConfigFiles; + /** + * Specify the file and optional data to be sent to the server. + * Each field including nested objects will be sent as a form data multipart. + * Samples: {pic: file, username: username} + * {files: files, otherInfo: {id: id, person: person,...}} multiple files (html5) + * {profiles: {[{pic: file1, username: username1}, {pic: file2, username: username2}]} nested array multiple files (html5) + * {file: file, info: Upload.json({id: id, name: name, ...})} send fields as json string + * {file: file, info: Upload.jsonBlob({id: id, name: name, ...})} send fields as json blob, 'application/json' content_type + * {picFile: Upload.rename(file, 'profile.jpg'), title: title} send file with picFile key and profile.jpg file name + * + * @type {Object} + */ + data: any; + /** + * upload.php script, node.js route, or servlet url + * @type {string} + */ + url: string; + /** + * This is to accommodate server implementations expecting nested data object keys in .key or [key] format. + * Example: data: {rec: {name: 'N', pic: file}} sent as: rec[name] -> N, rec[pic] -> file + * data: {rec: {name: 'N', pic: file}, objectKey: '.k'} sent as: rec.name -> N, rec.pic -> file + * @type {string} + */ + objectKey?: string; + /** + * This is to accommodate server implementations expecting array data object keys in '[i]' or '[]' or + * ''(multiple entries with same key) format. + * Example: data: {rec: [file[0], file[1], ...]} sent as: rec[0] -> file[0], rec[1] -> file[1],... + * data: {rec: {rec: [f[0], f[1], ...], arrayKey: '[]'} sent as: rec[] -> f[0], rec[] -> f[1],... + * @type {string} + */ + arrayKey?: string; + /** + * Uploaded file size so far on the server + * @type {string} + */ + resumeSizeUrl?: string; + /** + * Reads the uploaded file size from resumeSizeUrl GET response + * @type {Function} + */ + resumeSizeResponseReader?: Function; + /** + * Function that returns a prommise which will be resolved to the upload file size on the server. + * @type {[type]} + */ + resumeSize?: Function; + /** + * Upload in chunks of specified size + * @type {(number|string)} + */ + resumeChunkSize?: number | string; + /** + * Default false, experimental as hotfix for potential library conflicts with other plugins + * @type {boolean} + */ + disableProgress?: boolean; } interface IFileProgressEvent extends ProgressEvent { - config: IFileUploadConfigFile; } -} +} \ No newline at end of file diff --git a/ng-table/ng-table-tests.ts b/ng-table/ng-table-tests.ts new file mode 100644 index 000000000..1cc9c47a0 --- /dev/null +++ b/ng-table/ng-table-tests.ts @@ -0,0 +1,114 @@ +/// + +interface IPerson { + age: number; + name: string; +} + +function printPerson(p: IPerson) { + console.log('age: ' + p.age); + console.log('name: ' + p.name); +} + +// NgTableParams signature tests +namespace NgTableParamsTests { + + let initialParams: NgTable.IParamValues = { + filter: { name: 'Christian' }, + sorting: { age: 'asc' } + }; + let settings: NgTable.ISettings = { + dataset: [{ age: 1, name: 'Christian' }, { age: 2, name: 'Lee' }, { age: 40, name: 'Christian' }], + filterOptions: { + filterComparator: true, + filterDelay: 100 + }, + counts: [10, 20, 50] + }; + + export let tableParams = new NgTableParams(initialParams, settings); + + // modify parameters + tableParams.filter({ name: 'Lee' }); + tableParams.sorting('age', 'desc'); + tableParams.count(10); + tableParams.group(item => (item.age * 10).toString()); + + // modify settings at runtime + tableParams.settings({ + dataset: [{ age: 1, name: 'Brandon' }, { age: 2, name: 'Lee' }] + }); + + tableParams.reload().then(rows => { + rows.forEach(printPerson); + }); +} + +// Dynamic table column signature tests +namespace ColumnTests { + interface ICustomColFields { + field: string; + } + let dynamicCols: (NgTable.Columns.IDynamicTableColDef & ICustomColFields)[]; + + dynamicCols.push({ + class: () => 'table', + field: 'age', + filter: { age: 'number' }, + sortable: true, + show: true, + title: 'Age of Person', + titleAlt: 'Age' + }); +} + +namespace EventsTests { + declare let events: NgTable.Events.IEventsChannel; + + let unregistrationFuncs: NgTable.Events.IUnregistrationFunc[] = []; + let x: NgTable.Events.IUnregistrationFunc; + + x = events.onAfterCreated(params => { + // do stuff + }); + unregistrationFuncs.push(x); + + x = events.onAfterReloadData((params, newData, oldData) => { + newData.forEach(row => { + if (isDataGroup(row)) { + row.data.forEach(printPerson) + } else { + printPerson(row); + } + }); + }, NgTableParamsTests.tableParams); + unregistrationFuncs.push(x); + + x = events.onDatasetChanged((params, newDataset, oldDataset) => { + if (newDataset != null) { + newDataset.forEach(printPerson); + } + }, NgTableParamsTests.tableParams); + unregistrationFuncs.push(x); + + x = events.onPagesChanged((params, newButtons, oldButtons) => { + newButtons.forEach(printPageButton); + }, NgTableParamsTests.tableParams); + unregistrationFuncs.push(x); + + unregistrationFuncs.forEach(f => { + f(); + }); + + + function printPageButton(btn: NgTable.IPageButton) { + console.log('type: ' + btn.type); + console.log('number: ' + btn['number']); + console.log('current: ' + btn.current); + console.log('active: ' + btn.active); + } + + function isDataGroup(row: any): row is NgTable.Data.IDataRowGroup { + return ('$hideRows' in row); + } +} \ No newline at end of file diff --git a/ng-table/ng-table.d.ts b/ng-table/ng-table.d.ts new file mode 100644 index 000000000..ab485a277 --- /dev/null +++ b/ng-table/ng-table.d.ts @@ -0,0 +1,838 @@ +// Type definitions for ng-table +// Project: https://github.com/esvit/ng-table +// Definitions by: Christian Crowhurst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Parameters manager for an ngTable directive + */ +declare class NgTableParams { + /** + * The page of data rows currently being displayed in the table + */ + data: T[]; + + constructor(baseParameters?: NgTable.IParamValues, baseSettings?: NgTable.ISettings) + + /** + * Returns the number of data rows per page + */ + count(): number + /** + * Sets the number of data rows per page. + * Changes to count will cause `isDataReloadRequired` to return true + */ + count(count: number): NgTableParams + + /** + * Returns the current filter values used to restrict the set of data rows. + * @param trim supply true to return the current filter minus any insignificant values + * (null, undefined and empty string) + */ + filter(trim?: boolean): NgTable.IFilterValues + /** + * Sets filter values to the `filter` supplied; any existing filter will be removed + * Changes to filter will cause `isDataReloadRequired` to return true and the current `page` to be set to 1 + */ + filter(filter: NgTable.IFilterValues): NgTableParams + /** + * Generate array of pages. + * When no arguments supplied, the current parameter state of this `NgTableParams` instance will be used + */ + generatePagesArray(currentPage?: number, totalItems?: number, pageSize?: number, maxBlocks?: number): NgTable.IPageButton[] + /** + * Returns the current grouping used to group the data rows + */ + group(): NgTable.Grouping + /** + * Sets grouping to the `field` and `sortDirection` supplied; any existing grouping will be removed + * Changes to group will cause `isDataReloadRequired` to return true and the current `page` to be set to 1 + */ + group(field: string, sortDirection?: string): NgTableParams + /** + * Sets grouping to the `group` supplied; any existing grouping will be removed. + * Changes to group will cause `isDataReloadRequired` to return true and the current `page` to be set to 1 + */ + group(group: NgTable.Grouping): NgTableParams + /** + * Returns true when an attempt to `reload` the current `parameter` values have resulted in a failure. + * This method will continue to return true until the `reload` is successfully called or when the + * `parameter` values have changed + */ + hasErrorState(): boolean + /** + * Returns true if `filter` has significant filter value(s) (any value except null, undefined, or empty string), + * otherwise false + */ + hasFilter(): boolean + /** + * Return true when a change to `filters` require the `reload` method + * to be run so as to ensure the data presented to the user reflects these filters + */ + hasFilterChanges(): boolean + /** + * Returns true when at least one group has been set + */ + hasGroup(): boolean + /** + * Returns true when the `group` and when supplied, the `sortDirection` matches an existing group + */ + hasGroup(group: string | NgTable.IGroupingFunc, sortDirection?: string): boolean + /** + * Return true when a change to this instance should require the `reload` method + * to be run so as to ensure the data rows presented to the user reflects the current state. + * + * Note that this method will return false when the `reload` method has run but fails. In this case + * `hasErrorState` will return true. + * + * The built-in `ngTable` directives will watch for when this function returns true and will then call + * the `reload` method to load its data rows + */ + isDataReloadRequired(): boolean + /** + * Returns sorting values in a format that can be consumed by the angular `$orderBy` filter service + */ + orderBy(): string[] + /** + * Trigger a reload of the data rows + */ + reload>(): ng.IPromise + /** + * Returns the settings for the table. + */ + settings(): NgTable.ISettings + /** + * Sets the settings for the table; new setting values will be merged with the existing settings. + * Supplying a new `dataset` will cause `isDataReloadRequired` to return true and the `ngTableEventsChannel` + * to fire its `datasetChanged` event + */ + settings(newSettings: NgTable.ISettings): NgTableParams + /** + * Returns the current sorting used to order the data rows. + * Changes to sorting will cause `isDataReloadRequired` to return true + */ + sorting(): NgTable.ISortingValues + /** + * Sets sorting values to the `sorting` supplied; any existing sorting will be removed. + * Changes to sorting will cause `isDataReloadRequired` to return true + */ + sorting(sorting: NgTable.ISortingValues): NgTableParams + /** + * Sets sorting to the `field` and `direction` supplied; any existing sorting will be removed + */ + sorting(field: string, direction: string): NgTableParams + /** + * Returns the index of the current "slice" of data rows + */ + page(): number + /** + * Sets the index of the current "slice" of data rows. The index starts at 1. + * Changing the page number will cause `isDataReloadRequired` to return true + */ + page(page: number): NgTableParams + /** + * Returns the count of the data rows that match the current `filter` + */ + total(): number + /** + * Sets `settings().total` to the value supplied. + * Typically you will need to set a `total` in the body of any custom `getData` function + * you supply as a setting value to this instance. + * @example + * var tp = new NgTableParams({}, { getData: customGetData }) + * function customGetData(params) { + * var queryResult = /* code to fetch current data rows and total *\/ + * params.total(queryResult.total); + * return queryResult.dataRowsPage; + * } + */ + total(total: number): NgTableParams + /** + * Returns the current parameter values uri-encoded. Set `asString` to + * true for the parameters to be returned as an array of strings of the form 'paramName=value' + * otherwise parameters returned as a key-value object + */ + url(asString?: boolean): { [name: string]: string } | string[] +} + +declare namespace NgTable { + + interface IDataSettings { + applyPaging?: boolean; + } + + /** + * An angular value object that allow for overriding of the initial default values used when constructing + * an instance of `NgTableParams` + */ + interface IDefaults { + params?: IParamValues; + settings?: ISettings + } + + /** + * Map of the names of fields declared on a data row and the corrosponding filter value + */ + interface IFilterValues { [name: string]: any } + + /** + * Map of the names of fields on a data row and the corrosponding sort direction; + * Set the value of a key to undefined to let value of `ISettings.defaultSort` apply + */ + interface ISortingValues { [name: string]: string } + + type Grouping = IGroupValues | IGroupingFunc; + + /** + * Map of the names of fields on a data row and the corrosponding sort direction + */ + interface IGroupValues { [name: string]: string } + + /** + * Signature of a function that should return the name of the group + * that the `item` should be placed within + */ + interface IGroupingFunc { + (item: T): string; + /** + * 'asc' or 'desc'; leave undefined to let the value of `ISettings.groupOptions.defaultSort` apply + */ + sortDirection?: string + } + + /** + * The runtime values for `NgTableParams` that determine the set of data rows and + * how they are to be displayed in a table + */ + interface IParamValues { + /** + * The index of the "slice" of data rows, starting at 1, to be displayed by the table. + */ + page?: number; + /** + * The number of data rows per page + */ + count?: number; + /** + * The filter that should be applied to restrict the set of data rows + */ + filter?: IFilterValues; + /** + * The sort order that should be applied to the data rows. + */ + sorting?: ISortingValues; + /** + * The grouping that should be applied to the data rows + */ + group?: string | Grouping; + } + + + type FilterComparator = boolean | IFilterComparatorFunc; + + interface IFilterComparatorFunc { + (actual: T, expected: T): boolean; + } + + interface IFilterFunc { + (data: T[], filter: IFilterValues, filterComparator: FilterComparator): T[] + } + + + interface IFilterSettings { + /** + * Use this to determine how items are matched against the filter values. + * This setting is identical to the `comparator` parameter supported by the angular + * `$filter` filter service + * + * Defaults to `undefined` which will result in a case insensitive susbstring match when + * `IDefaultGetData` service is supplying the implementation for the + * `ISettings.getData` function + */ + filterComparator?: FilterComparator; + /** + * A duration to wait for the user to stop typing before applying the filter. + * - Defaults to 0 for small managed inmemory arrays ie where a `ISettings.dataset` argument is + * supplied to `NgTableParams.settings`. + * - Defaults to 500 milliseconds otherwise. + */ + filterDelay?: number; + /** + * The number of elements up to which a managed inmemory array is considered small. Defaults to 10000. + */ + filterDelayThreshold?: number; + /** + * Overrides `IDefaultGetDataProvider.filterFilterName`. + * The value supplied should be the name of the angular `$filter` service that will be selected to perform + * the actual filter logic. + * Defaults to 'filter'. + */ + filterFilterName?: string; + /** + * Tells `IDefaultGetData` to use this function supplied to perform the filtering instead of selecting an angular $filter. + */ + filterFn?: IFilterFunc; + /** + * The layout to use when multiple html templates are to rendered in a single table header column. + * Available values: + * - stack (the default) + * - horizontal + */ + filterLayout?: string + } + + interface IGroupSettings { + /** + * The default sort direction that will be used whenever a group is supplied that + * does not define its own sort direction + */ + defaultSort?: string; + /** + * Determines whether groups should be displayed expanded to show their items. Defaults to true + */ + isExpanded?: boolean; + } + + /** + * Definition of the buttons rendered by the data row pager directive + */ + interface IPageButton { + type: string; + number?: number; + active: boolean; + current?: boolean; + } + + /** + * Configuration settings for `NgTableParams` + */ + interface ISettings { + /** + * Returns true whenever a call to `getData` is in progress + */ + $loading?: boolean; + /** + * An array that contains all the data rows that NgTable should manage. + * The `gateData` function will be used to manage the data rows + * that ultimately will be displayed. + */ + dataset?: T[]; + dataOptions?: {}; + /** + * The total number of data rows before paging has been applied. + * Typically you will not need to supply this yourself + */ + total?: number; + /** + * The default sort direction that will be used whenever a sorting is supplied that + * does not define its own sort direction + */ + defaultSort?: string; + filterOptions?: IFilterSettings; + groupOptions?: IGroupSettings; + /** + * The page size buttons that should be displayed. Each value defined in the array + * determines the possible values that can be supplied to `NgTableParams.page()` + */ + counts?: number[]; + /** + * The collection of interceptors that should apply to the results of a call to + * the `getData` function before the data rows are displayed in the table + */ + interceptors?: IInterceptor[]; + /** + * Configuration for the template that will display the page size buttons + */ + paginationMaxBlocks?: number; + /** + * Configuration for the template that will display the page size buttons + */ + paginationMinBlocks?: number; + /** + * The html tag that will be used to display the sorting indicator in the table header + */ + sortingIndicator?: string; + /** + * The function that will be used fetch data rows. Leave undefined to let the `IDefaultGetData` + * service provide a default implementation that will work with the `dataset` array you supply. + * + * Typically you will supply a custom function when you need to execute filtering, paging and sorting + * on the server + */ + getData?: Data.IGetDataFunc | Data.IInterceptableGetDataFunc; + /** + * The function that will be used group data rows according to the groupings returned by `NgTableParams.group()` + */ + getGroups?: Data.IGetGroupFunc; + } + + /** + * Configuration values that determine the behaviour of the `ngTableFilterConfig` service + */ + interface IFilterConfigValues { + /** + * The default base url to use when deriving the url for a filter template given just an alias name + * Defaults to 'ng-table/filters/' + */ + defaultBaseUrl?: string; + /** + * The extension to use when deriving the url of a filter template when given just an alias name + */ + defaultExt?: string; + /** + * A map of alias names and their corrosponding urls. A lookup against this map will be used + * to find the url matching an alias name. + * If no match is found then a url will be derived using the following pattern `${defaultBaseUrl}${aliasName}.${defaultExt}` + */ + aliasUrls?: { [name: string]: string }; + } + + /** + * The angular provider used to configure the behaviour of the `ngTableFilterConfig` service + */ + interface IFilterConfigProvider { + $get: IFilterConfig; + /** + * Reset back to factory defaults the config values that `ngTableFilterConfig` service will use + */ + resetConfigs(): void; + /** + * Set the config values used by `ngTableFilterConfig` service + */ + setConfig(customConfig: IFilterConfigValues): void; + } + + /** + * A key value-pair map where the key is the name of a field in a data row and the value is the definition + * for the template used to render a filter cell in the header of a html table. + * Where the value is supplied as a string this should either be url to a html template or an alias to a url registered + * using the `ngTableFilterConfigProvider` + * @example + * vm.ageFilter = { "age": "number" } + * @example + * vm.ageFilter = { "age": "my/custom/ageTemplate.html" } + * @example + * vm.ageFilter = { "age": { id: "number", placeholder: "Age of person"} } + */ + interface IFilterTemplateDefMap { + [name: string]: string | IFilterTemplateDef + } + + /** + * A fully qualified template definition for a single filter + */ + interface IFilterTemplateDef { + /** + * A url to a html template of an alias to a url registered using the `ngTableFilterConfigProvider` + */ + id: string, + /** + * The text that should be rendered as a prompt to assist the user when entering a filter value + */ + placeholder: string + } + + /** + * Exposes configuration values and methods used to return the location of the html + * templates used to render the filter row of an ng-table directive + */ + interface IFilterConfig { + /** + * Readonly copy of the final values used to configure the service. + */ + config: IFilterConfigValues, + /** + * Return the url of the html filter template for the supplied definition and key. + * For more information see the documentation for `IFilterTemplateMap` + */ + getTemplateUrl(filterDef: string | IFilterTemplateDef, filterKey?: string): string, + /** + * Return the url of the html filter template registered with the alias supplied + */ + getUrlForAlias(aliasName: string, filterKey?: string): string + } + + interface InternalTableParams extends NgTableParams { + isNullInstance: boolean + } + + /** + * A custom object that can be registered with an NgTableParams instance that can be used + * to post-process the results (and failures) returned by its `getData` function + */ + interface IInterceptor { + response?: (data: TData, params: NgTableParams) => TData; + responseError?: (reason: any, params: NgTableParams) => any; + } + + type SelectData = ISelectOption[] | ISelectDataFunc + + interface ISelectOption { + id: string | number; + title: string; + } + + interface ISelectDataFunc { + (): ISelectOption[] | ng.IPromise + } + + /** + * Definition of the constructor function that will construct new instances of `NgTableParams`. + * On construction of `NgTableParams` the `ngTableEventsChannel` will fire its `afterCreated` event. + */ + interface ITableParamsConstructor { + new (baseParameters?: IParamValues, baseSettings?: ISettings): NgTableParams + } + + + namespace Data { + + type DataResult = T | IDataRowGroup; + + interface IDataRowGroup { + data: T[]; + $hideRows: boolean; + value: string; + } + + /** + * A default implementation of the getData function that will apply the `filter`, `orderBy` and + * paging values from the `NgTableParams` instance supplied to the data array supplied. + * + * A call to this function will: + * - return the resulting array + * - assign the total item count after filtering to the `total` of the `NgTableParams` instance supplied + */ + interface IDefaultGetData { + (data: T[], params: NgTableParams): T[]; + /** + * Convenience function that this service will use to apply paging to the data rows. + * + * Returns a slice of rows from the `data` array supplied and sets the `NgTableParams.total()` + * on the `params` instance supplied to `data.length` + */ + applyPaging(data: T[], params: NgTableParams): T[], + /** + * Returns a reference to the function that this service will use to filter data rows + */ + getFilterFn(params: NgTableParams): IFilterFunc, + /** + * Returns a reference to the function that this service will use to sort data rows + */ + getOrderByFn(params?: NgTableParams): void + } + + /** + * Allows for the configuration of the ngTableDefaultGetData service. + */ + interface IDefaultGetDataProvider { + $get(): IDefaultGetData; + /** + * The name of a angular filter that knows how to apply the values returned by + * `NgTableParams.filter()` to restrict an array of data. + * (defaults to the angular `filter` filter service) + */ + filterFilterName: string, + /** + * The name of a angular filter that knows how to apply the values returned by + * `NgTableParams.orderBy()` to sort an array of data. + * (defaults to the angular `orderBy` filter service) + */ + sortingFilterName: string + } + + interface IGetDataBcShimFunc { + (originalFunc: ILegacyGetDataFunc): { (params: NgTableParams): ng.IPromise } + } + + /** + * Signature of a function that will called whenever NgTable requires to load data rows + * into the table. + * `params` is the table requesting the data rows + */ + interface IGetDataFunc { + (params: NgTableParams): T[] | ng.IPromise; + } + + interface IGetGroupFunc { + (params: NgTableParams): { [name: string]: IDataRowGroup[] } + } + + /** + * Variation of the `IGetDataFunc` function signature that allows for flexibility for + * the shape of the return value. + * Typcially you will use this function signature when you want to configure `NgTableParams` with + * interceptors that will return the final data rows array. + */ + interface IInterceptableGetDataFunc { + (params: NgTableParams): TResult; + } + + interface ILegacyGetDataFunc { + ($defer: ng.IDeferred, params: NgTableParams): void + } + } + + namespace Events { + interface IEventSelectorFunc { + (publisher: NgTableParams): boolean + } + + type EventSelector = NgTableParams | IEventSelectorFunc + + interface IDatasetChangedListener { + (publisher: NgTableParams, newDataset: T[], oldDataset: T[]): any + } + interface IAfterCreatedListener { + (publisher: NgTableParams): any + } + interface IAfterReloadDataListener { + (publisher: NgTableParams, newData: NgTable.Data.DataResult[], oldData: NgTable.Data.DataResult[]): any + } + interface IPagesChangedListener { + (publisher: NgTableParams, newPages: NgTable.IPageButton[], oldPages: NgTable.IPageButton[]): any + } + + interface IUnregistrationFunc { + (): void + } + + interface IEventsChannel { + /** + * Subscribe to receive notification whenever a new `NgTableParams` instance has finished being constructed. + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a + * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. + * + * @param listener the function that will be called when the event fires + * @param scope the angular `$scope` that will limit the lifetime of the event subscription + * @param eventFilter a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onAfterCreated(listener: Events.IAfterCreatedListener, scope: ng.IScope, eventFilter?: Events.IEventSelectorFunc): IUnregistrationFunc; + /** + * Subscribe to receive notification whenever a new `NgTableParams` instance has finished being constructed. + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. + * + * @param listener the function that will be called when the event fires + * @param eventFilter a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onAfterCreated(listener: Events.IAfterCreatedListener, eventFilter?: Events.IEventSelectorFunc): IUnregistrationFunc; + /** + * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a + * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. + * + * @param listener the function that will be called when the event fires + * @param scope the angular `$scope` that will limit the lifetime of the event subscription + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onAfterReloadData(listener: Events.IAfterReloadDataListener, scope: ng.IScope, eventFilter?: Events.EventSelector): IUnregistrationFunc; + /** + * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. + * + * @param listener the function that will be called when the event fires + * @param eventFilter a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onAfterReloadData(listener: Events.IAfterReloadDataListener, eventFilter?: Events.EventSelector): IUnregistrationFunc; + + /** + * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance. + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a + * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. + * + * @param listener the function that will be called when the event fires + * @param scope the angular `$scope` that will limit the lifetime of the event subscription + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onDatasetChanged(listener: Events.IDatasetChangedListener, scope: ng.IScope, eventFilter?: Events.EventSelector): IUnregistrationFunc; + /** + * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance. + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. + * + * @param listener the function that will be called when the event fires + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onDatasetChanged(listener: Events.IDatasetChangedListener, eventFilter?: Events.EventSelector): IUnregistrationFunc; + + /** + * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a + * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. + * + * @param listener the function that will be called when the event fires + * @param scope the angular `$scope` that will limit the lifetime of the event subscription + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onPagesChanged(listener: Events.IPagesChangedListener, scope: ng.IScope, eventFilter?: Events.EventSelector): IUnregistrationFunc; + /** + * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. + * + * @param listener the function that will be called when the event fires + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @return a unregistration function that when called will unregister the `listener` + */ + onPagesChanged(listener: Events.IPagesChangedListener, eventFilter?: Events.EventSelector): IUnregistrationFunc; + + publishAfterCreated(publisher: NgTableParams): void; + publishAfterReloadData(publisher: NgTableParams, newData: T[], oldData: T[]): void; + publishDatasetChanged(publisher: NgTableParams, newDataset: T[], oldDataset: T[]): void; + publishPagesChanged(publisher: NgTableParams, newPages: NgTable.IPageButton[], oldPages: NgTable.IPageButton[]): void; + } + } + + namespace Columns { + + type ColumnFieldContext = ng.IScope & { + $column: IColumnDef; + $columns: IColumnDef[]; + } + + interface IColumnField { + (context?: ColumnFieldContext): T; + assign($scope: ng.IScope, value: T): void; + } + + /** + * The definition of the column within a ngTable. + * When using `ng-table` directive a column definition will be parsed from each `td` tag found in the + * `tr` data row tag. + * + * @example + * + * + * + * + */ + interface IColumnDef { + /** + * Custom CSS class that should be added to the `th` tag(s) of this column in the table header + * + * To set this on the `td` tag of a html table use the attribute `header-class` or `data-header-class` + */ + class: IColumnField; + /** + * The `ISelectOption`s that can be used in a html filter template for this colums. + */ + data?: SelectData; + /** + * The index position of this column within the `$columns` container array + */ + id: number; + /** + * The definition of 0 or more html filter templates that should be rendered for this column in + * the table header + */ + filter: IColumnField; + /** + * Supplies the `ISelectOption`s that can be used in a html filter template for this colums. + * At the creation of the `NgTableParams` this field will be called and the result then assigned + * to the `data` field of this column. + */ + filterData: IColumnField | SelectData>; + /** + * The name of the data row field that will be used to group on, or false when this column + * does not support grouping + */ + groupable: IColumnField; + /** + * The url of a custom html template that should be used to render a table header for this column + * + * To set this on the `td` tag for a html table use the attribute `header` or `data-header` + */ + headerTemplateURL: IColumnField; + /** + * The text that should be used as a tooltip for this column in the table header + */ + headerTitle: IColumnField; + /** + * Determines whether this column should be displayed in the table + * + * To set this on the `td` tag for a html table use the attribute `ng-if` + */ + show: IColumnField; + /** + * The name of the data row field that will be used to sort on, or false when this column + * does not support sorting + */ + sortable: IColumnField; + /** + * The title of this column that should be displayed in the table header + */ + title: IColumnField; + /** + * An alternate column title. Typically this can be used for responsive table layouts + * where the titleAlt should be used for small screen sizes + */ + titleAlt: IColumnField; + } + + type DynamicTableColField = IDynamicTableColFieldFunc | T; + + interface IDynamicTableColFieldFunc { + (context: ColumnFieldContext): T; + } + + /** + * The definition of the column supplied to a ngTableDynamic directive. + */ + interface IDynamicTableColDef { + /** + * Custom CSS class that should be added to the `th` tag(s) of this column in the table header + */ + class?: DynamicTableColField; + /** + * The definition of 0 or more html filter templates that should be rendered for this column in + * the table header + */ + filter?: DynamicTableColField; + /** + * Supplies the `ISelectOption`s that can be used in a html filter template for this colums. + * At the creation of the `NgTableParams` this field will be called and the result then assigned + * to the `data` field of this column. + */ + filterData?: DynamicTableColField | SelectData>; + /** + * The name of the data row field that will be used to group on, or false when this column + * does not support grouping + */ + groupable?: DynamicTableColField; + /** + * The url of a custom html template that should be used to render a table header for this column + */ + headerTemplateURL?: DynamicTableColField; + /** + * The text that should be used as a tooltip for this column in the table header + */ + headerTitle?: DynamicTableColField; + /** + * Determines whether this column should be displayed in the table + */ + show?: DynamicTableColField; + /** + * The name of the data row field that will be used to sort on, or false when this column + * does not support sorting + */ + sortable?: DynamicTableColField; + /** + * The title of this column that should be displayed in the table header + */ + title?: DynamicTableColField; + /** + * An alternate column title. Typically this can be used for responsive table layouts + * where the titleAlt should be used for small screen sizes + */ + titleAlt?: DynamicTableColField; + } + } +} + diff --git a/node/node-tests.ts b/node/node-tests.ts index eaab3c2c8..8faf5fed6 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -9,6 +9,7 @@ import * as crypto from "crypto"; import * as tls from "tls"; import * as http from "http"; import * as net from "net"; +import * as tty from "tty"; import * as dgram from "dgram"; import * as querystring from "querystring"; import * as path from "path"; @@ -133,6 +134,7 @@ function bufferTests() { var base64Buffer = new Buffer('','base64'); var octets: Uint8Array = null; var octetBuffer = new Buffer(octets); + var copiedBuffer = new Buffer(utf8Buffer); console.log(Buffer.isBuffer(octetBuffer)); console.log(Buffer.isEncoding('utf8')); console.log(Buffer.byteLength('xyz123')); @@ -158,6 +160,15 @@ function bufferTests() { // fill returns the input buffer. b.fill('a').fill('b'); + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.indexOf("23"); + index = buffer.indexOf("23", 1); + index = buffer.indexOf(23); + index = buffer.indexOf(buffer); + } } @@ -202,6 +213,13 @@ function stream_readable_pipe_test() { var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex'); +{ + let hmac: crypto.Hmac; + (hmac = crypto.createHmac('md5', 'hello')).end('world', 'utf8', () => { + let hash: Buffer|string = hmac.read(); + }); +} + function crypto_cipher_decipher_string_test() { var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); var clearText:string = "This is the clear text."; @@ -281,7 +299,7 @@ module http_tests { }); var agent: http.Agent = http.globalAgent; - + http.request({ agent: false }); @@ -293,6 +311,23 @@ module http_tests { }); } +//////////////////////////////////////////////////// +/// TTY tests : http://nodejs.org/api/tty.html +//////////////////////////////////////////////////// + +module tty_tests { + let rs: tty.ReadStream; + let ws: tty.WriteStream; + + let rsIsRaw: boolean = rs.isRaw; + rs.setRawMode(true); + + let wsColumns: number = ws.columns; + let wsRows: number = ws.rows; + + let isTTY: boolean = tty.isatty(1); +} + //////////////////////////////////////////////////// /// Dgram tests : http://nodejs.org/api/dgram.html //////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index 450facb4a..928b823e5 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -113,6 +113,12 @@ declare var Buffer: { * @param array The octets to store. */ new (array: any[]): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + new (buffer: Buffer): Buffer; prototype: Buffer; /** * Returns true if {obj} is a Buffer @@ -395,6 +401,7 @@ interface NodeBuffer { writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; fill(value: any, offset?: number, end?: number): Buffer; + indexOf(value: string | number | Buffer, byteOffset?: number): number; } /************************************************ @@ -1681,13 +1688,13 @@ declare module "crypto" { export function createHash(algorithm: string): Hash; export function createHmac(algorithm: string, key: string): Hmac; export function createHmac(algorithm: string, key: Buffer): Hmac; - interface Hash { + export interface Hash { update(data: any, input_encoding?: string): Hash; digest(encoding: 'buffer'): Buffer; digest(encoding: string): any; digest(): Buffer; } - interface Hmac { + export interface Hmac extends NodeJS.ReadWriteStream { update(data: any, input_encoding?: string): Hmac; digest(encoding: 'buffer'): Buffer; digest(encoding: string): any; @@ -1695,7 +1702,7 @@ declare module "crypto" { } export function createCipher(algorithm: string, password: any): Cipher; export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; - interface Cipher { + export interface Cipher { update(data: Buffer): Buffer; update(data: string, input_encoding?: string, output_encoding?: string): string; final(): Buffer; @@ -1704,7 +1711,7 @@ declare module "crypto" { } export function createDecipher(algorithm: string, password: any): Decipher; export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; - interface Decipher { + export interface Decipher { update(data: Buffer): Buffer; update(data: string, input_encoding?: string, output_encoding?: string): string; final(): Buffer; @@ -1712,18 +1719,18 @@ declare module "crypto" { setAutoPadding(auto_padding: boolean): void; } export function createSign(algorithm: string): Signer; - interface Signer extends NodeJS.WritableStream { + export interface Signer extends NodeJS.WritableStream { update(data: any): void; sign(private_key: string, output_format: string): string; } export function createVerify(algorith: string): Verify; - interface Verify extends NodeJS.WritableStream { + export interface Verify extends NodeJS.WritableStream { update(data: any): void; verify(object: string, signature: string, signature_format?: string): boolean; } export function createDiffieHellman(prime_length: number): DiffieHellman; export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; - interface DiffieHellman { + export interface DiffieHellman { generateKeys(encoding?: string): string; computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; getPrime(encoding?: string): string; @@ -1909,10 +1916,12 @@ declare module "tty" { export interface ReadStream extends net.Socket { isRaw: boolean; setRawMode(mode: boolean): void; + isTTY: boolean; } export interface WriteStream extends net.Socket { columns: number; rows: number; + isTTY: boolean; } } diff --git a/notifyjs/notifyjs-tests.ts b/notifyjs/notifyjs-tests.ts index 3289791de..7d9ffec67 100644 --- a/notifyjs/notifyjs-tests.ts +++ b/notifyjs/notifyjs-tests.ts @@ -31,6 +31,6 @@ function test_Notify_static_methods() { Notify.requestPermission(); Notify.requestPermission(()=> console.log("onPermissionGrantedCallback")); Notify.requestPermission(()=> console.log("onPermissionGrantedCallback"), ()=> console.log("onPermissionDeniedCallback")); - Notify.isSupported; + Notify.isSupported(); Notify.permissionLevel; } diff --git a/notifyjs/notifyjs.d.ts b/notifyjs/notifyjs.d.ts index 1c683084d..1214052c7 100644 --- a/notifyjs/notifyjs.d.ts +++ b/notifyjs/notifyjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for notify.js 1.2.3 +// Type definitions for notify.js 1.2.8 // Project: https://github.com/alexgibson/notify.js // Definitions by: soundTricker // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -23,7 +23,7 @@ declare var Notify: { * return true if the browser supports HTML5 Notification * @param true : the browser supports HTML5 Notification, false ; the browser does not supports HTML5 Notification. */ - isSupported: boolean; + isSupported(): boolean; /** * shows the user's current permission level (granted, denied or default), returns null if notifications are not supported. diff --git a/osmtogeojson/osmtogeojson-tests.ts b/osmtogeojson/osmtogeojson-tests.ts new file mode 100644 index 000000000..f7d52c075 --- /dev/null +++ b/osmtogeojson/osmtogeojson-tests.ts @@ -0,0 +1,96 @@ +/// +/// + +import osmtogeojson from 'osmtogeojson'; +import {OsmJSON, GeoJSON} from 'osmtogeojson'; +import * as xmldom from 'xmldom'; + +let xml: Document = (new xmldom.DOMParser()).parseFromString("", 'text/xml'); +let geojson: GeoJSON.FeatureCollection = { + type: "FeatureCollection", + features: [ + { + type: "Feature", + id: "node/1", + properties: { + type: "node", + id: 1, + tags: {}, + relations: [], + meta: {} + }, + geometry: { + type: "Point", + coordinates: [4.321, 1.234] + } + } + ] +}; + +osmtogeojson.toGeojson(xml); +osmtogeojson(xml, { + flatProperties: true, + uninterestingTags: {foo:true} +}); + +let json: OsmJSON.OsmJSONObject = { + elements: [ + { + type: "node", + id: 1, + lat: 1.234, + lon: 4.321, + timestamp: "2013-01-13T22:56:07Z", + version: 7, + changeset: 1234, + user: "johndoe", + uid: 666 + }, + { + type: "relation", + tags: {"type": "multipolygon"}, + id: 1, + members: [ + { + type: "way", + ref: 2, + role: "outer" + }, + { + type: "way", + ref: 3, + role: "outer" + } + ] + }, + { + type: "way", + id: 2, + nodes: [4,5,6,4] + }, + { + type: "node", + id: 4, + lat: 0.0, + lon: 0.0 + }, + { + type: "node", + id: 5, + lat: 0.0, + lon: 1.0 + }, + { + type: "node", + id: 6, + lat: 1.0, + lon: 0.0 + } + ] +}; + +osmtogeojson.toGeojson(json); +osmtogeojson(json, { + flatProperties: true, + uninterestingTags: {foo:true} +}); diff --git a/osmtogeojson/osmtogeojson.d.ts b/osmtogeojson/osmtogeojson.d.ts new file mode 100644 index 000000000..ad29c1b73 --- /dev/null +++ b/osmtogeojson/osmtogeojson.d.ts @@ -0,0 +1,96 @@ +// Type definitions for osmtogeojson 2.2.5 +// Project: https://github.com/tyrasd/osmtogeojson.git +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "osmtogeojson" { + export interface OsmToGeoJSON { + (data: Document|OsmJSON.OsmJSONObject, options?: Options): GeoJSON.GeoJSONObject; + toGeojson(data: Document|OsmJSON.OsmJSONObject, options?: Options): GeoJSON.GeoJSONObject; + } + + export interface Options { + verbose?: boolean; + /** + * If true, the resulting GeoJSON feature's properties will be a simple key-value list instead of a structured json object (with separate tags and metadata). default: false + */ + flatProperties?: boolean; + /** + * Either a blacklist of tag keys or a callback function. Will be used to decide if a feature is interesting enough for its own GeoJSON feature. + */ + uninterestingTags?: { [tag: string]: boolean; }|Function; //TODO: type function + /** + * Either a json object or callback function that is used to determine if a closed way should be treated as a Polygon or LineString. + */ + polygonFeatures?: any|Function; //TODO: type this + } + + export namespace GeoJSON { + export interface GeoJSONObject { + type: string; + } + + export interface Feature extends GeoJSONObject { + id?: string; + geometry: Geometry; + properties: any; //TODO: type this + } + + export interface FeatureCollection extends GeoJSONObject { + features: Feature[]; + } + + export interface Geometry extends GeoJSONObject { + coordinates: Coordinate|Coordinate[]|Coordinate[][]; + } + + export interface GeometryCollection extends GeoJSONObject { + geometries: Geometry[]; + } + + export type Coordinate2d = [number, number]; + export type Coordinate3d = [number, number, number]; + export type Coordinate = Coordinate2d|Coordinate3d; + } + + export namespace OsmJSON { + export interface OsmJSONObject { + elements: (Node|Way|Relationship)[]; + } + + export interface Element { + type: string; + id: number; + tags?: { [name: string]: string; } + timestamp?: string; + version?: number; + changeset?: number; + user?: string; + uid?: number; + } + + export interface Node extends Element { + lat: number; + lon: number; + } + + export interface Way extends Element { + nodes: number[]; + } + + export interface Relationship extends Element { + members: Member[]; + } + + export interface Member { + type: string; + ref: number; + role: string; + } + } + + var osmtogeojson: OsmToGeoJSON; + + export default osmtogeojson; +} + diff --git a/parsimmon/parsimmon-tests.ts b/parsimmon/parsimmon-tests.ts index 3f8019891..569328296 100644 --- a/parsimmon/parsimmon-tests.ts +++ b/parsimmon/parsimmon-tests.ts @@ -110,6 +110,9 @@ fooPar = P.succeed(foo); fooArrPar = P.seq(fooPar, fooPar); anyArrPar = P.seq(barPar, fooPar, numPar); +fooPar = P.custom((success, failure) => (stream, i) => { str = stream; num = i; return success(num, foo); }); +fooPar = P.custom((success, failure) => (stream, i) => failure(num, str)); + fooPar = P.alt(fooPar, fooPar); anyPar = P.alt(barPar, fooPar, numPar); diff --git a/parsimmon/parsimmon.d.ts b/parsimmon/parsimmon.d.ts index 719e9c937..94b1b3be1 100644 --- a/parsimmon/parsimmon.d.ts +++ b/parsimmon/parsimmon.d.ts @@ -1,12 +1,14 @@ // Type definitions for Parsimmon 0.5.0 // Project: https://github.com/jneen/parsimmon -// Definitions by: Bart van der Schoor +// Definitions by: Bart van der Schoor , Mizunashi Mana // Definitions: https://github.com/borisyankov/DefinitelyTyped // TODO convert to generics declare module 'parsimmon' { module Parsimmon { + + export type StreamType = string; export interface Mark { start: number; @@ -103,6 +105,14 @@ declare module 'parsimmon' { export function seq(...parsers: Parser[]): Parser; export function seq(...parsers: Parser[]): Parser; + export type SuccessFunctionType = (index: number, result: U) => Result; + export type FailureFunctionType = (index: number, msg: string) => Result; + export type ParseFunctionType = (stream: StreamType, index: number) => Result; + /* + allows to add custom primitive parsers. + */ + export function custom(parsingFunction: (success: SuccessFunctionType, failure: FailureFunctionType) => ParseFunctionType): Parser; + /* accepts a variable number of parsers, and yields the value of the first one that succeeds, backtracking in between. */ diff --git a/prettyjson/prettyjson-tests.ts b/prettyjson/prettyjson-tests.ts new file mode 100644 index 000000000..80ecbbb0f --- /dev/null +++ b/prettyjson/prettyjson-tests.ts @@ -0,0 +1,23 @@ +/// + +var options: prettyjson.RendererOptions, + input: string, + output: string, + version: string; + + +console.log("using prettyjson v" + prettyjson.version) +version = prettyjson.version; + +input = 'This is a string'; +output = prettyjson.render(input); + +output = prettyjson.render(input, {}, 4); + +output = prettyjson.render(['first string', ['nested 1', 'nested 2'], 'second string']); + +output = prettyjson.render({param1: 'first string', param2: 'second string'}); + +output = prettyjson.render({first_param: {subparam: 'first string', subparam2: 'another string'}, second_param: 'second string'}); + +prettyjson.renderString('{name: "Wael", nested: {list: ["a", "b"], int: 3}}') diff --git a/prettyjson/prettyjson.d.ts b/prettyjson/prettyjson.d.ts new file mode 100644 index 000000000..cf2a69c19 --- /dev/null +++ b/prettyjson/prettyjson.d.ts @@ -0,0 +1,55 @@ +// Type definitions for prettyjson +// Project: https://github.com/rafeca/prettyjson +// Definitions by: Wael BEN ZID EL GUEBSI +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module prettyjson { + + /** + * Defines prettyjson version + */ + export var version: string; + + /** + * Render pretty json. + * + * @param data {any} Data to prettify. + * @param options {IOptions} Hash with different options to configure the renderer. + * @param indentation {number} Indentation size. + * + * @return {string} pretty serialized json data ready to display. + */ + export function render(data: any, options?: RendererOptions, indentation?: number): string; + + /** + * Render pretty json from a string. + * + * @param data {string} Serialized JSON data to prettify. + * @param options {IOptions} Hash with different options to configure the renderer. + * @param indentation {number} Indentation size. + * + * @return {string} pretty serialized json data ready to display. + */ + export function renderString(data: string, options?: RendererOptions, indentation?: number): string; + + export interface RendererOptions { + + /** + * Define behavior for Array objects + */ + emptyArrayMsg ?: string; // default: (empty) + inlineArrays ?: boolean; + + /** + * Color definition + */ + noColor ?: boolean; + keysColor ?: string; + dashColor ?: string; + numberColor ?: string; + stringColor ?: string; + + defaultIndentation ?: number; + } +} diff --git a/raphael/raphael.d.ts b/raphael/raphael.d.ts index 4d174fa71..58c7aa156 100644 --- a/raphael/raphael.d.ts +++ b/raphael/raphael.d.ts @@ -19,7 +19,9 @@ interface RaphaelAnimation { } interface RaphaelFont { - + w:number; + face:any; + glyphs:any; } interface RaphaelElement { diff --git a/react-notification-system/react-notification-system-tests.ts b/react-notification-system/react-notification-system-tests.ts new file mode 100644 index 000000000..07cd8ff2c --- /dev/null +++ b/react-notification-system/react-notification-system-tests.ts @@ -0,0 +1,62 @@ +/// +/// + +import React = require('react'); +import NotificationSystem = require('react-notification-system'); + + +class MyComponent extends React.Component { + private notificationSystem: NotificationSystem.System = null; + + private notification: NotificationSystem.Notification = { + message: 'Notification message', + level: 'success', + action: { + label: "Button inside this notification", + callback: () => { + this.notificationSystem.removeNotification(this.notification); + } + } + }; + + private addNotification() { + this.notification = this.notificationSystem.addNotification(this.notification); + } + + componentDidMount() { + this.notificationSystem = this.refs['notificationSystem'] as NotificationSystem.System; + this.addNotification(); + } + + render() { + + var style = { + NotificationItem: { // Override the notification item + DefaultStyle: { // Applied to every notification, regardless of the notification level + margin: '10px 5px 2px 1px' + }, + + success: { // Applied only to the success notification item + color: 'red' + } + } + }; + + var attributes: NotificationSystem.Attributes = { + style: { + Containers: { + DefaultStyle: { + margin: '10px 5px 2px 1px' + } + }, + Title: { + success: { + color: 'green' + } + } + } + }; + + return React.createElement(NotificationSystem, { title: "NotificationTitile", style: style, } as NotificationSystem.Attributes); + } +} diff --git a/react-notification-system/react-notification-system.d.ts b/react-notification-system/react-notification-system.d.ts new file mode 100644 index 000000000..52a5d7d98 --- /dev/null +++ b/react-notification-system/react-notification-system.d.ts @@ -0,0 +1,89 @@ +// Type definitions for React Notification System v0.2.6 +// Project: https://www.npmjs.com/package/react-notification-system +// Definitions by: Giedrius Grabauskas , Deividas Bakanas +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module NotificationSystem { + + import React = __React; + + export interface System extends React.Component { + addNotification(notification: Notification): Notification; + removeNotification(notification: Notification): void; + removeNotification(uid: string): void; + } + + export interface CallBackFunction { + (notification: Notification): void; + } + + export interface Notification { + title?: string; + message?: string; + level?: string; + position?: string; + autoDismiss?: number; + dismissible?: boolean; + action?: ActionObject; + onAdd?: CallBackFunction; + onRemove?: CallBackFunction; + uid?: number | string; + } + + export interface ActionObject { + label: string; + callback?: Function; + } + + export interface ContainersStyle { + DefaultStyle: React.CSSProperties; + tl?: React.CSSProperties; + tr?: React.CSSProperties; + tc?: React.CSSProperties; + bl?: React.CSSProperties; + br?: React.CSSProperties; + bc?: React.CSSProperties; + } + + export interface ItemStyle { + DefaultStyle?: React.CSSProperties; + success?: React.CSSProperties; + error?: React.CSSProperties; + warning?: React.CSSProperties; + info?: React.CSSProperties; + } + + export interface WrapperStyle { + DefaultStyle?: React.CSSProperties; + } + + export interface Style { + Wrapper?: any; + Containers?: ContainersStyle; + NotificationItem?: ItemStyle; + Title?: ItemStyle; + MessageWrapper?: WrapperStyle; + Dismiss?: ItemStyle; + Action?: ItemStyle; + ActionWrapper?: WrapperStyle; + } + + export interface Attributes { + noAnimation?: boolean; + ref?: string; + style?: Style | boolean; + } + + + export interface Component { + (): React.ReactElement; + } +} + + +declare module 'react-notification-system' { + var component: NotificationSystem.Component; + export = component; +} diff --git a/react-router-bootstrap/react-router-bootstrap-tests.tsx b/react-router-bootstrap/react-router-bootstrap-tests.tsx new file mode 100644 index 000000000..0211e97e7 --- /dev/null +++ b/react-router-bootstrap/react-router-bootstrap-tests.tsx @@ -0,0 +1,32 @@ +// React-Router-Bootstrap Test +// ================================================================================ +/// +/// +/// + +// Imports +// -------------------------------------------------------------------------------- +import * as React from 'react'; +import { Component, CSSProperties } from 'react'; +import { Button } from 'react-bootstrap'; +import { LinkContainer, IndexLinkContainer } from 'react-router-bootstrap' + + +export class ReactRouterBootstrapTest extends Component { + callback() { + alert('Callback: ' + JSON.stringify(arguments)); + } + + public render() { + let style: CSSProperties = { padding: '50px' }; + return ( +
    + +
    + + +
    +
    + ); + } +} diff --git a/react-router-bootstrap/react-router-bootstrap.d.ts b/react-router-bootstrap/react-router-bootstrap.d.ts new file mode 100644 index 000000000..c268a4ad4 --- /dev/null +++ b/react-router-bootstrap/react-router-bootstrap.d.ts @@ -0,0 +1,46 @@ +// Type definitions for react-router-bootstrap +// Project: https://github.com/react-bootstrap/react-router-bootstrap +// Definitions by: Vincent Lesierse +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare namespace ReactRouterBootstrap { + // Import React + import React = __React; + + interface LinkContainerProps extends ReactRouter.LinkProps { + disabled?: boolean + } + interface LinkContainer extends React.ComponentClass {} + interface LinkContainerElement extends React.ReactElement {} + const LinkContainer: LinkContainer + + const IndexLinkContainer: LinkContainer +} + +declare module "react-router-bootstrap/lib/LinkContainer" { + + export default ReactRouterBootstrap.LinkContainer + +} + +declare module "react-router-bootstrap/lib/IndexLinkContainer" { + + export default ReactRouterBootstrap.IndexLinkContainer + +} + +declare module "react-router-bootstrap" { + + import LinkContainer from "react-router-bootstrap/lib/LinkContainer" + + import IndexLinkContainer from "react-router-bootstrap/lib/IndexLinkContainer" + + export { + LinkContainer, + IndexLinkContainer + } + +} diff --git a/react-router/react-router-1.0.0.d.ts b/react-router/react-router-1.0.0.d.ts new file mode 100644 index 000000000..2010a1f49 --- /dev/null +++ b/react-router/react-router-1.0.0.d.ts @@ -0,0 +1,452 @@ +// Type definitions for react-router v1.0.0 +// Project: https://github.com/rackt/react-router +// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// +/// + + +declare namespace ReactRouter { + + import React = __React + + import H = HistoryModule + + // types based on https://github.com/rackt/react-router/blob/master/docs/Glossary.md + + type Component = React.ReactType + + type EnterHook = (nextState: RouterState, replaceState: RedirectFunction, callback?: Function) => any + + type LeaveHook = () => any + + type Params = Object + + type ParseQueryString = (queryString: H.QueryString) => H.Query + + type RedirectFunction = (state: H.LocationState, pathname: H.Pathname | H.Path, query?: H.Query) => void + + type RouteComponent = Component + + // use the following interface in an app code to get access to route param values, history, location... + // interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: number }> {} + // somewhere in MyComponent + // ... + // let id = this.props.routeParams.id + // ... + // this.props.history. ... + // ... + interface RouteComponentProps { + history?: History + location?: H.Location + params?: P + route?: PlainRoute + routeParams?: R + routes?: PlainRoute[] + } + + type RouteComponents = { [key: string]: RouteComponent } + + type RouteConfig = React.ReactNode | PlainRoute | PlainRoute[] + + type RouteHook = (nextLocation?: H.Location) => any + + type RoutePattern = string + + type StringifyQuery = (queryObject: H.Query) => H.QueryString + + type RouterListener = (error: Error, nextState: RouterState) => void + + interface RouterState { + location: H.Location + routes: PlainRoute[] + params: Params + components: RouteComponent[] + } + + + interface HistoryBase extends H.History { + routes: PlainRoute[] + parseQueryString?: ParseQueryString + stringifyQuery?: StringifyQuery + } + + type History = HistoryBase & H.HistoryQueries & HistoryRoutes + + + /* components */ + + interface RouterProps extends React.Props { + history?: H.History + routes?: RouteConfig // alias for children + createElement?: (component: RouteComponent, props: Object) => any + onError?: (error: any) => any + onUpdate?: () => any + parseQueryString?: ParseQueryString + stringifyQuery?: StringifyQuery + } + interface Router extends React.ComponentClass {} + interface RouterElement extends React.ReactElement {} + const Router: Router + + + interface LinkProps extends React.HTMLAttributes, React.Props { + activeStyle?: React.CSSProperties + activeClassName?: string + onlyActiveOnIndex?: boolean + to: RoutePattern + query?: H.Query + state?: H.LocationState + } + interface Link extends React.ComponentClass {} + interface LinkElement extends React.ReactElement {} + const Link: Link + + + const IndexLink: Link + + + interface RoutingContextProps extends React.Props { + history: H.History + createElement: (component: RouteComponent, props: Object) => any + location: H.Location + routes: RouteConfig + params: Params + components?: RouteComponent[] + } + interface RoutingContext extends React.ComponentClass {} + interface RoutingContextElement extends React.ReactElement {} + const RoutingContext: RoutingContext + + + /* components (configuration) */ + + interface RouteProps extends React.Props { + path?: RoutePattern + component?: RouteComponent + components?: RouteComponents + getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void + getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void + onEnter?: EnterHook + onLeave?: LeaveHook + } + interface Route extends React.ComponentClass {} + interface RouteElement extends React.ReactElement {} + const Route: Route + + + interface PlainRoute { + path?: RoutePattern + component?: RouteComponent + components?: RouteComponents + getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void + getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void + onEnter?: EnterHook + onLeave?: LeaveHook + indexRoute?: PlainRoute + getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void + childRoutes?: PlainRoute[] + getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void + } + + + interface RedirectProps extends React.Props { + path?: RoutePattern + from?: RoutePattern // alias for path + to: RoutePattern + query?: H.Query + state?: H.LocationState + } + interface Redirect extends React.ComponentClass {} + interface RedirectElement extends React.ReactElement {} + const Redirect: Redirect + + + interface IndexRouteProps extends React.Props { + component?: RouteComponent + components?: RouteComponents + getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void + getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void + onEnter?: EnterHook + onLeave?: LeaveHook + } + interface IndexRoute extends React.ComponentClass {} + interface IndexRouteElement extends React.ReactElement {} + const IndexRoute: IndexRoute + + + interface IndexRedirectProps extends React.Props { + to: RoutePattern + query?: H.Query + state?: H.LocationState + } + interface IndexRedirect extends React.ComponentClass {} + interface IndexRedirectElement extends React.ReactElement {} + const IndexRedirect: IndexRedirect + + + /* mixins */ + + interface HistoryMixin { + history: History + } + const History: React.Mixin + + + interface LifecycleMixin { + routerWillLeave(nextLocation: H.Location): string | boolean + } + const Lifecycle: React.Mixin + + + const RouteContext: React.Mixin + + + /* utils */ + + interface HistoryRoutes { + listen(listener: RouterListener): Function + listenBeforeLeavingRoute(route: PlainRoute, hook: RouteHook): void + match(location: H.Location, callback: (error: any, nextState: RouterState, nextLocation: H.Location) => void): void + isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean + } + + function useRoutes(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory + + + function createRoutes(routes: RouteConfig): PlainRoute[] + + + interface MatchArgs { + routes?: RouteConfig + history?: H.History + location?: H.Location + parseQueryString?: ParseQueryString + stringifyQuery?: StringifyQuery + } + interface MatchState extends RouterState { + history: History + } + function match(args: MatchArgs, cb: (error: any, nextLocation: H.Location, nextState: MatchState) => void): void + +} + + +declare module "react-router/lib/Router" { + + export default ReactRouter.Router + +} + + +declare module "react-router/lib/Link" { + + export default ReactRouter.Link + +} + + +declare module "react-router/lib/IndexLink" { + + export default ReactRouter.IndexLink + +} + + +declare module "react-router/lib/IndexRedirect" { + + export default ReactRouter.IndexRedirect + +} + + +declare module "react-router/lib/IndexRoute" { + + export default ReactRouter.IndexRoute + +} + + +declare module "react-router/lib/Redirect" { + + export default ReactRouter.Redirect + +} + + +declare module "react-router/lib/Route" { + + export default ReactRouter.Route + +} + + +declare module "react-router/lib/History" { + + export default ReactRouter.History + +} + + +declare module "react-router/lib/Lifecycle" { + + export default ReactRouter.Lifecycle + +} + + +declare module "react-router/lib/RouteContext" { + + export default ReactRouter.RouteContext + +} + + +declare module "react-router/lib/useRoutes" { + + export default ReactRouter.useRoutes + +} + +declare module "react-router/lib/PatternUtils" { + + export function formatPattern(pattern: string, params: {}): string; + +} + +declare module "react-router/lib/RouteUtils" { + + type E = __React.ReactElement + + export function isReactChildren(object: E | E[]): boolean + + export function createRouteFromReactElement(element: E): ReactRouter.PlainRoute + + export function createRoutesFromReactChildren(children: E | E[], parentRoute: ReactRouter.PlainRoute): ReactRouter.PlainRoute[] + + export import createRoutes = ReactRouter.createRoutes + +} + + +declare module "react-router/lib/RoutingContext" { + + export default ReactRouter.RoutingContext + +} + + +declare module "react-router/lib/PropTypes" { + + import React = __React + + export function falsy(props: any, propName: string, componentName: string): Error; + + export const history: React.Requireable + + export const location: React.Requireable + + export const component: React.Requireable + + export const components: React.Requireable + + export const route: React.Requireable + + export const routes: React.Requireable + + export default { + falsy, + history, + location, + component, + components, + route + } + +} + + +declare module "react-router/lib/match" { + + export default ReactRouter.match + +} + + +declare module "react-router" { + + import Router from "react-router/lib/Router" + + import Link from "react-router/lib/Link" + + import IndexLink from "react-router/lib/IndexLink" + + import IndexRedirect from "react-router/lib/IndexRedirect" + + import IndexRoute from "react-router/lib/IndexRoute" + + import Redirect from "react-router/lib/Redirect" + + import Route from "react-router/lib/Route" + + import History from "react-router/lib/History" + + import Lifecycle from "react-router/lib/Lifecycle" + + import RouteContext from "react-router/lib/RouteContext" + + import useRoutes from "react-router/lib/useRoutes" + + import { createRoutes } from "react-router/lib/RouteUtils" + + import { formatPattern } from "react-router/lib/PatternUtils" + + import RoutingContext from "react-router/lib/RoutingContext" + + import PropTypes from "react-router/lib/PropTypes" + + import match from "react-router/lib/match" + + // PlainRoute is defined in the API documented at: + // https://github.com/rackt/react-router/blob/master/docs/API.md + // but not included in any of the .../lib modules above. + export type PlainRoute = ReactRouter.PlainRoute + + // The following definitions are also very useful to export + // because by using these types lots of potential type errors + // can be exposed: + export type EnterHook = ReactRouter.EnterHook + export type LeaveHook = ReactRouter.LeaveHook + export type ParseQueryString = ReactRouter.ParseQueryString + export type RedirectFunction = ReactRouter.RedirectFunction + export type RouteComponentProps = ReactRouter.RouteComponentProps; + export type RouteHook = ReactRouter.RouteHook + export type StringifyQuery = ReactRouter.StringifyQuery + export type RouterListener = ReactRouter.RouterListener + export type RouterState = ReactRouter.RouterState + export type HistoryBase = ReactRouter.HistoryBase + + export { + Router, + Link, + IndexLink, + IndexRedirect, + IndexRoute, + Redirect, + Route, + History, + Lifecycle, + RouteContext, + useRoutes, + createRoutes, + formatPattern, + RoutingContext, + PropTypes, + match + } + + export default Router + +} diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index 42ee3236f..ab32451a0 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -8,10 +8,7 @@ import * as React from "react" import * as ReactDOM from "react-dom" -import { Router, Route, IndexRoute, Link } from "react-router" - -import createHistory from "history/lib/createBrowserHistory" - +import { browserHistory, hashHistory, Router, Route, IndexRoute, Link } from "react-router" class Master extends React.Component, {}> { @@ -59,7 +56,7 @@ class Users extends React.Component<{}, {}> { ReactDOM.render(( - + diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index 2010a1f49..01411fcd5 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -74,7 +74,8 @@ declare namespace ReactRouter { } type History = HistoryBase & H.HistoryQueries & HistoryRoutes - + const browserHistory: History; + const hashHistory: History; /* components */ @@ -367,6 +368,13 @@ declare module "react-router/lib/PropTypes" { } +declare module "react-router/lib/browserHistory" { + export default ReactRouter.browserHistory; +} + +declare module "react-router/lib/hashHistory" { + export default ReactRouter.hashHistory; +} declare module "react-router/lib/match" { @@ -397,6 +405,10 @@ declare module "react-router" { import RouteContext from "react-router/lib/RouteContext" + import browserHistory from "react-router/lib/browserHistory" + + import hashHistory from "react-router/lib/hashHistory" + import useRoutes from "react-router/lib/useRoutes" import { createRoutes } from "react-router/lib/RouteUtils" @@ -437,6 +449,8 @@ declare module "react-router" { Redirect, Route, History, + browserHistory, + hashHistory, Lifecycle, RouteContext, useRoutes, diff --git a/react/react-addons-transition-group.d.ts b/react/react-addons-transition-group.d.ts index 728c52aa8..9178eb516 100644 --- a/react/react-addons-transition-group.d.ts +++ b/react/react-addons-transition-group.d.ts @@ -6,14 +6,14 @@ /// declare namespace __React { - + interface TransitionGroupProps { component?: ReactType; childFactory?: (child: ReactElement) => ReactElement; } - + type TransitionGroup = ComponentClass; - + namespace __Addons { export var TransitionGroup: __React.TransitionGroup; } @@ -23,4 +23,4 @@ declare module "react-addons-transition-group" { var TransitionGroup: __React.TransitionGroup; type TransitionGroup = __React.TransitionGroup; export = TransitionGroup; -} \ No newline at end of file +} diff --git a/recursive-readdir/recursive-readdir.d.ts b/recursive-readdir/recursive-readdir.d.ts index b948fac87..4cd17c80b 100644 --- a/recursive-readdir/recursive-readdir.d.ts +++ b/recursive-readdir/recursive-readdir.d.ts @@ -3,13 +3,16 @@ // Definitions by: Elisée Maurer // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "recursive-readdir" { +/// +declare module "recursive-readdir" { + import * as fs from "fs"; module RecursiveReaddir { interface readdir { (path: string, callback: (error: Error, files: string[]) => any): void; // ignorePattern supports glob syntax via https://github.com/isaacs/minimatch - (path: string, ignorePattern: string[], callback: (error: Error, files: string[]) => any): void; + (path: string, ignorePattern: (string | ((file: string, stats: fs.Stats) => void))[], callback: (error: Error, files: string[]) => any): void; + (path: string, ignoreFunction: (file: string, stats: fs.Stats) => void, callback: (error: Error, files: string[]) => any): void; } } diff --git a/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx b/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx new file mode 100644 index 000000000..00845bdc0 --- /dev/null +++ b/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx @@ -0,0 +1,7 @@ +/// +/// + +import * as React from 'react' +import DockMonitor from 'redux-devtools-dock-monitor' + +let dockMonitor = \ No newline at end of file diff --git a/redux-devtools-dock-monitor/redux-devtools-dock-monitor.d.ts b/redux-devtools-dock-monitor/redux-devtools-dock-monitor.d.ts new file mode 100644 index 000000000..09e3d9603 --- /dev/null +++ b/redux-devtools-dock-monitor/redux-devtools-dock-monitor.d.ts @@ -0,0 +1,59 @@ +// Type definitions for redux-devtools-dock-monitor 1.0.1 +// Project: https://github.com/gaearon/redux-devtools-dock-monitor +// Definitions by: Petryshyn Sergii +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "redux-devtools-dock-monitor" { + import * as React from 'react' + + interface IDockMonitorProps { + /** + * Any valid Redux DevTools monitor. + */ + children?: React.ReactNode + + /** + * A key or a key combination that toggles the dock visibility. + * Must be recognizable by parse-key (for example, 'ctrl-h') + */ + toggleVisibilityKey: string + + /** + * A key or a key combination that toggles the dock position. + * Must be recognizable by parse-key (for example, 'ctrl-w') + */ + changePositionKey: string + + /** + * When true, the dock size is a fraction of the window size, fixed otherwise. + * + * @default true + */ + fluid?: boolean + + /** + * Size of the dock. When fluid is true, a float (0.5 means half the window size). + * When fluid is false, a width in pixels + * + * @default 0.3 (3/10th of the window size) + */ + defaultSize?: number + + /** + * Where the dock appears on the screen. + * Valid values: 'left', 'top', 'right', 'bottom' + * + * @default 'right' + */ + defaultPosition?: string + + /** + * @default true + */ + defaultIsVisible?: boolean + } + + export default class DockMonitor extends React.Component {} +} \ No newline at end of file diff --git a/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx b/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx new file mode 100644 index 000000000..dbcdbcf7a --- /dev/null +++ b/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx @@ -0,0 +1,7 @@ +/// +/// + +import * as React from 'react' +import LogMonitor from 'redux-devtools-log-monitor' + +let logMonitor = \ No newline at end of file diff --git a/redux-devtools-log-monitor/redux-devtools-log-monitor.d.ts b/redux-devtools-log-monitor/redux-devtools-log-monitor.d.ts new file mode 100644 index 000000000..8c96c804d --- /dev/null +++ b/redux-devtools-log-monitor/redux-devtools-log-monitor.d.ts @@ -0,0 +1,39 @@ +// Type definitions for redux-devtools-log-monitor 1.0.1 +// Project: https://github.com/gaearon/redux-devtools-log-monitor +// Definitions by: Petryshyn Sergii +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "redux-devtools-log-monitor" { + import * as React from 'react' + + interface ILogMonitorProps { + /** + * Either a string referring to one of the themes provided by + * redux-devtools-themes or a custom object of the same format. + * + * @see https://github.com/gaearon/redux-devtools-themes + */ + theme?: string + + /** + * A function that selects the slice of the state for DevTools to show. + * + * @example state => state.thePart.iCare.about. + * @default state => state. + */ + select?: (state: any) => any + + /** + * When true, records the current scroll top every second so it + * can be restored on refresh. This only has effect when used together + * with persistState() enhancer from Redux DevTools. + * + * @default true + */ + preserveScrollTop?: boolean + } + + export default class LogMonitor extends React.Component {} +} \ No newline at end of file diff --git a/redux-devtools/redux-devtools-2.1.4-tests.tsx b/redux-devtools/redux-devtools-2.1.4-tests.tsx new file mode 100644 index 000000000..a57811f16 --- /dev/null +++ b/redux-devtools/redux-devtools-2.1.4-tests.tsx @@ -0,0 +1,62 @@ +/// +/// +/// + +import { compose, createStore, applyMiddleware, Middleware, Reducer } from 'redux'; +import { devTools, persistState } from 'redux-devtools'; +import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; +import * as React from 'react'; +import { Component } from 'react'; + +declare var m1: Middleware; +declare var m2: Middleware; +declare var m3: Middleware; +declare var reducer: Reducer; +class CounterApp extends Component { }; +class Provider extends Component<{ store: any }, any> { }; + +const finalCreateStore = compose( + // Enables your middleware: + applyMiddleware(m1, m2, m3), // any Redux middleware, e.g. redux-thunk + // Provides support for DevTools: + devTools(), + // Lets you write ?debug_session= in address bar to persist debug sessions + persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)) +)(createStore); +const store = finalCreateStore(reducer); + +class Root extends Component { + render() { + return ( +
    + + {() => } + + + + +
    + ); + } +} + +// +// https://github.com/gaearon/redux-devtools/blob/master/examples/counter/containers/App.js +// + +class App extends Component { + render() { + return ( +
    + + {() => } + + + + +
    + ); + } +} diff --git a/redux-devtools/redux-devtools-2.1.4.d.ts b/redux-devtools/redux-devtools-2.1.4.d.ts new file mode 100644 index 000000000..7612adb7c --- /dev/null +++ b/redux-devtools/redux-devtools-2.1.4.d.ts @@ -0,0 +1,109 @@ +// Type definitions for redux-devtools 2.1.4 +// Project: https://github.com/gaearon/redux-devtools +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "redux-devtools" { + export function devTools(): Function; + export function persistState(sessionId: any, stateDeserializer?: Function, actionDeserializer?: Function): Function; +} + +declare module "redux-devtools/lib/react" { + import * as React from 'react'; + + export class DevTools extends React.Component { + + } + + export interface DevToolsProps { + monitor: Function; + store: Store; + } + + export interface Store { + devToolStore: DevToolStore; + } + + export class DevToolStore extends React.Component { + dispatch: Function; + } + + export class DebugPanel extends React.Component { } + + export interface DebugPanelProps { + position?: string; + zIndex?: number; + fontSize?: string; + overflow?: string; + opacity?: number; + color?: string; + left?: boolean|number; + right?: boolean|number; + top?: boolean|number; + bottom?: boolean|number; + maxHeight?: string; + maxWidth?: string; + wordWrap?: string; + boxSizing?: string; + boxShadow?: string; + getStyle?: () => DebugPanelProps; + } + + export class LogMonitor extends React.Component { } + + export interface LogMonitorProps { + computedStates?: ComputedState[]; + currentStateIndex?: number; + monitorState?: MonitorState; + stagedActions?: Action[]; + skippedActions?: boolean[]; + reset?: Function; + commit?: Function; + rollback?: Function; + sweep?: Function; + toggleAction?: Function; + jumpToState?: Function; + setMonitorState?: Function; + select?: Function; + visibleOnLoad?: boolean; + theme?: Theme|string; + } + + export interface ComputedState { + state?: any; + error?: string; + } + + export interface MonitorState { + isViaible?: boolean; + } + + export interface Action { + type: string; + } + + export interface Theme { + scheme: string; + author: string; + base00: string; + base01: string; + base02: string; + base03: string; + base04: string; + base05: string; + base06: string; + base07: string; + base08: string; + base09: string; + base0A: string; + base0B: string; + base0C: string; + base0D: string; + base0E: string; + base0F: string; + } +} + diff --git a/redux-devtools/redux-devtools-tests.tsx b/redux-devtools/redux-devtools-tests.tsx index c17aa38ab..2cacd47c7 100644 --- a/redux-devtools/redux-devtools-tests.tsx +++ b/redux-devtools/redux-devtools-tests.tsx @@ -1,62 +1,31 @@ -/// -/// /// +/// +/// +/// -import { compose, createStore, applyMiddleware, Middleware, Reducer } from 'redux'; -import { devTools, persistState } from 'redux-devtools'; -import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; -import * as React from 'react'; -import { Component } from 'react'; +import * as React from 'react' +import { createStore, applyMiddleware, compose } from 'redux' +import { Provider } from 'react-redux' +import { createDevTools, persistState } from 'redux-devtools' -declare var m1: Middleware; -declare var m2: Middleware; -declare var m3: Middleware; -declare var reducer: Reducer; -class CounterApp extends Component { }; -class Provider extends Component<{ store: any }, any> { }; +class DevToolsMonitor extends React.Component { +} + +const DevTools = createDevTools( + +) const finalCreateStore = compose( - // Enables your middleware: - applyMiddleware(m1, m2, m3), // any Redux middleware, e.g. redux-thunk - // Provides support for DevTools: - devTools(), - // Lets you write ?debug_session= in address bar to persist debug sessions - persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)) -)(createStore); -const store = finalCreateStore(reducer); + DevTools.instrument(), + persistState('test-session') +)(createStore) -class Root extends Component { - render() { - return ( -
    - - {() => } - - - - -
    - ); - } -} - -// -// https://github.com/gaearon/redux-devtools/blob/master/examples/counter/containers/App.js -// - -class App extends Component { - render() { - return ( -
    - - {() => } - - - - -
    - ); - } -} +class App extends React.Component { + render() { + return ( + + + + ) + } +} \ No newline at end of file diff --git a/redux-devtools/redux-devtools.d.ts b/redux-devtools/redux-devtools.d.ts index 7612adb7c..47ad2198d 100644 --- a/redux-devtools/redux-devtools.d.ts +++ b/redux-devtools/redux-devtools.d.ts @@ -1,109 +1,22 @@ -// Type definitions for redux-devtools 2.1.4 +// Type definitions for redux-devtools 3.0.0 // Project: https://github.com/gaearon/redux-devtools -// Definitions by: Qubo -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Petryshyn Sergii +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// declare module "redux-devtools" { - export function devTools(): Function; - export function persistState(sessionId: any, stateDeserializer?: Function, actionDeserializer?: Function): Function; -} + import * as React from 'react' -declare module "redux-devtools/lib/react" { - import * as React from 'react'; + interface IDevTools { + new (): JSX.ElementClass + instrument(): Function + } - export class DevTools extends React.Component { + export function createDevTools(el: React.ReactElement): IDevTools + export function persistState(debugSessionKey: string): Function - } - - export interface DevToolsProps { - monitor: Function; - store: Store; - } - - export interface Store { - devToolStore: DevToolStore; - } - - export class DevToolStore extends React.Component { - dispatch: Function; - } - - export class DebugPanel extends React.Component { } - - export interface DebugPanelProps { - position?: string; - zIndex?: number; - fontSize?: string; - overflow?: string; - opacity?: number; - color?: string; - left?: boolean|number; - right?: boolean|number; - top?: boolean|number; - bottom?: boolean|number; - maxHeight?: string; - maxWidth?: string; - wordWrap?: string; - boxSizing?: string; - boxShadow?: string; - getStyle?: () => DebugPanelProps; - } - - export class LogMonitor extends React.Component { } - - export interface LogMonitorProps { - computedStates?: ComputedState[]; - currentStateIndex?: number; - monitorState?: MonitorState; - stagedActions?: Action[]; - skippedActions?: boolean[]; - reset?: Function; - commit?: Function; - rollback?: Function; - sweep?: Function; - toggleAction?: Function; - jumpToState?: Function; - setMonitorState?: Function; - select?: Function; - visibleOnLoad?: boolean; - theme?: Theme|string; - } - - export interface ComputedState { - state?: any; - error?: string; - } - - export interface MonitorState { - isViaible?: boolean; - } - - export interface Action { - type: string; - } - - export interface Theme { - scheme: string; - author: string; - base00: string; - base01: string; - base02: string; - base03: string; - base04: string; - base05: string; - base06: string; - base07: string; - base08: string; - base09: string; - base0A: string; - base0B: string; - base0C: string; - base0D: string; - base0E: string; - base0F: string; - } -} + var factory: { instrument(): Function } + export default factory; +} \ No newline at end of file diff --git a/request/request.d.ts b/request/request.d.ts index d47ed5f9a..4d51fd14b 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -110,6 +110,7 @@ declare module 'request' { passphrase?: string; ca?: Buffer; har?: HttpArchiveRequest; + useQuerystring?: boolean; } interface UriOptions { diff --git a/restify/restify.d.ts b/restify/restify.d.ts index c523810ee..1464176eb 100644 --- a/restify/restify.d.ts +++ b/restify/restify.d.ts @@ -16,6 +16,23 @@ declare module "restify" { family: string; address: string; } + + interface requestFileInterface { + path: string; + type: string; + } + + /** + * Comes from authorizationParser plugin + */ + interface requestAuthorization { + scheme: string; + credentials: string; + basic?: { + username: string; + password: string; + } + } interface Request extends http.ServerRequest { header: (key: string, defaultValue?: string) => any; @@ -32,17 +49,22 @@ declare module "restify" { secure: boolean; time: number; params: any; - - body?: any; //available when bodyParser plugin is used + files?: { [name: string]: requestFileInterface }; isSecure: () => boolean; + /** available when bodyParser plugin is used */ + body?: any; + /** available when authorizationParser plugin is used */ + username?: string; + /** available when authorizationParser plugin is used */ + authorization?: requestAuthorization; } interface Response extends http.ServerResponse { header: (key: string, value ?: any) => any; cache: (type?: any, options?: Object) => any; status: (code: number) => any; - send: (status?: any, body?: any) => any; - json: (status?: any, body?: any) => any; + send: (status?: any, body?: any, headers?: { [header: string]: string }) => any; + json: (status?: any, body?: any, headers?: { [header: string]: string }) => any; code: number; contentLength: number; charSet(value: string): void; @@ -50,47 +72,111 @@ declare module "restify" { headers: Object; id: string; } + + interface Route { + name: string; + method: string; + path: RoutePathRegex; + spec: Object; + types: string[]; + versions: string[]; + } + + interface RouteOptions { + name: string; + method: string; + path?: string | RegExp; + url?: string | RegExp; + urlParamPattern?: RegExp; + contentType?: string | string[]; + versions?: string | string[]; + } + + interface RoutePathRegex extends RegExp { + restifyParams: string[]; + } + + interface Router { + name: string; + mounts: { [routeName: string]: Route }; + versions: string[]; + contentType: string[]; + routes: { + DELETE: Route[]; + GET: Route[]; + HEAD: Route[]; + OPTIONS: Route[]; + PATCH: Route[]; + POST: Route[]; + PUT: Route[]; + }; + log?: any; + toString: () => string; + + /** + * Takes an object of route params and query params, and 'renders' a URL + * @param {String} routeName the route name + * @param {Object} params an object of route params + * @param {Object} query an object of query params + * @returns {String} + */ + render: (routeName: string, params: Object, query?: Object) => string; + + /** + * adds a route. + * @param {Object} options an options object + * @returns {String} returns the route name if creation is successful. + */ + mount: (options: Object) => string; + + /** + * unmounts a route. + * @param {String} name the route name + * @returns {String} the name of the deleted route (or false if it was not matched) + */ + unmount: (name: string) => string | boolean; + } interface Server extends http.Server { - use(handler: RequestHandler, ...handlers: RequestHandler[]): any; - use(handler: RequestHandler[], ...handlers: RequestHandler[]): any; - use(handler: RequestHandler, ...handlers: RequestHandler[][]): any; - use(handler: RequestHandler[], ...handlers: RequestHandler[][]): any; + use(handler: RequestHandler, ...handlers: RequestHandler[]): Server; + use(handler: RequestHandler[], ...handlers: RequestHandler[]): Server; + use(handler: RequestHandler, ...handlers: RequestHandler[][]): Server; + use(handler: RequestHandler[], ...handlers: RequestHandler[][]): Server; - post(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): any; - post(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): any; - post(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): any; - post(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): any; + post(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): Route; + post(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route; + post(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route; + post(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route; - patch(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): any; - patch(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): any; - patch(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): any; - patch(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): any; + patch(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): Route; + patch(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route; + patch(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route; + patch(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route; - put(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): any; - put(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): any; - put(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): any; - put(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): any; + put(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): Route; + put(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route; + put(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route; + put(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route; - del(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): any; - del(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): any; - del(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): any; - del(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): any; + del(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): Route; + del(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route; + del(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route; + del(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route; - get(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): any; - get(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): any; - get(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): any; - get(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): any; + get(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): Route; + get(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route; + get(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route; + get(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route; - head(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): any; - head(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): any; - head(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): any; - head(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): any; + head(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): Route; + head(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route; + head(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route; + head(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route; - opts(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): any; - opts(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): any; - opts(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): any; - opts(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): any; + opts(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[]): Route; + opts(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[]): Route; + opts(route: any, routeCallBack: RequestHandler, ...routeCallBacks: RequestHandler[][]): Route; + opts(route: any, routeCallBack: RequestHandler[], ...routeCallBacks: RequestHandler[][]): Route; name: string; version: string; @@ -100,9 +186,11 @@ declare module "restify" { address: () => addressInterface; listen(... args: any[]): any; close(... args: any[]): any; - pre(routeCallBack: RequestHandler): any; + pre(routeCallBack: RequestHandler): Server; server: http.Server; - + router: Router; + routes: Route[]; + toString: () => string; } interface ServerOptions { @@ -116,6 +204,7 @@ declare module "restify" { responseTimeHeader ?: string; responseTimeFormatter ?: (durationInMilliseconds: number) => any; handleUpgrades ?: boolean; + router ?: Router; } interface ClientOptions { @@ -162,6 +251,7 @@ declare module "restify" { interface Next { (err?: any): any; + ifError: (err?: any) => any; } interface RequestHandler { diff --git a/rsync/rsync-tests.ts b/rsync/rsync-tests.ts new file mode 100644 index 000000000..6e12213bd --- /dev/null +++ b/rsync/rsync-tests.ts @@ -0,0 +1,157 @@ +/// + +import * as Rsync from 'rsync'; + +// -------------------------- +// simple usage +// Build the command +const rs = new Rsync() + .shell('ssh') + .flags('az') + .source('/path/to/source') + .destination('server:/path/to/destination'); + +// Execute the command +rs.execute(function(error, code, cmd) { + // we're done +}); + +// -------------------------- +// api +const rsync = new Rsync(); + + +// set(flags, set) +rsync.set('a') + .set('progress') + .set('list-only') + .set('exclude-from', '/path/to/exclude-file'); + +// unset +rsync.unset('progress') + .unset('quiet'); + +// flags// As String +rsync.flags('avz'); // set +rsync.flags('avz', false); // unset + +// As String arguments +rsync.flags('a', 'v', 'z'); // set +rsync.flags('a', 'v', 'z', false); // unset + +// As Array +rsync.flags(['a', 'v', 'z']); // set +rsync.flags(['a', 'z'], false); // unset + +// As Object +rsync.flags({ + 'a': true, // set + 'z': true, // set + 'v': false // unset +}); + + +// isSet(option) +rsync.set('quiet'); +rsync.isSet('quiet'); // is TRUE +rsync.isSet('q'); // is FALSE + + +// option(option) +rsync.option('rsh'); // returns String value +rsync.option('progress'); // returns NULL + + +// command() +const command = rsync.command(); + + +// output(stdoutHandler, stderrHandler) +rsync.output( + function(data) { + // do things like parse progress + }, function(data) { + // do things like parse error output + } +); + + +// execute(callback, stdoutHandler, stderrHandler) +// signal handler function +const quitting = function() { + if (rsyncPid) { + rsyncPid.kill(); + } + process.exit(); +} +process.on("SIGINT", quitting); // run signal handler on CTRL-C +process.on("SIGTERM", quitting); // run signal handler on SIGTERM +process.on("exit", quitting); // run signal handler when main process exits + +// simple execute +var rsyncPid = rsync.execute(function(error, code, cmd) { + // we're done +}); + +// execute with stream callbacks +var rsyncPid = rsync.execute( + function(error, code, cmd) { + // we're done + }, function(data) { + // do things like parse progress + }, function(data) { + // do things like parse error output + } +); + + +// option shorthands +rsync.shell('ssh') + .delete() + .progress() + .archive() + .compress() + .recursive() + .update() + .quiet() + .dirs() + .links() + .dry(); + + +// accessor methods +rsync.executable('executable'); +const e = rsync.executable(); + +rsync.executableShell('executableShell'); +const s = rsync.executableShell(); + +rsync.destination('destination'); +const d = rsync.destination(); + +rsync.source('/a/path') + .source('/b/path'); +rsync.source(['/a/path', '/b/path']); +const src = rsync.source() + + +// patterns +// on an existing Rsync object +rsync.patterns([ '-.git', { action: '+', pattern: '/some_dir' }]); + +// exclude(pattern) +// chained +rsync.exclude('.git') + .exclude('.DS_Store'); + +// as Array +rsync.exclude(['.git', '.DS_Store']); + + +// include(pattern) +// chained +rsync.include('/a/file') + .include('/b/file'); + +// as Array +rsync.include(['/a/file', '/b/file']); \ No newline at end of file diff --git a/rsync/rsync.d.ts b/rsync/rsync.d.ts new file mode 100644 index 000000000..9c828e6fb --- /dev/null +++ b/rsync/rsync.d.ts @@ -0,0 +1,96 @@ +// Type definitions for node-rsync v0.4.0 +// Project: https://github.com/mattijs/node-rsync +// Definitions by: Philipp Stucki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'rsync' { + import * as child_process from 'child_process'; + interface StreamDataHandler { + (data: any): void; + } + + interface Pattern { + action: string; + pattern: string; + } + + interface Flag { + [name: string]: boolean; + } + + interface Rsync { + // instance methods + set(option: string, value: string): Rsync; + set(option: string): Rsync; + + unset(option: string): Rsync; + + flags(flags: string, set?: boolean): Rsync; + flags(flags: Flag): Rsync; + flags(flags: string[], set?: boolean): Rsync; + flags(...flags: any[]): Rsync; + + isSet(option: string): boolean; + + option(option: string): any; + + args(): string[]; + + command(): string; + + output(stdout: StreamDataHandler, stderr: StreamDataHandler): Rsync; + + execute(callback: (err: Error, code: number, cmd: string) => void): child_process.ChildProcess; + execute( + callback: (err: Error, code: number, cmd: string) => void, + stdout: StreamDataHandler, + stderr: StreamDataHandler + ): child_process.ChildProcess; + + + // option shorthands + shell(shell: string): Rsync; + delete(): Rsync; + progress(): Rsync; + archive(): Rsync; + compress(): Rsync; + recursive(): Rsync; + update(): Rsync; + quiet(): Rsync; + dirs(): Rsync; + links(): Rsync; + dry(): Rsync; + + // accessor methods + executable(): string; + executable(e: string): Rsync; + + executableShell(): string; + executableShell(e: string): Rsync; + + destination(): string; + destination(d: string): Rsync; + + source(): string[]; + source(s: string): Rsync; + source(s: string[]): Rsync; + + // pattern accessors + patterns(patterns: (string|Pattern)[]): Rsync; + + exclude(p: string): Rsync; + exclude(p: string[]): Rsync; + + include(p: string): Rsync; + include(p: string[]): Rsync; + } + + interface RsyncStatic { + new(): Rsync; + } + + const e: RsyncStatic; + export = e; +} diff --git a/serve-index/serve-index-tests.ts b/serve-index/serve-index-tests.ts new file mode 100644 index 000000000..5c4910af9 --- /dev/null +++ b/serve-index/serve-index-tests.ts @@ -0,0 +1,72 @@ +/// +/// + +import * as express from 'express'; +import * as serveIndex from 'serve-index'; +import * as fs from 'fs'; + +const app = express(); + +// Serve URLs like /ftp/thing as public/ftp/thing +app.use('/ftp', serveIndex('public/ftp', {'icons': true})); +app.listen(8080); + + +// Taken from https://github.com/expressjs/serve-index/blob/v1.7.2/test/test.js + +import * as path from 'path'; +var fixtures = path.join(__dirname, '/fixtures'); +const createServer = serveIndex; + +var server = createServer('test/fixtures', {'hidden': false}); + +var server = createServer('test/fixtures', {'hidden': true}); + +var server = createServer(fixtures, {'filter': filter}); +function filter(name: string): boolean { + if (name.indexOf('foo') === -1) return true + return false +} + +var server = createServer(fixtures, {'filter': filter, 'hidden': false}); + +var server = createServer(fixtures, {'icons': true}); + +var server = createServer(fixtures, {'template': __dirname + '/shared/template.html'}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(null, 'This is a template.'); +}}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(new Error('boom!')); +}}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(null, JSON.stringify(locals.directory)); +}}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(null, JSON.stringify(locals.displayIcons)); +}}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(null, JSON.stringify(locals.fileList.map(function (file) { + //file.stat = file.stat instanceof fs.Stats; + return file; + }))); +}}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(null, JSON.stringify(locals.path)); +}}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(null, JSON.stringify(locals.style)); +}}); + +var server = createServer(fixtures, {'template': function (locals, callback) { + callback(null, JSON.stringify(locals.viewName)); +}}); + +var server = createServer(fixtures, {'stylesheet': __dirname + '/shared/styles.css'}); diff --git a/serve-index/serve-index.d.ts b/serve-index/serve-index.d.ts new file mode 100644 index 000000000..6b2ae6447 --- /dev/null +++ b/serve-index/serve-index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for serve-index v1.7.2 +// Project: https://github.com/expressjs/serve-index +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'serve-index' { + import * as express from 'express'; + import * as fs from 'fs'; + + namespace serveIndex { + interface File { + name: string; + stat: fs.Stats; + } + + interface Locals { + directory: string; + displayIcons: boolean; + fileList: Array; + name: string; + stat: fs.Stats; + path: string; + style: string; + viewName: string; + } + + type templateCallback = (error: Error, htmlString?: string) => void; + + interface Options { + filter?: (filename: string, index: number, files: Array, dir: string) => boolean; + hidden?: boolean; + icons?: boolean; + stylesheet?: string; + template?: string | ((locals: Locals, callback: templateCallback) => void); + view?: string; + } + } + + function serveIndex(path: string, options?: serveIndex.Options): express.Handler; + + export = serveIndex; +} diff --git a/serve-static/serve-static.d.ts b/serve-static/serve-static.d.ts index ef59fa2bc..29e5276cf 100644 --- a/serve-static/serve-static.d.ts +++ b/serve-static/serve-static.d.ts @@ -15,22 +15,22 @@ declare module "serve-static" { import * as express from "express"; - + /** - * Create a new middleware function to serve files from within a given root directory. - * The file to serve will be determined by combining req.url with the provided root directory. + * Create a new middleware function to serve files from within a given root directory. + * The file to serve will be determined by combining req.url with the provided root directory. * When a file is not found, instead of sending a 404 response, this module will instead call next() to move on to the next middleware, allowing for stacking and fall-backs. */ function serveStatic(root: string, options?: { /** - * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot ("."). - * Note this check is done on the path itself without checking if the path actually exists on the disk. - * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny"). - * The default value is 'ignore'. - * 'allow' No special treatment for dotfiles - * 'deny' Send a 403 for any request for a dotfile - * 'ignore' Pretend like the dotfile does not exist and call next() - */ + * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot ("."). + * Note this check is done on the path itself without checking if the path actually exists on the disk. + * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny"). + * The default value is 'ignore'. + * 'allow' No special treatment for dotfiles + * 'deny' Send a 403 for any request for a dotfile + * 'ignore' Pretend like the dotfile does not exist and call next() + */ dotfiles?: string; /** diff --git a/sharepoint/SharePoint.d.ts b/sharepoint/SharePoint.d.ts index 4e32dade4..0cb60b5c6 100644 --- a/sharepoint/SharePoint.d.ts +++ b/sharepoint/SharePoint.d.ts @@ -8448,7 +8448,7 @@ declare module SP.WorkflowServices { /** Specifies the custom status set by workflow authors. */ set_userStatus(value: string): string; /** Gets the unique identifier (GUID) of the subscription that instantiates the WorkflowInstance */ - get_workflowSubscriptionId(): string; + get_workflowSubscriptionId(): SP.Guid; /** This method is internal and is not intended to be used in your code. */ initPropertiesFromJson(parentNode: any): void; @@ -11205,4 +11205,4 @@ declare module SP { get_Columns(): SP.JsGrid.ColumnInfo[]; } -} \ No newline at end of file +} diff --git a/should/should-tests.ts b/should/should-tests.ts index 43b21d0ef..41c814aea 100644 --- a/should/should-tests.ts +++ b/should/should-tests.ts @@ -15,6 +15,20 @@ should.throws(() => {}); should.doesNotThrow(() => {}); should.ifError('value'); +(0).should + .a + .an + .and + .be + .has + .have + .is + .it + .of + .the + .which + .with + .equal(0) class User { name: string; @@ -60,36 +74,48 @@ should.not.exist(null); should.not.exist(''); should.not.exist({}); -true.should.be.ok; -'yay'.should.be.ok; -(1).should.be.ok; +true.should.be.ok(); +'yay'.should.be.ok(); +(1).should.be.ok(); -false.should.not.be.ok; -''.should.not.be.ok; -(0).should.not.be.ok; +false.should.not.be.ok(); +''.should.not.be.ok(); +(0).should.not.be.ok(); -true.should.be.true -'1'.should.not.be.true -false +true.should.be.true(); +true.should.be.True(); +'1'.should.not.be.true(); -false.should.be.false; -(0).should.not.be.false; +false.should.be.false(); +false.should.be.False(); +(0).should.not.be.false(); var args = function (a: string, b: string, c: string) { return arguments; }; -args.should.be.arguments; -['a'].should.not.be.arguments; +args.should.be.arguments(); +args.should.be.Arguments(); +['a'].should.not.be.arguments(); -['a'].should.be.empty; -''.should.be.empty; -({ length: 0 }).should.be.empty; +['a'].should.be.empty(); +''.should.be.empty(); +({ length: 0 }).should.be.empty(); ({ foo: 'bar' }).should.eql({ foo: 'bar' }); [1, 2, 3].should.eql([1, 2, 3]); +[1, 2, 3].should.deepEqual([1, 2, 3]); (4).should.equal(4); 'test'.should.equal('test'); [1, 2, 3].should.not.equal([1, 2, 3]); +'ab'.should.equalOneOf('a', 10, 'ab'); +'ab'.should.equalOneOf(['a', 10, 'ab']); + +({a: 10}).should.be.oneOf('a', 10, 'ab', {a: 10}); +({a: 10}).should.be.oneOf(['a', 10, 'ab', {a: 10}]); + +'1'.should.be.exactly('1'); +'1'.should.not.be.exactly(1); + user.age.should.be.within(5, 50); user.should.be.of.type('object'); @@ -114,7 +140,29 @@ user.should.have.property('age', 15); user.should.not.have.property('rawr'); user.should.not.have.property('age', 0); +({ a: 10 }).should.have.properties('a'); +({ a: 10, b: 20 }).should.have.properties([ 'a' ]); +({ a: 10, b: 20 }).should.have.properties({ b: 20 }); ({ foo: 'bar' }).should.have.ownProperty('foo'); +({ foo: 'bar' }).should.hasOwnProperty('foo'); +({ a: {b: 10}}).should.have.propertyByPath('a', 'b').eql(10); +({ a: 10 }).should.have.propertyWithDescriptor('a', { enumerable: true }); + +NaN.should.be.NaN(); +Infinity.should.be.Infinity(); +new Date().should.be.a.Date(); +({}).should.be.an.Object(); +"".should.be.a.String(); +true.should.be.a.Boolean(); +(4).should.be.a.Number(); +new ReferenceError("error").should.be.an.Error(); +(function() {}).should.be.a.Function(); +User.should.be.a.class(); +User.should.be.a.Class(); +'a'.should.not.be.a.generator(); +[].should.be.iterable(); +[].should.be.an.iterator(); +[].should.be.an.Array(); var res = {}; res.should.have.status(200); @@ -123,30 +171,60 @@ res.should.have.header('content-length'); res.should.have.header('Content-Length', '123'); res.should.have.header('content-length', '123'); -res.should.be.json; +res.should.be.json(); -res.should.be.html; +res.should.be.html(); -[1, 2, 3].should.include(3); -[1, 2, 3].should.include(2); -[1, 2, 3].should.not.include(4); +[1, 2, 3].should.containEql(3); +[1, 2, 3].should.containEql(2); +[1, 2, 3].should.not.containEql(4); -'foo bar baz'.should.include('foo'); -'foo bar baz'.should.include('bar'); -'foo bar baz'.should.include('baz'); -'foo bar baz'.should.not.include('FOO'); +'foo bar baz'.should.containEql('foo'); +'foo bar baz'.should.containEql('bar'); +'foo bar baz'.should.containEql('baz'); +'foo bar baz'.should.not.containEql('FOO') var tobi = { name: 'Tobi', age: 1 }; var jane = { name: 'Jane', age: 5 }; var tj = { name: 'TJ', pet: tobi }; -tj.should.include({ pet: tobi }); -tj.should.include({ pet: tobi, name: 'TJ' }); -tj.should.not.include({ pet: jane }); -tj.should.not.include({ name: 'Someone' }); +tj.should.containEql({ pet: tobi }); +tj.should.containEql({ pet: tobi, name: 'TJ' }); +tj.should.not.containEql({ pet: jane }); +tj.should.not.containEql({ name: 'Someone' }); -[[1], [2], [3]].should.includeEql([3]); -[[1], [2], [3]].should.includeEql([2]); -[[1], [2], [3]].should.not.includeEql([4]); +[[1], [2], [3]].should.containEql([3]); +[[1], [2], [3]].should.containEql([2]); +[[1], [2], [3]].should.not.containEql([4]); + +var spy = function() { }; +spy.should.be.alwaysCalledOn({}); +spy.should.be.alwaysCalledWith(1, 2); +spy.should.be.alwaysCalledWithExactly(1, 2); +spy.should.be.alwaysCalledWithMatch(1, 2); +spy.should.have.alwaysThrew("ReferenceError"); +spy.should.have.callCount(1); +spy.should.be.called(); +spy.should.be.calledOn({}); +spy.should.be.calledOnce(); +spy.should.be.calledTwice(); +spy.should.be.calledThrice(); +spy.should.be.calledWith(1, 2); +spy.should.be.calledWithExactly(1, 2); +spy.should.be.calledWithMatch(1, 2); +spy.should.be.calledWithNew(); +spy.should.be.neverCalledWith(1, 2); +spy.should.be.neverCalledWithMatch(1, 2); +spy.should.have.threw("ReferenceError"); + +(10).should.be.aboveOrEqual(0); +(10).should.be.aboveOrEqual(10); +(10).should.be.greaterThanOrEqual(0); +(10).should.be.greaterThanOrEqual(10); + +(0).should.be.belowOrEqual(10); +(0).should.be.belowOrEqual(0); +(0).should.be.lessThanOrEqual(10); +(0).should.be.lessThanOrEqual(0); (function () { throw new Error('fail'); @@ -170,9 +248,17 @@ tj.should.not.include({ name: 'Someone' }); var obj = { foo: 'bar', baz: 'raz' }; obj.should.have.keys('foo', 'bar'); obj.should.have.keys(['foo', 'bar']); +obj.should.have.key('foo'); + +({ a: 10 }).should.have.enumerable('a'); +({ a: 10 }).should.have.enumerable('a', 10); +({ a: 10, b: 10 }).should.have.enumerables('a', 'b'); (1).should.eql(0, 'some useful description'); +[ 1, 2, 3].should.containDeep([2, 1]); +[ 1, 2, [ 1, 2, 3 ]].should.containDeep([ 1, [ 3, 1 ]]); + [ 1, 2, 3].should.containDeepOrdered([1, 2]); [ 1, 2, [ 1, 2, 3 ]].should.containDeepOrdered([ 1, [ 2, 3 ]]); diff --git a/should/should.d.ts b/should/should.d.ts index 26a42d7ed..d4ab3ef38 100644 --- a/should/should.d.ts +++ b/should/should.d.ts @@ -1,5 +1,5 @@ -// Type definitions for should.js 3.1.2 -// Project: https://github.com/visionmedia/should.js +// Type definitions for should.js v8.1.1 +// Project: https://github.com/shouldjs/should.js // Definitions by: Alex Varju , Maxime LUCE // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -13,34 +13,49 @@ interface ShouldAssertion { an: ShouldAssertion; and: ShouldAssertion; be: ShouldAssertion; + has: ShouldAssertion; have: ShouldAssertion; + is: ShouldAssertion; + it: ShouldAssertion; with: ShouldAssertion; + which: ShouldAssertion; + the: ShouldAssertion; of: ShouldAssertion; not: ShouldAssertion; // validators - arguments: ShouldAssertion; - empty: ShouldAssertion; - ok: ShouldAssertion; - true: ShouldAssertion; - false: ShouldAssertion; - NaN: ShouldAssertion; - Infinity: ShouldAssertion; - Array: ShouldAssertion; - Object: ShouldAssertion; - String: ShouldAssertion; - Boolean: ShouldAssertion; - Number: ShouldAssertion; - Error: ShouldAssertion; - Function: ShouldAssertion; + arguments(): ShouldAssertion; + empty(): ShouldAssertion; + ok(): ShouldAssertion; + true(): ShouldAssertion; + false(): ShouldAssertion; + NaN(): ShouldAssertion; + Infinity(): ShouldAssertion; + Array(): ShouldAssertion; + Object(): ShouldAssertion; + String(): ShouldAssertion; + Boolean(): ShouldAssertion; + Number(): ShouldAssertion; + Error(): ShouldAssertion; + Function(): ShouldAssertion; + Date(): ShouldAssertion; + Class(): ShouldAssertion; + generator(): ShouldAssertion; + iterable(): ShouldAssertion; + iterator(): ShouldAssertion; eql(expected: any, description?: string): ShouldAssertion; equal(expected: any, description?: string): ShouldAssertion; + equalOneOf(...values: any[]): ShouldAssertion; within(start: number, finish: number, description?: string): ShouldAssertion; approximately(value: number, delta: number, description?: string): ShouldAssertion; type(expected: any, description?: string): ShouldAssertion; instanceof(constructor: Function, description?: string): ShouldAssertion; above(n: number, description?: string): ShouldAssertion; below(n: number, description?: string): ShouldAssertion; + aboveOrEqual(n: number, description?: string): ShouldAssertion; + greaterThanOrEqual(n: number, description?: string): ShouldAssertion; + belowOrEqual(n: number, description?: string): ShouldAssertion; + lessThanOrEqual(n: number, description?: string): ShouldAssertion; match(other: {}, description?: string): ShouldAssertion; match(other: (val: any) => any, description?: string): ShouldAssertion; match(regexp: RegExp, description?: string): ShouldAssertion; @@ -60,32 +75,60 @@ interface ShouldAssertion { properties(name: string): ShouldAssertion; properties(descriptor: any): ShouldAssertion; properties(...properties: string[]): ShouldAssertion; + propertyByPath(...properties: string[]): ShouldAssertion; + propertyWithDescriptor(name: string, descriptor: PropertyDescriptor): ShouldAssertion; + oneOf(...values: any[]): ShouldAssertion; ownProperty(name: string, description?: string): ShouldAssertion; - contain(obj: any): ShouldAssertion; containEql(obj: any): ShouldAssertion; containDeep(obj: any): ShouldAssertion; containDeepOrdered(obj: any): ShouldAssertion; keys(...allKeys: string[]): ShouldAssertion; keys(allKeys: string[]): ShouldAssertion; - header(field: string, val?: string): ShouldAssertion; - status(code: number): ShouldAssertion; - json: ShouldAssertion; - html: ShouldAssertion; + enumerable(property: string, value?: any): ShouldAssertion; + enumerables(...properties: string[]): ShouldAssertion; startWith(expected: string, message?: any): ShouldAssertion; endWith(expected: string, message?: any): ShouldAssertion; throw(message?: any): ShouldAssertion; - // deprecated - include(obj: any, description?: string): ShouldAssertion; - includeEql(obj: any[], description?: string): ShouldAssertion; + //http + header(field: string, val?: string): ShouldAssertion; + status(code: number): ShouldAssertion; + json(): ShouldAssertion; + html(): ShouldAssertion; + + //stubs + alwaysCalledOn(thisTarget: any): ShouldAssertion; + alwaysCalledWith(...arguments: any[]): ShouldAssertion; + alwaysCalledWithExactly(...arguments: any[]): ShouldAssertion; + alwaysCalledWithMatch(...arguments: any[]): ShouldAssertion; + alwaysCalledWithNew(): ShouldAssertion; + alwaysThrew(exception?: any): ShouldAssertion; + callCount(count: number): ShouldAssertion; + called(): ShouldAssertion; + calledOn(thisTarget: any): ShouldAssertion; + calledOnce(): ShouldAssertion; + calledTwice(): ShouldAssertion; + calledThrice(): ShouldAssertion; + calledWith(...arguments: any[]): ShouldAssertion; + calledWithExactly(...arguments: any[]): ShouldAssertion; + calledWithMatch(...arguments: any[]): ShouldAssertion; + calledWithNew(): ShouldAssertion; + neverCalledWith(...arguments: any[]): ShouldAssertion; + neverCalledWithMatch(...arguments: any[]): ShouldAssertion; + threw(exception?: any): ShouldAssertion; // aliases + True(): ShouldAssertion; + False(): ShouldAssertion; + Arguments(): ShouldAssertion; + class(): ShouldAssertion; + deepEqual(expected: any, description?: string): ShouldAssertion; exactly(expected: any, description?: string): ShouldAssertion; instanceOf(constructor: Function, description?: string): ShouldAssertion; throwError(message?: any): ShouldAssertion; lengthOf(n: number, description?: string): ShouldAssertion; key(key: string): ShouldAssertion; - haveOwnProperty(name: string, description?: string): ShouldAssertion; + hasOwnProperty(name: string, description?: string): ShouldAssertion; greaterThan(n: number, description?: string): ShouldAssertion; lessThan(n: number, description?: string): ShouldAssertion; } diff --git a/sinon-chai/sinon-chai.d.ts b/sinon-chai/sinon-chai.d.ts index 03bd0e81d..1695b1e54 100644 --- a/sinon-chai/sinon-chai.d.ts +++ b/sinon-chai/sinon-chai.d.ts @@ -80,5 +80,6 @@ declare module Chai { declare module "sinon-chai" { function sinonChai(chai: any, utils: any): void; + namespace sinonChai { } export = sinonChai; } diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts index a34a78b8c..355606858 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/socket.io.d.ts @@ -647,7 +647,7 @@ declare module SocketIO { * @param close If true, also closes the underlying connection * @return This Socket */ - disconnect( close: boolean ): Socket; + disconnect( close?: boolean ): Socket; /** * Adds a listener for a particular event. Calling multiple times will add diff --git a/spotify-web-api-js/spotify-web-api-js-tests.ts b/spotify-web-api-js/spotify-web-api-js-tests.ts new file mode 100644 index 000000000..11fcf2b43 --- /dev/null +++ b/spotify-web-api-js/spotify-web-api-js-tests.ts @@ -0,0 +1,70 @@ +// Test for the type definitions for spotify-web-api-js +// Project: https://github.com/JMPerez/spotify-web-api-js +// Definitions by: Niels Kristian Hansen Skovmand +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// This test-file assumes the following two d.ts files to be present. + +/// +/// + +var spotify = new SpotifyWebApi(); + +/** + * Tests getAlbums + */ +spotify.getAlbums(['1uw3ISK6Khq5xVWF1GWTjt', '5R8N32ocA6RqSxibt4W6x3'], { market: 'DK' }) +.then(results => { + results.albums.forEach(album => { + album.images.forEach(image => { + console.log('Image URL: ' + image.url.toUpperCase()); + }) + }); +}); + + + +/** + * Tests getAlbum with an error + */ +function albumSearchCallback(error: SpotifyWebApiJs.ErrorObject, results: SpotifyApi.SingleAlbumResponse) { + console.log(error.status.toString() + " - message is: " + error.statusText); +}; + +spotify.getAlbum('xxx1uw3ISK6Khq5xVWF1GWTjt', albumSearchCallback); + + + +/** + * Tests getCategories with a callback + */ +function trackSearchCallback(error: SpotifyWebApiJs.ErrorObject, results: SpotifyApi.TrackSearchResponse) { + console.log("Found a total of " + results.tracks.total + " tracks"); + var onlyExplicitTracks = results.tracks.items.filter(track => { + return track.explicit; + }); + onlyExplicitTracks.forEach(track => console.log(track.name)); +}; + +spotify.searchTracks("Love itself", {limit: 5, market: 'DK'}, trackSearchCallback); + + +/** + * Tests getting a users public profile + */ +spotify.getUser('physicaltunes') +.then(results => { + console.log(results.id.toUpperCase(), + 'Followers: ' + results.followers.total.toString()); +}); + + +/** + * Tests getting top tracks + */ +spotify.getArtistTopTracks('07QEuhtrNmmZ0zEcqE9SF6', 'DK') +.then(results => { + results.tracks.forEach(track => { + console.log(track.name, track.artists.shift().name); + }) +}); \ No newline at end of file diff --git a/spotify-web-api-js/spotify-web-api-js.d.ts b/spotify-web-api-js/spotify-web-api-js.d.ts new file mode 100644 index 000000000..bb980b26f --- /dev/null +++ b/spotify-web-api-js/spotify-web-api-js.d.ts @@ -0,0 +1,534 @@ +// Type definitions for spotify-web-api-js +// Project: https://github.com/JMPerez/spotify-web-api-js +// Definitions by: Niels Kristian Hansen Skovmand +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +/** + * Declare SpotifyWebApi variable, sincle that is the name of the function in spotify-web-api-js. + */ +declare var SpotifyWebApi: SpotifyWebApiJs.SpotifyWebApiJsStatic; + +declare module SpotifyWebApiJs { + /** + * An optional callback that receives 2 parameters. The first + * one is the error object (null if no error), and the second is the value if the request succeeded. + */ + interface ResultsCallback { + (error: ErrorObject, value: T) : any + } + + /** + * Describes the regular error object: https://developer.spotify.com/web-api/user-guide/#error-details + */ + interface ErrorObject { + status: number, + response: string, + statusText: string + } + + /** + * Describes the static side of SpotifyApi. Get a new instance of the SpotifyApi. + */ + interface SpotifyWebApiJsStatic { + new(): SpotifyApiJs; + } + + /** + * Describes an instance of SpotifyApi + */ + interface SpotifyApiJs { + /** + * Fetches a resource through a generic GET request. + * + * @param url The URL to be fetched + * @param callback An optional callback + */ + getGeneric(url: string, callback?: ResultsCallback) : Promise; + + /** + * Fetches information about the current user. + * See [Get Current User's Profile](https://developer.spotify.com/web-api/get-current-users-profile/) + * + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getMe(options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches current user's saved tracks. + * See [Get Current User's Saved Tracks](https://developer.spotify.com/web-api/get-users-saved-tracks/) + * + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getMySavedTracks(options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Adds a list of tracks to the current user's saved tracks. + * See [Save Tracks for Current User](https://developer.spotify.com/web-api/save-tracks-user/) + * + * @param trackIds The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + addToMySavedTracks(trackIds: string[], options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Remove a list of tracks from the current user's saved tracks. + * See [Remove Tracks for Current User](https://developer.spotify.com/web-api/remove-tracks-user/) + * + * @param trackIds The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + removeFromMySavedTracks(trackIds: string[], options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Checks if the current user's saved tracks contains a certain list of tracks. + * See [Check Current User's Saved Tracks](https://developer.spotify.com/web-api/check-users-saved-tracks/) on the Spotify Developer site for more information about the endpoint. + * + * @param trackIds The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + containsMySavedTracks(trackIds: string[], options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Adds the current user as a follower of one or more other Spotify users. + * See [Follow Artists or Users](https://developer.spotify.com/web-api/follow-artists-users/) on the Spotify Developer site for more information about the endpoint. + * + * @param userIds The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. one is the error object (null if no error), and the second is an empty value if the request succeeded. + */ + followUsers(userIds: string[], callback?: ResultsCallback) : Promise; + + /** + * Adds the current user as a follower of one or more artists. + * See [Follow Artists or Users](https://developer.spotify.com/web-api/follow-artists-users/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistIds The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. one is the error object (null if no error), and the second is an empty value if the request succeeded. + */ + followArtists(artistIds: string[], callback?: ResultsCallback) : Promise; + + /** + * Add the current user as a follower of one playlist. + * See [Follow a Playlist](https://developer.spotify.com/web-api/follow-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param ownerId The id of the playlist owner. If you know the Spotify URI of the playlist, it is easy to find the owner's user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param options A JSON object with options that can be passed. For instance, whether you want the playlist to be followed privately ({public: false}) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + followPlaylist(ownerId: string, playlistId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Removes the current user as a follower of one or more other Spotify users. + * See [Unfollow Artists or Users](https://developer.spotify.com/web-api/unfollow-artists-users/) on the Spotify Developer site for more information about the endpoint. + * + * @param userIds The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + unfollowUsers(userIds: string[], callback?: ResultsCallback) : Promise; + + /** + * Removes the current user as a follower of one or more artists. + * See [Unfollow Artists or Users](https://developer.spotify.com/web-api/unfollow-artists-users/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistIds The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + unfollowArtists(artistIds: string[], callback?: ResultsCallback) : Promise; + + /** + * Remove the current user as a follower of one playlist. + * See [Unfollow a Playlist](https://developer.spotify.com/web-api/unfollow-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param ownerId The id of the playlist owner. If you know the Spotify URI of the playlist, it is easy to find the owner's user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + unfollowPlaylist(ownerId: string, playlistId: string, callback?: ResultsCallback) : Promise; + + /** + * Checks to see if the current user is following one or more other Spotify users. + * See [Check if Current User Follows Users or Artists](https://developer.spotify.com/web-api/check-current-user-follows/) on the Spotify Developer site for more information about the endpoint. + * + * @param userIds The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + isFollowingUsers(userIds: string[], callback?: ResultsCallback) : Promise + + /** + * Checks to see if the current user is following one or more artists. + * See [Check if Current User Follows](https://developer.spotify.com/web-api/check-current-user-follows/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistIds The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + isFollowingArtists(artistIds: string[], callback?: ResultsCallback) : Promise; + + /** + * Check to see if one or more Spotify users are following a specified playlist. + * See [Check if Users Follow a Playlist](https://developer.spotify.com/web-api/check-user-following-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param ownerId The id of the playlist owner. If you know the Spotify URI of the playlist, it is easy to find the owner's user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param userIds The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + areFollowingPlaylist(ownerId: string, playlistId: string, userIds: string[], callback?: ResultsCallback) : Promise; + + /** + * Get the current user's followed artists. + * See [Get User's Followed Artists](https://developer.spotify.com/web-api/get-followed-artists/) on the Spotify Developer site for more information about the endpoint. + * + * @param options Options, being after and limit. + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getFollowedArtists(options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches information about a specific user. + * See [Get a User's Profile](https://developer.spotify.com/web-api/get-users-profile/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getUser(userId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches a list of the current user's playlists. + * See [Get a List of a User's Playlists](https://developer.spotify.com/web-api/get-list-users-playlists/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getUserPlaylists(userId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches a specific playlist. + * See [Get a Playlist](https://developer.spotify.com/web-api/get-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getPlaylist(userId: string, playlistId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches the tracks from a specific playlist. + * See [Get a Playlist's Tracks](https://developer.spotify.com/web-api/get-playlists-tracks/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getPlaylistTracks(userId: string, playlistId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Creates a playlist and stores it in the current user's library. + * See [Create a Playlist](https://developer.spotify.com/web-api/create-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. You may want to user the "getMe" function to find out the id of the current logged in user + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + createPlaylist(userId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Change a playlist's name and public/private state + * See [Change a Playlist's Details](https://developer.spotify.com/web-api/change-playlist-details/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. You may want to user the "getMe" function to find out the id of the current logged in user + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param data A JSON object with the data to update. E.g. {name: 'A new name', public: true} + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + changePlaylistDetails(userId: string, playlistId: string, data: Object, callback?: ResultsCallback) : Promise; + + /** + * Add tracks to a playlist. + * See [Add Tracks to a Playlist](https://developer.spotify.com/web-api/add-tracks-to-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param uris An array of Spotify URIs for the tracks + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + addTracksToPlaylist(userId: string, playlistId: string, uris: string[], options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Replace the tracks of a playlist + * See [Replace a Playlist's Tracks](https://developer.spotify.com/web-api/replace-playlists-tracks/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param uris An array of Spotify URIs for the tracks + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + replaceTracksInPlaylist(userId: string, playlistId: string, uris: string[], callback?: ResultsCallback) : Promise; + + /** + * Reorder tracks in a playlist + * See [Reorder a Playlist’s Tracks](https://developer.spotify.com/web-api/reorder-playlists-tracks/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param rangeStart The position of the first track to be reordered. + * @param insertBefore The position where the tracks should be inserted. To reorder the tracks to the end of the playlist, simply set insert_before to the position after the last track. + * @param options An object with optional parameters (range_length, snapshot_id) + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + reorderTracksInPlaylist(userId: string, playlistId: string, rangeStart: number, insertBefore: number, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Remove tracks from a playlist + * See [Remove Tracks from a Playlist](https://developer.spotify.com/web-api/remove-tracks-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param uris An array of tracks to be removed. Each element of the array can be either a string, in which case it is treated as a URI, or an object containing the properties `uri` (which is a string) and `positions` (which is an array of integers). + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + removeTracksFromPlaylist(userId: string, playlistId: string, uris: Object[], callback?: ResultsCallback) : Promise; + + /** + * Remove tracks from a playlist, specifying a snapshot id. + * See [Remove Tracks from a Playlist](https://developer.spotify.com/web-api/remove-tracks-playlist/) on the Spotify Developer site for more information about the endpoint. + * + * @param userId The id of the user. If you know the Spotify URI it is easy to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param uris An array of tracks to be removed. Each element of the array can be either a string, in which case it is treated as a URI, or an object containing the properties `uri` (which is a string) and `positions` (which is an array of integers). + * @param snapshotId The playlist's snapshot ID against which you want to make the changes + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + removeTracksFromPlaylistWithSnapshotId(userId: string, playlistId: string, uris: Object[], snapshotId: string, callback?: ResultsCallback) : Promise; + + /** + * Remove tracks from a playlist, specifying the positions of the tracks to be removed. + * See [Remove Tracks from a Playlist](https://developer.spotify.com/web-api/remove-tracks-playlist/) on + * the Spotify Developer site for more information about the endpoint. + * @param userId The id of the user. If you know the Spotify URI it is easy + * to find the user id (e.g. spotify:user::playlist:xxxx) + * @param playlistId The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:) + * @param positions array of integers containing the positions of the tracks to remove from the playlist. + * @param snapshotId The playlist's snapshot ID against which you want to make the changes + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + removeTracksFromPlaylistInPositions(userId: string, playlistId: string, positions: number[], snapshotId: string, callback?: ResultsCallback) : Promise; + + /** + * Fetches an album from the Spotify catalog. + * See [Get an Album](https://developer.spotify.com/web-api/get-album/) on the Spotify Developer site for more information about the endpoint. + * + * @param albumId The id of the album. If you know the Spotify URI it is easy to find the album id (e.g. spotify:album:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getAlbum(albumId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches the tracks of an album from the Spotify catalog. + * See [Get an Album's Tracks](https://developer.spotify.com/web-api/get-albums-tracks/) on the Spotify Developer site for more information about the endpoint. + * + * @param albumId The id of the album. If you know the Spotify URI it is easy to find the album id (e.g. spotify:album:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getAlbumTracks(albumId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches multiple albums from the Spotify catalog. + * See [Get Several Albums](https://developer.spotify.com/web-api/get-several-albums/) on the Spotify Developer site for more information about the endpoint. + * + * @param albumIds The ids of the albums. If you know their Spotify URI it is easy to find their album id (e.g. spotify:album:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getAlbums(albumIds: string[], options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches a track from the Spotify catalog. + * See [Get a Track](https://developer.spotify.com/web-api/get-track/) on the Spotify Developer site for more information about the endpoint. + * + * @param trackId The id of the track. If you know the Spotify URI it is easy to find the track id (e.g. spotify:track:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getTrack(trackId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches multiple tracks from the Spotify catalog. + * See [Get Several Tracks](https://developer.spotify.com/web-api/get-several-tracks/) on + * the Spotify Developer site for more information about the endpoint. + * @param trackIds The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getTracks(trackIds: string[], options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches an artist from the Spotify catalog. + * See [Get an Artist](https://developer.spotify.com/web-api/get-artist/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistId The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getArtist(artistId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches multiple artists from the Spotify catalog. + * See [Get Several Artists](https://developer.spotify.com/web-api/get-several-artists/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistIds The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getArtists(artistIds: string[], options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches the albums of an artist from the Spotify catalog. + * See [Get an Artist's Albums](https://developer.spotify.com/web-api/get-artists-albums/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistId The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getArtistAlbums(artistId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches a list of top tracks of an artist from the Spotify catalog, for a specific country. + * See [Get an Artist's Top Tracks](https://developer.spotify.com/web-api/get-artists-top-tracks/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistId The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:) + * @param countryId The id of the country (e.g. ES for Spain or US for United States) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getArtistTopTracks(artistId: string, countryId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches a list of artists related with a given one from the Spotify catalog. + * See [Get an Artist's Related Artists](https://developer.spotify.com/web-api/get-related-artists/) on the Spotify Developer site for more information about the endpoint. + * + * @param artistId The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:) + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getArtistRelatedArtists(artistId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches a list of Spotify featured playlists (shown, for example, on a Spotify player's "Browse" tab). + * See [Get a List of Featured Playlists](https://developer.spotify.com/web-api/get-list-featured-playlists/) on the Spotify Developer site for more information about the endpoint. + * + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getFeaturedPlaylists(options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches a list of new album releases featured in Spotify (shown, for example, on a Spotify player's "Browse" tab). + * See [Get a List of New Releases](https://developer.spotify.com/web-api/get-list-new-releases/) on the Spotify Developer site for more information about the endpoint. + * + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getNewReleases(options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Get a list of categories used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab). + * See [Get a List of Categories](https://developer.spotify.com/web-api/get-list-categories/) on the Spotify Developer site for more information about the endpoint. + * + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getCategories(options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Get a single category used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab). + * See [Get a Category](https://developer.spotify.com/web-api/get-category/) on the Spotify Developer site for more information about the endpoint. + * + * @param categoryId The id of the category. These can be found with the getCategories function + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getCategory(categoryId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Get a list of Spotify playlists tagged with a particular category. + * See [Get a Category's Playlists](https://developer.spotify.com/web-api/get-categorys-playlists/) on the Spotify Developer site for more information about the endpoint. + * + * @param categoryId The id of the category. These can be found with the getCategories function + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + getCategoryPlaylists(categoryId: string, options?: Object, callback?: ResultsCallback) : Promise; + + /** + * Fetches albums from the Spotify catalog according to a query. + * See [Search for an Item](https://developer.spotify.com/web-api/search-item/) on the Spotify Developer site for more information about the endpoint. + * + * @param query The search query + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + searchAlbums(query: string, options?: SpotifyApi.SearchForItemParameterObject, callback?: ResultsCallback) : Promise; + + /** + * Fetches artists from the Spotify catalog according to a query. + * See [Search for an Item](https://developer.spotify.com/web-api/search-item/) on the Spotify Developer site for more information about the endpoint. + * + * @param query The search query + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + searchArtists(query: string, options?: SpotifyApi.SearchForItemParameterObject, callback?: ResultsCallback) : Promise; + + /** + * Fetches tracks from the Spotify catalog according to a query. + * See [Search for an Item](https://developer.spotify.com/web-api/search-item/) on the Spotify Developer site for more information about the endpoint. + * + * @param query The search query + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + searchTracks(query: string, options?: SpotifyApi.SearchForItemParameterObject, callback?: ResultsCallback) : Promise; + + /** + * Fetches playlists from the Spotify catalog according to a query. + * See [Search for an Item](https://developer.spotify.com/web-api/search-item/) on the Spotify Developer site for more information about the endpoint. + * + * @param query The search query + * @param options A JSON object with options that can be passed + * @param callback An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded. + */ + searchPlaylists(query: string, options?: SpotifyApi.SearchForItemParameterObject, callback?: ResultsCallback) : Promise; + + /** + * Sets the access token to be used. + * See [the Authorization Guide](https://developer.spotify.com/web-api/authorization-guide/) on the Spotify Developer site for more information about obtaining an access token. + * + * @param accessToken The access token + */ + setAccessToken(accessToken: string) : void; + + /** + * Sets an implementation of Promises/A+ to be used. E.g. Q, when. + * See [Conformant Implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md) for a list of some available options + * + * @param promiseImplementation A Promises/A+ valid implementation + * @throws {Error} If the implementation being set doesn't conform with Promises/A+ + */ + setPromiseImplementation(promiseImplementation: Object) : void; + } +} diff --git a/stylus/stylus.d.ts b/stylus/stylus.d.ts index b0c8db62f..dcaa07902 100644 --- a/stylus/stylus.d.ts +++ b/stylus/stylus.d.ts @@ -647,6 +647,11 @@ declare module Stylus { */ render(callback: RenderCallback): void; + /** + * Parse and evaluate AST and return the result. + */ + render(): string; + /** * Get dependencies of the compiled file. */ diff --git a/temp/temp-tests.ts b/temp/temp-tests.ts index be25d357b..4fb0cc6f8 100644 --- a/temp/temp-tests.ts +++ b/temp/temp-tests.ts @@ -67,6 +67,8 @@ function testMkdirSync() { function testPath() { const p = temp.path({ suffix: "justSuffix" }, "defaultPrefix"); p.length; + const p2: string = temp.path("prefix"); + const p3: string = temp.path({ prefix: "prefix" }); } function testTrack() { diff --git a/temp/temp.d.ts b/temp/temp.d.ts index 7cd51d2be..c8caab746 100644 --- a/temp/temp.d.ts +++ b/temp/temp.d.ts @@ -31,8 +31,8 @@ declare module "temp" { export function openSync(affixes: string): { path: string, fd: number }; export function openSync(affixes: AffixOptions): { path: string, fd: number }; - export function path(affixes: string, defaultPrefix: string): string; - export function path(affixes: AffixOptions, defaultPrefix: string): string; + export function path(affixes: string, defaultPrefix?: string): string; + export function path(affixes: AffixOptions, defaultPrefix?: string): string; export function cleanup(callback?: (result: boolean | {files: number, dirs?: number}) => void): void; diff --git a/threejs/three-canvasrenderer.d.ts b/threejs/three-canvasrenderer.d.ts index cb4e610bc..4a3b84801 100644 --- a/threejs/three-canvasrenderer.d.ts +++ b/threejs/three-canvasrenderer.d.ts @@ -23,6 +23,7 @@ declare module THREE { export interface CanvasRendererParameters { canvas?: HTMLCanvasElement; devicePixelRatio?: number; + alpha?: boolean; } export class CanvasRenderer implements Renderer { @@ -55,4 +56,4 @@ declare module THREE { clearStencil(): void; render(scene: Scene, camera: Camera): void; } -} \ No newline at end of file +} diff --git a/threejs/three-orbitcontrols.d.ts b/threejs/three-orbitcontrols.d.ts index 69cde47a7..b904ab321 100644 --- a/threejs/three-orbitcontrols.d.ts +++ b/threejs/three-orbitcontrols.d.ts @@ -7,10 +7,10 @@ declare module THREE { class OrbitControls { - constructor(object:Camera, domElement?:HTMLElement); + constructor(object: Camera, domElement?: HTMLElement); - object:Camera; - domElement:HTMLElement; + object: Camera; + domElement: HTMLElement; // API enabled: boolean; @@ -19,13 +19,13 @@ declare module THREE { // deprecated center: THREE.Vector3; - noZoom: boolean; + enableZoom: boolean; zoomSpeed: number; minDistance: number; maxDistance: number; - noRotate: boolean; + enableRotate: boolean; rotateSpeed: number; - noPan: boolean; + enablePan: boolean; keyPanSpeed: number; autoRotate: boolean; autoRotateSpeed: number; @@ -33,24 +33,27 @@ declare module THREE { maxPolarAngle: number; minAzimuthAngle: number; maxAzimuthAngle: number; - noKeys: boolean; + enableKeys: boolean; keys: { LEFT: number; UP: number; RIGHT: number; BOTTOM: number; }; mouseButtons: { ORBIT: MOUSE; ZOOM: MOUSE; PAN: MOUSE; }; + enableDamping: boolean; + dampingFactor: number; + rotateLeft(angle?: number): void; rotateUp(angle?: number): void; panLeft(distance?: number): void; panUp(distance?: number): void; - pan( deltaX: number, deltaY: number): void; + pan(deltaX: number, deltaY: number): void; dollyIn(dollyScale: number): void; dollyOut(dollyScale: number): void; update(): void; reset(): void; - getPolarAngle() : number; + getPolarAngle(): number; getAzimuthalAngle(): number; // EventDispatcher mixins - addEventListener(type: string, listener: (event: any) => void ): void; + addEventListener(type: string, listener: (event: any) => void): void; hasEventListener(type: string, listener: (event: any) => void): void; removeEventListener(type: string, listener: (event: any) => void): void; dispatchEvent(event: { type: string; target: any; }): void; diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 1939bfc5d..0717427b3 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -1227,7 +1227,7 @@ declare module THREE { */ computeBoundingSphere(): void; - merge( geometry: Geometry, matrix: Matrix, materialIndexOffset: number): void; + merge( geometry: Geometry, matrix: Matrix, materialIndexOffset?: number): void; mergeMesh( mesh: Mesh ): void; @@ -1677,7 +1677,7 @@ declare module THREE { * Abstract base class for lights. */ export class Light extends Object3D { - constructor(hex?: number); + constructor(hex?: number|string); color: Color; receiveShadow: boolean; @@ -1727,7 +1727,7 @@ declare module THREE { * This creates a Ambientlight with a color. * @param hex Numeric value of the RGB component of the color. */ - constructor(hex?: number); + constructor(hex?: number|string); clone(recursive?: boolean): AmbientLight; copy(source: AmbientLight): AmbientLight; @@ -1746,7 +1746,7 @@ declare module THREE { */ export class DirectionalLight extends Light { - constructor(hex?: number, intensity?: number); + constructor(hex?: number|string, intensity?: number); /** * Target used for shadow camera orientation. @@ -1766,7 +1766,7 @@ declare module THREE { } export class HemisphereLight extends Light { - constructor(skyColorHex?: number, groundColorHex?: number, intensity?: number); + constructor(skyColorHex?: number|string, groundColorHex?: number|string, intensity?: number); groundColor: Color; intensity: number; @@ -1784,7 +1784,7 @@ declare module THREE { * scene.add( light ); */ export class PointLight extends Light { - constructor(hex?: number, intensity?: number, distance?: number, decay?: number); + constructor(hex?: number|string, intensity?: number, distance?: number, decay?: number); /* * Light's intensity. @@ -1810,7 +1810,7 @@ declare module THREE { * A point light that can cast shadow in one direction. */ export class SpotLight extends Light { - constructor(hex?: number, intensity?: number, distance?: number, angle?: number, exponent?: number, decay?: number); + constructor(hex?: number|string, intensity?: number, distance?: number, angle?: number, exponent?: number, decay?: number); /** * Spotlight focus points at target.position. @@ -2244,7 +2244,7 @@ declare module THREE { } export interface LineBasicMaterialParameters extends MaterialParameters { - color?: number; + color?: number|string; linewidth?: number; linecap?: string; linejoin?: string; @@ -2267,7 +2267,7 @@ declare module THREE { } export interface LineDashedMaterialParameters extends MaterialParameters { - color?: number; + color?: number|string; linewidth?: number; scale?: number; dashSize?: number; @@ -2295,7 +2295,7 @@ declare module THREE { * parameters is an object with one or more properties defining the material's appearance. */ export interface MeshBasicMaterialParameters extends MaterialParameters{ - color?: number; + color?: number|string; opacity?: number; map?: Texture; aoMap?: Texture; @@ -2361,7 +2361,7 @@ declare module THREE { } export interface MeshLambertMaterialParameters extends MaterialParameters{ - color?: number; + color?: number|string; emissive?: number; opacity?: number; map?: Texture; @@ -2433,7 +2433,7 @@ declare module THREE { export interface MeshPhongMaterialParameters extends MaterialParameters { /** geometry color in hexadecimal. Default is 0xffffff. */ - color?: number; + color?: number | string; emissive?: number; specular?: number; shininess?: number; @@ -2461,7 +2461,7 @@ declare module THREE { blending?: Blending; depthTest?: boolean; depthWrite?: boolean; - wireframe?: string; + wireframe?: boolean; wireframeLinewidth?: number; vertexColors?: Colors; skinning?: boolean; @@ -2528,7 +2528,7 @@ declare module THREE { } export interface PointsMaterialParameters extends MaterialParameters{ - color?: number; + color?: number|string; opacity?: number; map?: Texture; size?: number; @@ -2604,7 +2604,7 @@ declare module THREE { } export interface SpriteMaterialParameters extends MaterialParameters { - color?: number; + color?: number|string; opacity?: number; map?: Texture; blending?: Blending; @@ -4470,6 +4470,11 @@ declare module THREE { clearAlpha?: number; devicePixelRatio?: number; + + /** + * default is false. + */ + logarithmicDepthBuffer?: boolean; } @@ -5106,7 +5111,7 @@ declare module THREE { * This class contains the parameters that define linear fog, i.e., that grows exponentially denser with the distance. */ export class FogExp2 implements IFog { - constructor(hex: number, density?: number); + constructor(hex: number|string, density?: number); name: string; color: Color; diff --git a/tinycolor/tinycolor.d.ts b/tinycolor/tinycolor.d.ts index 4d36c084b..d7bc54342 100644 --- a/tinycolor/tinycolor.d.ts +++ b/tinycolor/tinycolor.d.ts @@ -329,6 +329,11 @@ interface tinycolorInstance { * Gets the complement of the current color */ complement(): tinycolorInstance; + + /** + * Gets a new instance with the current color + */ + clone(): tinycolorInstance; } declare module Readable { diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index e01e0d509..8164d430e 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -181,7 +181,13 @@ declare module Twitter.Typeahead { * Defaults to value. */ display?: string | ((obj: any) => string); - + + /** + * Can be used in place of display above. + * + */ + displayKey?: string | ((obj: any) => string); + /** * A hash of templates to be used when rendering the dataset. * Note a precompiled template is a function that takes a JavaScript object as its first argument and returns a HTML string. diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index e6dd7468d..a480d7bb4 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -114,11 +114,11 @@ declare module uiGrid { ROW: string; COLUMN: string; OPTIONS: string; - } + }; scrollbars: { NEVER: number; ALWAYS: number; - } + }; } export type IGridInstance = IGridInstanceOf; export interface IGridInstanceOf { @@ -1057,7 +1057,7 @@ declare module uiGrid { * @param {sortChangedHandler} handler callback */ sortChanged: (scope: ng.IScope, handler: sortChangedHandler) => void; - } + }; } export interface columnVisibilityChangedHandler { /** @@ -1211,7 +1211,7 @@ declare module uiGrid { * @param {viewportKeyPressHandler} handler Callback */ viewportKeyPress: (scope: ng.IScope, handler: viewportKeyPressHandler) => void; - } + }; } export interface navigateHandler { @@ -1282,7 +1282,7 @@ declare module uiGrid { KEYDOWN: number; CLICK: number; CLEAR: number; - } + }; } } @@ -1481,7 +1481,7 @@ declare module uiGrid { BEGIN_CELL_EDIT: string; END_CELL_EDIT: string; CANCEL_CELL_EDIT: string; - } + }; } } @@ -1548,7 +1548,7 @@ declare module uiGrid { * @param {rowExpandedStateChangedHandler} handler */ rowExpandedStateChanged: (scope: ng.IScope, handler: rowExpandedStateChangedHandler) => void; - } + }; } export interface rowExpandedStateChangedHandler { @@ -2300,7 +2300,7 @@ declare module uiGrid { * @param {columnPositionChangedHandler} handler Callback Function */ columnPositionChanged?: (scope: ng.IScope, handler: columnPositionChangedHandler) => void; - } + }; } export interface columnPositionChangedHandler { (colDef: IColumnDef, originalPosition: number, finalPosition: number): void; @@ -2387,7 +2387,7 @@ declare module uiGrid { * @param {paginationChangedHandler} handler Callback */ paginationChanged: (scope: ng.IScope, handler: paginationChangedHandler) => void; - } + }; } /** @@ -2469,7 +2469,7 @@ declare module uiGrid { LEFT: string; RIGHT: string; NONE: string; - } + }; } } @@ -2508,7 +2508,7 @@ declare module uiGrid { * @param {columnSizeChangedHandler} handler Callback */ columnSizeChanged: (scope: ng.IScope, handler: columnSizeChangedHandler) => void; - } + }; } export interface columnSizeChangedHandler { @@ -2594,7 +2594,7 @@ declare module uiGrid { * @param {saveRowHandler} handler Callback */ saveRow: (scope: ng.IScope, handler: saveRowHandler) => void; - } + }; } export interface saveRowHandler { @@ -2973,7 +2973,7 @@ declare module uiGrid { * @param {rowSelectionChangedBatchHandler} handler callback */ rowSelectionChangedBatch: (scope: ng.IScope, handler: rowSelectionChangedBatchHandler) => void; - } + }; } export interface rowSelectionChangedHandler { /** @@ -3206,13 +3206,13 @@ declare module uiGrid { * @param {rowExpandedHandler} handler Callback */ rowExpanded: (scope: ng.IScope, handler: rowExpandedHandler) => void; - } + }; } export interface ITreeState { expandedState: { [index: string]: string - } + }; } export interface rowCollapsedHandler { @@ -3275,7 +3275,7 @@ declare module uiGrid { MAX: string; MIN: string; AVG: string; - } + }; } // Tree View @@ -3766,6 +3766,14 @@ declare module uiGrid { * You may specify one of the sortingAlgorithms found in the rowSorter service. */ sortCellFiltered?: boolean; + /** + *(optional) An array of sort directions, specifying the order that they should cycle through as + * the user repeatedly clicks on the column heading. The default is [null, uiGridConstants.ASC, uiGridConstants.DESC]. + * Null refers to the unsorted state. This does not affect the initial sort direction; use the sort property for that. + * If suppressRemoveSort is also set, the unsorted state will be skipped even if it is listed here. Each direction may + * not appear in the list more than once (e.g. [ASC, DESC, DESC] is not allowed), and the list may not be empty.* + */ + sortDirectionCycle?: Array; /** Algorithm to use for sorting this column */ sortingAlgorithm?: (a: any, b: any) => number; /** diff --git a/ui-select/ui-select-tests.ts b/ui-select/ui-select-tests.ts new file mode 100644 index 000000000..e0017576f --- /dev/null +++ b/ui-select/ui-select-tests.ts @@ -0,0 +1,9 @@ +/// + +angular + .module('main', ['ui-select']) + .config(function(uiSelectConfig: angular.ui.select.ISelectConfig) { + uiSelectConfig.appendToBody = true; + uiSelectConfig.resetSearchInput = true; + uiSelectConfig.theme = "bootstrap"; + }); \ No newline at end of file diff --git a/ui-select/ui-select.d.ts b/ui-select/ui-select.d.ts new file mode 100644 index 000000000..e223b947e --- /dev/null +++ b/ui-select/ui-select.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ui-select 0.13.2 +// Project: https://github.com/angular-ui/ui-select +// Definitions by: Niko Kovačič +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "ui-select" { + var _: string; + export = _; +} + +declare module angular.ui.select { + interface ISelectConfig { + appendToBody: boolean; + resetSearchInput: boolean; + theme: string; + } +} diff --git a/underscore/underscore-tests.ts b/underscore/underscore-tests.ts index 051e000d0..74cef85ec 100644 --- a/underscore/underscore-tests.ts +++ b/underscore/underscore-tests.ts @@ -479,3 +479,25 @@ _.chain(obj).map(function (value, key) { empty[key] = value; console.log("vk", value, key); }); + +function strong_typed_values_tests() { + var dictionaryLike: { [k: string] : {title: string, value: number} } = { + 'test' : { title: 'item1', value: 5 }, + 'another' : { title: 'item2', value: 8 }, + 'third' : { title: 'item3', value: 10 } + }; + + _.chain(dictionaryLike).values().filter((r) => { + return r.value >= 8; + }).map((r) => { + return [r.title, true]; + }).object().value(); + + var x: number = _(dictionaryLike).chain().filter((x) => { + console.log(x.title); + console.log(x.value.toFixed()); + return x.title == 'item1'; + }).size().value(); + + _.values<{title: string, value: number}>(dictionaryLike); +} diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 8cf98071b..66b2e8f3e 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -76,6 +76,7 @@ interface UnderscoreStatic { * as the first parameter can be invoked through this function. * @param key First argument to Underscore object functions. **/ + (value: _.Dictionary): Underscore; (value: Array): Underscore; (value: T): Underscore; @@ -900,6 +901,16 @@ interface UnderscoreStatic { **/ zip(...arrays: any[]): any[]; + /** + * The opposite of zip. Given a number of arrays, returns a series of new arrays, the first + * of which contains all of the first elements in the input arrays, the second of which + * contains all of the second elements, and so on. Use with apply to pass in an array + * of arrays + * @param arrays The arrays to unzip. + * @return Unzipped version of `arrays`. + **/ + unzip(...arrays: any[][]): any[][]; + /** * Converts arrays into objects. Pass either a single list of [key, value] pairs, or a * list of keys, and a list of values. @@ -961,6 +972,30 @@ interface UnderscoreStatic { array: _.List, value: T, from?: number): number; + + /** + * Returns the first index of an element in `array` where the predicate truth test passes + * @param array The array to search for the index of the first element where the predicate truth test passes. + * @param predicate Predicate function. + * @param context `this` object in `predicate`, optional. + * @return Returns the index of an element in `array` where the predicate truth test passes or -1.` + **/ + findIndex( + array: _.List, + predicate: _.ListIterator, + context?: any): number; + + /** + * Returns the last index of an element in `array` where the predicate truth test passes + * @param array The array to search for the index of the last element where the predicate truth test passes. + * @param predicate Predicate function. + * @param context `this` object in `predicate`, optional. + * @return Returns the index of an element in `array` where the predicate truth test passes or -1.` + **/ + findLastIndex( + array: _.List, + predicate: _.ListIterator, + context?: any): number; /** * Uses a binary search to determine the index at which the value should be inserted into the list in order @@ -1192,6 +1227,20 @@ interface UnderscoreStatic { **/ keys(object: any): string[]; + /** + * Retrieve all the names of object's own and inherited properties. + * @param object Retrieve the key or property names from this object. + * @return List of all the property names on `object`. + **/ + allKeys(object: any): string[]; + + /** + * Return all of the values of the object's properties. + * @param object Retrieve the values of all the properties on this object. + * @return List of all the values on `object`. + **/ + values(object: _.Dictionary): T[]; + /** * Return all of the values of the object's properties. * @param object Retrieve the values of all the properties on this object. @@ -1371,6 +1420,13 @@ interface UnderscoreStatic { **/ property(key: string): (object: Object) => any; + /** + * Returns a function that will itself return the value of a object key property. + * @param key The object to get the property value from. + * @return Function which accept a key property in `object` and returns its value. + **/ + propertyOf(object: Object): (key: string) => any; + /** * Performs an optimized deep comparison between the two objects, * to determine if they should be considered equal. @@ -1387,6 +1443,14 @@ interface UnderscoreStatic { **/ isEmpty(object: any): boolean; + /** + * Returns true if the keys and values in `properties` matches with the `object` properties. + * @param object Object to be compared with `properties`. + * @param properties Properties be compared with `object` + * @return True if `object` has matching keys and values, otherwise false. + **/ + isMatch(object:any, properties:any): boolean; + /** * Returns true if object is a DOM element. * @param object Check if this object is a DOM element. @@ -1422,6 +1486,13 @@ interface UnderscoreStatic { * @return True if `object` is a Function, otherwise false. **/ isFunction(object: any): boolean; + + /** + * Returns true if object inherits from an Error. + * @param object Check if this object is an Error. + * @return True if `object` is a Error, otherwise false. + **/ + isError(object:any): boolean; /** * Returns true if object is a String. @@ -1573,12 +1644,7 @@ interface UnderscoreStatic { * @param prefix A prefix string to start the unique ID with. * @return Unique string ID beginning with `prefix`. **/ - uniqueId(prefix: string): string; - - /** - * @see _.uniqueId - **/ - uniqueId(): number; + uniqueId(prefix?: string): string; /** * Escapes a string for insertion into HTML, replacing &, <, >, ", ', and / characters. @@ -1598,9 +1664,10 @@ interface UnderscoreStatic { * If the value of the named property is a function then invoke it; otherwise, return it. * @param object Object to maybe invoke function `property` on. * @param property The function by name to invoke on `object`. + * @param defaultValue The value to be returned in case `property` doesn't exist or is undefined. * @return The result of invoking the function `property` on `object. **/ - result(object: any, property: string): any; + result(object: any, property: string, defaultValue?:any): any; /** * Compiles JavaScript templates into functions that can be evaluated for rendering. Useful @@ -1641,6 +1708,7 @@ interface UnderscoreStatic { * @return Wrapped `obj`. **/ chain(obj: T[]): _Chain; + chain(obj: _.Dictionary): _Chain; chain(obj: T): _Chain; } @@ -2079,6 +2147,12 @@ interface Underscore { **/ zip(...arrays: any[][]): any[][]; + /** + * Wrapped type `any[][]`. + * @see _.unzip + **/ + unzip(...arrays: any[][]): any[][]; + /** * Wrapped type `any[][]`. * @see _.object @@ -2107,6 +2181,16 @@ interface Underscore { **/ lastIndexOf(value: T, from?: number): number; + /** + * @see _.findIndex + **/ + findIndex(array: _.List, predicate: _.ListIterator, context?: any): number; + + /** + * @see _.findLastIndex + **/ + findLastIndex(array: _.List, predicate: _.ListIterator, context?: any): number; + /** * Wrapped type `any[]`. * @see _.sortedIndex @@ -2228,6 +2312,12 @@ interface Underscore { **/ keys(): string[]; + /** + * Wrapped type `object`. + * @see _.allKeys + **/ + allKeys(): string[]; + /** * Wrapped type `object`. * @see _.values @@ -2314,6 +2404,12 @@ interface Underscore { * @see _.property **/ property(): (object: Object) => any; + + /** + * Wrapped type `object`. + * @see _.propertyOf + **/ + propertyOf(): (key: string) => any; /** * Wrapped type `object`. @@ -2326,6 +2422,12 @@ interface Underscore { * @see _.isEmpty **/ isEmpty(): boolean; + + /** + * Wrapped type `object`. + * @see _.isMatch + **/ + isMatch(): boolean; /** * Wrapped type `object`. @@ -2356,6 +2458,12 @@ interface Underscore { * @see _.isFunction **/ isFunction(): boolean; + + /** + * Wrapped type `object`. + * @see _.isError + **/ + isError(): boolean; /** * Wrapped type `object`. @@ -2484,7 +2592,7 @@ interface Underscore { * Wrapped type `object`. * @see _.result **/ - result(property: string): any; + result(property: string, defaultValue?:any): any; /** * Wrapped type `string`. @@ -2815,7 +2923,7 @@ interface _Chain { * Wrapped type `any`. * @see _.size **/ - size(): _Chain; + size(): _ChainSingle; /********* * Arrays * @@ -2957,6 +3065,12 @@ interface _Chain { **/ zip(...arrays: any[][]): _Chain; + /** + * Wrapped type `any[][]`. + * @see _.unzip + **/ + unzip(...arrays: any[][]): _Chain; + /** * Wrapped type `any[][]`. * @see _.object @@ -2985,6 +3099,16 @@ interface _Chain { **/ lastIndexOf(value: T, from?: number): _ChainSingle; + /** + * @see _.findIndex + **/ + findIndex(predicate: _.ListIterator, context?: any): _Chain; + + /** + * @see _.findLastIndex + **/ + findLastIndex(predicate: _.ListIterator, context?: any): _Chain; + /** * Wrapped type `any[]`. * @see _.sortedIndex @@ -3106,6 +3230,12 @@ interface _Chain { **/ keys(): _Chain; + /** + * Wrapped type `object`. + * @see _.allKeys + **/ + allKeys(): _Chain; + /** * Wrapped type `object`. * @see _.values @@ -3192,6 +3322,12 @@ interface _Chain { * @see _.property **/ property(): _Chain; + + /** + * Wrapped type `object`. + * @see _.propertyOf + **/ + propertyOf(): _Chain; /** * Wrapped type `object`. @@ -3204,6 +3340,12 @@ interface _Chain { * @see _.isEmpty **/ isEmpty(): _Chain; + + /** + * Wrapped type `object`. + * @see _.isMatch + **/ + isMatch(): _Chain; /** * Wrapped type `object`. @@ -3235,6 +3377,12 @@ interface _Chain { **/ isFunction(): _Chain; + /** + * Wrapped type `object`. + * @see _.isError + **/ + isError(): _Chain; + /** * Wrapped type `object`. * @see _.isString @@ -3362,7 +3510,7 @@ interface _Chain { * Wrapped type `object`. * @see _.result **/ - result(property: string): _Chain; + result(property: string, defaultValue?:any): _Chain; /** * Wrapped type `string`. diff --git a/username/username-tests.ts b/username/username-tests.ts new file mode 100644 index 000000000..46265958b --- /dev/null +++ b/username/username-tests.ts @@ -0,0 +1,10 @@ +/// + +import username = require("username"); + +username(function(err, username) { + err === new Error(); + username === "string"; +}); + +username.sync() === "string"; diff --git a/username/username.d.ts b/username/username.d.ts new file mode 100644 index 000000000..5784f46ff --- /dev/null +++ b/username/username.d.ts @@ -0,0 +1,27 @@ +// Type definitions for username v1.0.1 +// Project: https://www.npmjs.com/package/username +// Definitions by: Klaus Reimer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "username" { + /** + * Tries to get the username from the LOGNAME, USER, LNAME or USERNAME environment variables. + * Falls back to `id -un` on OS X / Linux and `whoami` on Windows in the rare case none of the environment + * variables are set. The result is cached. + * + * @param callback The callback function to call asynchronously with the result. + */ + function username(callback: (err: Error, result: string) => void): void; + + module username { + /** + * Tries to get the username from the LOGNAME, USER, LNAME or USERNAME environment variables. Falls back + * to returning an empty string in the reare case none of the environment variables are set. + * + * @return The username or empty string if not found. + */ + function sync(): string; + } + + export = username; +} diff --git a/vec3/vec3-tests.ts b/vec3/vec3-tests.ts new file mode 100644 index 000000000..8196b9d93 --- /dev/null +++ b/vec3/vec3-tests.ts @@ -0,0 +1,5 @@ +/// + +import {Vec3} from "vec3"; +let myVector: Vec3 = new Vec3(10, 10, 10); +console.log(myVector.toString()); \ No newline at end of file diff --git a/vec3/vec3.d.ts b/vec3/vec3.d.ts new file mode 100644 index 000000000..29bac0c56 --- /dev/null +++ b/vec3/vec3.d.ts @@ -0,0 +1,34 @@ +// Type definitions for Vec3 Librairy +// Project: https://www.npmjs.com/package/vec3 +// Definitions by: Xavier Stouder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "vec3" { + class Vec3 { + constructor(x: number, y: number, z: number); + constructor(location: number[]); + constructor(location: {x: number; y: number; z: number}); + constructor(locationStr: string); + + set(x: number, y: number, z: number): Vec3; + update(other: Vec3): Vec3; + floored(): Vec3; + floor(): Vec3; + offset(dx: number, dy: number, dz: number): Vec3; + translate(dx: number, dy: number, dz: number): Vec3; + add(other: Vec3): Vec3; + substract(other: Vec3): Vec3; + plus(other: Vec3): Vec3; + minus(other: Vec3): Vec3; + scaled(scalar: number): Vec3; + abs(): Vec3 + volume(): number; + modulus(): Vec3; + distanceTo(other: Vec3): number; + equals(other: Vec3): boolean; + toString(): string; + clone(): Vec3; + min(other: Vec3): Vec3; + max(other: Vec3): Vec3; + } +} \ No newline at end of file diff --git a/verror/verror-tests.ts b/verror/verror-tests.ts new file mode 100644 index 000000000..22957fdea --- /dev/null +++ b/verror/verror-tests.ts @@ -0,0 +1,18 @@ +// Type definitions for verror v1.6.0 +// Project: https://github.com/davepacheco/node-verror +// Definitions by: Sven Reglitzki +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +import VError = require("verror"); + +var error = new Error("foo"); +var verror1 = new VError(error, "bar"); +var verror2 = new VError.VError(error, "bar"); +var serror = new VError.SError(error, "bar"); +var multiError = new VError.MultiError([verror1, verror2]); +var werror = new VError.WError(verror1, "foobar"); + +var cause1: Error = verror1.cause(); +var cause2: Error = werror.cause(); diff --git a/verror/verror.d.ts b/verror/verror.d.ts new file mode 100644 index 000000000..3ad450776 --- /dev/null +++ b/verror/verror.d.ts @@ -0,0 +1,63 @@ +// Type definitions for verror v1.6.0 +// Project: https://github.com/davepacheco/node-verror +// Definitions by: Sven Reglitzki +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "verror" { + + /* + * VError([cause], fmt[, arg...]): Like JavaScript's built-in Error class, but + * supports a "cause" argument (another error) and a printf-style message. The + * cause argument can be null or omitted entirely. + * + * Examples: + * + * CODE MESSAGE + * new VError('something bad happened') "something bad happened" + * new VError('missing file: "%s"', file) "missing file: "/etc/passwd" + * with file = '/etc/passwd' + * new VError(err, 'open failed') "open failed: file not found" + * with err.message = 'file not found' + */ + class VError extends Error { + static VError: typeof VError; + static SError: typeof SError; + static MultiError: typeof MultiError; + static WError: typeof WError; + cause():Error; + constructor(cause: Error, message: string, ...params: any[]); + constructor(message: string, ...params: any[]); + } + + /* + * SError is like VError, but stricter about types. You cannot pass "null" or + * "undefined" as string arguments to the formatter. Since SError is only a + * different function, not really a different class, we don't set + * SError.prototype.name. + */ + class SError extends VError { + } + + /* + * Represents a collection of errors for the purpose of consumers that generally + * only deal with one error. Callers can extract the individual errors + * contained in this object, but may also just treat it as a normal single + * error, in which case a summary message will be printed. + */ + class MultiError extends VError { + constructor(errors: Error[]); + } + + /* + * Like JavaScript's built-in Error class, but supports a "cause" argument which + * is wrapped, not "folded in" as with VError. Accepts a printf-style message. + * The cause argument can be null. + */ + class WError extends Error { + cause():Error; + constructor(cause: Error, message: string, ...params: any[]); + constructor(message: string, ...params: any[]); + } + + export = VError; +} diff --git a/vinyl/vinyl-0.4.3.d.ts b/vinyl/vinyl-0.4.3.d.ts new file mode 100644 index 000000000..3669de261 --- /dev/null +++ b/vinyl/vinyl-0.4.3.d.ts @@ -0,0 +1,108 @@ +// Type definitions for vinyl 0.4.3 +// Project: https://github.com/wearefractal/vinyl +// Definitions by: vvakame , jedmao +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "vinyl" { + + import fs = require("fs"); + + /** + * A virtual file format. + */ + class File { + constructor(options?: { + /** + * Default: process.cwd() + */ + cwd?: string; + /** + * Used for relative pathing. Typically where a glob starts. + */ + base?: string; + /** + * Full path to the file. + */ + path?: string; + /** + * Path history. Has no effect if options.path is passed. + */ + history?: string[]; + /** + * The result of an fs.stat call. See fs.Stats for more information. + */ + stat?: fs.Stats; + /** + * File contents. + * Type: Buffer, Stream, or null + */ + contents?: Buffer | NodeJS.ReadWriteStream; + }); + + /** + * Default: process.cwd() + */ + public cwd: string; + /** + * Used for relative pathing. Typically where a glob starts. + */ + public base: string; + /** + * Full path to the file. + */ + public path: string; + public stat: fs.Stats; + /** + * Type: Buffer|Stream|null (Default: null) + */ + public contents: Buffer | NodeJS.ReadableStream; + /** + * Returns path.relative for the file base and file path. + * Example: + * var file = new File({ + * cwd: "/", + * base: "/test/", + * path: "/test/file.js" + * }); + * console.log(file.relative); // file.js + */ + public relative: string; + + public isBuffer(): boolean; + + public isStream(): boolean; + + public isNull(): boolean; + + public isDirectory(): boolean; + + /** + * Returns a new File object with all attributes cloned. Custom attributes are deep-cloned. + */ + public clone(opts?: { contents?: boolean }): File; + + /** + * If file.contents is a Buffer, it will write it to the stream. + * If file.contents is a Stream, it will pipe it to the stream. + * If file.contents is null, it will do nothing. + */ + public pipe( + stream: T, + opts?: { + /** + * If false, the destination stream will not be ended (same as node core). + */ + end?: boolean; + }): T; + + /** + * Returns a pretty String interpretation of the File. Useful for console.log. + */ + public inspect(): string; + } + + export = File; + +} \ No newline at end of file diff --git a/vinyl/vinyl-0.4.3.tests.ts b/vinyl/vinyl-0.4.3.tests.ts new file mode 100644 index 000000000..22a7d775a --- /dev/null +++ b/vinyl/vinyl-0.4.3.tests.ts @@ -0,0 +1,560 @@ +/// +/// + +/// + +import File = require('vinyl'); +import Stream = require('stream'); +import fs = require('fs'); + +declare var fakeStream: NodeJS.ReadWriteStream; + +describe('File', () => { + + describe('constructor()', () => { + + it('should default cwd to process.cwd', done => { + var file = new File(); + file.cwd.should.equal(process.cwd()); + done(); + }); + + it('should default base to cwd', done => { + var cwd = "/"; + var file = new File({cwd: cwd}); + file.base.should.equal(cwd); + done(); + }); + + it('should default base to cwd even when none is given', done => { + var file = new File(); + file.base.should.equal(process.cwd()); + done(); + }); + + it('should default path to null', done => { + var file = new File(); + should.not.exist(file.path); + done(); + }); + + it('should default stat to null', done => { + var file = new File(); + should.not.exist(file.stat); + done(); + }); + + it('should default contents to null', done => { + var file = new File(); + should.not.exist(file.contents); + done(); + }); + + it('should set base to given value', done => { + var val = "/"; + var file = new File({base: val}); + file.base.should.equal(val); + done(); + }); + + it('should set cwd to given value', done => { + var val = "/"; + var file = new File({cwd: val}); + file.cwd.should.equal(val); + done(); + }); + + it('should set path to given value', done => { + var val = "/test.coffee"; + var file = new File({path: val}); + file.path.should.equal(val); + done(); + }); + + it('should set stat to given value', done => { + var val = {}; + var file = new File({stat: val}); + file.stat.should.equal(val); + done(); + }); + + it('should set contents to given value', done => { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.contents.should.equal(val); + done(); + }); + }); + + describe('isBuffer()', () => { + it('should return true when the contents are a Buffer', done => { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.isBuffer().should.equal(true); + done(); + }); + + it('should return false when the contents are a Stream', done => { + var file = new File({ contents: fakeStream}); + file.isBuffer().should.equal(false); + done(); + }); + + it('should return false when the contents are a null', done => { + var file = new File({contents: null}); + file.isBuffer().should.equal(false); + done(); + }); + }); + + describe('isStream()', () => { + it('should return false when the contents are a Buffer', done => { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.isStream().should.equal(false); + done(); + }); + + it('should return true when the contents are a Stream', done => { + var file = new File({ contents: fakeStream}); + file.isStream().should.equal(true); + done(); + }); + + it('should return false when the contents are a null', done => { + var file = new File({contents: null}); + file.isStream().should.equal(false); + done(); + }); + }); + + describe('isNull()', () => { + it('should return false when the contents are a Buffer', done => { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.isNull().should.equal(false); + done(); + }); + + it('should return false when the contents are a Stream', done => { + var file = new File({ contents: fakeStream}); + file.isNull().should.equal(false); + done(); + }); + + it('should return true when the contents are a null', done => { + var file = new File({contents: null}); + file.isNull().should.equal(true); + done(); + }); + }); + + describe('isDirectory()', () => { + var fakeStat = { + isDirectory() { + return true; + } + }; + + it('should return false when the contents are a Buffer', done => { + var val = new Buffer("test"); + var file = new File({contents: val, stat: fakeStat}); + file.isDirectory().should.equal(false); + done(); + }); + + it('should return false when the contents are a Stream', done => { + var file = new File({ contents: fakeStream, stat: fakeStat}); + file.isDirectory().should.equal(false); + done(); + }); + + it('should return true when the contents are a null', done => { + var file = new File({contents: null, stat: fakeStat}); + file.isDirectory().should.equal(true); + done(); + }); + }); + + describe('clone()', () => { + it('should copy all attributes over with Buffer', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Buffer("test") + }; + var file = new File(options); + var file2 = file.clone(); + + file2.should.not.equal(file, 'refs should be different'); + file2.cwd.should.equal(file.cwd); + file2.base.should.equal(file.base); + file2.path.should.equal(file.path); + + let fileContents = file.contents; + let file2Contents = file2.contents; + + file2Contents.should.not.equal(fileContents, 'buffer ref should be different'); + + let fileUtf8Contents = fileContents instanceof Buffer ? + fileContents.toString('utf8') : + (fileContents).toString(); + let file2Utf8Contents = file2Contents instanceof Buffer ? + file2Contents.toString('utf8') : + (file2Contents).toString(); + + file2Utf8Contents.should.equal(fileUtf8Contents); + done(); + }); + + it('should copy all attributes over with Stream', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: fakeStream + }; + var file = new File(options); + var file2 = file.clone(); + + file2.should.not.equal(file, 'refs should be different'); + file2.cwd.should.equal(file.cwd); + file2.base.should.equal(file.base); + file2.path.should.equal(file.path); + file2.contents.should.equal(file.contents, 'stream ref should be the same'); + done(); + }); + + it('should copy all attributes over with null', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: fakeStream + }; + var file = new File(options); + var file2 = file.clone(); + + file2.should.not.equal(file, 'refs should be different'); + file2.cwd.should.equal(file.cwd); + file2.base.should.equal(file.base); + file2.path.should.equal(file.path); + should.not.exist(file2.contents); + done(); + }); + + it('should properly clone the `stat` property', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.js", + contents: new Buffer("test"), + stat: fs.statSync(__filename) + }; + + var file = new File(options); + var copy = file.clone(); + + // ReSharper disable WrongExpressionStatement + copy.stat.isFile().should.be.true; + copy.stat.isDirectory().should.be.false; + // ReSharper restore WrongExpressionStatement + + done(); + }); + }); + + describe('pipe()', () => { + it('should write to stream with Buffer', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Buffer("test") + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', (chunk: any) => { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(options.contents.toString('utf8')); + }); + stream.on('end', () => { + done(); + }); + var ret = file.pipe(stream); + ret.should.equal(stream, 'should return the stream'); + }); + + it('should pipe to stream with Stream', done => { + var testChunk = new Buffer("test"); + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Stream.PassThrough() + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', (chunk: any) => { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(testChunk.toString('utf8')); + done(); + }); + var ret = file.pipe(stream); + ret.should.equal(stream, 'should return the stream'); + + let fileContents = file.contents; + if (fileContents instanceof Buffer) { + fileContents.write(testChunk.toString()); + } + }); + + it('should do nothing with null', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: fakeStream + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', () => { + throw new Error("should not write"); + }); + stream.on('end', () => { + done(); + }); + var ret = file.pipe(stream); + ret.should.equal(stream, 'should return the stream'); + }); + + it('should write to stream with Buffer', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Buffer("test") + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', (chunk: any) => { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(options.contents.toString('utf8')); + done(); + }); + stream.on('end', () => { + throw new Error("should not end"); + }); + var ret = file.pipe(stream, {end: false}); + ret.should.equal(stream, 'should return the stream'); + }); + + it('should pipe to stream with Stream', done => { + var testChunk = new Buffer("test"); + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Stream.PassThrough() + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', (chunk: any) => { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(testChunk.toString('utf8')); + done(); + }); + stream.on('end', () => { + throw new Error("should not end"); + }); + var ret = file.pipe(stream, {end: false}); + ret.should.equal(stream, 'should return the stream'); + + let fileContents = file.contents; + if (fileContents instanceof Buffer) { + fileContents.write(testChunk.toString()); + } + }); + + it('should do nothing with null', done => { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: fakeStream + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', () => { + throw new Error("should not write"); + }); + stream.on('end', () => { + throw new Error("should not end"); + }); + var ret = file.pipe(stream, {end: false}); + ret.should.equal(stream, 'should return the stream'); + process.nextTick(done); + }); + }); + + describe('inspect()', () => { + it('should return correct format when no contents and no path', done => { + var file = new File(); + file.inspect().should.equal(''); + done(); + }); + + it('should return correct format when Buffer and no path', done => { + var val = new Buffer("test"); + var file = new File({ + contents: val + }); + file.inspect().should.equal('>'); + done(); + }); + + it('should return correct format when Buffer and relative path', done => { + var val = new Buffer("test"); + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: val + }); + file.inspect().should.equal('>'); + done(); + }); + + it('should return correct format when Buffer and only path and no base', done => { + var val = new Buffer("test"); + var file = new File({ + cwd: "/", + path: "/test/test.coffee", + contents: val + }); + delete file.base; + file.inspect().should.equal('>'); + done(); + }); + + it('should return correct format when Stream and relative path', done => { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Stream.PassThrough() + }); + file.inspect().should.equal('>'); + done(); + }); + + it('should return correct format when null and relative path', done => { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: null + }); + file.inspect().should.equal(''); + done(); + }); + }); + + describe('contents get/set', () => { + it('should work with Buffer', done => { + var val = new Buffer("test"); + var file = new File(); + file.contents = val; + file.contents.should.equal(val); + done(); + }); + + it('should work with Stream', done => { + var val = new Stream.PassThrough(); + var file = new File(); + file.contents = val; + file.contents.should.equal(val); + done(); + }); + + it('should work with null', done => { + var file = new File(); + file.contents = null; + (file.contents === null).should.equal(true); + done(); + }); + + it('should not work with string', done => { + var val = "test"; + var file = new File(); + try { + file.contents = new Buffer(val); + } catch (err) { + should.exist(err); + done(); + } + }); + }); + + describe('relative get/set', () => { + it('should error on set', done => { + var file = new File(); + try { + file.relative = "test"; + } catch (err) { + should.exist(err); + done(); + } + }); + + it('should error on get when no base', done => { + var a: string; + var file = new File(); + delete file.base; + try { + // ReSharper disable once AssignedValueIsNeverUsed + a = file.relative; + } catch (err) { + should.exist(err); + done(); + } + }); + + it('should error on get when no path', done => { + var a: string; + var file = new File(); + try { + // ReSharper disable once AssignedValueIsNeverUsed + a = file.relative; + } catch (err) { + should.exist(err); + done(); + } + }); + + it('should return a relative path from base', done => { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee" + }); + file.relative.should.equal("test.coffee"); + done(); + }); + + it('should return a relative path from cwd', done => { + var file = new File({ + cwd: "/", + path: "/test/test.coffee" + }); + file.relative.should.equal("test/test.coffee"); + done(); + }); + }); + +}); diff --git a/vinyl/vinyl-tests.ts b/vinyl/vinyl-tests.ts index cb1ceaea6..1d39646b1 100644 --- a/vinyl/vinyl-tests.ts +++ b/vinyl/vinyl-tests.ts @@ -22,13 +22,13 @@ describe('File', () => { it('should default base to cwd', done => { var cwd = "/"; var file = new File({cwd: cwd}); - file.base.should.equal(cwd); + file.basename.should.equal(cwd); done(); }); it('should default base to cwd even when none is given', done => { var file = new File(); - file.base.should.equal(process.cwd()); + file.basename.should.equal(process.cwd()); done(); }); @@ -53,7 +53,7 @@ describe('File', () => { it('should set base to given value', done => { var val = "/"; var file = new File({base: val}); - file.base.should.equal(val); + file.basename.should.equal(val); done(); }); @@ -84,6 +84,41 @@ describe('File', () => { file.contents.should.equal(val); done(); }); + + it('should default basename to cwd', done => { + var cwd = "/"; + var file = new File({cwd: cwd}); + file.basename.should.equal(cwd); + done(); + }); + + it('should default basename to cwd even when none is given', done => { + var file = new File(); + file.basename.should.equal(process.cwd()); + done(); + }); + + it('should set basename to given value', done => { + var val = "/"; + var file = new File({base: val}); + file.basename.should.equal(val); + done(); + }); + + it('should default extname to null', done => { + var cwd = "/"; + var file = new File({cwd: cwd}); + should.not.exist(file.path); + done(); + }); + + it('should default dirname to null', done => { + var cwd = "/"; + var file = new File({cwd: cwd}); + should.not.exist(file.dirname); + done(); + }); + }); describe('isBuffer()', () => { @@ -149,33 +184,6 @@ describe('File', () => { }); }); - describe('isDirectory()', () => { - var fakeStat = { - isDirectory() { - return true; - } - }; - - it('should return false when the contents are a Buffer', done => { - var val = new Buffer("test"); - var file = new File({contents: val, stat: fakeStat}); - file.isDirectory().should.equal(false); - done(); - }); - - it('should return false when the contents are a Stream', done => { - var file = new File({ contents: fakeStream, stat: fakeStat}); - file.isDirectory().should.equal(false); - done(); - }); - - it('should return true when the contents are a null', done => { - var file = new File({contents: null, stat: fakeStat}); - file.isDirectory().should.equal(true); - done(); - }); - }); - describe('clone()', () => { it('should copy all attributes over with Buffer', done => { var options = { @@ -189,7 +197,7 @@ describe('File', () => { file2.should.not.equal(file, 'refs should be different'); file2.cwd.should.equal(file.cwd); - file2.base.should.equal(file.base); + file2.basename.should.equal(file.basename); file2.path.should.equal(file.path); let fileContents = file.contents; @@ -220,7 +228,7 @@ describe('File', () => { file2.should.not.equal(file, 'refs should be different'); file2.cwd.should.equal(file.cwd); - file2.base.should.equal(file.base); + file2.basename.should.equal(file.basename); file2.path.should.equal(file.path); file2.contents.should.equal(file.contents, 'stream ref should be the same'); done(); @@ -238,7 +246,7 @@ describe('File', () => { file2.should.not.equal(file, 'refs should be different'); file2.cwd.should.equal(file.cwd); - file2.base.should.equal(file.base); + file2.basename.should.equal(file.basename); file2.path.should.equal(file.path); should.not.exist(file2.contents); done(); @@ -258,7 +266,6 @@ describe('File', () => { // ReSharper disable WrongExpressionStatement copy.stat.isFile().should.be.true; - copy.stat.isDirectory().should.be.false; // ReSharper restore WrongExpressionStatement done(); @@ -437,7 +444,7 @@ describe('File', () => { path: "/test/test.coffee", contents: val }); - delete file.base; + delete file.basename; file.inspect().should.equal('>'); done(); }); @@ -515,7 +522,7 @@ describe('File', () => { it('should error on get when no base', done => { var a: string; var file = new File(); - delete file.base; + delete file.basename; try { // ReSharper disable once AssignedValueIsNeverUsed a = file.relative; @@ -557,4 +564,95 @@ describe('File', () => { }); }); + describe('path get/set', () => { + + it('should return an absolute path', done => { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee" + }); + file.path.should.equal("/test/test.coffee"); + done(); + }); + + }); + + describe('history get', () => { + it('should error on set', done => { + var file = new File(); + try { + file.history = []; + } catch (err) { + should.exist(err); + done(); + } + }); + + it('should return an history', done => { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee" + }); + file.history.should.equal(["/test/test.coffee"]); + done(); + }); + + }); + + describe('dirname get', () => { + + it('should return an dirname', done => { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee" + }); + file.dirname.should.equal("test"); + done(); + }); + + it('should set dirname to given value', done => { + var file = new File(); + file.dirname = ".ext" + file.dirname.should.equal(".ext") + done(); + }); + + it('should set dirname to null', done => { + var file = new File(); + file.dirname = null + should.not.exist(file.dirname) + done(); + }); + }); + + describe('extname get/set', () => { + + it('should return an extname', done => { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee" + }); + file.dirname.should.equal(".coffee"); + done(); + }); + + it('should set extname to given value', done => { + var file = new File(); + file.extname = ".ext" + file.extname.should.equal(".ext") + done(); + }); + + it('should set extname to null', done => { + var file = new File(); + file.extname = null + should.not.exist(file.extname) + done(); + }); + }); + }); diff --git a/vinyl/vinyl.d.ts b/vinyl/vinyl.d.ts index 39960361f..77bf252b7 100644 --- a/vinyl/vinyl.d.ts +++ b/vinyl/vinyl.d.ts @@ -1,4 +1,4 @@ -// Type definitions for vinyl 0.4.3 +// Type definitions for vinyl 1.1.0 // Project: https://github.com/wearefractal/vinyl // Definitions by: vvakame , jedmao // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -14,26 +14,32 @@ declare module "vinyl" { */ class File { constructor(options?: { + /** * Default: process.cwd() */ cwd?: string; + /** * Used for relative pathing. Typically where a glob starts. */ base?: string; + /** * Full path to the file. */ path?: string; + /** * Path history. Has no effect if options.path is passed. */ history?: string[]; + /** * The result of an fs.stat call. See fs.Stats for more information. */ stat?: fs.Stats; + /** * File contents. * Type: Buffer, Stream, or null @@ -45,19 +51,40 @@ declare module "vinyl" { * Default: process.cwd() */ public cwd: string; + /** * Used for relative pathing. Typically where a glob starts. */ + public dirname: string; + public basename: string; public base: string; + /** * Full path to the file. */ public path: string; public stat: fs.Stats; + + /** + * Gets and sets stem (filename without suffix) for the file path. + */ + public stem: string; + + /** + * Gets and sets path.extname for the file path + */ + public extname: string; + + /** + * Array of path values the file object has had + */ + public history: string[]; + /** * Type: Buffer|Stream|null (Default: null) */ public contents: Buffer | NodeJS.ReadableStream; + /** * Returns path.relative for the file base and file path. * Example: @@ -70,18 +97,25 @@ declare module "vinyl" { */ public relative: string; + /** + * Returns true if file.contents is a Buffer. + */ public isBuffer(): boolean; + /** + * Returns true if file.contents is a Stream. + */ public isStream(): boolean; + /** + * Returns true if file.contents is null. + */ public isNull(): boolean; - public isDirectory(): boolean; - /** * Returns a new File object with all attributes cloned. Custom attributes are deep-cloned. */ - public clone(opts?: { contents?: boolean }): File; + public clone(opts?: { contents?: boolean, deep?:boolean }): File; /** * If file.contents is a Buffer, it will write it to the stream. diff --git a/voximplant-websdk/voximplant-websdk-tests.ts b/voximplant-websdk/voximplant-websdk-tests.ts index efd1b6499..5dcb6c62e 100644 --- a/voximplant-websdk/voximplant-websdk-tests.ts +++ b/voximplant-websdk/voximplant-websdk-tests.ts @@ -1,7 +1,8 @@ /// var vox: VoxImplant.Client = VoxImplant.getInstance(), - call: VoxImplant.Call; + call: VoxImplant.Call, + room: string; vox.init({ micRequired: true @@ -83,3 +84,10 @@ vox.addEventListener(VoxImplant.IMEvents.RosterReceived, function(event: VoxImpl console.log("Roster received: " + roster); }); +vox.addEventListener(VoxImplant.IMEvents.ChatRoomBanList, function(event: VoxImplant.IMEvents.ChatRoomBanList) { + console.log("Banned participants: " + event.participants + " in room " + event.room); +}); + +room = vox.createChatRoom(); + +vox.inviteToChatRoom(room, "user1", "Come and join us"); diff --git a/voximplant-websdk/voximplant-websdk.d.ts b/voximplant-websdk/voximplant-websdk.d.ts index 55c160a8b..e3ba00655 100644 --- a/voximplant-websdk/voximplant-websdk.d.ts +++ b/voximplant-websdk/voximplant-websdk.d.ts @@ -12,8 +12,7 @@ declare namespace VoxImplant { AuthResult, ConnectionClosed, ConnectionEstablished, - ConnectionFailed, - IMError, + ConnectionFailed, IncomingCall, MicAccessResult, NetStatsReceived, @@ -26,14 +25,40 @@ declare namespace VoxImplant { * VoxImplant.Client Instant Messaging and Presence events */ enum IMEvents { + ChatHistoryReceived, + ChatRoomBanList, + ChatRoomCreated, + ChatRoomError, + ChatRoomHistoryReceived, + ChatRoomInfo, + ChatRoomInvitation, + ChatRoomInviteDeclined, + ChatRoomMessageModified, + ChatRoomMessageNotModified, + ChatRoomMessageReceived, + ChatRoomMessageRemoved, + ChatRoomNewParticipant, + ChatRoomOperation, + ChatRoomParticipantExit, + ChatRoomParticipants, + ChatRoomPresenceUpdate, + ChatRoomStateUpdate, + ChatRoomSubjectChange, + ChatRoomsDataReceived, ChatStateUpdate, + MessageModified, + MessageNotModified, MessageReceived, + MessageRemoved, MessageStatus, - PresenceUpdate, + PresenceUpdate, RosterItemChange, RosterPresenceUpdate, RosterReceived, - SubscriptionRequest + SubscriptionRequest, + SystemError, + UCConnected, + UCDisconnected } /** @@ -43,6 +68,7 @@ declare namespace VoxImplant { Connected, Disconnected, Failed, + ICETimeout, InfoReceived, MessageReceived, ProgressToneStart, @@ -97,21 +123,7 @@ declare namespace VoxImplant { * Failure reason description */ message: string; - } - - /** - * Event dispatched in case of instant messaging subsystem error - */ - interface IMError { - /** - * Error data object, contains the error details - */ - errorData: Object; - /** - * Error type - */ - errorType: IMErrorType; - } + } /** * Event dispatched when there is a new incoming call to current user @@ -221,6 +233,16 @@ declare namespace VoxImplant { reason: string; } + /** + * Event dispatched in case of network connection problem between 2 peers + */ + interface ICETimeout { + /** + * Call that dispatched the event + */ + call: Call; + } + /** * Event dispatched when INFO message is received */ @@ -298,7 +320,415 @@ declare namespace VoxImplant { } } - module IMEvents { + module IMEvents { + + /** + * Event dispatched when chat history received + */ + interface ChatHistoryReceived { + /** + * User id + */ + id: string; + /** + * Message id specified in getInstantMessagingHistory method + */ + message_id: string; + /** + * List of messages + */ + messages: IMHistoryMessage[]; + } + + /** + * Event dispatched when info about banned chat room participants received + */ + interface ChatRoomBanList { + /** + * Participants list + */ + participants: ChatRoomParticipant[]; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched if chat room was created successfully + */ + interface ChatRoomCreated { + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched in case of error while chat room operation + */ + interface ChatRoomError { + /** + * Error code + */ + code: string; + /** + * Operation name + */ + operation: string; + /** + * Room id + */ + room: string; + /** + * Error description + */ + text: string; + } + + /** + * Event dispatched when chat room history received + */ + interface ChatRoomHistoryReceived { + /** + * Message id specified in getInstantMessagingHistory method + */ + message_id: string; + /** + * List of messages + */ + messages: VoxImplant.IMHistoryMessage[]; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched when user joins chat room + */ + interface ChatRoomInfo { + /** + * Room features + */ + features: number; + /** + * Room info object + */ + info: ChatRoomInfo; + /** + * Room id + */ + room: string; + /** + * Room name + */ + room_name: string; + } + + /** + * Event dispatched when invitation to chat room received + */ + interface ChatRoomInvitation { + /** + * The body of the message + */ + body: string; + /** + * User id (inviter) + */ + from: string; + /** + * Password for the room + */ + password: string; + /** + * A reason of the invitation + */ + reason: string; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched if an invitation to chat room was declined by the invitee + */ + interface ChatRoomInviteDeclined { + /** + * User id (invitee) + */ + invitee: string; + /** + * A reason of the invitation + */ + reason: string; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched when chat room message modified + */ + interface ChatRoomMessageModified { + /** + * New message content + */ + content: string; + /** + * User id + */ + from: string; + /** + * Modified message id + */ + message_id: string; + /** + * Private/public message flag + */ + private_message: string; + /** + * Resource name + */ + resource: string; + /** + * Room id + */ + room: string; + /** + * Message timestamp + */ + timestamp: string; + } + + /** + * Event dispatched in case of error during chat room message modification + */ + interface ChatRoomMessageNotModified { + /** + * Error code + */ + code: number; + /** + * Message id + */ + message_id: string; + /** + * Private/public message flag + */ + private_message: string; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched when instant message was sent to chat room + */ + interface ChatRoomMessageReceived { + /** + * Message content + */ + content: string; + /** + * User id + */ + from: string; + /** + * Modified message id + */ + message_id: string; + /** + * Private/public message flag + */ + private_message: string; + /** + * Resource name + */ + resource: string; + /** + * Room id + */ + room: string; + /** + * Message timestamp + */ + timestamp: string; + } + + /** + * Event dispatched when chat room message removed + */ + interface ChatRoomMessageRemoved { + /** + * User id + */ + from: string; + /** + * Modified message id + */ + message_id: string; + /** + * Private/public message flag + */ + private_message: string; + /** + * Resource name + */ + resource: string; + /** + * Room id + */ + room: string; + /** + * Message timestamp + */ + timestamp: string; + } + + /** + * Event dispatched when new participant joined the chat room + */ + interface ChatRoomNewParticipant { + /** + * User display name + */ + displayName: string; + /** + * User id + */ + participant: string; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched when chat room participant was banned/unbanned + */ + interface ChatRoomOperation { + /** + * Room id + */ + room: string; + /** + * Operation type + */ + operation: ChatRoomOperationType; + /** + * Operation result: true/false - success/failure + */ + result: boolean; + } + + /** + * Event dispatched when participant left the chat room + */ + interface ChatRoomParticipantExit { + /** + * User id + */ + participant: string; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched when info about chat room participants received + */ + interface ChatRoomParticipants { + /** + * Participants list + */ + participants: ChatRoomParticipant[]; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched if chat room participant presence status was updated + */ + interface ChatRoomPresenceUpdate { + /** + * Optional presence message + */ + message: string; + /** + * Participant info + */ + participant: ParticipantInfo; + /** + * Current presence status + */ + presence: UserStatuses; + /** + * Room id + */ + room: string; + } + + /** + * Event dispatched when chat session state updated + */ + interface ChatRoomStateUpdate { + /** + * User id + */ + from: string; + /** + * Resource name + */ + resource: string; + /** + * Room id + */ + room: string; + /** + * Current chat session state + */ + state: ChatStateType; + } + + /** + * Event dispatched if chat room subject was changed + */ + interface ChatRoomSubjectChange { + /** + * User id who changed the subject + */ + id: string; + /** + * Resource name + */ + resource: string; + /** + * Room id + */ + room: string; + /** + * New subject + */ + subject: string; + } + + /** + * Event dispatched when information about chat rooms where user participates received + */ + interface ChatRoomsDataReceived { + /** + * Rooms list + */ + rooms: ChatRoom[]; + } /** * Event dispatched when chat session state updated @@ -307,15 +737,55 @@ declare namespace VoxImplant { /** * User id */ - id: string, + id: string; /** * Resource name */ - resource?: string, + resource?: string; /** * Current chat session state. See VoxImplant.ChatStateType enum */ - state: ChatStateType + state: ChatStateType; + } + + /** + * Event dispatched when instant message was modified by user + */ + interface MessageModified { + /** + * Message new content + */ + content: string; + /** + * User id (of the user who sent the message) + */ + id: string; + /** + * Message id + */ + message_id: string; + /** + * User id (of the user to whom the message was sent) + */ + to: string; + } + + /** + * Event dispatched if error happened during instant message modification + */ + interface MessageNotModified { + /** + * Message new content + */ + code: number; + /** + * Message id + */ + message_id: string; + /** + * User id (of the user to whom the message was sent) + */ + to: string; } /** @@ -325,19 +795,41 @@ declare namespace VoxImplant { /** * Message content */ - content: string, + content: string; /** - * User id + * User id (of the user who sent the message) */ - id: string, + id: string; /** * Message id */ - message_id: string, + message_id: string; /** * Resource name */ - resource?: string + resource?: string; + /** + * User id (of the user to whom the message was sent) + */ + to: string; + } + + /** + * Event dispatched when instant message was removed by user + */ + interface MessageRemoved { + /** + * User id (of the user who sent the message) + */ + id: string; + /** + * Message id + */ + message_id: string; + /** + * User id (of the user to whom the message was sent) + */ + to: string; } /** @@ -347,19 +839,19 @@ declare namespace VoxImplant { /** * User id */ - id: string, + id: string; /** * Message id */ - message_id: string, + message_id: string; /** * Resource name */ - resource?: string, + resource?: string; /** * Message event type. See VoxImplant.MessageEventType enum */ - type: MessageEventType + type: MessageEventType; } /** @@ -369,19 +861,19 @@ declare namespace VoxImplant { /** * User id */ - id: string, + id: string; /** * Status message */ - message: string, + message: string; /** * Current presence status */ - presence: UserStatuses, + presence: UserStatuses; /** * Resource name */ - resource?: string + resource?: string; } /** @@ -391,19 +883,23 @@ declare namespace VoxImplant { /** * User display name */ - displayName: string, + displayName: string; + /** + * Roster item groups + */ + groups: string[]; /** * User id */ - id: string, + id: string; /** * Resource name */ - resource?: string, + resource?: string; /** * Roster item event type. See VoxImplant.RosterItemEvent enum */ - type: RosterItemEvent + type: RosterItemEvent; } /** @@ -413,19 +909,19 @@ declare namespace VoxImplant { /** * User id */ - id: string, + id: string; /** * Status message */ - message?: string, + message?: string; /** * Current presence status */ - presence: UserStatuses, + presence: UserStatuses; /** * Resource name */ - resource?: string + resource?: string; } /** @@ -435,11 +931,11 @@ declare namespace VoxImplant { /** * User id */ - id: string, + id: string; /** * Array contains VoxImplant.RosterItem elements */ - roster: RosterItem[] + roster: RosterItem[]; } /** @@ -449,25 +945,49 @@ declare namespace VoxImplant { /** * User id */ - id: string, + id: string; /** * Optional message */ - message?: string, + message?: string; /** * Resource name */ - resource?: string, + resource?: string; /** * Message event type. See VoxImplant.SubscriptionRequestType enum */ - type: SubscriptionRequestType + type: SubscriptionRequestType; } + /** + * Event dispatched in case of instant messaging subsystem error + */ + interface SystemError { + /** + * Error data object, contains the error details + */ + errorData: Object; + /** + * Error type + */ + errorType: IMErrorType; + } + + /** + * Event dispatched when instant messaging and presence subsystems (UC) are online + */ + interface UCConnected {} + + /** + * Event dispatched when instant messaging and presence subsystems (UC) are offline + */ + interface UCDisconnected { } + } type VoxImplantEvent = Events.AuthResult | Events.ConnectionClosed | Events.ConnectionEstablished | - Events.ConnectionFailed | Events.IMError | Events.IncomingCall | Events.MicAccessResult | + Events.ConnectionFailed | Events.IncomingCall | Events.MicAccessResult | Events.NetStatsReceived | Events.PlaybackFinished | Events.SDKReady | Events.SourcesInfoUpdated; @@ -475,9 +995,18 @@ declare namespace VoxImplant { CallEvents.InfoReceived | CallEvents.MessageReceived | CallEvents.ProgressToneStart | CallEvents.ProgressToneStop | CallEvents.TransferComplete | CallEvents.TransferFailed; - type VoxImplantIMEvent = IMEvents.ChatStateUpdate | IMEvents.MessageReceived | IMEvents.MessageStatus | - IMEvents.PresenceUpdate | IMEvents.RosterItemChange | IMEvents.RosterPresenceUpdate | - IMEvents.RosterReceived | IMEvents.SubscriptionRequest; + type VoxImplantIMEvent = IMEvents.ChatHistoryReceived | IMEvents.ChatRoomBanList | + IMEvents.ChatRoomCreated | IMEvents.ChatRoomError | IMEvents.ChatRoomHistoryReceived | + IMEvents.ChatRoomInfo | IMEvents.ChatRoomInvitation | IMEvents.ChatRoomInviteDeclined | + IMEvents.ChatRoomMessageModified | IMEvents.ChatRoomMessageNotModified | IMEvents.ChatRoomMessageReceived | + IMEvents.ChatRoomMessageRemoved | IMEvents.ChatRoomNewParticipant | IMEvents.ChatRoomOperation | + IMEvents.ChatRoomParticipantExit | IMEvents.ChatRoomParticipants | IMEvents.ChatRoomPresenceUpdate | + IMEvents.ChatRoomStateUpdate | IMEvents.ChatRoomSubjectChange | IMEvents.ChatRoomsDataReceived | + IMEvents.ChatStateUpdate | IMEvents.MessageModified | IMEvents.MessageNotModified | + IMEvents.MessageReceived | IMEvents.MessageRemoved | IMEvents.MessageStatus | + IMEvents.PresenceUpdate | IMEvents.RosterItemChange | IMEvents.RosterPresenceUpdate | + IMEvents.RosterReceived | IMEvents.SubscriptionRequest | IMEvents.SystemError | + IMEvents.UCConnected | IMEvents.UCDisconnected; /** * VoxImplant SDK Configuration @@ -522,7 +1051,7 @@ declare namespace VoxImplant { /** * Default constraints that will be applied while the next attachRecordingDevice function call or if micRequired set to true */ - videoConstraints?: VideoSettings; + videoConstraints?: VideoSettings | boolean; /** * Video support */ @@ -543,6 +1072,20 @@ declare namespace VoxImplant { serverPresenceControl?: boolean; } + /** + * Audio playback device info + */ + interface AudioOutputInfo { + /** + * Device id that can be used to choose audio playback device + */ + id: number | string; + /** + * Device name , in WebRTC mode populated with real data only when app has been opened using HTTPS protocol + */ + name: string; + } + /** * Audio recording device info */ @@ -702,6 +1245,123 @@ declare namespace VoxImplant { XA } + enum ChatRoomOperationType { + /** + * Ban operation + */ + Ban, + /** + * Unban operation + */ + Unban + } + + /** + * Chat room + */ + interface ChatRoom { + /** + * Chat room id + */ + id: string; + /** + * Chat room password + */ + pass: string; + } + + /** + * Chat room info + */ + interface ChatRoomInfo { + /** + * Creation date + */ + creationdate: string; + /** + * Room description + */ + description: string; + /** + * Number of chat room participants + */ + occupants: number; + /** + * Room's name / subject + */ + subject: string; + } + + /** + * Chat room participant + */ + interface ChatRoomParticipant { + /** + * User id + */ + id: string; + /** + * User display name + */ + name: string; + /** + * True if the user is owner/admin of the room + */ + owner?: boolean; + } + + /** + * Message received from history + */ + interface IMHistoryMessage { + /** + * Message body + */ + body: string; + /** + * User id - author of the message + */ + from: string; + /** + * Message id + */ + id: string; + /** + * Message creation time + */ + time: string; + } + + /** + * Participant info + */ + interface ParticipantInfo { + /** + * The participant's affiliation with the room + */ + affiliation: number; + /** + * Indicate conditions like: user has been kicked or banned from the room + */ + flags: number; + /** + * User id + */ + id: string; + /** + * Reason + */ + reason: string; + /** + * Resource name + */ + resource: string; + /** + * The participant's role with the room + */ + role: number; + } + /** * Client class used to control platform functions. Can't be instantiatied directly (singleton), please use VoxImplant.getInstance to get the class instance */ @@ -736,10 +1396,22 @@ declare namespace VoxImplant { */ attachRecordingDevice(successCallback?: () => any, failedCallback?: () => any): void; /** + * Get a list of all currently available audio playback devices + */ + audioOutputs(): AudioOutputInfo[]; + /** * Get a list of all currently available audio sources / microphones */ audioSources(): AudioSourceInfo[]; /** + * Ban user from the chat room + * + * @param room Room id + * @param user_id User id + * @param reason Ban reason + */ + banChatRoomUser(room: string, user_id: string, reason?: string): void; + /** * Create call * * @param number The number to call @@ -761,6 +1433,21 @@ declare namespace VoxImplant { */ connected(): boolean; /** + * Create multi-user chat room and join it + * + * @param pass Password for room access + * @param users User ids of the invited users to the chat room + */ + createChatRoom(pass?: string, users?: string[]): string; + /** + * Decline invitation to join chat room + * + * @param room Room id + * @param user_id User id (inviter) + * @param reason User-supplied decline reason + */ + declineChatRoomInvite(room: string, user_id: string, reason?: string): void; + /** * Disable microphone/camera if micRequired in VoxImplant.Config was set to false (WebRTC mode only) */ detachRecordingDevice(): void; @@ -769,16 +1456,72 @@ declare namespace VoxImplant { */ disconnect(): void; /** + * Edit message in the chat room + * + * @param room Room id + * @param message_id Message id + * @param msg New message content + */ + editChatRoomMessage(room: string, message_id: string, msg: string): void; + /** + * Edit message sent to user + * + * @param room Room id + * @param message_id Message id + * @param msg New message content + */ + editInstantMessage(room: string, message_id: string, msg: string): void; + /** + * Get chat room history + * + * @param room Room id + * @param message_id Message id (to get messages sent before/after the message) + * @param direction False/true to get messages older/newer than the message with specified id + * @param count Number of messages + */ + getChatRoomHistory(room: string, message_id?: string, direction?: boolean, count?: number): void; + /** + * Get messages in a conversation with particular use + * + * @param user_id User id + * @param message_id Message id (to get messages sent before/after the message) + * @param direction False/true to get messages older/newer than the message with specified id + * @param count Number of messages + */ + getInstantMessagingHistory(user_id: string, message_id?: string, direction?: boolean, count?: number): void; + /** * Initialize SDK. SDKReady event will be dispatched after succesful SDK initialization. SDK can't be used until it's initialized * * @param config Client configuration options */ init(config?: Config): void; /** + * Invite user to join chat room + * + * @param room Room id + * @param user_id User id (invitee) + * @param reason User-supplied reason for the invitation + */ + inviteToChatRoom(room: string, user_id: string, reason?: string): void; + /** * Check if WebRTC support is available */ isRTCsupported(): boolean; /** + * Join multi-user chat room + * + * @param room Room id + * @param pass Password for room access + */ + joinChatRoom(room: string, pass?: string): void; + /** + * Leave multi-user chat room + * + * @param room Room id + * @param msg Message for other participants + */ + leaveChatRoom(room: string, msg?: string): void; + /** * Login into application * * @param username @@ -818,6 +1561,21 @@ declare namespace VoxImplant { */ playToneScript(script: string, loop?: boolean): void; /** + * Remove message in the chat room + * + * @param room Room id + * @param message_id Message id + */ + removeChatRoomMessage(room: string, message_id: string): void; + /** + * Remove user from the chat room + * + * @param room Room id + * @param user_id User id + * @param reason Reason + */ + removeChatRoomUser(room: string, user_id: string, reason?: string): void; + /** * Remove handler for specified event * * @param eventName Event name @@ -825,6 +1583,13 @@ declare namespace VoxImplant { */ removeEventListener(eventName: VoxImplant.Events | VoxImplant.IMEvents, eventHandler: () => any): void; /** + * Remove message sent to user + * + * @param user_id User id + * @param message_id Message id + */ + removeInstantMessage(user_id: string, message_id: string): void; + /** * Remove roster item (IM) * * @param user_id User id @@ -851,6 +1616,13 @@ declare namespace VoxImplant { */ requestOneTimeLoginKey(username: string): void; /** + * Send message to chat room + * + * @param room Room id + * @param msg Message for other participants + */ + sendChatRoomMessage(room: string, msg: string): string; + /** * Send message to user (IM) * * @param user_id User id @@ -871,6 +1643,20 @@ declare namespace VoxImplant { */ setCallActive(call: Call, active: boolean): void; /** + * Set chat room session state info + * + * @param room Room id + * @param status Chat session status + */ + setChatRoomState(room: string, status: ChatStateType): void; + /** + * Set new chat room subject + * + * @param room Room id + * @param subject New subject + */ + setChatRoomSubject(room: string, subject: string): void; + /** * Set chat session state info * * @param user_id User id @@ -956,6 +1742,14 @@ declare namespace VoxImplant { */ transferCall(call1: Call, call2: Call): void; /** + * Remove a ban on a user in the chat room + * + * @param room Room id + * @param user_id User id + * @param reason Reason + */ + unbanChatRoomUser(room: string, user_id: string, reason?: string): void; + /** * Use specified audio source , use audioSources to get the list of available audio sources * * @param id Id of the audio source @@ -1115,14 +1909,42 @@ declare namespace VoxImplant { * WebRTC Video Settings (aka Constraints) */ interface VideoSettings { + /** + * The width or width range, in pixels + */ + width?: number | any; + /** + * The height or height range, in pixels + */ + height?: number | any; + /** + * The exact aspect ratio (width in pixels divided by height in pixels, represented as a double rounded to the tenth decimal place) or aspect ratio range + */ + aspectRatio?: number | any; + /** + * The exact frame rate (frames per second) or frame rate range + */ + frameRate?: number | any; + /** + * This string (or each string, when a list) should be one of the members of VideoFacingModeEnum + */ + facingMode?: string | any; + /** + * The origin-unique identifier for the source of the MediaStreamTrack + */ + deviceId?: string; + /** + * The origin-unique group identifier for the source of the MediaStreamTrack. Two devices have the same group identifier if they belong to the same physical device + */ + groupId?: string; /** * Mandatory constraints object */ - mandatory: Object; + mandatory?: Object; /** * Optional constraints object */ - optional: Object; + optional?: Object; } /** diff --git a/webfontloader/webfontloader.d.ts b/webfontloader/webfontloader.d.ts index 0afadfd3b..bea108ec1 100644 --- a/webfontloader/webfontloader.d.ts +++ b/webfontloader/webfontloader.d.ts @@ -35,8 +35,8 @@ declare module WebFont { monotype?:Monotype; } export interface Google { - families?:Array; - text: string; + families:Array; + text?: string; } export interface Typekit { id?:Array; @@ -57,4 +57,4 @@ declare module WebFont { } declare module "webfontloader" { export = WebFont; -} \ No newline at end of file +} diff --git a/webpack/webpack.d.ts b/webpack/webpack.d.ts index 3889446b2..5bf5050b8 100644 --- a/webpack/webpack.d.ts +++ b/webpack/webpack.d.ts @@ -1,4 +1,4 @@ -// Type definitions for webpack 1.12.2 +// Type definitions for webpack 1.12.9 // Project: https://github.com/webpack/webpack // Definitions by: Qubo // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,10 +6,58 @@ declare module "webpack" { namespace webpack { interface Configuration { + context?: string; entry?: string|string[]|Entry; + /** Choose a developer tool to enhance debugging. */ devtool?: string; + /** Options affecting the output. */ output?: Output; + /** Options affecting the normal modules (NormalModuleFactory) */ module?: Module; + /** Options affecting the resolving of modules. */ + resolve?: Resolve; + /** Like resolve but for loaders. */ + resolveLoader?: ResolveLoader; + /** + * Specify dependencies that shouldn’t be resolved by webpack, but should become dependencies of the resulting bundle. + * The kind of the dependency depends on output.libraryTarget. + */ + externals?: ExternalsElement|ExternalsElement[]; + /** + *
      + *
    • "web" Compile for usage in a browser-like environment (default)
    • + *
    • "webworker" Compile as WebWorker
    • + *
    • "node" Compile for usage in a node.js-like environment (use require to load chunks)
    • + *
    • "async-node" Compile for usage in a node.js-like environment (use fs and vm to load chunks async)
    • + *
    • "node-webkit" Compile for usage in webkit, uses jsonp chunk loading but also supports builtin node.js modules plus require(“nw.gui”) (experimental)
    • + *
    • "atom" Compile for usage in electron (formerly known as atom-shell), supports require for modules necessary to run Electron.
    • + *
        + */ + target?: string; + /** Report the first error as a hard error instead of tolerating it. */ + bail?: boolean; + /** Capture timing information for each module. */ + profile?: boolean; + /** Cache generated modules and chunks to improve performance for multiple incremental builds. */ + cache?: boolean|any; + /** Enter watch mode, which rebuilds on file change. */ + watch?: boolean; + watchOptions?: WatchOptions; + /** Switch loaders to debug mode. */ + debug?: boolean; + /** Can be used to configure the behaviour of webpack-dev-server when the webpack config is passed to webpack-dev-server CLI. */ + devServer?: any; // TODO: Type this + /** Include polyfills or mocks for various node stuff */ + node?: Node; + /** Set the value of require.amd and define.amd. */ + amd?: { [moduleName: string]: boolean }; + /** Used for recordsInputPath and recordsOutputPath */ + recordsPath?: string; + /** Load compiler state from a json file. */ + recordsInputPath?: string; + /** Store compiler state to a json file. */ + recordsOutputPath?: string; + /** Add additional plugins to the compiler. */ plugins?: (Plugin|Function)[]; } @@ -18,21 +66,161 @@ declare module "webpack" { } interface Output { + /** The output directory as absolute path (required). */ path?: string; + /** The filename of the entry chunk as relative path inside the output.path directory. */ filename?: string; + /** The filename of non-entry chunks as relative path inside the output.path directory. */ chunkFilename?: string; + /** The filename of the SourceMaps for the JavaScript files. They are inside the output.path directory. */ + sourceMapFilename?: string; + /** Filename template string of function for the sources array in a generated SourceMap. */ + devtoolModuleFilenameTemplate?: string; + /** Similar to output.devtoolModuleFilenameTemplate, but used in the case of duplicate module identifiers. */ + devtoolFallbackModuleFilenameTemplate?: string; + /** + * Enable line to line mapped mode for all/specified modules. + * Line to line mapped mode uses a simple SourceMap where each line of the generated source is mapped to the same line of the original source. + * It’s a performance optimization. Only use it if your performance need to be better and you are sure that input lines match which generated lines. + * true enables it for all modules (not recommended) + */ + devtoolLineToLine?: boolean; + /** The filename of the Hot Update Chunks. They are inside the output.path directory. */ + hotUpdateChunkFilename?: string; + /** The filename of the Hot Update Main File. It is inside the output.path directory. */ + hotUpdateMainFilename?: string; + /** The output.path from the view of the Javascript / HTML page. */ publicPath?: string; + /** The JSONP function used by webpack for asnyc loading of chunks. */ + jsonpFunction?: string; + /** The JSONP function used by webpack for async loading of hot update chunks. */ + hotUpdateFunction?: string; + /** Include comments with information about the modules. */ + pathinfo?: boolean; + /** If set, export the bundle as library. output.library is the name. */ + library?: boolean; + /** + * Which format to export the library: + *
          + *
        • "var" - Export by setting a variable: var Library = xxx (default)
        • + *
        • "this" - Export by setting a property of this: this["Library"] = xxx
        • + *
        • "commonjs" - Export by setting a property of exports: exports["Library"] = xxx
        • + *
        • "commonjs2" - Export by setting module.exports: module.exports = xxx
        • + *
        • "amd" - Export to AMD (optionally named)
        • + *
        • "umd" - Export to AMD, CommonJS2 or as property in root
        • + *
        + */ + libraryTarget?: string; + /** If output.libraryTarget is set to umd and output.library is set, setting this to true will name the AMD module. */ + umdNamedDefine?: boolean; + /** Prefixes every line of the source in the bundle with this string. */ + sourcePrefix?: string; + /** This option enables cross-origin loading of chunks. */ + crossOriginLoading?: string|boolean; } interface Module { + /** A array of automatically applied loaders. */ loaders?: Loader[]; + /** A array of applied pre loaders. */ + preLoaders?: Loader[]; + /** A array of applied post loaders. */ + postLoaders?: Loader[]; + /** A RegExp or an array of RegExps. Don’t parse files matching. */ + noParse?: RegExp|RegExp[]; + unknownContextRequest?: string; + unknownContextRecursive?: boolean; + unknownContextRegExp?: RegExp; + unknownContextCritical?: boolean; + exprContextRequest?: string; + exprContextRegExp?: RegExp; + exprContextRecursive?: boolean; + exprContextCritical?: boolean; + wrappedContextRegExp?: RegExp; + wrappedContextRecursive?: boolean; + wrappedContextCritical?: boolean; } + interface Resolve { + /** Replace modules by other modules or paths. */ + alias: { [key: string]: string; }; + /** + * The directory (absolute path) that contains your modules. + * May also be an array of directories. + * This setting should be used to add individual directories to the search path. */ + root?: string|string[]; + /** + * An array of directory names to be resolved to the current directory as well as its ancestors, and searched for modules. + * This functions similarly to how node finds “node_modules” directories. + * For example, if the value is ["mydir"], webpack will look in “./mydir”, “../mydir”, “../../mydir”, etc. + */ + modulesDirectories?: string[]; + /** + * A directory (or array of directories absolute paths), + * in which webpack should look for modules that weren’t found in resolve.root or resolve.modulesDirectories. + */ + fallback?: string|string[]; + /** + * An array of extensions that should be used to resolve modules. + * For example, in order to discover CoffeeScript files, your array should contain the string ".coffee". + */ + extensions?: string[]; + /** Check these fields in the package.json for suitable files. */ + packageMains?: (string|string[])[]; + /** Check this field in the package.json for an object. Key-value-pairs are threaded as aliasing according to this spec */ + packageAlias?: (string|string[])[]; + /** + * Enable aggressive but unsafe caching for the resolving of a part of your files. + * Changes to cached paths may cause failure (in rare cases). An array of RegExps, only a RegExp or true (all files) is expected. + * If the resolved path matches, it’ll be cached. + */ + unsafeCache?: RegExp|RegExp[]|boolean; + } + + interface ResolveLoader extends Resolve { + /** It describes alternatives for the module name that are tried. */ + moduleTemplates?: string[]; + } + + type ExternalsElement = string|RegExp|ExternalsObjectElement|ExternalsFunctionElement; + + interface ExternalsObjectElement { + [key: string]: boolean|string; + } + + interface ExternalsFunctionElement { + (context: any, request: any, callback: (error: any, result: any) => void): any; + } + + interface WatchOptions { + /** Delay the rebuilt after the first change. Value is a time in ms. */ + aggregateTimeout?: number; + /** true: use polling, number: use polling with specified interval */ + poll?: boolean|number; + } + + interface Node { + console?: boolean; + global?: boolean; + process?: boolean; + Buffer?: boolean; + __filename?: boolean|string; + __dirname?: boolean|string; + [nodeBuiltin: string]: boolean|string; + } + + type LoaderCondition = string|RegExp|((absPath: string) => boolean); + interface Loader { - exclude?: string[]; - include?: string[]; - test: RegExp; + /** A condition that must not be met */ + exclude?: LoaderCondition|LoaderCondition[]; + /** A condition that must be met */ + include?: LoaderCondition|LoaderCondition[]; + /** A condition that must be met */ + test: LoaderCondition|LoaderCondition[]; + /** A string of “!” separated loaders */ loader?: string; + /** A array of loaders as string */ loaders?: string[]; query?: { [name: string]: any; diff --git a/wiiu/wiiu-tests.ts b/wiiu/wiiu-tests.ts new file mode 100644 index 000000000..0417e252a --- /dev/null +++ b/wiiu/wiiu-tests.ts @@ -0,0 +1,56 @@ +/// + +var state = window.wiiu.gamepad.update(); +if( !state.isEnabled || !state.isDataValid ){ + console.log('gyro X:' + state.gyroX.toString() + ' Y:' + state.gyroY.toString() + ' Z:' + state.gyroZ.toString()); + console.log('angle X:' + state.angleX.toString() + ' Y:' + state.angleY.toString() + ' Z:' + state.angleZ.toString()); + console.log('dirX X:' + state.dirXx.toString() + ' Y:' + state.dirXy.toString() + ' Z:' + state.dirXz.toString()); + console.log('dirY X:' + state.dirYx.toString() + ' Y:' + state.dirYy.toString() + ' Z:' + state.dirYz.toString()); + console.log('dirZ X:' + state.dirZx.toString() + ' Y:' + state.dirZy.toString() + ' Z:' + state.dirZz.toString()); + console.log('acc X:' + state.accX.toString() + ' Y:' + state.accY.toString() + ' Z:' + state.accZ.toString()); + console.log('LStick axis X:' + state.lStickX.toString() + ' Y:' + state.lStickY.toString()); + console.log('RStick axis X:' + state.rStickX.toString() + ' Y:' + state.rStickY.toString()); + + if(state.hold & window.wiiu.Button.A){ + console.log('pushing A button'); + } + + if( state.tpTouch && state.tpValidity == window.wiiu.TPValidity.VALID ){ + console.log("touch X:" + state.contentX.toString() + " Y:" + state.contentY.toString()); + } +} + +document.getElementById('video').addEventListener('wiiu_videoplayer_end', (e) => { + console.log(e); + console.log('VideoPlayer end'); +}); + +if(window.wiiu.videoplayer.viewMode == 0){ + window.wiiu.videoplayer.viewMode = 1; +} +window.wiiu.videoplayer.end(); + +window.addEventListener('wiiu_imageview_start', (e) => { + console.log(e); + console.log('ImageViewer start'); +}); +window.addEventListener('wiiu_imageview_end', (e) => { + console.log(e); + console.log('ImageViewer end'); +}); +window.addEventListener('wiiu_imageview_change_viewmode', (e) => { + console.log(e); + console.log('ImageViewer change viewmode'); + if(window.wiiu.imageview.viewMode == 1){ + window.wiiu.imageview.viewMode = 0; + } +}); +window.addEventListener('wiiu_imageview_change_content', (e) => { + console.log(e); + console.log('ImageViewer change content'); +}); +window.addEventListener('wiiu_imageview_error', (e) => { + console.log(e); + console.log('ImageViewer error'); + console.log(window.wiiu.imageview.getErrorCode()); +}); diff --git a/wiiu/wiiu.d.ts b/wiiu/wiiu.d.ts new file mode 100644 index 000000000..184fc5f0a --- /dev/null +++ b/wiiu/wiiu.d.ts @@ -0,0 +1,112 @@ +// Type definitions for Extended Functionality of Wii U Internet Browser +// Project: https://www.nintendo.co.jp/wiiu/hardware/internetbrowser/extended_functionality.html +// Definitions by: MIZUSHIMA Junki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module wiiu { + const enum TPValidity { + VALID = 0, + X_INVALID = 1, + Y_INVALID = 2, + INVALID = 3 + } + const enum Button { + MINUS = 0x00000004, + SELECT = MINUS, + PLUS = 0x00000008, + START = PLUS, + R = 0x00000010, + L = 0x00000020, + ZR = 0x00000040, + ZL = 0x00000080, + DOWN = 0x00000100, + UP = 0x00000200, + RIGHT = 0x00000400, + LEFT = 0x00000800, + Y = 0x00001000, + X = 0x00002000, + B = 0x00004000, + A = 0x00008000, + R_STICK = 0x00020000, + L_STICK = 0x00040000, + R_STICK_DOWN = 0x00800000, + R_STICK_UP = 0x01000000, + R_STICK_RIGHT = 0x02000000, + R_STICK_LEFT = 0x04000000, + L_STICK_DOWN = 0x08000000, + L_STICK_UP = 0x10000000, + L_STICK_RIGHT = 0x20000000, + L_STICK_LEFT = 0x40000000 + } + + interface WiiuGamePad { + isEnabled: boolean; + isDataValid: boolean; + tpTouch: boolean; + tpValidity: number; + contentX: number; + contentY: number; + lStickX: number; + lStickY: number; + rStickX: number; + rStickY: number; + hold: number; + accX: number; + accY: number; + accZ: number; + gyroX: number; + gyroY: number; + gyroZ: number; + angleX: number; + angleY: number; + angleZ: number; + dirXx: number; + dirXy: number; + dirYx: number; + dirXz: number; + dirYy: number; + dirYz: number; + dirZx: number; + dirZz: number; + dirZy: number; + + update(): WiiuGamePad; + } + + interface VideoPlayer { + viewMode: number; + + end(): boolean; + } + + const enum ImageViewErrorCode { + UNSUPPORTED_FORMAT = 202, + DIMENSIONS_TOO_LARGE = 203, + FILE_SIZE_TOO_LARGE = 204, + TOO_MANY_PIXELS_PROGRESSIVE_JPEG = 205 + } + + interface ImageView { + viewMode: number; + + end(): boolean; + getErrorCode(): number; + } + + var gamepad: WiiuGamePad; + var videoplayer: VideoPlayer; + var imageview: ImageView; +} + +interface HTMLElement { + addEventListener(type: "wiiu_videoplayer_end", listener: (ev: CustomEvent) => any, useCapture?: boolean): void; +} + +interface Window { + wiiu: typeof wiiu; + addEventListener(type: "wiiu_imageview_start", listener: (ev: CustomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wiiu_imageview_end", listener: (ev: CustomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wiiu_imageview_change_viewmode", listener: (ev: CustomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wiiu_imageview_change_content", listener: (ev: CustomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wiiu_imageview_error", listener: (ev: CustomEvent) => any, useCapture?: boolean): void; +} diff --git a/winreg/winreg-tests.ts b/winreg/winreg-tests.ts new file mode 100644 index 000000000..376006aed --- /dev/null +++ b/winreg/winreg-tests.ts @@ -0,0 +1,95 @@ +/// + +var regKey = new Winreg({ + hive: Winreg.HKCU, + key: "\\Foo\\Bar", + host: "\\FooBar" +}) + +var regKey2 = new Winreg({ + hive: Winreg.HKCU, + key: "\\Foo\\Bar" +}) + +var regKey3 = new Winreg({ + key: "\\Foo\\Bar" +}) + +var str: string = regKey.parent.key +var par: Winreg = regKey.parent + +regKey.values((err, items) => { + var itemsC: Array = items; + var errorC: Error = err; + + items.forEach((item) => { + var str: string = item.host; + }); +}); + +regKey.keys((err, items) => { + var itemsC: Array = items; + var errorC: Error = err; + + items.forEach((item) => { + var regKey4: Winreg = item; + }); +}); + +//--- TEST CASE --- + +// create a registry client +var r1 = new Winreg({ + hive: Winreg.HKCU, + key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run' +}) +var r2 = new Winreg({ + hive: Winreg.HKCU, + key: '\\Control Panel\\Desktop' +}) + +// get parent key +console.log('parent of "'+r2.path+'" -> "'+r2.parent.path+'"'); + +// list subkeys +r2.keys(function (err, items) { + + if (!err) { + for (var i = 0, l = items.length; i < l; i++) { + console.log('subkey of "'+r2.path+'": '+items[i].path); + } + } + + // list values + r1.values(function (err, items) { + + if (!err) { + console.log(JSON.stringify(items, null, '\t')); + } + + // query named value + r1.get(items[0].name, function (err, item) { + + if (!err) { + console.log(JSON.stringify(item, null, '\t')); + } + + // add value + r1.set('bla', Winreg.REG_SZ, 'hello world!', function (err) { + + if (!err) { + console.log('value written'); + } + + // delete value + r1.remove('bla', function (err) { + + if (!err) { + console.log('value deleted'); + } + + }); + }); + }); + }); +}); diff --git a/winreg/winreg.d.ts b/winreg/winreg.d.ts new file mode 100644 index 000000000..459a6e780 --- /dev/null +++ b/winreg/winreg.d.ts @@ -0,0 +1,248 @@ +// Type definitions for Winreg v0.0.15 +// Project: https://github.com/fresc81/node-winreg/ +// Definitions by: RX14 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var Winreg: WinregStatic; + +interface WinregStatic { + /** + * Create a new Winreg instance with the given options. + * @param options options object + */ + new (options: Winreg.Options): Winreg; + + /** + * HKEY_LOCAL_MACHINE registry hive. + */ + HKLM: string; + + /** + * HKEY_CURRENT_USER registry hive. + */ + HKCU: string; + + /** + * HKEY_CLASSES_ROOT registry hive. + */ + HKCR: string; + + /** + * HKEY_USERS registry hive. + */ + HKU: string; + + /** + * HKEY_CURRENT_CONFIG registry hive. + */ + HKCC: string; + + /** + * Array of available registry hives. + */ + HIVES: Array; + + /** + * Registry value type STRING. + * + * Values of this type contain a string. + */ + REG_SZ: string; + + /** + * Registry value type MULTILINE_STRING. + * + * Values of this type contain a multiline string. + */ + REG_MULTI_SZ: string; + + /** + * Registry value type EXPANDABLE_STRING. + * + * Values of this type contain an expandable string. + */ + REG_EXPAND_SZ: string; + + /** + * Registry value type DOUBLE_WORD. + * + * Values of this type contain a double word (32 bit integer). + */ + REG_DWORD: string; + + /** + * Registry value type QUAD_WORD. + * + * Values of this type contain a quad word (64 bit integer). + */ + REG_QWORD: string; + + /** + * Registry value type BINARY. + * + * Values of this type contain a binary value. + */ + REG_BINARY: string; + + /** + * Registry value type UNKNOWN. + * + * Values of this type contain a value of an unknown type. + */ + REG_NONE: string; + + /** + * Array of available registry value types. + */ + REG_TYPES: Array; +} + +interface Winreg { + /** + * Hostname, if set in options. + * @readonly + */ + host: string; + + /** + * Hive ID. + * @readonly + */ + hive: string; + + /** + * The registry key. + * @readonly + */ + key: string; + + /** + * The path of the registry key, including hostname (if set) and hive. + * @readonly + */ + path: string; + + /** + * A new Winreg instance of the parent key. + * @readonly + */ + parent: Winreg; + + /** + * Retrieves all values from this registry key. + * + * @param cb Callback with an array of RegistryItem objects, one for each value. + */ + values(cb: (err: Error, result: Array) => void): void; + + /** + * Retrieves all subkeys of this registry key. + * + * @param cb Callback with an array of Winreg objects, one for each subkey. + */ + keys(cb: (err: Error, result: Array) => void): void; + + /** + * Retrieves a named value from this registry key. + * + * @param name Name of the value to retrieve. + * @param cb Callback with a RegistryItem object for the value. + */ + get(name: string, cb: (err: Error, result: Winreg.RegistryItem) => void): void; + + /** + * Sets a named value in this registry key. Overwrites existing value. + * + * @param name Name of the value to set. + * @param type Type of the value to set. + * @param value Value of value to set. + * @param cb Callback with any errors. + */ + set(name: string, type: string, value: string, cb: (err: Error) => void): void; + + /** + * Remove a named value from this registry key. + * + * @param name Name of the value to remove. + * @param cb Callback with any errors. + */ + remove(name: string, cb: (err: Error) => void): void; + + /** + * Create this registry key. + * + * @param cb Callback with any errors. + */ + create(cb: (err: Error) => void): void; + + /** + * Erase this registry key and its contents. + * + * @param cb Callback with any errors. + */ + erase(cb: (err: Error) => void): void; +} + +declare namespace Winreg { + export interface Options { + /** + * Optional hostname, must start with '\\' sequence. + */ + host?: string; + + /** + * Optional hive ID, default is HKLM. + */ + hive?: string; + + /** + * Optional key, default is the root key. + */ + key?: String; + } + + /** + * A single registry value record + */ + interface RegistryItem { + /** + * Hostname, if set in options. + * @readonly + */ + host: string; + + /** + * Hive ID. + * @readonly + */ + hive: string; + + /** + * Key that the registry value belongs to. + * @readonly + */ + key: string; + + /** + * Name of the registry value. + * @readonly + */ + name: string; + + /** + * Type of the registry value. + * @readonly + */ + type: string; + + /** + * Value of the registry value, as a string. + * @readonly + */ + value: string; + } +} + +declare module "winreg" { + export = Winreg; +} diff --git a/winrt/winrt-uwp.d.ts b/winrt/winrt-uwp.d.ts index e03cfc87b..e7216e732 100644 --- a/winrt/winrt-uwp.d.ts +++ b/winrt/winrt-uwp.d.ts @@ -2007,7 +2007,7 @@ declare namespace Windows { /** Represents a background task that has been registered with the system. */ abstract class BackgroundTaskRegistration { /** Enumerates an application's registered background tasks. */ - static allTasks: Windows.Foundation.Collections.IMapView; + static allTasks: Windows.Foundation.Collections.IMapView; /** Gets the name of a registered background task. */ name: string; /** Attaches a completed event handler to the registered background task. */ @@ -3079,9 +3079,9 @@ declare namespace Windows { * @param mimeType The MIME type of the attachment. * @param dataStreamReference A stream containing the attachment data. */ - constructor(mimeType: string, dataStreamReference: Windows.Storage.Streams.RandomAccessStreamReference); + constructor(mimeType: string, dataStreamReference: Windows.Storage.Streams.IRandomAccessStreamReference); /** Gets or sets a stream reference for a message attachment. */ - dataStreamReference: Windows.Storage.Streams.RandomAccessStreamReference; + dataStreamReference: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the identifier for the attachment group to which this attachment belongs. */ groupId: number; /** Gets or sets the MIME type of the attachment. */ @@ -3091,7 +3091,7 @@ declare namespace Windows { /** Gets or sets the text encoded representation of the attachment object. */ text: string; /** Gets or sets the thumbnail image for the attachment. */ - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the progress of transferring the attachment. */ transferProgress: number; } @@ -3818,7 +3818,7 @@ declare namespace Windows { /** Gets the email addresses for a contact. */ emails: Windows.Foundation.Collections.IVector; /** Sets the fields that contain information about a contact. */ - fields: Windows.Foundation.Collections.IVector; + fields: Windows.Foundation.Collections.IVector; /** Gets and sets the first name for a contact. The maximum string length for the first name is 64 characters. */ firstName: string; /** Gets the full name of the Contact . */ @@ -3840,7 +3840,7 @@ declare namespace Windows { /** Gets the job info items for a contact. */ jobInfo: Windows.Foundation.Collections.IVector; /** Gets a large version of the display picture for the Contact . */ - largeDisplayPicture: Windows.Storage.Streams.RandomAccessStreamReference; + largeDisplayPicture: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets and sets the last name for a contact. The maximum string length for the last name is 64 characters. */ lastName: string; /** Gets and sets the middle name for a contact. The maximum string length for the middle name is 64 characters. */ @@ -3854,7 +3854,7 @@ declare namespace Windows { /** Gets info about the phones for a contact. */ phones: Windows.Foundation.Collections.IVector; /** Gets the property set object for the contact. */ - providerProperties: Windows.Foundation.Collections.PropertySet; + providerProperties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets an ID that can be used by a service provider to access the Contact in their remote system. */ remoteId: string; /** Gets or puts the path to the ringtone file for the Contact . */ @@ -3862,11 +3862,11 @@ declare namespace Windows { /** Gets the significant others for a contact. */ significantOthers: Windows.Foundation.Collections.IVector; /** Gets a small version of the display picture for the Contact . */ - smallDisplayPicture: Windows.Storage.Streams.RandomAccessStreamReference; + smallDisplayPicture: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets the name used to sort the contact. */ sortName: string; /** Gets or sets the display picture for the Contact in its original size. */ - sourceDisplayPicture: Windows.Storage.Streams.RandomAccessStreamReference; + sourceDisplayPicture: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or puts the path to the audio file to play when an SMS/MMS message is received from the Contact . */ textToneToken: string; thumbnail: any; /* unmapped type */ @@ -4655,7 +4655,7 @@ declare namespace Windows { * @param vCard A stream containing the vCard data. * @return The converted Contact . */ - static convertVCardToContactAsync(vCard: Windows.Storage.Streams.RandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; + static convertVCardToContactAsync(vCard: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Gets a Boolean value indicating if the ShowContactCard method is supported on the current platform. * @return A Boolean value indicating if the ShowContactCard method is supported on the current platform. @@ -5326,9 +5326,9 @@ declare namespace Windows { /** Gets the number of items that are contained in the property set. */ size: number; /** Gets or sets the source app's logo. */ - square30x30Logo: Windows.Storage.Streams.RandomAccessStreamReference; + square30x30Logo: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets a thumbnail image for the DataPackage . */ - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the text that displays as a title for the contents of the DataPackage object. */ title: string; } @@ -5377,7 +5377,7 @@ declare namespace Windows { */ split(): { /** The first half of the object. */ first: Windows.Foundation.Collections.IMapView; /** The second half of the object. */ second: Windows.Foundation.Collections.IMapView; }; /** Gets the source app's logo. */ - square30x30Logo: Windows.Storage.Streams.RandomAccessStreamReference; + square30x30Logo: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets the thumbnail image for the DataPackageView . */ thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; /** Gets the text that displays as a title for the contents of the DataPackagePropertySetView object. */ @@ -5629,7 +5629,7 @@ declare namespace Windows { * @param file The file to share with the target app. * @return The sharing token to provide to the target app as part of a Uri activation. */ - static addFile(file: Windows.Storage.StorageFile): string; + static addFile(file: Windows.Storage.IStorageFile): string; /** * Gets a file shared by another app by providing the sharing token received from the source app. * @param token The sharing token for the shared file. @@ -5685,20 +5685,20 @@ declare namespace Windows { * @param filename The file name to use for the attachment. * @param data A random access stream containing the data for the attachment. */ - constructor(filename: string, data: Windows.Storage.Streams.RandomAccessStreamReference); + constructor(filename: string, data: Windows.Storage.Streams.IRandomAccessStreamReference); /** * Initializes a new instance of the EmailAttachment class. * @param fileName The filename of the attachment. * @param data The stream to use to download the attachment. * @param mimeType The MIME type of the attachment. */ - constructor(fileName: string, data: Windows.Storage.Streams.RandomAccessStreamReference, mimeType: string); + constructor(fileName: string, data: Windows.Storage.Streams.IRandomAccessStreamReference, mimeType: string); /** Gets or sets a value that identifies the content of the attachment on a remote system. */ contentId: string; /** Gets or sets the location of an email attachment as a Uniform Resource Identifier (URI). */ contentLocation: string; /** Gets or sets the email attachment's data. */ - data: Windows.Storage.Streams.RandomAccessStreamReference; + data: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the download state of the email attachment. */ downloadState: Windows.ApplicationModel.Email.EmailAttachmentDownloadState; /** Gets or sets the estimated download size of the attachment. */ @@ -6645,7 +6645,7 @@ declare namespace Windows { * @param type The kind of message body; plain text or HTML. * @return The selected body stream. */ - getBodyStream(type: Windows.ApplicationModel.Email.EmailMessageBodyKind): Windows.Storage.Streams.RandomAccessStreamReference; + getBodyStream(type: Windows.ApplicationModel.Email.EmailMessageBodyKind): Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets a Boolean value indicating whether this email message contains partial bodies. */ hasPartialBodies: boolean; /** Gets the identifier of an email message. */ @@ -6691,9 +6691,9 @@ declare namespace Windows { * @param type Indicates which body stream, plain text or HTML. * @param stream The message for the specified body stream. */ - setBodyStream(type: Windows.ApplicationModel.Email.EmailMessageBodyKind, stream: Windows.Storage.Streams.RandomAccessStreamReference): void; + setBodyStream(type: Windows.ApplicationModel.Email.EmailMessageBodyKind, stream: Windows.Storage.Streams.IRandomAccessStreamReference): void; /** Gets or sets the S/MIME data associated with an email message. For more information, see the Certificate class. */ - smimeData: Windows.Storage.Streams.RandomAccessStreamReference; + smimeData: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the type of S/MIME encryption/signature for the email message. */ smimeKind: Windows.ApplicationModel.Email.EmailMessageSmimeKind; /** Gets or sets the subject of the email message. */ @@ -7114,24 +7114,24 @@ declare namespace Windows { /** Gets the name. */ automationName: string; /** Gets the glyph to display. */ - glyph: Windows.Storage.Streams.RandomAccessStream; + glyph: Windows.Storage.Streams.IRandomAccessStream; /** Launches the app corresponding to the badge. */ launchApp(): void; /** Gets the logo to display with the badge. */ - logo: Windows.Storage.Streams.RandomAccessStream; + logo: Windows.Storage.Streams.IRandomAccessStream; /** Gets the number to display with the badge. */ number: number; } /** Provides access to the same data that the default lock screen has access to, such as wallpaper, badges, and so on. */ abstract class LockScreenInfo { /** Gets the alarm icon to display. */ - alarmIcon: Windows.Storage.Streams.RandomAccessStream; + alarmIcon: Windows.Storage.Streams.IRandomAccessStream; /** Gets the badges to display. */ badges: Windows.Foundation.Collections.IVectorView; /** Gets the detail text to display. */ detailText: Windows.Foundation.Collections.IVectorView; /** Gets the image to display on the lock screen. */ - lockScreenImage: Windows.Storage.Streams.RandomAccessStream; + lockScreenImage: Windows.Storage.Streams.IRandomAccessStream; /** Indicates the alarm icon has changed. */ onalarmiconchanged: Windows.Foundation.TypedEventHandler; addEventListener(type: "alarmiconchanged", listener: Windows.Foundation.TypedEventHandler): void; @@ -7313,7 +7313,7 @@ declare namespace Windows { * Asynchronously returns an IRandomAccessStream that accesses the value of this ResourceCandidate . * @return An asynchronous operation to return the requested IRandomAccessStream . */ - getValueAsStreamAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + getValueAsStreamAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; /** Indicates whether this ResourceCandidate can be used as a default fallback value for any context. */ isDefault: boolean; /** Indicates whether this ResourceCandidate matched the ResourceContext against which it was evaluated. */ @@ -7479,14 +7479,14 @@ declare namespace Windows { * Loads one or more PRI files and adds their contents to the default resource manager. * @param files The files you want to add. */ - loadPriFiles(files: Windows.Foundation.Collections.IIterable): void; + loadPriFiles(files: Windows.Foundation.Collections.IIterable): void; /** Gets the ResourceMap that is associated with the main package of the currently running application. */ mainResourceMap: Windows.ApplicationModel.Resources.Core.ResourceMap; /** * Unloads one or more PRI files. * @param files The files you want unloaded. */ - unloadPriFiles(files: Windows.Foundation.Collections.IIterable): void; + unloadPriFiles(files: Windows.Foundation.Collections.IIterable): void; } /** A collection of related resources, typically either for a particular app package, or a resource file for a particular package. */ abstract class ResourceMap { @@ -7809,7 +7809,7 @@ declare namespace Windows { /** Gets the value that was passed to the detailText parameter of the AppendResultSuggestion method. */ detailText: string; /** Gets the value that was passed to the image parameter of the AppendResultSuggestion method. */ - image: Windows.Storage.Streams.RandomAccessStreamReference; + image: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets the value that was passed to the imageAlternateText parameter of the AppendResultSuggestion method. */ imageAlternateText: string; /** Gets the type of suggestion. */ @@ -8075,7 +8075,7 @@ declare namespace Windows { * @param image The image to accompany the results suggestion. * @param imageAlternateText The alternate text for the image. */ - appendResultSuggestion(text: string, detailText: string, tag: string, image: Windows.Storage.Streams.RandomAccessStreamReference, imageAlternateText: string): void; + appendResultSuggestion(text: string, detailText: string, tag: string, image: Windows.Storage.Streams.IRandomAccessStreamReference, imageAlternateText: string): void; /** * Appends a text label that is used to separate groups of suggestions in the search pane. * @param label The text to use as a separator. This text should be descriptive of any suggestions that are appended after it. @@ -8966,7 +8966,7 @@ declare namespace Windows { */ findEmailMailboxesAsync(): Windows.Foundation.IPromiseWithIAsyncOperation>; /** Gets the icon associated with the UserDataAccount . */ - icon: Windows.Storage.Streams.RandomAccessStreamReference; + icon: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets a string that uniquely identifies the UserDataAccount on the local device. */ id: string; /** Gets a Boolean value indicating if the user account data is encrypted when the device becomes locked. */ @@ -9103,7 +9103,7 @@ declare namespace Windows { /** Gets or sets the layout template used to display the content tile on the Cortana canvas. */ contentTileType: Windows.ApplicationModel.VoiceCommands.VoiceCommandContentTileType; /** Gets or sets an image the background app service can associate with the content tile. */ - image: Windows.Storage.StorageFile; + image: Windows.Storage.IStorageFile; /** Gets or sets the first line of text the background app service can associate with the content tile. */ textLine1: string; /** Gets or sets the second line of text the background app service can associate with the content tile. */ @@ -9308,7 +9308,7 @@ declare namespace Windows { * @param stream The ".mswallet" file to import. * @return An asynchronous operation that, on successful completion, returns the wallet item that was imported into the wallet. If you use Asynchronous programming, the result type on successful completion is a single WalletItem . */ - importItemAsync(stream: Windows.Storage.Streams.RandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; + importItemAsync(stream: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Launches the app that is associated with the given wallet item. * @param item The wallet item to launch an app for. @@ -9350,7 +9350,7 @@ declare namespace Windows { * Initializes a new instance of the WalletBarcode class. * @param streamToBarcodeImage A stream representing the bar code image. */ - constructor(streamToBarcodeImage: Windows.Storage.Streams.RandomAccessStreamReference); + constructor(streamToBarcodeImage: Windows.Storage.Streams.IRandomAccessStreamReference); /** * Initializes a new instance of the WalletBarcode class. * @param symbology The symbology type for this barcode. Use one of the supported symbologies, such as Upca. Don't set to Invalid or Custom. @@ -9361,7 +9361,7 @@ declare namespace Windows { * Creates and returns a bitmap image stream for the barcode (or returns the custom image used during instantiation). * @return An asynchronous operation. If you use Asynchronous programming, the result type on successful completion is an IRandomAccessStreamReference instance. This can be assigned as the source for an image (with some additional code). */ - getImageAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + getImageAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the symbology used by the bar code. */ symbology: Windows.ApplicationModel.Wallet.WalletBarcodeSymbology; /** Gets a string representation of the barcode (its message). */ @@ -9438,7 +9438,7 @@ declare namespace Windows { /** Gets or sets the barcode that's representative of the wallet item. */ barcode: Windows.ApplicationModel.Wallet.WalletBarcode; /** Gets or sets the background image of the body of the wallet item (uses a stream). */ - bodyBackgroundImage: Windows.Storage.Streams.RandomAccessStreamReference; + bodyBackgroundImage: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the body color of the wallet item. */ bodyColor: Windows.UI.Color; /** Gets or sets the body font color of the wallet item. */ @@ -9452,7 +9452,7 @@ declare namespace Windows { /** Gets or sets the expiration date of the wallet item. */ expirationDate: Date; /** Gets or sets the header background image of the wallet item. */ - headerBackgroundImage: Windows.Storage.Streams.RandomAccessStreamReference; + headerBackgroundImage: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the header color of the wallet item. */ headerColor: Windows.UI.Color; /** Gets or sets the header font color of the wallet item. */ @@ -9472,17 +9472,17 @@ declare namespace Windows { /** Gets or sets the date and time the data for this item was last updated. */ lastUpdated: Date; /** Gets or sets the medium (159 x 159) logo image of the wallet item. */ - logo159x159: Windows.Storage.Streams.RandomAccessStreamReference; + logo159x159: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the large (336 x 336) logo image of the wallet item. */ - logo336x336: Windows.Storage.Streams.RandomAccessStreamReference; + logo336x336: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the small (99 x 99) logo image of the wallet item. */ - logo99x99: Windows.Storage.Streams.RandomAccessStreamReference; + logo99x99: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the logo image of the wallet item. */ - logoImage: Windows.Storage.Streams.RandomAccessStreamReference; + logoImage: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the logo text of the wallet item. */ logoText: string; /** Gets or sets the promotional image of the wallet item. */ - promotionalImage: Windows.Storage.Streams.RandomAccessStreamReference; + promotionalImage: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets or sets the date on which the item is valid. */ relevantDate: Date; /** Gets or sets the description of the relevant date of the wallet item. */ @@ -9572,7 +9572,7 @@ declare namespace Windows { * @param stream The ".mswallet" file to import. * @return An asynchronous operation that, on successful completion, returns the wallet item that was imported into the wallet. If you use Asynchronous programming, the result type on successful completion is a single WalletItem . */ - importItemAsync(stream: Windows.Storage.Streams.RandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; + importItemAsync(stream: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Displays the item with the given ID in the Wallet UI. * @param id The ID of the item to display. @@ -9677,26 +9677,26 @@ declare namespace Windows { * @param password The password to open the PDF document, if it requires one. * @return The asynchronous operation. */ - static loadFromFileAsync(file: Windows.Storage.StorageFile, password: string): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFromFileAsync(file: Windows.Storage.IStorageFile, password: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Outputs an asynchronous operation. When the operation completes, a PdfDocument object is returned, which represents a Portable Document Format (PDF) document. * @param file The file, which represents a PDF document. * @return The asynchronous operation. */ - static loadFromFileAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a PdfDocument object, representing a Portable Document Format (PDF) document, from a stream of data that represents a PDF document in the file system. Use this method if the PDF document is password-protected. * @param inputStream The stream of data, which represents a PDF document. * @param password The password to open the PDF document, if it requires one. * @return The asynchronous operation. */ - static loadFromStreamAsync(inputStream: Windows.Storage.Streams.RandomAccessStream, password: string): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFromStreamAsync(inputStream: Windows.Storage.Streams.IRandomAccessStream, password: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a PdfDocument object, representing a Portable Document Format (PDF) document, from a stream of data that represents a PDF document in the file system. * @param inputStream The stream of data, which represents a PDF document. * @return The asynchronous operation. */ - static loadFromStreamAsync(inputStream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFromStreamAsync(inputStream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Gets a page from a Portable Document Format (PDF) document. * @param pageIndex The location of the PDF page relative to its parent document. @@ -9728,14 +9728,14 @@ declare namespace Windows { * @param outputStream The stream of data, which represents a PDF page's content. * @return The asynchronous action. */ - renderToStreamAsync(outputStream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; + renderToStreamAsync(outputStream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; /** * Takes a set of display settings, applies them to the output of a Portable Document Format (PDF) page's contents, and creates a stream with the customized, rendered output as an asynchronous action. This asynchronous action can be used to create a customized display image of the PDF page. * @param outputStream The stream of data, which represents a PDF page's contents. * @param options The requested set of display settings to apply to the display image that is output based on the PDF page. * @return The asynchronous action. */ - renderToStreamAsync(outputStream: Windows.Storage.Streams.RandomAccessStream, options: Windows.Data.Pdf.PdfPageRenderOptions): Windows.Foundation.IPromiseWithIAsyncAction; + renderToStreamAsync(outputStream: Windows.Storage.Streams.IRandomAccessStream, options: Windows.Data.Pdf.PdfPageRenderOptions): Windows.Foundation.IPromiseWithIAsyncAction; /** Gets the number of degrees that the Portable Document Format (PDF) page will be rotated when it's displayed or printed. */ rotation: Windows.Data.Pdf.PdfPageRotation; /** Gets the Portable Document Format (PDF) page's size based on its related CropBox , MediaBox , and Rotation property values. */ @@ -10662,7 +10662,7 @@ declare namespace Windows { * @param offset The number of characters at which to split this text node into two nodes, starting from zero. * @return The new text node. */ - splitText(offset: number): Windows.Data.Xml.Dom.XmlText; + splitText(offset: number): Windows.Data.Xml.Dom.IXmlText; /** * Retrieves a substring of the full string from the specified range. * @param offset Specifies the offset, in characters, from the beginning of the string. An offset of zero indicates copying from the start of the data. @@ -10817,13 +10817,13 @@ declare namespace Windows { * @param loadSettings Settings for customizing parser behavior. * @return The object that must be used to start the operation. */ - static loadFromFileAsync(file: Windows.Storage.StorageFile, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFromFileAsync(file: Windows.Storage.IStorageFile, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously loads an XML document from the specified file. The document is parsed using the default parser settings. * @param file The file from which to load the document. * @return The object that must be used to start the operation. */ - static loadFromFileAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously loads an XML document from the specified location. The document is parsed using the provided settings. * @param uri A URL that specifies the location of the XML file. @@ -10982,13 +10982,13 @@ declare namespace Windows { * Loads an XML document using the buffer. The document is parsed using the default parser settings. * @param buffer The buffer to load into this XML document object. This buffer can contain an entire XML document or a well-formed fragment. */ - loadXmlFromBuffer(buffer: Windows.Storage.Streams.Buffer): void; + loadXmlFromBuffer(buffer: Windows.Storage.Streams.IBuffer): void; /** * Loads an XML document using the buffer. The document is parsed using the settings provided. * @param buffer The buffer to load into this XML document object. This buffer can contain an entire XML document or a well-formed fragment. * @param loadSettings The settings for parsing the document. */ - loadXmlFromBuffer(buffer: Windows.Storage.Streams.Buffer, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): void; + loadXmlFromBuffer(buffer: Windows.Storage.Streams.IBuffer, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): void; /** Gets the local name, which is the local part of a qualified name. This is called the local part in Namespaces in XML. */ localName: any; /** Returns the Uniform Resource Identifier (URI) for the namespace. */ @@ -11029,7 +11029,7 @@ declare namespace Windows { * @param file The file to save the document to. * @return The object that must be used to start the operation. */ - saveToFileAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + saveToFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList . * @param xpath Specifies an XPath expression. @@ -11932,7 +11932,7 @@ declare namespace Windows { * @param offset The number of characters at which to split this text node into two nodes, starting from zero. * @return The new text node. */ - splitText(offset: number): Windows.Data.Xml.Dom.XmlText; + splitText(offset: number): Windows.Data.Xml.Dom.IXmlText; /** * Retrieves a substring of the full string from the specified range. * @param offset The offset, in characters, from the beginning of the string. An offset of zero indicates copying from the start of the data. @@ -12018,7 +12018,7 @@ declare namespace Windows { * @param offset The number of characters at which to split this text node into two nodes, starting from zero. * @return The new text node. */ - splitText(offset: number): Windows.Data.Xml.Dom.XmlText; + splitText(offset: number): Windows.Data.Xml.Dom.IXmlText; } /** Encapsulates the methods needed to execute XPath queries on an XML DOM tree or subtree. */ interface IXmlNodeSelector { @@ -12701,9 +12701,9 @@ declare namespace Windows { * @param offset The offset of byte pattern from beginning of advertisement data section. * @param data The Bluetooth LE advertisement data byte pattern to match. */ - constructor(dataType: number, offset: number, data: Windows.Storage.Streams.Buffer); + constructor(dataType: number, offset: number, data: Windows.Storage.Streams.IBuffer); /** The Bluetooth LE advertisement data byte pattern to match. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; /** The Bluetooth LE advertisement data type defined by the Bluetooth Special Interest Group (SIG) to match. */ dataType: number; /** The offset of byte pattern from beginning of advertisement data section. */ @@ -12718,9 +12718,9 @@ declare namespace Windows { * @param dataType The Bluetooth LE advertisement data type as defined by the Bluetooth Special Interest Group (SIG). * @param data The Bluetooth LE advertisement data payload. */ - constructor(dataType: number, data: Windows.Storage.Streams.Buffer); + constructor(dataType: number, data: Windows.Storage.Streams.IBuffer); /** The Bluetooth LE advertisement data payload. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; /** The Bluetooth LE advertisement data type as defined by the Bluetooth Special Interest Group (SIG). */ dataType: number; } @@ -12934,11 +12934,11 @@ declare namespace Windows { * @param companyId The Bluetooth LE company identifier code as defined by the Bluetooth Special Interest Group (SIG). * @param data Bluetooth LE manufacturer-specific section data. */ - constructor(companyId: number, data: Windows.Storage.Streams.Buffer); + constructor(companyId: number, data: Windows.Storage.Streams.IBuffer); /** The Bluetooth LE company identifier code as defined by the Bluetooth Special Interest Group (SIG). */ companyId: number; /** Bluetooth LE manufacturer-specific section data. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; } /** Specifies the Bluetooth LE scanning mode. */ enum BluetoothLEScanningMode { @@ -12971,7 +12971,7 @@ declare namespace Windows { /** Gets the GATT characteristic that changed. */ characteristic: Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic; /** Gets a byte stream containing the new value of the characteristic. */ - value: Windows.Storage.Streams.Buffer; + value: Windows.Storage.Streams.IBuffer; } /** Provides information about the Bluetooth device that caused this trigger to fire. */ abstract class RfcommConnectionTriggerDetails { @@ -12987,7 +12987,7 @@ declare namespace Windows { /** Gets or sets the service UUID that will be advertised in the SDP record. */ localServiceId: Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId; /** Gets or sets the Bluetooth SDP record that the system will advertise on behalf of the app. */ - sdpRecord: Windows.Storage.Streams.Buffer; + sdpRecord: Windows.Storage.Streams.IBuffer; /** Gets or sets the service capabilities that will be advertised. */ serviceCapabilities: Windows.Devices.Bluetooth.BluetoothServiceCapabilities; } @@ -13129,7 +13129,7 @@ declare namespace Windows { /** Gets the read-only list of RFCOMM services supported by the device. */ rfcommServices: Windows.Foundation.Collections.IVectorView; /** Gets the read-only list of Service Discovery Protocol (SDP) records for the device. */ - sdpRecords: Windows.Foundation.Collections.IVectorView; + sdpRecords: Windows.Foundation.Collections.IVectorView; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -13645,14 +13645,14 @@ declare namespace Windows { * @param value A Windows.Storage.Streams.IBuffer object which contains the data to be written to the Bluetooth LE device. * @return The object that manages the asynchronous operation, which, upon completion, returns the status with which the operation completed. */ - writeValueAsync(value: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + writeValueAsync(value: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Performs a Characteristic Value write to a Bluetooth LE device. * @param value A Windows.Storage.Streams.IBuffer object which contains the data to be written to the Bluetooth LE device. * @param writeOption Specifies what type of GATT write should be performed. * @return The object that manages the asynchronous operation, which, upon completion, returns the status with which the operation completed. */ - writeValueAsync(value: Windows.Storage.Streams.Buffer, writeOption: Windows.Devices.Bluetooth.GenericAttributeProfile.GattWriteOption): Windows.Foundation.IPromiseWithIAsyncOperation; + writeValueAsync(value: Windows.Storage.Streams.IBuffer, writeOption: Windows.Devices.Bluetooth.GenericAttributeProfile.GattWriteOption): Windows.Foundation.IPromiseWithIAsyncOperation; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -13892,7 +13892,7 @@ declare namespace Windows { * @param value A Windows.Storage.Streams.IBuffer object which contains the data to be written to the Bluetooth LE device. * @return The object that manages the asynchronous operation, which, upon completion, returns the status with which the operation completed. */ - writeValueAsync(value: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + writeValueAsync(value: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Represents an enumeration of the most well known Descriptor UUID values, and provides convenience methods for working with GATT descriptor UUIDs, and static properties providing descriptor UUIDs for common GATT descriptors. */ abstract class GattDescriptorUuids { @@ -14065,7 +14065,7 @@ declare namespace Windows { /** Gets the status of an asynchronous operation. */ status: Windows.Devices.Bluetooth.GenericAttributeProfile.GattCommunicationStatus; /** Gets the value read from the device. */ - value: Windows.Storage.Streams.Buffer; + value: Windows.Storage.Streams.IBuffer; } /** Performs GATT reliable writes on the Bluetooth LE device, in the form of a transaction write operation. */ class GattReliableWriteTransaction { @@ -14081,7 +14081,7 @@ declare namespace Windows { * @param characteristic The GattCharacteristic object on which to perform the write operation. * @param value The Characteristic Value to be written to characteristic. */ - writeValue(characteristic: Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic, value: Windows.Storage.Streams.Buffer): void; + writeValue(characteristic: Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic, value: Windows.Storage.Streams.IBuffer): void; } /** Represents an enumeration of the most well known Service UUID values, and provides convenience methods for working with GATT service UUIDs, and static properties providing service UUIDs for common GATT services. */ abstract class GattServiceUuids { @@ -14133,7 +14133,7 @@ declare namespace Windows { /** Represents the value received when registering to receive notifications or indications from a Bluetooth LE device. */ abstract class GattValueChangedEventArgs { /** Gets the new Characteristic Value. */ - characteristicValue: Windows.Storage.Streams.Buffer; + characteristicValue: Windows.Storage.Streams.IBuffer; /** Gets the time at which the system was notified of the Characteristic Value change. */ timestamp: Date; } @@ -14235,7 +14235,7 @@ declare namespace Windows { */ static createAsync(serviceId: Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets a collection of SDP attributes for advertising. */ - sdpRawAttributes: Windows.Foundation.Collections.IMap; + sdpRawAttributes: Windows.Foundation.Collections.IMap; /** Gets the RfcommServiceId of this local RFCOMM service instance. */ serviceId: Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId; /** @@ -14283,7 +14283,7 @@ declare namespace Windows { * @param outputBuffer The output buffer. * @return The result of the async operation. */ - sendIOControlAsync(ioControlCode: Windows.Devices.Custom.IOControlCode, inputBuffer: Windows.Storage.Streams.Buffer, outputBuffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + sendIOControlAsync(ioControlCode: Windows.Devices.Custom.IIOControlCode, inputBuffer: Windows.Storage.Streams.IBuffer, outputBuffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Sends an IO control code. A return value indicates whether the operation succeeded. * @param ioControlCode The IO control code. @@ -14291,7 +14291,7 @@ declare namespace Windows { * @param outputBuffer The output buffer. * @return true if the operation is successful; otherwise, false. */ - trySendIOControlAsync(ioControlCode: Windows.Devices.Custom.IOControlCode, inputBuffer: Windows.Storage.Streams.Buffer, outputBuffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + trySendIOControlAsync(ioControlCode: Windows.Devices.Custom.IIOControlCode, inputBuffer: Windows.Storage.Streams.IBuffer, outputBuffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; } /** The device access mode. */ enum DeviceAccessMode { @@ -14901,7 +14901,7 @@ declare namespace Windows { * Creates a new instance of a IRandomAccessStream over the same resource as the current stream. * @return The new stream. The initial, internal position of the stream is 0. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Closes the current stream and releases system resources. */ close(): void; /** Returns the content type of the thumbnail image. */ @@ -14932,7 +14932,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Sets the position of the stream to the specified value. * @param position The new position of the stream. @@ -14945,7 +14945,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Contains information about the result of attempting to unpair a device. */ abstract class DeviceUnpairingResult { @@ -16072,7 +16072,7 @@ declare namespace Windows { /** Represents a feature report. */ abstract class HidFeatureReport { /** Retrieves, or sets, the data associated with a given feature report. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; /** * Retrieves the Boolean control associated with the usagePage and usageIdparameter and found in the given feature report. * @param usagePage The usage page of the top-level collection for the given HID device. @@ -16107,7 +16107,7 @@ declare namespace Windows { /** Retrieves the currently activated Boolean controls for the given HID device. */ activatedBooleanControls: Windows.Foundation.Collections.IVectorView; /** Retrieves the data associated with a given input report. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; getBooleanControl: any; /* unmapped type */ /** * Retrieves the Boolean control described by the controlDescription parameter and found in the given input report. @@ -16187,7 +16187,7 @@ declare namespace Windows { /** Represents an output report. */ abstract class HidOutputReport { /** Retrieves, or sets, the data associated with a given output report. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; getBooleanControl: any; /* unmapped type */ /** * Retrieves the boolean control associated with the given controlDescription. @@ -16546,7 +16546,7 @@ declare namespace Windows { /** Creates a new MidiActiveSensingMessage object. */ constructor(); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16565,7 +16565,7 @@ declare namespace Windows { /** Gets the pressure from 0-127. */ pressure: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16576,7 +16576,7 @@ declare namespace Windows { /** Creates a new MidiContinueMessage object. */ constructor(); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16598,7 +16598,7 @@ declare namespace Windows { /** Gets controller from 0-127 to receive this message. */ controller: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16688,7 +16688,7 @@ declare namespace Windows { /** Gets the note to turn off which is specified as a value from 0-127. */ note: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16710,7 +16710,7 @@ declare namespace Windows { /** Gets the note to turn on which is specified as a value from 0-127. */ note: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16725,7 +16725,7 @@ declare namespace Windows { * @param deviceId The device ID, which can be obtained by enumerating the devices on the system Windows.Devices.Enumeration.DeviceInformation.FindAllAsync . * @return The asynchronous operation. Upon completion, IAsyncOperation.GetResults returns a MidiOutPort object. */ - static fromIdAsync(deviceId: string): Windows.Foundation.IPromiseWithIAsyncOperation; + static fromIdAsync(deviceId: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Gets a query string that can be used to enumerate all MidiOutPort objects on the system. * @return The query string used to enumerate the MidiOutPort objects on the system. @@ -16739,7 +16739,7 @@ declare namespace Windows { * Send the specified data buffer to the device associated with this MidiOutPort . * @param midiData The data to send to the device. */ - sendBuffer(midiData: Windows.Storage.Streams.Buffer): void; + sendBuffer(midiData: Windows.Storage.Streams.IBuffer): void; /** * Send the data in the specified MIDI message to the device associated with this MidiOutPort . * @param midiMessage The MIDI message to send to the device. @@ -16759,7 +16759,7 @@ declare namespace Windows { /** Gets the channel from 0-15 that this message applies to. */ channel: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16781,7 +16781,7 @@ declare namespace Windows { /** Gets the polyphonic key pressure which is specified as a value from 0-127. */ pressure: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16800,7 +16800,7 @@ declare namespace Windows { /** Gets the program to change from 0-127. */ program: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16816,7 +16816,7 @@ declare namespace Windows { /** Gets the song position pointer encoded in a 14-bit value from 0-16383. */ beats: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16830,7 +16830,7 @@ declare namespace Windows { */ constructor(song: number); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the song to select from 0-127. */ song: number; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ @@ -16843,7 +16843,7 @@ declare namespace Windows { /** Creates a new MidiStartMessage object. */ constructor(); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16854,7 +16854,7 @@ declare namespace Windows { /** Creates a new MidiStopMessage object. */ constructor(); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16889,7 +16889,7 @@ declare namespace Windows { * Sends an array of bytes through the synthesizer's out port . This enables you to send your data as a byte array instead of as a defined MIDI message. * @param midiData The array of bytes to send. */ - sendBuffer(midiData: Windows.Storage.Streams.Buffer): void; + sendBuffer(midiData: Windows.Storage.Streams.IBuffer): void; /** * Sends a MIDI message through the Microsoft MIDI synthesizer's out port . * @param midiMessage The MIDI message to send. @@ -16904,9 +16904,9 @@ declare namespace Windows { * Creates a new MidiSystemExclusiveMessage object. * @param rawData The system exclusive data. */ - constructor(rawData: Windows.Storage.Streams.Buffer); + constructor(rawData: Windows.Storage.Streams.IBuffer); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16917,7 +16917,7 @@ declare namespace Windows { /** Creates a new MidiSystemResetMessage object. */ constructor(); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16934,7 +16934,7 @@ declare namespace Windows { /** Gets the value of the frame type from 0-7. */ frameType: number; /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16947,7 +16947,7 @@ declare namespace Windows { /** Creates a new MidiTimingClockMessage object. */ constructor(); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16958,7 +16958,7 @@ declare namespace Windows { /** Creates a new MidiTuneRequestMessage object. */ constructor(); /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16967,7 +16967,7 @@ declare namespace Windows { /** Represents a MIDI message which is implemented by all MIDI message classes. */ interface IMidiMessage { /** Gets the array of bytes associated with the MIDI message, including status byte. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Gets the duration from when the MidiInPort was created to the time the message was received. For messages being sent to a MidiOutPort , this value has no meaning. */ timestamp: number; /** Gets the type of this MIDI message. */ @@ -16979,7 +16979,7 @@ declare namespace Windows { * Sends the contents of the buffer through the MIDI out port. * @param midiData The data to send to the device. */ - sendBuffer(midiData: Windows.Storage.Streams.Buffer): void; + sendBuffer(midiData: Windows.Storage.Streams.IBuffer): void; /** * Send the data in the specified MIDI message to the device associated with this MidiOutPort . * @param midiMessage The MIDI message to send to the device. @@ -17847,7 +17847,7 @@ declare namespace Windows { /** Represents a frame of data from the device. */ abstract class PerceptionFrame { /** The actual bytes of the frame which can be consumed as described by the Properties of the IPerceptionFrameProvider which produced the frame. */ - frameData: Windows.Foundation.MemoryBuffer; + frameData: Windows.Foundation.IMemoryBuffer; /** Gets the Properties for this frame. */ properties: Windows.Foundation.Collections.ValueSet; /** Gets or sets the Relative Time of this frame relative to other frames from this IPerceptionFrameProvider. */ @@ -17989,7 +17989,7 @@ declare namespace Windows { /** Gets the PerceptionFrameProviderInfo describing this device. */ frameProviderInfo: Windows.Devices.Perception.Provider.PerceptionFrameProviderInfo; /** The properties describing the device and the frames produced by the device. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** The IPerceptionFrameProviderManager is expected to provide any IPerceptionFrameProvider that has been registered via PerceptionFrameProviderManagerService::RegisterFrameProviderInfo(). */ interface IPerceptionFrameProviderManager extends Windows.Foundation.IClosable { @@ -18068,7 +18068,7 @@ declare namespace Windows { * @param statisticsCategories The list of statistics to retrieve. * @return IBuffer representing the requested statistics. */ - retrieveStatisticsAsync(statisticsCategories: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; + retrieveStatisticsAsync(statisticsCategories: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -18107,9 +18107,9 @@ declare namespace Windows { /** Contains the barcode scanner data. */ abstract class BarcodeScannerReport { /** Gets the full raw data from the DataReceived event. */ - scanData: Windows.Storage.Streams.Buffer; + scanData: Windows.Storage.Streams.IBuffer; /** Gets the decoded barcode label, which does not include the header, checksum, and other miscellaneous information. */ - scanDataLabel: Windows.Storage.Streams.Buffer; + scanDataLabel: Windows.Storage.Streams.IBuffer; /** Gets the decoded barcode label type. Possible values are defined in the BarcodeSymbologies class. */ scanDataType: number; } @@ -18713,7 +18713,7 @@ declare namespace Windows { * Retrieves a challenge token from the device. * @return Buffer used to store the resulting challenge token from the device. */ - retrieveDeviceAuthenticationDataAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + retrieveDeviceAuthenticationDataAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Sets the type of error to report by the ErrorOccurred event. * @param value Error reporting type. @@ -19016,7 +19016,7 @@ declare namespace Windows { * @param statisticsCategories The list of statistics to retrieve. * @return IBuffer representing the requested statistics. */ - retrieveStatisticsAsync(statisticsCategories: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; + retrieveStatisticsAsync(statisticsCategories: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the card types supported by the magnetic stripe reader. */ supportedCardTypes: number; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; @@ -19170,9 +19170,9 @@ declare namespace Windows { /** Contains data from the recently swiped card. */ abstract class MagneticStripeReaderReport { /** Gets the additional security or encryption information for the recently swiped card. */ - additionalSecurityInformation: Windows.Storage.Streams.Buffer; + additionalSecurityInformation: Windows.Storage.Streams.IBuffer; /** Gets the card authentication information for the recently swiped card. */ - cardAuthenticationData: Windows.Storage.Streams.Buffer; + cardAuthenticationData: Windows.Storage.Streams.IBuffer; /** Gets the length of the raw CardAuthenticationData before it is encrypted. */ cardAuthenticationDataLength: number; /** Gets the card type identifier for the recently swiped card. */ @@ -19207,11 +19207,11 @@ declare namespace Windows { /** Contains the track data obtained following a card swipe. */ abstract class MagneticStripeReaderTrackData { /** Gets the raw or decoded data from the swiped card. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; /** Gets the discretionary data from the swiped card. */ - discretionaryData: Windows.Storage.Streams.Buffer; + discretionaryData: Windows.Storage.Streams.IBuffer; /** Gets the encrypted data from the swiped card. */ - encryptedData: Windows.Storage.Streams.Buffer; + encryptedData: Windows.Storage.Streams.IBuffer; } /** Defines the constants that indicates the track error type. */ enum MagneticStripeReaderTrackErrorType { @@ -20379,7 +20379,7 @@ declare namespace Windows { * @param targetStream The scanned image file. * @return The progress of the scan and the scanned file format. */ - scanPreviewToStreamAsync(scanSource: Windows.Devices.Scanners.ImageScannerScanSource, targetStream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + scanPreviewToStreamAsync(scanSource: Windows.Devices.Scanners.ImageScannerScanSource, targetStream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Represents the auto-configured scan source of the scanner. */ abstract class ImageScannerAutoConfiguration { @@ -21637,7 +21637,7 @@ declare namespace Windows { * Returns the smart card's Answer to Reset (ATR), a standard series of bytes that contains info about the smart card's characteristics, behaviors, and state. * @return The smart card's ATR byte set. */ - getAnswerToResetAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + getAnswerToResetAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Returns the smart card's status. * @return One of the SmartCardStatus enumeration values, representing the smart card's status. @@ -21649,14 +21649,14 @@ declare namespace Windows { /** Represents a smart card authentication challenge/response operation. */ abstract class SmartCardChallengeContext { /** Gets the smart card's challenge value. */ - challenge: Windows.Storage.Streams.Buffer; + challenge: Windows.Storage.Streams.IBuffer; /** * Changes the smart card's admin key (also known as an administrator PIN or unblock PIN). * @param response The response to a smart card authentication challenge/response operation. * @param newAdministrativeKey The new smart card admin key. * @return An asynchronous action that completes after the admin key change attempt is done. */ - changeAdministrativeKeyAsync(response: Windows.Storage.Streams.Buffer, newAdministrativeKey: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncAction; + changeAdministrativeKeyAsync(response: Windows.Storage.Streams.IBuffer, newAdministrativeKey: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncAction; /** Completes the smart card authentication challenge/response operation and frees associated system resources. */ close(): void; /** @@ -21665,7 +21665,7 @@ declare namespace Windows { * @param formatCard True to format the smart card; otherwise false. * @return An asynchronous action that completes after the smart card reconfiguration attempt is done. */ - provisionAsync(response: Windows.Storage.Streams.Buffer, formatCard: boolean): Windows.Foundation.IPromiseWithIAsyncAction; + provisionAsync(response: Windows.Storage.Streams.IBuffer, formatCard: boolean): Windows.Foundation.IPromiseWithIAsyncAction; /** * Reconfigures an existing, configured smart card with a new response and ID. Optionally, formats the smart card. * @param response The new response to a smart card authentication challenge/response operation. @@ -21673,13 +21673,13 @@ declare namespace Windows { * @param newCardId The new smart card ID. * @return An asynchronous action that completes after the smart card reconfiguration attempt is done. */ - provisionAsync(response: Windows.Storage.Streams.Buffer, formatCard: boolean, newCardId: string): Windows.Foundation.IPromiseWithIAsyncAction; + provisionAsync(response: Windows.Storage.Streams.IBuffer, formatCard: boolean, newCardId: string): Windows.Foundation.IPromiseWithIAsyncAction; /** * Verifies the response to the smart card challenge request. * @param response The response to the smart card challenge request. * @return After the verification attempt is done, true if the response was successfully verified; otherwise false. */ - verifyResponseAsync(response: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + verifyResponseAsync(response: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Represents a connection to a smart card. */ abstract class SmartCardConnection { @@ -21690,7 +21690,7 @@ declare namespace Windows { * @param command The APDU command to transmit to the smart card. * @return An asynchronous operation that, when completed, returns the response to the command that was transmitted. */ - transmitAsync(command: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + transmitAsync(command: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Specifies the rules for characters in a smart card personal identification number (PIN). */ enum SmartCardPinCharacterPolicyOption { @@ -21726,7 +21726,7 @@ declare namespace Windows { /** Represents a smart card personal identification number (PIN) reset request. */ abstract class SmartCardPinResetRequest { /** Gets the smart card's challenge value. */ - challenge: Windows.Storage.Streams.Buffer; + challenge: Windows.Storage.Streams.IBuffer; /** Gets the length of time to wait before requesting the smart card personal identification number (PIN) reset. */ deadline: Date; /** @@ -21738,7 +21738,7 @@ declare namespace Windows { * Sets the response to a smart card authentication challenge/response operation. * @param response The response to a smart card authentication challenge/response operation. */ - setResponse(response: Windows.Storage.Streams.Buffer): void; + setResponse(response: Windows.Storage.Streams.IBuffer): void; } /** Represents info about, and operations for, configuring smart cards. */ abstract class SmartCardProvisioning { @@ -21757,7 +21757,7 @@ declare namespace Windows { * @param cardId The smart card's ID. * @return After the operation completes, returns an instance of SmartCardProvisioning , representing the configured TPM virtual smart card. */ - static requestVirtualSmartCardCreationAsync(friendlyName: string, administrativeKey: Windows.Storage.Streams.Buffer, pinPolicy: Windows.Devices.SmartCards.SmartCardPinPolicy, cardId: string): Windows.Foundation.IPromiseWithIAsyncOperation; + static requestVirtualSmartCardCreationAsync(friendlyName: string, administrativeKey: Windows.Storage.Streams.IBuffer, pinPolicy: Windows.Devices.SmartCards.SmartCardPinPolicy, cardId: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a Trusted Platform Module (TPM) virtual smart card with a given human-readable name, admin key, and personal identification number (PIN) rules set. * @param friendlyName The smart card's human-readable name. @@ -21765,7 +21765,7 @@ declare namespace Windows { * @param pinPolicy The smart card's PIN rules set. * @return After the operation completes, returns an instance of SmartCardProvisioning , representing the configured TPM virtual smart card. */ - static requestVirtualSmartCardCreationAsync(friendlyName: string, administrativeKey: Windows.Storage.Streams.Buffer, pinPolicy: Windows.Devices.SmartCards.SmartCardPinPolicy): Windows.Foundation.IPromiseWithIAsyncOperation; + static requestVirtualSmartCardCreationAsync(friendlyName: string, administrativeKey: Windows.Storage.Streams.IBuffer, pinPolicy: Windows.Devices.SmartCards.SmartCardPinPolicy): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Deletes a Trusted Platform Module (TPM) virtual smart card. * @param card The TPM virtual smart card to delete. @@ -22015,7 +22015,7 @@ declare namespace Windows { /** Constructor. Used to create an SmsAppMessage prior to sending it. */ constructor(); /** Reads or writes the binary part of the Application message. */ - binaryBody: Windows.Storage.Streams.Buffer; + binaryBody: Windows.Storage.Streams.IBuffer; /** The plain text body of the message. */ body: string; /** The number to be dialed in reply to a received SMS message. */ @@ -22619,7 +22619,7 @@ declare namespace Windows { * @param format A value from the SmsDataFormat enumeration. * @return The new binary message that holds the result of this method call. */ - toBinaryMessages(format: Windows.Devices.Sms.SmsDataFormat): Windows.Foundation.Collections.IVectorView; + toBinaryMessages(format: Windows.Devices.Sms.SmsDataFormat): Windows.Foundation.Collections.IVectorView; } /** Encapsulates a decoded SMS text message. Prefer this class to the older SmsTextMessage class. */ class SmsTextMessage2 { @@ -22682,7 +22682,7 @@ declare namespace Windows { /** Gets the value of the X-Wap-Application-Id header of the SmsWapMessage . */ applicationId: string; /** Gets the binary body of the blob in the SmsWapMessage . */ - binaryBody: Windows.Storage.Streams.Buffer; + binaryBody: Windows.Storage.Streams.IBuffer; /** Gets the cellular class of the SMS device that received the message. */ cellularClass: Windows.Devices.Sms.CellularClass; /** Gets the value of the Content-Type header in the SmsWapMessage . Parameters are presents in the Headers property. */ @@ -23035,7 +23035,7 @@ declare namespace Windows { * Reads descriptor data in the caller-supplied buffer. * @param buffer A caller-supplied buffer that receives descriptor data. */ - readDescriptorBuffer(buffer: Windows.Storage.Streams.Buffer): void; + readDescriptorBuffer(buffer: Windows.Storage.Streams.IBuffer): void; } /** Represents a USB device. The object provides methods and properties that an app can use to find the device (in the system) with which the app wants to communicate, and sends IN and OUT control transfers to the device. */ abstract class UsbDevice { @@ -23086,13 +23086,13 @@ declare namespace Windows { * @param buffer A caller-supplied buffer that contains transfer data. * @return Returns an IAsyncOperation(IBuffer) object that returns the results of the operation. */ - sendControlInTransferAsync(setupPacket: Windows.Devices.Usb.UsbSetupPacket, buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + sendControlInTransferAsync(setupPacket: Windows.Devices.Usb.UsbSetupPacket, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Starts a zero-length USB control transfer that reads from the default control endpoint of the device. * @param setupPacket A UsbSetupPacket object that contains the setup packet for the control transfer. * @return Returns an IAsyncOperation(IBuffer) object that returns the results of the operation. */ - sendControlInTransferAsync(setupPacket: Windows.Devices.Usb.UsbSetupPacket): Windows.Foundation.IPromiseWithIAsyncOperation; + sendControlInTransferAsync(setupPacket: Windows.Devices.Usb.UsbSetupPacket): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Starts a zero-length USB control transfer that writes to the default control endpoint of the device. * @param setupPacket A UsbSetupPacket object that contains the setup packet for the control transfer. @@ -23105,7 +23105,7 @@ declare namespace Windows { * @param buffer A caller-supplied buffer that contains the transfer data. * @return Returns an IAsyncOperation(UInt32) object that returns the results of the operation. */ - sendControlOutTransferAsync(setupPacket: Windows.Devices.Usb.UsbSetupPacket, buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + sendControlOutTransferAsync(setupPacket: Windows.Devices.Usb.UsbSetupPacket, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Provides a way for the app to get an Advanced Query Syntax (AQS) string by specifying the class code, subclass code, and the protocol code defined by the device. The properties in this class are passed in the call to GetDeviceClassSelector . */ class UsbDeviceClass { @@ -23272,7 +23272,7 @@ declare namespace Windows { /** Represents the object that is passed as a parameter to the event handler for the DataReceived event. */ abstract class UsbInterruptInEventArgs { /** Gets data from the interrupt IN endpoint. */ - interruptData: Windows.Storage.Streams.Buffer; + interruptData: Windows.Storage.Streams.IBuffer; } /** Represents the pipe that the underlying USB driver opens to communicate with a USB interrupt IN endpoint of the device. The object also enables the app to specify an event handler. That handler that gets invoked when data is read from the endpoint. */ abstract class UsbInterruptInPipe { @@ -23336,7 +23336,7 @@ declare namespace Windows { * Creates a UsbSetupPacket object from a formatted buffer (eight bytes) that contains the setup packet. * @param eightByteBuffer A caller-supplied buffer that contains the setup packet formatted as per the standard USB specification. The length of the buffer must be eight bytes because that is the size of a setup packet on the bus. */ - constructor(eightByteBuffer: Windows.Storage.Streams.Buffer); + constructor(eightByteBuffer: Windows.Storage.Streams.IBuffer); /** Gets or sets the wIndex field in the setup packet of the USB control transfer. */ index: number; /** Gets the length, in bytes, of the setup packet. */ @@ -23560,7 +23560,7 @@ declare namespace Windows { * @param serviceInfoFilter A byte sequence that must be found in the advertiser's service information blob. * @return The AQS string for the requested advertiser query. */ - static getSelector(serviceName: string, serviceInfoFilter: Windows.Storage.Streams.Buffer): string; + static getSelector(serviceName: string, serviceInfoFilter: Windows.Storage.Streams.IBuffer): string; /** * Initiates the establishment of a service session with the Wi-Fi Direct Service represented by this instance. * @return An asynchronous connection operation. When successfully completed, returns an object that represents the session that has been established. @@ -23585,11 +23585,11 @@ declare namespace Windows { /** Gets or sets a value specifying whether the service instance should choose Wi-Fi Direct Point to Point (P2P) Group Owner (GO) mode. */ preferGroupOwnerMode: boolean; /** Gets the service information blob from this service instance. */ - remoteServiceInfo: Windows.Storage.Streams.Buffer; + remoteServiceInfo: Windows.Storage.Streams.IBuffer; /** Error information about the latest attempt to connect to the service. */ serviceError: Windows.Devices.WiFiDirect.Services.WiFiDirectServiceError; /** Gets or sets app-specific session information passed to the server when initiating a session. */ - sessionInfo: Windows.Storage.Streams.Buffer; + sessionInfo: Windows.Storage.Streams.IBuffer; /** Gets a list of supported configuration methods, ordered by preference. Your code uses IVector operations to modify the contents of the list. */ supportedConfigurationMethods: Windows.Foundation.Collections.IVectorView; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; @@ -23633,7 +23633,7 @@ declare namespace Windows { /** Gets or sets a custom service status code. Only valid if the ServiceStatus property value is Custom. */ customServiceStatusCode: number; /** Gets or sets the service-specific information that is passed to a session requester when establishing a session will not be completed immediately, as when, for example, the service is waiting for user input to complete the request. A requester should implement a 120 second timeout when its request is deferred. */ - deferredSessionInfo: Windows.Storage.Streams.Buffer; + deferredSessionInfo: Windows.Storage.Streams.IBuffer; /** Event raised when the AdvertisementStatus property value changes. */ onadvertisementstatuschanged: Windows.Foundation.TypedEventHandler; addEventListener(type: "advertisementstatuschanged", listener: Windows.Foundation.TypedEventHandler): void; @@ -23653,7 +23653,7 @@ declare namespace Windows { /** Gets a specific error code when AdvertisementStatus is Aborted. */ serviceError: Windows.Devices.WiFiDirect.Services.WiFiDirectServiceError; /** Gets or sets the service information blob. The format and contents of the blob are determined by the individual service, and are intended to be used by Seekers during service discovery. */ - serviceInfo: Windows.Storage.Streams.Buffer; + serviceInfo: Windows.Storage.Streams.IBuffer; /** Gets the service name. */ serviceName: string; /** Gets a list of service name prefixes that should match this service when a seeker is using prefix searching. Your code uses IVector methods to add or remove elements from the list. */ @@ -23672,7 +23672,7 @@ declare namespace Windows { /** Gets the WiFiDirectServiceSession that was created when the connection was automatically accepted. */ session: Windows.Devices.WiFiDirect.Services.WiFiDirectServiceSession; /** Gets the session information buffer that corresponds to this automatically accepted connection. */ - sessionInfo: Windows.Storage.Streams.Buffer; + sessionInfo: Windows.Storage.Streams.IBuffer; } /** Values describing how service configuration is performed when a session is being established. Typically, either no input is required, or one device in the session displays a PIN and the other device requires that the PIN be entered. */ enum WiFiDirectServiceConfigurationMethod { @@ -23766,7 +23766,7 @@ declare namespace Windows { /** Returned when a WiFiDirectService.SessionDeferred event is raised. */ abstract class WiFiDirectServiceSessionDeferredEventArgs { /** Gets the service-defined session information returned by the service when it sends a deferral in response to a connection request. Note that a deferral does not indicate that the connection is refused. Rather, it indicates that the server is performing a time-consuming operation such as requesting user input. A seeker should implement a 120-second timeout after getting a deferral before giving up on the request. */ - deferredSessionInfo: Windows.Storage.Streams.Buffer; + deferredSessionInfo: Windows.Storage.Streams.IBuffer; } /** Values used in the WiFiDirectServiceSession.ErrorStatus property. */ enum WiFiDirectServiceSessionErrorStatus { @@ -23792,7 +23792,7 @@ declare namespace Windows { /** Gets information about how provisioning should be performed if the session is established. */ provisioningInfo: Windows.Devices.WiFiDirect.Services.WiFiDirectServiceProvisioningInfo; /** Gets the session information blob associated with this request. */ - sessionInfo: Windows.Storage.Streams.Buffer; + sessionInfo: Windows.Storage.Streams.IBuffer; } /** Returned when a WiFiDirectServiceAdvertiser.SessionRequested event is raised. */ abstract class WiFiDirectServiceSessionRequestedEventArgs { @@ -24008,7 +24008,7 @@ declare namespace Windows { * @param buffer The data buffer that contains a information element. * @return A array of information elements created from the buffer. */ - static createFromBuffer(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.Collections.IVector; + static createFromBuffer(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.Collections.IVector; /** * Create an array of information elements from a DeviceInformation object. * @param deviceInformation The device information object that contains the information elements. @@ -24018,11 +24018,11 @@ declare namespace Windows { /** Creates a new WiFiDirectInformationElement object. */ constructor(); /** A three-byte organization identifier used to indicate the organization which defined a vendor extension information element (IE). */ - oui: Windows.Storage.Streams.Buffer; + oui: Windows.Storage.Streams.IBuffer; /** A one byte type value used in a vendor extension information element (IE) to distinguish between different IE formats defined by the same organization. */ ouiType: number; /** The value of the information element. */ - value: Windows.Storage.Streams.Buffer; + value: Windows.Storage.Streams.IBuffer; } /** Settings governing "legacy" mode (non-Wi-Fi Direct connections to the access point being advertised.) */ abstract class WiFiDirectLegacySettings { @@ -24569,12 +24569,12 @@ declare namespace Windows { * @param loggingChannel The logging channel to add. * @param maxLevel The minimum logging level that an event must have to be accepted by the session. */ - addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel, maxLevel: Windows.Foundation.Diagnostics.LoggingLevel): void; + addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel, maxLevel: Windows.Foundation.Diagnostics.LoggingLevel): void; /** * Adds a logging channel to the current logging session. * @param loggingChannel The logging channel to add. */ - addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel): void; + addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel): void; /** Ends the current logging session. */ close(): void; /** @@ -24585,14 +24585,14 @@ declare namespace Windows { /** Gets the name of the logging session. */ name: string; /** Raised when a log file is saved. */ - onlogfilegenerated: Windows.Foundation.TypedEventHandler; - addEventListener(type: "logfilegenerated", listener: Windows.Foundation.TypedEventHandler): void; - removeEventListener(type: "logfilegenerated", listener: Windows.Foundation.TypedEventHandler): void; + onlogfilegenerated: Windows.Foundation.TypedEventHandler; + addEventListener(type: "logfilegenerated", listener: Windows.Foundation.TypedEventHandler): void; + removeEventListener(type: "logfilegenerated", listener: Windows.Foundation.TypedEventHandler): void; /** * Removes the specified logging channel from the current logging session. * @param loggingChannel The logging channel to remove. */ - removeLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel): void; + removeLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel): void; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -24609,13 +24609,13 @@ declare namespace Windows { * @param loggingChannel The logging channel. * @param level The logging level. */ - constructor(activityName: string, loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel, level: Windows.Foundation.Diagnostics.LoggingLevel); + constructor(activityName: string, loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel, level: Windows.Foundation.Diagnostics.LoggingLevel); /** * Initializes a new instance of the LoggingActivity class for the specified LoggingChannel in Windows 8.1 compatibility mode. * @param activityName The name of the logging activity. * @param loggingChannel The logging channel. */ - constructor(activityName: string, loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel); + constructor(activityName: string, loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel); /** Returns the channel associated with this activity. */ channel: Windows.Foundation.Diagnostics.LoggingChannel; /** Ends the current logging activity. */ @@ -24816,9 +24816,9 @@ declare namespace Windows { /** Gets the name of the current LoggingChannel . */ name: string; /** Raised when the logging channel is attached to a LoggingSession or other event tracing and debugging tools. */ - onloggingenabled: Windows.Foundation.TypedEventHandler; - addEventListener(type: "loggingenabled", listener: Windows.Foundation.TypedEventHandler): void; - removeEventListener(type: "loggingenabled", listener: Windows.Foundation.TypedEventHandler): void; + onloggingenabled: Windows.Foundation.TypedEventHandler; + addEventListener(type: "loggingenabled", listener: Windows.Foundation.TypedEventHandler): void; + removeEventListener(type: "loggingenabled", listener: Windows.Foundation.TypedEventHandler): void; /** * Writes an activity start event with the specified fields and level, and creates a LoggingActivity object. * @param startEventName The name for this event. @@ -25763,12 +25763,12 @@ declare namespace Windows { * @param loggingChannel The logging channel to add. * @param maxLevel The logging level for loggingChannel. */ - addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel, maxLevel: Windows.Foundation.Diagnostics.LoggingLevel): void; + addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel, maxLevel: Windows.Foundation.Diagnostics.LoggingLevel): void; /** * Adds a logging channel to the current logging session. * @param loggingChannel The logging channel to add. */ - addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel): void; + addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel): void; /** Ends the current logging session. */ close(): void; /** Gets the name of the logging session. */ @@ -25777,14 +25777,14 @@ declare namespace Windows { * Removes the specified logging channel from the current logging session. * @param loggingChannel The logging channel to remove. */ - removeLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel): void; + removeLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel): void; /** * Saves the current logging session to a file. * @param folder The folder that contains the log file. * @param fileName The name of the log file. * @return When this method completes, it returns the new file as a StorageFile . */ - saveToFileAsync(folder: Windows.Storage.StorageFolder, fileName: string): Windows.Foundation.IPromiseWithIAsyncOperation; + saveToFileAsync(folder: Windows.Storage.IStorageFolder, fileName: string): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Represents diagnostic error reporting settings. */ class RuntimeBrokerErrorSettings { @@ -25848,12 +25848,12 @@ declare namespace Windows { * @param loggingChannel The logging channel to add. * @param maxLevel The logging level for loggingChannel. */ - addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel, maxLevel: Windows.Foundation.Diagnostics.LoggingLevel): void; + addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel, maxLevel: Windows.Foundation.Diagnostics.LoggingLevel): void; /** * Adds a logging channel to the current logging session. * @param loggingChannel The logging channel to add. */ - addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel): void; + addLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel): void; /** * Ends the current logging session and saves it to a file. * @return When this method completes, it returns the new file as a StorageFile . @@ -25863,7 +25863,7 @@ declare namespace Windows { * Removes the specified logging channel from the current logging session. * @param loggingChannel The logging channel to remove. */ - removeLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.LoggingChannel): void; + removeLoggingChannel(loggingChannel: Windows.Foundation.Diagnostics.ILoggingChannel): void; /** Gets the name of the logging session. */ name: string; } @@ -26374,7 +26374,7 @@ declare namespace Windows { userName: string; } /** Parses a URL query string, and exposes the results as a read-only vector (list) of name-value pairs from the query string. */ - class WwwFormUrlDecoder extends Array { + class WwwFormUrlDecoder extends Array { /** * Creates and initializes a new instance of the WwwFormUrlDecoder class. * @param query The URL to parse. @@ -26384,13 +26384,13 @@ declare namespace Windows { * Gets an iterator that represents the first name-value pair in the current URL query string. * @return The first name-value pair. */ - first(): Windows.Foundation.Collections.IIterator; + first(): Windows.Foundation.Collections.IIterator; /** * Gets the name-value pair at the specified index in the current URL query string. * @param index The index of the name-value pair. * @return The name-value pair at the position specified by index. */ - getAt(index: number): Windows.Foundation.WwwFormUrlDecoderEntry; + getAt(index: number): Windows.Foundation.IWwwFormUrlDecoderEntry; /** * Gets the first name-value pair that has the specified name, as obtained from the constructing Uniform Resource Identifier (URI) query string. * @param name The name of the value to get. @@ -26402,17 +26402,17 @@ declare namespace Windows { * @param startIndex The index to start getting name-value pairs at. * @return */ - getMany(startIndex: number): { /** The name-value pairs. */ items: Windows.Foundation.WwwFormUrlDecoderEntry; /** The number of name-value pairs in items. */ returnValue: number; }; + getMany(startIndex: number): { /** The name-value pairs. */ items: Windows.Foundation.IWwwFormUrlDecoderEntry; /** The number of name-value pairs in items. */ returnValue: number; }; /** * Gets a value indicating whether the specified IWwwFormUrlDecoderEntry is at the specified index in the current URL query string. * @param value The name-value pair to get the index of. * @return */ - indexOf(value: Windows.Foundation.WwwFormUrlDecoderEntry): { /** The position in value. */ index: number; /** true if value is at the position specified by index; otherwise, false. */ returnValue: boolean; }; + indexOf(value: Windows.Foundation.IWwwFormUrlDecoderEntry): { /** The position in value. */ index: number; /** true if value is at the position specified by index; otherwise, false. */ returnValue: boolean; }; /** Gets the number of the name-value pairs in the current URL query string. */ size: number; - indexOf(value: Windows.Foundation.WwwFormUrlDecoderEntry, ...extra: any[]): { index: number; returnValue: boolean; } /* hack */ - indexOf(searchElement: Windows.Foundation.WwwFormUrlDecoderEntry, fromIndex?: number): number; /* hack */ + indexOf(value: Windows.Foundation.IWwwFormUrlDecoderEntry, ...extra: any[]): { index: number; returnValue: boolean; } /* hack */ + indexOf(searchElement: Windows.Foundation.IWwwFormUrlDecoderEntry, fromIndex?: number): number; /* hack */ } /** Represents a name-value pair in a URL query string. Use the IWwwFormUrlDecoderEntry interface instead; see Remarks. */ abstract class WwwFormUrlDecoderEntry { @@ -26716,7 +26716,7 @@ declare namespace Windows { /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ status: Windows.Gaming.XboxLive.Storage.GameSaveErrorStatus; /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - value: Windows.Foundation.Collections.IMapView; + value: Windows.Foundation.Collections.IMapView; } /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ abstract class GameSaveBlobInfo { @@ -26775,7 +26775,7 @@ declare namespace Windows { * @param blobsToRead This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @return This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - readAsync(blobsToRead: Windows.Foundation.Collections.IMapView): Windows.Foundation.IPromiseWithIAsyncOperation; + readAsync(blobsToRead: Windows.Foundation.Collections.IMapView): Windows.Foundation.IPromiseWithIAsyncOperation; /** * This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @param blobsToWrite This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. @@ -26783,7 +26783,7 @@ declare namespace Windows { * @param displayName This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @return This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - submitPropertySetUpdatesAsync(blobsToWrite: Windows.Foundation.Collections.PropertySet, blobsToDelete: Windows.Foundation.Collections.IIterable, displayName: string): Windows.Foundation.IPromiseWithIAsyncOperation; + submitPropertySetUpdatesAsync(blobsToWrite: Windows.Foundation.Collections.IPropertySet, blobsToDelete: Windows.Foundation.Collections.IIterable, displayName: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @param blobsToWrite This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. @@ -26791,7 +26791,7 @@ declare namespace Windows { * @param displayName This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @return This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - submitUpdatesAsync(blobsToWrite: Windows.Foundation.Collections.IMapView, blobsToDelete: Windows.Foundation.Collections.IIterable, displayName: string): Windows.Foundation.IPromiseWithIAsyncOperation; + submitUpdatesAsync(blobsToWrite: Windows.Foundation.Collections.IMapView, blobsToDelete: Windows.Foundation.Collections.IIterable, displayName: string): Windows.Foundation.IPromiseWithIAsyncOperation; } /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ abstract class GameSaveContainerInfo { @@ -28930,7 +28930,7 @@ declare namespace Windows { * Asynchronously gets the default International Color Consortium (ICC) color profile that is associated with the physical display. * @return Object that manages the asynchronous retrieval of the color profile. */ - getColorProfileAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + getColorProfileAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the pixels per logical inch of the current environment. */ logicalDpi: number; /** Gets the native orientation of the display monitor, which is typically the orientation where the buttons on the device match the orientation of the monitor. */ @@ -28984,7 +28984,7 @@ declare namespace Windows { * * @return Object that manages the asynchronous retrieval of the color profile. */ - static getColorProfileAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + static getColorProfileAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; static logicalDpi: number; static nativeOrientation: Windows.Graphics.Display.DisplayOrientations; static oncolorprofilechanged: Windows.Graphics.Display.DisplayPropertiesEventHandler; @@ -29174,14 +29174,14 @@ declare namespace Windows { * @param stream The stream containing the image file to be decoded. * @return An object that manages the asynchronous creation of a new BitmapDecoder . */ - static createAsync(stream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static createAsync(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously creates a new BitmapDecoder using a specific bitmap codec and initializes it using a stream. * @param decoderId The unique identifier of the specified bitmap codec. * @param stream The stream containing the image file to be decoded. * @return An object that manages the asynchronous creation of a new BitmapDecoder . */ - static createAsync(decoderId: string, stream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static createAsync(decoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** * The bitmap decoders installed on the system and information about them. * @return A list of BitmapCodecInformation objects containing information about each decoder. @@ -29288,14 +29288,14 @@ declare namespace Windows { * @param encodingOptions A collection of key-value pairs containing one or more codec-specific encoding options and the desired values. * @return An object that manages the asynchronous creation of a new BitmapEncoder . */ - static createAsync(encoderId: string, stream: Windows.Storage.Streams.RandomAccessStream, encodingOptions: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IPromiseWithIAsyncOperation; + static createAsync(encoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream, encodingOptions: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously creates a new BitmapEncoder . * @param encoderId The unique identifier of the specified encoder. * @param stream The output stream. * @return An object that manages the asynchronous creation of a new BitmapEncoder . */ - static createAsync(encoderId: string, stream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static createAsync(encoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously creates a new BitmapEncoder for in-place property and metadata editing. The new encoder can only edit bitmap properties in-place and will fail for any other uses. * @param bitmapDecoder A BitmapDecoder containing the image data to be edited. This parameter must be created on a stream with an access mode of ReadWrite . @@ -29308,7 +29308,7 @@ declare namespace Windows { * @param bitmapDecoder A BitmapDecoder containing the image data to be copied. * @return An object that manages the asynchronous creation of a new BitmapEncoder using data from an existing BitmapDecoder . */ - static createForTranscodingAsync(stream: Windows.Storage.Streams.RandomAccessStream, bitmapDecoder: Windows.Graphics.Imaging.BitmapDecoder): Windows.Foundation.IPromiseWithIAsyncOperation; + static createForTranscodingAsync(stream: Windows.Storage.Streams.IRandomAccessStream, bitmapDecoder: Windows.Graphics.Imaging.BitmapDecoder): Windows.Foundation.IPromiseWithIAsyncOperation; /** * A list of the bitmap encoders installed on the system and information about them. * @return A list of BitmapCodecInformation objects containing information about each encoder. @@ -29611,7 +29611,7 @@ declare namespace Windows { * Returns the file stream for the ImageStream . * @return The file stream for the image. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Closes the ImageStream . */ close(): void; /** Returns the data format of the stream. */ @@ -29642,7 +29642,7 @@ declare namespace Windows { * @param options The options for the stream to be read. * @return The byte reader operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Sets the position of the stream to the specified value. * @param position The new position of the stream. @@ -29655,7 +29655,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Specifies which chroma subsampling mode will be used for image compression in JPEG images. */ enum JpegSubsamplingMode { @@ -29724,7 +29724,7 @@ declare namespace Windows { * @param height The height of the software bitmap, in pixels. * @return The new software bitmap. */ - static createCopyFromBuffer(source: Windows.Storage.Streams.Buffer, format: Windows.Graphics.Imaging.BitmapPixelFormat, width: number, height: number): Windows.Graphics.Imaging.SoftwareBitmap; + static createCopyFromBuffer(source: Windows.Storage.Streams.IBuffer, format: Windows.Graphics.Imaging.BitmapPixelFormat, width: number, height: number): Windows.Graphics.Imaging.SoftwareBitmap; /** * Creates a new SoftwareBitmap by performing a deep copy of the provided buffer. Modifications to the data in the new SoftwareBitmap will not effect the buffer from which it was created. * @param source The source buffer from which the copy will be created. @@ -29734,7 +29734,7 @@ declare namespace Windows { * @param alpha The alpha mode of the software bitmap. * @return The new software bitmap. */ - static createCopyFromBuffer(source: Windows.Storage.Streams.Buffer, format: Windows.Graphics.Imaging.BitmapPixelFormat, width: number, height: number, alpha: Windows.Graphics.Imaging.BitmapAlphaMode): Windows.Graphics.Imaging.SoftwareBitmap; + static createCopyFromBuffer(source: Windows.Storage.Streams.IBuffer, format: Windows.Graphics.Imaging.BitmapPixelFormat, width: number, height: number, alpha: Windows.Graphics.Imaging.BitmapAlphaMode): Windows.Graphics.Imaging.SoftwareBitmap; /** * Asynchronously creates a new SoftwareBitmap by performing a deep copy of the provided IDirect3DSurface . Modifications to the data in the new SoftwareBitmap will not effect the surface from which it was created. * @param surface The source surface from which the copy will be created. @@ -29773,7 +29773,7 @@ declare namespace Windows { * Copies the pixel data from an IBuffer into the SoftwareBitmap . * @param buffer The buffer containing the pixel data to be copied. */ - copyFromBuffer(buffer: Windows.Storage.Streams.Buffer): void; + copyFromBuffer(buffer: Windows.Storage.Streams.IBuffer): void; /** * Copies the current SoftwareBitmap into the provided SoftwareBitmap object. * @param bitmap The target software bitmap into which the data will be copied. @@ -29783,7 +29783,7 @@ declare namespace Windows { * Copies the software bitmap pixel data into the specified IBuffer . * @param buffer The target buffer to which the pixel data will be copied. */ - copyToBuffer(buffer: Windows.Storage.Streams.Buffer): void; + copyToBuffer(buffer: Windows.Storage.Streams.IBuffer): void; /** Gets or sets the dots per inch of the software bitmap in the X direction. */ dpiX: number; /** Gets or sets the dots per inch of the software bitmap in the Y direction. */ @@ -31137,7 +31137,7 @@ declare namespace Windows { * @param value A 3MF file stream. * @return A Printing3D3MFPackage created from the specified 3MF package stream. */ - static loadAsync(value: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadAsync(value: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** Creates a Printing3D3MFPackage object. */ constructor(); /** @@ -31145,16 +31145,16 @@ declare namespace Windows { * @param value A 3MF file stream. * @return A Printing3DModel object created from the specified 3MF object stream. */ - loadModelFromPackageAsync(value: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + loadModelFromPackageAsync(value: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets or sets an XML stream to the 3D model in the 3D Manufacturing Format (3MF) package. */ - modelPart: Windows.Storage.Streams.RandomAccessStream; + modelPart: Windows.Storage.Streams.IRandomAccessStream; /** Gets or sets a stream to the print ticket in the 3D Manufacturing Format (3MF) package. */ - printTicket: Windows.Storage.Streams.RandomAccessStream; + printTicket: Windows.Storage.Streams.IRandomAccessStream; /** * Saves the Printing3D3MFPackage object to a 3D Manufacturing Format (3MF) file stream. * @return A stream to the 3MF file where the package is to be saved. */ - saveAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + saveAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Saves the specified 3D model to the 3D Manufacturing Format (3MF) package. * @param value The 3D model to be saved to the 3MF package. @@ -31296,9 +31296,9 @@ declare namespace Windows { /** Creates an instance of the Printing3DMesh class. */ constructor(); /** Gets a set of mesh buffer descriptions. */ - bufferDescriptionSet: Windows.Foundation.Collections.PropertySet; + bufferDescriptionSet: Windows.Foundation.Collections.IPropertySet; /** Gets a set of mesh buffers. */ - bufferSet: Windows.Foundation.Collections.PropertySet; + bufferSet: Windows.Foundation.Collections.IPropertySet; /** * Creates the buffer for triangle indices. * @param value The capacity of the buffer, the maximum number of bytes that the IBuffer can hold. @@ -31323,22 +31323,22 @@ declare namespace Windows { * Gets the buffer for triangle indices. * @return The buffer for triangle indices. */ - getTriangleIndices(): Windows.Storage.Streams.Buffer; + getTriangleIndices(): Windows.Storage.Streams.IBuffer; /** * Gets the buffer for triangle material indices. * @return The buffer for triangle material indices. */ - getTriangleMaterialIndices(): Windows.Storage.Streams.Buffer; + getTriangleMaterialIndices(): Windows.Storage.Streams.IBuffer; /** * Gets the buffer for vertex normals. * @return The buffer for vertex normals. */ - getVertexNormals(): Windows.Storage.Streams.Buffer; + getVertexNormals(): Windows.Storage.Streams.IBuffer; /** * Gets the buffer for vertex positions. * @return The buffer for vertex positions. */ - getVertexPositions(): Windows.Storage.Streams.Buffer; + getVertexPositions(): Windows.Storage.Streams.IBuffer; /** Gets or sets the number of triangle indices. */ indexCount: number; /** Gets or sets the buffer description for triangle indices. */ @@ -31818,14 +31818,14 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the list of effect definitions for the audio device input node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the encoding properties for the audio device input node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** Gets the list of outgoing connections from the audio device input node to other nodes in the audio graph. */ @@ -31869,14 +31869,14 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the list of effect definitions for the audio device output node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the encoding properties for the audio device output node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** Gets or sets the outgoing gain for the audio device output node. */ @@ -31909,16 +31909,16 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the duration for the audio input file. */ duration: number; /** Gets the list of effect definitions for the audio file input node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the encoding properties for the audio file input node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** Gets or sets the end time for the audio file input node. */ @@ -31983,18 +31983,18 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the list of effect definitions for the audio file output node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the encoding properties for the audio file output node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** Gets the file associated with the audio file output node. */ - file: Windows.Storage.StorageFile; + file: Windows.Storage.IStorageFile; /** Gets the file encoding profile supported by the audio file output node. */ fileEncodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile; /** @@ -32042,16 +32042,16 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Removes queued frames from the audio frame input node. */ discardQueuedFrames(): void; /** Gets the list of effect definitions for the audio frame input node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the encoding properties for the audio frame input node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** Notifies of a completed audio frame that has been submitted to the graph with a call to AddFrame . */ @@ -32094,14 +32094,14 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the list of effect definitions for the audio frame output node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the encoding properties for the audio frame output node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** @@ -32161,20 +32161,20 @@ declare namespace Windows { * @param file A IStorageFile object representing the file associated with the file input node. * @return When this operation completes, a CreateAudioFileInputNodeResult object is returned. */ - createFileInputNodeAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + createFileInputNodeAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a file output node for the indicated file. * @param file A StorageFile object representing the file. * @return When this operation completes, a CreateAudioFileOutputNodeResult object is returned. */ - createFileOutputNodeAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + createFileOutputNodeAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a file output node for the indicated file and media encoding profile. * @param file A StorageFile object representing the file. * @param fileEncodingProfile An objecting representing the media encoding profile. * @return When this operation completes, a CreateAudioFileOutputNodeResult object is returned. */ - createFileOutputNodeAsync(file: Windows.Storage.StorageFile, fileEncodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; + createFileOutputNodeAsync(file: Windows.Storage.IStorageFile, fileEncodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates an audio frame input node from encoding properties. * @param encodingProperties An object representing encoding properties. @@ -32314,14 +32314,14 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the list of effect definitions for the audio submix node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Gets the encoding properties for the audio device submix node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** Gets outgoing connections from the audio submix node to other nodes in the audio graph. */ @@ -32389,7 +32389,7 @@ declare namespace Windows { /** Gets or sets the feedback included in the echo effect definition. */ feedback: number; /** Gets or sets the properties supported by the echo effect definition. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets the wet-dry audio voice mix for the echo effect definition. */ wetDryMix: number; } @@ -32414,7 +32414,7 @@ declare namespace Windows { /** Gets the bands included in the equalizer effect definition. */ bands: Windows.Foundation.Collections.IVectorView; /** Gets the properties supported by the equalizer effect definition. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Provides data for the AudioFrameInputNode::QuantumStarted event. This event is raised when the audio graph containing the audio frame input node is ready to begin processing a new quantum of data. */ abstract class FrameInputNodeQuantumStartedEventArgs { @@ -32433,7 +32433,7 @@ declare namespace Windows { /** Gets or sets the loudness included in the limiter effect definition. */ loudness: number; /** Gets the properties supported by the limiter effect definition. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets the release included in the limiter effect definition. */ release: number; } @@ -32482,7 +32482,7 @@ declare namespace Windows { /** Gets or sets the position right included in the reverberation effect definition. */ positionRight: number; /** Gets the properties supported by the reverberation effect definition. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets the rear delay included in the reverberation effect definition. */ rearDelay: number; /** Gets or sets the reflections delay included in the reverberation effect definition. */ @@ -32514,12 +32514,12 @@ declare namespace Windows { * Disables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to disable. */ - disableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + disableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** * Enables all effects in the EffectDefinitions list with the specified effect definition. * @param definition The effect definition of the effects to enable. */ - enableEffectsByDefinition(definition: Windows.Media.Effects.AudioEffectDefinition): void; + enableEffectsByDefinition(definition: Windows.Media.Effects.IAudioEffectDefinition): void; /** Resets the audio node. */ reset(): void; /** Starts the audio node. */ @@ -32529,7 +32529,7 @@ declare namespace Windows { /** Gets or sets a value indicating if the audio node consumes input. */ consumeInput: boolean; /** Gets the list of effect definitions for the audio node. */ - effectDefinitions: Windows.Foundation.Collections.IVector; + effectDefinitions: Windows.Foundation.Collections.IVector; /** Gets the encoding properties for the audio node. */ encodingProperties: Windows.Media.MediaProperties.AudioEncodingProperties; /** Gets or sets the outgoing gain for the audio node. */ @@ -32571,7 +32571,7 @@ declare namespace Windows { /** Gets or sets the duration of the audio frame. */ duration: number; /** Gets the extended property set which enables getting and setting properties on the AudioFrame . */ - extendedProperties: Windows.Foundation.Collections.PropertySet; + extendedProperties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets a value that indicates whether an audio frame is the first frame after a gap in the stream. */ isDiscontinuous: boolean; /** Gets a value indicating whether the audio frame is read-only. */ @@ -32867,7 +32867,7 @@ declare namespace Windows { * Creates a copy of the stream. * @return The clone of the strem. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Closes the captured framed object. */ close(): void; /** Gets the content type of the captured frame. */ @@ -32900,7 +32900,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Seeks the stream to the specified position. * @param position The position in the stream to seek too. @@ -32917,7 +32917,7 @@ declare namespace Windows { * @param buffer The data to write to the stream. * @return Represents an asynchronous operation that returns a result and reports progress. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Provides information about the capture device settings that were used for a frame in a variable photo sequence. */ abstract class CapturedFrameControlValues { @@ -33117,7 +33117,7 @@ declare namespace Windows { * @param definition The object containing the definition of the effect to be added. * @return An asynchronous operation that returns an IMediaExtension upon successful completion. */ - addAudioEffectAsync(definition: Windows.Media.Effects.AudioEffectDefinition): Windows.Foundation.IPromiseWithIAsyncOperation; + addAudioEffectAsync(definition: Windows.Media.Effects.IAudioEffectDefinition): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Adds an audio or video effect. * @param mediaStreamType Specifies the streams to which the effect will be applied. @@ -33125,14 +33125,14 @@ declare namespace Windows { * @param effectSettings Configuration parameters for the effect. * @return Returns an IAsyncAction object that is used to control the asynchronous operation. */ - addEffectAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType, effectActivationID: string, effectSettings: Windows.Foundation.Collections.PropertySet): Windows.Foundation.IPromiseWithIAsyncAction; + addEffectAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType, effectActivationID: string, effectSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IPromiseWithIAsyncAction; /** * Adds a video effect to the capture pipeline. * @param definition The object containing the definition of the effect to be added. * @param mediaStreamType Specifies the streams to which the effect will be applied. * @return An asynchronous operation that returns an IMediaExtension upon successful completion. */ - addVideoEffectAsync(definition: Windows.Media.Effects.VideoEffectDefinition, mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Foundation.IPromiseWithIAsyncOperation; + addVideoEffectAsync(definition: Windows.Media.Effects.IVideoEffectDefinition, mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets an object that controls settings for the microphone. */ audioDeviceController: Windows.Media.Devices.AudioDeviceController; /** Gets the current stream state of the camera stream. */ @@ -33143,14 +33143,14 @@ declare namespace Windows { * @param file The storage file where the image is saved. * @return Returns an IAsyncAction object that is used to control the asynchronous operation. */ - capturePhotoToStorageFileAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + capturePhotoToStorageFileAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Captures a photo to a random-access stream. * @param type The encoding properties for the output image. * @param stream The stream where the image data is written. * @return Returns an IAsyncAction object that is used to control the asynchronous operation. */ - capturePhotoToStreamAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, stream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; + capturePhotoToStreamAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; /** * Removes all audio and video effects from a stream. * @param mediaStreamType The stream from which to remove the effects. @@ -33267,21 +33267,21 @@ declare namespace Windows { * @param customSinkSettings Contains properties of the media extension. * @return When this method completes, a LowLagMediaRecording object is returned which can be used to start the photo capture. */ - prepareLowLagRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.PropertySet): Windows.Foundation.IPromiseWithIAsyncOperation; + prepareLowLagRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Initializes the low lag recording using the specified file to store the recording. This method provides the LowLagMediaRecording object used to managed the recording. * @param encodingProfile The encoding profile for the recording. * @param file The storage file where the image is saved. * @return When this method completes, a LowLagMediaRecording object is returned which can be used to start the photo capture. */ - prepareLowLagRecordToStorageFileAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + prepareLowLagRecordToStorageFileAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Initializes the low lag recording using the specified random-access stream to store the recording. This method provides the LowLagMediaRecording object used to managed the recording. * @param encodingProfile The encoding profile for the recording. * @param stream The stream where the image data is written. * @return When this method completes, a LowLagMediaRecording object is returned which can be used to start the photo capture. */ - prepareLowLagRecordToStreamAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, stream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + prepareLowLagRecordToStreamAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Initializes the variable photo sequence capture and provides the VariablePhotoSequenceCapture object used to manage the recording. * @param type The encoding profile used for the image. @@ -33330,7 +33330,7 @@ declare namespace Windows { * @param customSinkSettings Contains properties of the media extension. * @return Anobject that is used to control the asynchronous operation. */ - startRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.PropertySet): Windows.Foundation.IPromiseWithIAsyncAction; + startRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IPromiseWithIAsyncAction; /** * Start recording to a custom media sink using the specified encoding profile. * @param encodingProfile The encoding profile to use for the recording. @@ -33344,14 +33344,14 @@ declare namespace Windows { * @param file The storage file where the image is saved. * @return Returns a IAsyncAction object that is used to control the asynchronous operation. */ - startRecordToStorageFileAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + startRecordToStorageFileAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Starts recording to a random-access stream. * @param encodingProfile The encoding profile for the recording. * @param stream The stream where the image data is written. * @return Returns a IAsyncAction object that is used to control the asynchronous operation. */ - startRecordToStreamAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, stream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; + startRecordToStreamAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; /** * Stops recording. * @return Returns a IAsyncAction object that is used to control the asynchronous operation. @@ -33385,7 +33385,7 @@ declare namespace Windows { /** Gets or sets a value that specifies the audio processing mode. */ audioProcessing: Windows.Media.AudioProcessing; /** Gets or sets the audio source for the capture operation. */ - audioSource: Windows.Media.Core.MediaSource; + audioSource: Windows.Media.Core.IMediaSource; /** Gets or set the media category. */ mediaCategory: Windows.Media.Capture.MediaCategory; /** Gets or sets the stream that is used for photo capture. */ @@ -33403,7 +33403,7 @@ declare namespace Windows { /** Gets or sets the video profile which provides hints to the driver to allow it to optimize for different capture scenarios. */ videoProfile: Windows.Media.Capture.MediaCaptureVideoProfile; /** Gets or sets the video source for the capture operation. */ - videoSource: Windows.Media.Core.MediaSource; + videoSource: Windows.Media.Core.IMediaSource; } /** Contains read-only configuration settings for the MediaCapture object. */ abstract class MediaCaptureSettings { @@ -33932,7 +33932,7 @@ declare namespace Windows { /** The unique content ID of a piece of content, in the app's content catalog. */ id: string; /** The thumbnail image associated with the content. */ - image: Windows.Storage.Streams.RandomAccessStreamReference; + image: Windows.Storage.Streams.IRandomAccessStreamReference; /** Provides all existing third-party and Windows Store age ratings for a piece of content. */ ratings: Windows.Foundation.Collections.IVector; /** The display title of a piece of content. */ @@ -34006,7 +34006,7 @@ declare namespace Windows { /** Initializes a new instance of the DataCue class. */ constructor(); /** Gets the data associated with the cue. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; /** Gets or sets the duration of the cue. */ duration: number; /** Gets the identifier for the timed metadata track. */ @@ -34033,7 +34033,7 @@ declare namespace Windows { * Sets properties on the IMediaExtension . * @param configuration The property set. */ - setProperties(configuration: Windows.Foundation.Collections.PropertySet): void; + setProperties(configuration: Windows.Foundation.Collections.IPropertySet): void; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -34046,7 +34046,7 @@ declare namespace Windows { /** Gets or sets a value that prioritizes the speed of face detection and the quality of detection results. */ detectionMode: Windows.Media.Core.FaceDetectionMode; /** Gets the set of properties for configuring the FaceDetectionEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets a value indicating whether synchronous face detection is enabled. */ synchronousDetectionEnabled: boolean; } @@ -34059,7 +34059,7 @@ declare namespace Windows { /** Gets or sets the duration of the face detection effect frame. */ duration: number; /** Gets the extended property set which enables getting and setting properties on the media frame. */ - extendedProperties: Windows.Foundation.Collections.PropertySet; + extendedProperties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets a value that indicates whether a video frame is the first frame after a gap in the stream. */ isDiscontinuous: boolean; /** Gets a value indicating whether the frame is read-only. */ @@ -34123,13 +34123,13 @@ declare namespace Windows { * @param stream A stream containing the media content. * @param contentType A string specifying the content type of the media content. */ - setStream(stream: Windows.Storage.Streams.RandomAccessStream, contentType: string): void; + setStream(stream: Windows.Storage.Streams.IRandomAccessStream, contentType: string): void; /** * Sets the media content to be bound to the MediaSource . * @param stream A stream reference containing the media content to be bound. * @param contentType A string specifying the content type of the media content. */ - setStreamReference(stream: Windows.Storage.Streams.RandomAccessStreamReference, contentType: string): void; + setStreamReference(stream: Windows.Storage.Streams.IRandomAccessStreamReference, contentType: string): void; /** * Sets the URI of the media content to be bound to the MediaSource . * @param uri The URI of the media content to be bound. @@ -34156,7 +34156,7 @@ declare namespace Windows { * @param mediaSource The IMediaSource from which the MediaSource is created. * @return The new media source. */ - static createFromIMediaSource(mediaSource: Windows.Media.Core.MediaSource): Windows.Media.Core.MediaSource; + static createFromIMediaSource(mediaSource: Windows.Media.Core.IMediaSource): Windows.Media.Core.MediaSource; /** * Creates an instance of MediaSource from the provided MediaBinder . * @param binder The MediaBinder with which the MediaSource is associated. @@ -34180,21 +34180,21 @@ declare namespace Windows { * @param file The IStorageFile from which the MediaSource is created. * @return The new media source. */ - static createFromStorageFile(file: Windows.Storage.StorageFile): Windows.Media.Core.MediaSource; + static createFromStorageFile(file: Windows.Storage.IStorageFile): Windows.Media.Core.MediaSource; /** * Creates an instance of MediaSource from the provided IRandomAccessStream . * @param stream The stream from which the MediaSource is created. * @param contentType The MIME type of the contents of the stream. * @return The new media source. */ - static createFromStream(stream: Windows.Storage.Streams.RandomAccessStream, contentType: string): Windows.Media.Core.MediaSource; + static createFromStream(stream: Windows.Storage.Streams.IRandomAccessStream, contentType: string): Windows.Media.Core.MediaSource; /** * Creates an instance of MediaSource from the provided IRandomAccessStreamReference . * @param stream The stream reference from which the MediaSource is created. * @param contentType The MIME type of the contents of the stream. * @return The new media source. */ - static createFromStreamReference(stream: Windows.Storage.Streams.RandomAccessStreamReference, contentType: string): Windows.Media.Core.MediaSource; + static createFromStreamReference(stream: Windows.Storage.Streams.IRandomAccessStreamReference, contentType: string): Windows.Media.Core.MediaSource; /** * Creates an instance of MediaSource from the provided Uri . * @param uri The URI from which the MediaSource is created. @@ -34265,7 +34265,7 @@ declare namespace Windows { * @param timestamp The presentation time of this sample. * @return The sample created from the data in buffer. */ - static createFromBuffer(buffer: Windows.Storage.Streams.Buffer, timestamp: number): Windows.Media.Core.MediaStreamSample; + static createFromBuffer(buffer: Windows.Storage.Streams.IBuffer, timestamp: number): Windows.Media.Core.MediaStreamSample; /** * Asynchronously creates a MediaStreamSample from an IInputStream . * @param stream The stream that contains the media data used to create the MediaStreamSample . @@ -34438,7 +34438,7 @@ declare namespace Windows { */ setBufferedRange(startOffset: number, endOffset: number): void; /** Gets or sets the thumbnail which is a reference to a stream for a video thumbnail image or music album art. */ - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets the video properties which are used for video related metadata. */ videoProperties: Windows.Storage.FileProperties.VideoProperties; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; @@ -34587,7 +34587,7 @@ declare namespace Windows { * Sets properties on the IMediaExtension . * @param configuration The property set. */ - setProperties(configuration: Windows.Foundation.Collections.PropertySet): void; + setProperties(configuration: Windows.Foundation.Collections.IPropertySet): void; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -34598,7 +34598,7 @@ declare namespace Windows { /** Gets a string containing the activatable class ID of the scene analysis effect definition. */ activatableClassId: string; /** Gets the set of properties for configuring the SceneAnalysisEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Represents a video frame that includes the results of the scene analysis operation. */ abstract class SceneAnalysisEffectFrame { @@ -34607,7 +34607,7 @@ declare namespace Windows { /** Gets or sets the duration of the scene analysis effect frame. */ duration: number; /** Gets the extended property set which enables getting and setting properties on the media frame. */ - extendedProperties: Windows.Foundation.Collections.PropertySet; + extendedProperties: Windows.Foundation.Collections.IPropertySet; /** Gets a CapturedFrameControlValues object that indicates the capture settings used for the frame. */ frameControlValues: Windows.Media.Capture.CapturedFrameControlValues; /** Gets a HighDynamicRangeOutput object that provides recommended FrameController objects and a value indicating the certainty of the HDR analysis. */ @@ -34810,14 +34810,14 @@ declare namespace Windows { * @param stream The stream from which the timed text source is created. * @return The new timed text source. */ - static createFromStream(stream: Windows.Storage.Streams.RandomAccessStream): Windows.Media.Core.TimedTextSource; + static createFromStream(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Media.Core.TimedTextSource; /** * Creates a new instance of TimedTextSource with the specified default language from the provided stream. * @param stream The stream from which the timed text source is created. * @param defaultLanguage A string specifying the default language for the timed text source. * @return The new timed text source. */ - static createFromStream(stream: Windows.Storage.Streams.RandomAccessStream, defaultLanguage: string): Windows.Media.Core.TimedTextSource; + static createFromStream(stream: Windows.Storage.Streams.IRandomAccessStream, defaultLanguage: string): Windows.Media.Core.TimedTextSource; /** * Creates a new instance of TimedTextSource from the provided URI. * @param uri The URI from which the timed text source is created. @@ -34942,7 +34942,7 @@ declare namespace Windows { * Sets properties on the IMediaExtension . * @param configuration The property set. */ - setProperties(configuration: Windows.Foundation.Collections.PropertySet): void; + setProperties(configuration: Windows.Foundation.Collections.IPropertySet): void; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -34953,7 +34953,7 @@ declare namespace Windows { /** Gets a string containing the activatable class ID of the video stabilization effect definition. */ activatableClassId: string; /** Gets the set of properties for configuring the VideoStabilizationEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Provides data for the VideoStabilizationEffect::EnabledChanged event. */ abstract class VideoStabilizationEffectEnabledChangedEventArgs { @@ -36370,7 +36370,7 @@ declare namespace Windows { /** Gets the remote device's ID. You can use this ID with the Windows.Devices.Enumeration APIs as well. */ id: string; /** Gets a stream containing the thumbnail image for the DIAL device. */ - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; } /** The possible statuses a DIAL device can have in the DIAL device picker. You can use these to adjust the sub-status and other visual attributes for a particular device in the picker. */ enum DialDeviceDisplayStatus { @@ -36473,9 +36473,9 @@ declare namespace Windows { * @param file A StorageFile object representing the source audio file. * @return A new background audio track object containing the contents of the audio file. */ - static createFromFileAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static createFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the list of audio effect definitions for processing the background audio track. */ - audioEffectDefinitions: Windows.Foundation.Collections.IVector; + audioEffectDefinitions: Windows.Foundation.Collections.IVector; /** * Creates a BackgroundAudioTrack object that is identical to this instance. * @return A BackgroundAudioTrack object that is a copy of this instance. @@ -36523,14 +36523,14 @@ declare namespace Windows { * @param file A StorageFile object representing the source video file. * @return A new media clip object containing a video clip of the video file. */ - static createFromFileAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static createFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a video clip that displays a single image for a specified length of time. * @param file A StorageFile object representing the source image file. * @param originalDuration How long to display the image in the video clip. * @return A new media clip object containing the image-based video clip. */ - static createFromImageFileAsync(file: Windows.Storage.StorageFile, originalDuration: number): Windows.Foundation.IPromiseWithIAsyncOperation; + static createFromImageFileAsync(file: Windows.Storage.IStorageFile, originalDuration: number): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a video clip from a Direct3D surface. * @param surface The Direct3D surface. @@ -36539,7 +36539,7 @@ declare namespace Windows { */ static createFromSurface(surface: Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface, originalDuration: number): Windows.Media.Editing.MediaClip; /** Gets the list of audio effect definitions for processing the media clip. */ - audioEffectDefinitions: Windows.Foundation.Collections.IVector; + audioEffectDefinitions: Windows.Foundation.Collections.IVector; /** * Creates a MediaClip object that is identical to this instance. * @return A MediaClip object that is a copy of this instance. @@ -36569,7 +36569,7 @@ declare namespace Windows { /** An associative collection for storing custom properties associated with the media clip. */ userData: Windows.Foundation.Collections.IMap; /** Gets the list of video effect definitions for processing the media clip. */ - videoEffectDefinitions: Windows.Foundation.Collections.IVector; + videoEffectDefinitions: Windows.Foundation.Collections.IVector; /** Gets or sets the volume of the media clip. */ volume: number; } @@ -36642,14 +36642,14 @@ declare namespace Windows { * @param destination The file to which this MediaComposition is rendered. * @return An async operation which can be used to track the success or failure of the operation. */ - renderToFileAsync(destination: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + renderToFileAsync(destination: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Asynchronously renders the MediaComposition to a specified file using the indicated media trimming preference. * @param destination The file to which this MediaComposition is rendered. * @param trimmingPreference Specifies whether to be fast or precise when trimming the media. * @return An async operation which can be used to track the success or failure of the operation. */ - renderToFileAsync(destination: Windows.Storage.StorageFile, trimmingPreference: Windows.Media.Editing.MediaTrimmingPreference): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + renderToFileAsync(destination: Windows.Storage.IStorageFile, trimmingPreference: Windows.Media.Editing.MediaTrimmingPreference): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Asynchronously renders the MediaComposition to a specified file using the indicated media trimming preference and encoding profile. * @param destination The file to which this MediaComposition is rendered. @@ -36657,13 +36657,13 @@ declare namespace Windows { * @param encodingProfile Specifies the encoding profile to use for rendering the media. * @return An async operation which can be used to track the success or failure of the operation. */ - renderToFileAsync(destination: Windows.Storage.StorageFile, trimmingPreference: Windows.Media.Editing.MediaTrimmingPreference, encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + renderToFileAsync(destination: Windows.Storage.IStorageFile, trimmingPreference: Windows.Media.Editing.MediaTrimmingPreference, encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Asynchronously serializes the MediaComposition to disk so that it can be loaded and modified in the future. * @param file The file to which the MediaComposition is saved. * @return An async action which can be used to track the success or failure of the operation. */ - saveAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + saveAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** An associative collection for storing custom properties associated with the media composition. */ userData: Windows.Foundation.Collections.IMap; } @@ -36705,14 +36705,14 @@ declare namespace Windows { * Initializes a new instance of the MediaOverlayLayer class. * @param compositorDefinition The definition of the custom compositor associated with the media overlay layer. */ - constructor(compositorDefinition: Windows.Media.Effects.VideoCompositorDefinition); + constructor(compositorDefinition: Windows.Media.Effects.IVideoCompositorDefinition); /** * Creates a MediaOverlayLayer object that is identical to this instance. * @return A MediaOverlayLayer object that is a copy of this instance. */ clone(): Windows.Media.Editing.MediaOverlayLayer; /** Gets the definition of the custom compositor associated with the media overlay layer, if there is one. */ - customCompositorDefinition: Windows.Media.Effects.VideoCompositorDefinition; + customCompositorDefinition: Windows.Media.Effects.IVideoCompositorDefinition; /** Gets the list of overlays for this media overlay layer. */ overlays: Windows.Foundation.Collections.IVector; } @@ -36759,7 +36759,7 @@ declare namespace Windows { * @param activatableClassId The activatable class ID of the audio effect definition. * @param props Configuration properties for the specified audio effect definition. */ - constructor(activatableClassId: string, props: Windows.Foundation.Collections.PropertySet); + constructor(activatableClassId: string, props: Windows.Foundation.Collections.IPropertySet); /** * Creates a new AudioEffectDefinition object with the specified activatable class ID. * @param activatableClassId The activatable class ID of the audio effect definition. @@ -36768,7 +36768,7 @@ declare namespace Windows { /** The activatable class ID of the audio effect definition. */ activatableClassId: string; /** The set of properties for configuring an AudioEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Defines values for audio effect types. */ enum AudioEffectType { @@ -36918,7 +36918,7 @@ declare namespace Windows { * @param activatableClassId The activatable class ID of the video compositor. * @param props The set of properties for configuring the video compositor object. */ - constructor(activatableClassId: string, props: Windows.Foundation.Collections.PropertySet); + constructor(activatableClassId: string, props: Windows.Foundation.Collections.IPropertySet); /** * Initializes a new instance of the VideoCompositorDefinition class. * @param activatableClassId The activatable class ID of the video compositor. @@ -36927,7 +36927,7 @@ declare namespace Windows { /** Gets the activatable class ID of the video compositor. */ activatableClassId: string; /** Gets the set of properties for configuring the video compositor object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Represents a video effect definition. */ class VideoEffectDefinition { @@ -36936,7 +36936,7 @@ declare namespace Windows { * @param activatableClassId The activatable class ID of the video effect definition. * @param props Configuration properties for the specified video effect definition. */ - constructor(activatableClassId: string, props: Windows.Foundation.Collections.PropertySet); + constructor(activatableClassId: string, props: Windows.Foundation.Collections.IPropertySet); /** * Creates a new VideoEffectDefinition object with the specified activatable class ID. * @param activatableClassId The activatable class ID of the video effect definition. @@ -36945,7 +36945,7 @@ declare namespace Windows { /** Gets the activatable class ID of the video effect definition. */ activatableClassId: string; /** Gets the set of properties for configuring the VideoEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Represents the definition of a video transform effect. */ class VideoTransformEffectDefinition { @@ -36964,7 +36964,7 @@ declare namespace Windows { /** Gets or sets the media processing algorithm that is used for the video transform. */ processingAlgorithm: Windows.Media.Transcoding.MediaVideoProcessingAlgorithm; /** Gets the set of properties for configuring the VideoTransformEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets the angle and direction in which the video will be rotated. */ rotation: Windows.Media.MediaProperties.MediaRotation; } @@ -36973,21 +36973,21 @@ declare namespace Windows { /** The activatable class ID of the audio effect definition. */ activatableClassId: string; /** The set of properties for configuring an AudioEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Exposes the methods and properties of a VideoEffectDefinition object. Implement this interface when you create a custom video effect definition. */ interface IVideoEffectDefinition { /** The activatable class ID of the video effect definition. */ activatableClassId: string; /** The set of properties for configuring the VideoEffectDefinition object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** The interface defining a custom video compositor definition. */ interface IVideoCompositorDefinition { /** Gets the activatable class ID of the video compositor. */ activatableClassId: string; /** Gets the set of properties for configuring the video compositor object. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } } /** Provides APIs for face detection in bitmaps or video frames. */ @@ -37291,7 +37291,7 @@ declare namespace Windows { /** Gets the size of the item, in bytes. */ sizeInBytes: number; /** Gets a random access stream containing the thumbnail image associated with the item. */ - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets the list of video segments associated with the item. */ videoSegments: Windows.Foundation.Collections.IVectorView; } @@ -37363,7 +37363,7 @@ declare namespace Windows { /** Gets or sets the prefix for the destination file name. */ destinationFileNamePrefix: string; /** Gets or sets the destination folder for the photo import session. */ - destinationFolder: Windows.Storage.StorageFolder; + destinationFolder: Windows.Storage.IStorageFolder; /** * Asynchronously finds items on the source device that are available for import. * @param contentTypeFilter A value indicating whether the find operation includes images, videos, or both in the results. @@ -37394,7 +37394,7 @@ declare namespace Windows { * @param sourceRootFolder The root folder from which the photo import source is created. * @return An asynchronous operation that returns a PhotoImportSource upon successful completion. */ - static fromFolderAsync(sourceRootFolder: Windows.Storage.StorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; + static fromFolderAsync(sourceRootFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a new instance of PhotoImportSource from the specified device ID. * @param sourceId The root folder from which the photo import source is created. @@ -37435,7 +37435,7 @@ declare namespace Windows { /** Gets a list of objects representing the different storage media exposed by the source device. */ storageMedia: Windows.Foundation.Collections.IVectorView; /** Gets a reference to a stream containing the thumbnail image for the source device. */ - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets a value indicating the type of the source device. */ type: Windows.Media.Import.PhotoImportSourceType; } @@ -37614,7 +37614,7 @@ declare namespace Windows { * @param outputSubtype The guid identifier of the media type that is output by the audio decoder. * @param configuration An optional parameter that contains the configuration properties to be passed to the audio decoder. */ - registerAudioDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.PropertySet): void; + registerAudioDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; /** * Registers an audio encoder for the specified input and output media types with an optional configuration parameter. * @param activatableClassId The class identifier of the activatable runtime class of the audio encoder. The runtime class must implement the IMediaExtension interface. @@ -37622,7 +37622,7 @@ declare namespace Windows { * @param outputSubtype The guid identifier of the media type that is output by the audio encoder. * @param configuration An optional parameter that contains the configuration properties to be passed to the audio encoder. */ - registerAudioEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.PropertySet): void; + registerAudioEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; /** * Registers an audio encoder for the specified input and output media types. * @param activatableClassId The class identifier of the activatable runtime class of the audio encoder. The runtime class must implement the IMediaExtension interface. @@ -37644,14 +37644,14 @@ declare namespace Windows { * @param mimeType The MIME type that is registered for this byte-stream handler. * @param configuration An optional parameter that contains configuration properties for the byte-stream handler. */ - registerByteStreamHandler(activatableClassId: string, fileExtension: string, mimeType: string, configuration: Windows.Foundation.Collections.PropertySet): void; + registerByteStreamHandler(activatableClassId: string, fileExtension: string, mimeType: string, configuration: Windows.Foundation.Collections.IPropertySet): void; /** * Registers a scheme handler for the specified URL scheme with an optional configuration parameter. * @param activatableClassId The class identifier of the activatable runtime class of the scheme handler. The runtime class must implement the IMediaExtension interface. * @param scheme The URL scheme that will be recognized to invoke the scheme handler. For example, "myscheme://". * @param configuration An optional parameter that contains configuration properties for the scheme handler. */ - registerSchemeHandler(activatableClassId: string, scheme: string, configuration: Windows.Foundation.Collections.PropertySet): void; + registerSchemeHandler(activatableClassId: string, scheme: string, configuration: Windows.Foundation.Collections.IPropertySet): void; /** * Registers a scheme handler for the specified URL scheme. * @param activatableClassId The class identifier of the activatable runtime class of the scheme handler. The runtime class must implement the IMediaExtension interface. @@ -37672,7 +37672,7 @@ declare namespace Windows { * @param outputSubtype The guid identifier of the media type that is output by the video decoder. * @param configuration An optional parameter that contains the configuration properties to be passed to the video decoder. */ - registerVideoDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.PropertySet): void; + registerVideoDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; /** * Registers a video encoder for the specified input and output media types. * @param activatableClassId The class identifier of the activatable runtime class of the video encoder. The runtime class must implement the IMediaExtension interface. @@ -37687,7 +37687,7 @@ declare namespace Windows { * @param outputSubtype The guid identifier of the media type that is output by the video encoder. * @param configuration An optional parameter that contains the configuration properties to be passed to the video encoder. */ - registerVideoEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.PropertySet): void; + registerVideoEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; } /** Provides a static list of media marker types. */ abstract class MediaMarkerTypes { @@ -37902,13 +37902,13 @@ declare namespace Windows { * @param file The media file from which to create the profile. * @return An object that is used to control the asynchronous operation. */ - static createFromFileAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static createFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates an encoding profile from a stream that contains media data. * @param stream The media stream from which to create the profile. * @return An object that is used to control the asynchronous operation. */ - static createFromStreamAsync(stream: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static createFromStreamAsync(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates an encoding profile for AAC audio. * @param quality Specifies whether to create a profile with a low bit rate, medium bit rate, or high bit rate. @@ -38469,7 +38469,7 @@ declare namespace Windows { addEventListener(type: "volumechangerequested", listener: Windows.Foundation.TypedEventHandler): void; removeEventListener(type: "volumechangerequested", listener: Windows.Foundation.TypedEventHandler): void; /** Gets a set of custom properties for the Play To receiver. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; /** * Start receiving Play To commands. * @return An asynchronous handler that's called when the start operation is complete. @@ -38567,7 +38567,7 @@ declare namespace Windows { /** Gets the media stream for the Play To receiver. */ stream: Windows.Storage.Streams.IRandomAccessStreamWithContentType; /** Gets the thumbnail image for the content in the media stream. */ - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets the title of the content in the media stream. */ title: string; } @@ -38871,7 +38871,7 @@ declare namespace Windows { * @param effectOptional A value indicating whether the effect is optional. * @param configuration A property set containing configuration settings for the specified audio effect. */ - addAudioEffect(activatableClassId: string, effectOptional: boolean, configuration: Windows.Foundation.Collections.PropertySet): void; + addAudioEffect(activatableClassId: string, effectOptional: boolean, configuration: Windows.Foundation.Collections.IPropertySet): void; /** Gets or sets the type of audio that is currently being played. */ audioCategory: Windows.Media.Playback.MediaPlayerAudioCategory; /** Gets or sets a value that describes the primary usage of the device that is being used to play back audio. */ @@ -38952,17 +38952,17 @@ declare namespace Windows { * Set the media source to a file. * @param file The media source file. */ - setFileSource(file: Windows.Storage.StorageFile): void; + setFileSource(file: Windows.Storage.IStorageFile): void; /** * Sets the media source for playback. * @param source The media source for playback. */ - setMediaSource(source: Windows.Media.Core.MediaSource): void; + setMediaSource(source: Windows.Media.Core.IMediaSource): void; /** * Sets the media source to a stream. * @param stream The media source stream. */ - setStreamSource(stream: Windows.Storage.Streams.RandomAccessStream): void; + setStreamSource(stream: Windows.Storage.Streams.IRandomAccessStream): void; /** * Sets the path to the media. * @param value The path to the media. @@ -39145,7 +39145,7 @@ declare namespace Windows { * @param file Represents the files to load. * @return Represents the asynchronous operation for loading the playlist. The GetResults method of this IAsyncOperation object returns the playlist. */ - static loadAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** Creates a new instance of a Playlist object. */ constructor(); /** The set of media files that make up the playlist. */ @@ -39158,7 +39158,7 @@ declare namespace Windows { * @param playlistFormat The playlist format. One of the values of the PlaylistFormat enumeration. * @return Represents the asynchronous operation to save the playlist to a specified file and folder. */ - saveAsAsync(saveLocation: Windows.Storage.StorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption, playlistFormat: Windows.Media.Playlists.PlaylistFormat): Windows.Foundation.IPromiseWithIAsyncOperation; + saveAsAsync(saveLocation: Windows.Storage.IStorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption, playlistFormat: Windows.Media.Playlists.PlaylistFormat): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously saves the playlist to a specified file and folder. * @param saveLocation The folder in which to save the playlist. @@ -39166,7 +39166,7 @@ declare namespace Windows { * @param option The action to take if the playlist is saved to an existing file. One of the values of the NameCollisionOption enumeration. * @return Represents the asynchronous operation to save the playlist to a specified file and folder. */ - saveAsAsync(saveLocation: Windows.Storage.StorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; + saveAsAsync(saveLocation: Windows.Storage.IStorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously saves the playlist. * @return Represents the asynchronous action to save the playlist. @@ -39218,7 +39218,7 @@ declare namespace Windows { addEventListener(type: "servicerequested", listener: Windows.Media.Protection.ServiceRequestedEventHandler): void; removeEventListener(type: "servicerequested", listener: Windows.Media.Protection.ServiceRequestedEventHandler): void; /** Gets a PropertySet object containing any properties attached to the protection manager. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -39228,9 +39228,9 @@ declare namespace Windows { * Initializes a new instance of the MediaProtectionPMPServer class with the specified properties. * @param pProperties The set of properties used to initialize the server. */ - constructor(pProperties: Windows.Foundation.Collections.PropertySet); + constructor(pProperties: Windows.Foundation.Collections.IPropertySet); /** Gets the property set for the MediaProtectionPMPServer . */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; } /** Contains a method that indicates whether a protection service has completed successfully. */ abstract class MediaProtectionServiceCompletion { @@ -39331,7 +39331,7 @@ declare namespace Windows { * @param licenseFetchDescriptor Descriptor for the license being fetched. * @return The result of the asynchronous license fetch call. */ - licenseFetchAsync(licenseFetchDescriptor: Windows.Media.Protection.PlayReady.NDLicenseFetchDescriptor): Windows.Foundation.IPromiseWithIAsyncOperation; + licenseFetchAsync(licenseFetchDescriptor: Windows.Media.Protection.PlayReady.INDLicenseFetchDescriptor): Windows.Foundation.IPromiseWithIAsyncOperation; /** Notifies listeners that a closed caption acquisition operation has completed. */ onclosedcaptiondatareceived: Windows.Foundation.TypedEventHandler; addEventListener(type: "closedcaptiondatareceived", listener: Windows.Foundation.TypedEventHandler): void; @@ -39357,7 +39357,7 @@ declare namespace Windows { * @param registrationCustomData Custom data for the registration request. * @return The result of the asynchronous reregistration call. */ - reRegistrationAsync(registrationCustomData: Windows.Media.Protection.PlayReady.NDCustomData): Windows.Foundation.IPromiseWithIAsyncAction; + reRegistrationAsync(registrationCustomData: Windows.Media.Protection.PlayReady.INDCustomData): Windows.Foundation.IPromiseWithIAsyncAction; /** * Starts the registration, proximity detection, and license fetch procedures between a client receiver and a transmitter. * @param contentUrl The URL of the streamed content. @@ -39366,7 +39366,7 @@ declare namespace Windows { * @param licenseFetchDescriptor The descriptor used for license fetching. * @return The result of the asynchronous start call. */ - startAsync(contentUrl: Windows.Foundation.Uri, startAsyncOptions: number, registrationCustomData: Windows.Media.Protection.PlayReady.NDCustomData, licenseFetchDescriptor: Windows.Media.Protection.PlayReady.NDLicenseFetchDescriptor): Windows.Foundation.IPromiseWithIAsyncOperation; + startAsync(contentUrl: Windows.Foundation.Uri, startAsyncOptions: number, registrationCustomData: Windows.Media.Protection.PlayReady.INDCustomData, licenseFetchDescriptor: Windows.Media.Protection.PlayReady.INDLicenseFetchDescriptor): Windows.Foundation.IPromiseWithIAsyncOperation; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -39409,7 +39409,7 @@ declare namespace Windows { * Called by the download engine when a content identifier is received. * @param licenseFetchDescriptor The license from which the download engine receives the content identifier. */ - onContentIDReceived(licenseFetchDescriptor: Windows.Media.Protection.PlayReady.NDLicenseFetchDescriptor): void; + onContentIDReceived(licenseFetchDescriptor: Windows.Media.Protection.PlayReady.INDLicenseFetchDescriptor): void; /** * Called by the download engine when it receives data. * @param dataBytes The byte array that holds the data. @@ -39436,13 +39436,13 @@ declare namespace Windows { * @param contentIDBytes The content identifier. * @param licenseFetchChallengeCustomData The license fetch challenge custom data. */ - constructor(contentIDType: Windows.Media.Protection.PlayReady.NDContentIDType, contentIDBytes: number[], licenseFetchChallengeCustomData: Windows.Media.Protection.PlayReady.NDCustomData); + constructor(contentIDType: Windows.Media.Protection.PlayReady.NDContentIDType, contentIDBytes: number[], licenseFetchChallengeCustomData: Windows.Media.Protection.PlayReady.INDCustomData); /** Gets the content identifer. */ contentID: number; /** Gets the type of the content identifier. */ contentIDType: Windows.Media.Protection.PlayReady.NDContentIDType; /** Gets or sets custom data for a license fetch challenge. */ - licenseFetchChallengeCustomData: Windows.Media.Protection.PlayReady.NDCustomData; + licenseFetchChallengeCustomData: Windows.Media.Protection.PlayReady.INDCustomData; } /** Indicates the type of a protected media stream. */ enum NDMediaStreamType { @@ -39476,7 +39476,7 @@ declare namespace Windows { * @param file A storage file object that a media server has discovered. * @return The transmitter settings found in the storage file. */ - getFileURLs(file: Windows.Storage.StorageFile): Windows.Foundation.Collections.IVector; + getFileURLs(file: Windows.Storage.IStorageFile): Windows.Foundation.Collections.IVector; } /** Contains methods that a stream parser plug-in uses to send notifications to a PlayReady-ND client. */ class NDStreamParserNotifier { @@ -39493,7 +39493,7 @@ declare namespace Windows { * Called by a stream parser when it receives the content identifier. * @param licenseFetchDescriptor The license fetch descriptor containing the content identifier. */ - onContentIDReceived(licenseFetchDescriptor: Windows.Media.Protection.PlayReady.NDLicenseFetchDescriptor): void; + onContentIDReceived(licenseFetchDescriptor: Windows.Media.Protection.PlayReady.INDLicenseFetchDescriptor): void; /** * Called by the stream parser when the media stream descriptor is created. * @param audioStreamDescriptors An array of audio stream descriptors that are part of the media stream descriptor. @@ -39659,17 +39659,17 @@ declare namespace Windows { * Returns an iterator that iterates over the items in the PlayReady domain collection. * @return The PlayReady domain iterator. */ - first(): Windows.Foundation.Collections.IIterator; + first(): Windows.Foundation.Collections.IIterator; } /** Provides for iteration of the PlayReadyDomain class. */ abstract class PlayReadyDomainIterator { /** Gets the current item in the PlayReady domain collection. */ - current: Windows.Media.Protection.PlayReady.PlayReadyDomain; + current: Windows.Media.Protection.PlayReady.IPlayReadyDomain; /** * Retrieves all items in the PlayReady domain collection. * @return */ - getMany(): { /** The items in the collection. */ items: Windows.Media.Protection.PlayReady.PlayReadyDomain; /** The number of items in the collection. */ returnValue: number; }; + getMany(): { /** The items in the collection. */ items: Windows.Media.Protection.PlayReady.IPlayReadyDomain; /** The number of items in the collection. */ returnValue: number; }; /** Gets a value that indicates whether there is a current item or the iterator is at the end of the PlayReady domain collection. */ hasCurrent: boolean; /** @@ -39797,7 +39797,7 @@ declare namespace Windows { * @param format The format for the ITA serialized data. * @return The serialized blob. See Remarks. */ - generateData(guidCPSystemId: string, countOfStreams: number, configuration: Windows.Foundation.Collections.PropertySet, format: Windows.Media.Protection.PlayReady.PlayReadyITADataFormat): number[]; + generateData(guidCPSystemId: string, countOfStreams: number, configuration: Windows.Foundation.Collections.IPropertySet, format: Windows.Media.Protection.PlayReady.PlayReadyITADataFormat): number[]; } /** Provides the service methods for requesting platform individualization. */ class PlayReadyIndividualizationServiceRequest { @@ -39910,17 +39910,17 @@ declare namespace Windows { * Returns an iterator that iterates over the items in the PlayReady license collection. * @return The PlayReady license iterator. */ - first(): Windows.Foundation.Collections.IIterator; + first(): Windows.Foundation.Collections.IIterator; } /** Provides for iteration of the PlayReadyLicense class. */ abstract class PlayReadyLicenseIterator { /** Gets the current item in the PlayReady license collection. */ - current: Windows.Media.Protection.PlayReady.PlayReadyLicense; + current: Windows.Media.Protection.PlayReady.IPlayReadyLicense; /** * Retrieves all items in the PlayReady license collection. * @return */ - getMany(): { /** The items in the collection. */ items: Windows.Media.Protection.PlayReady.PlayReadyLicense; /** The number of items in the collection. */ returnValue: number; }; + getMany(): { /** The items in the collection. */ items: Windows.Media.Protection.PlayReady.IPlayReadyLicense; /** The number of items in the collection. */ returnValue: number; }; /** Gets a value that indicates whether there is a current item or the iterator is at the end of the PlayReady license collection. */ hasCurrent: boolean; /** @@ -39944,7 +39944,7 @@ declare namespace Windows { * Initializes a new instance of the PlayReadyLicenseSession class. * @param configuration The configuration data for the license session. */ - constructor(configuration: Windows.Foundation.Collections.PropertySet); + constructor(configuration: Windows.Foundation.Collections.IPropertySet); /** * Updates the media protection manger with the appropriate settings so the media foundation can be used for playback. * @param mpm The media protection manager to be updated. @@ -39954,7 +39954,7 @@ declare namespace Windows { * Creates a license acquisition service request whose license will be tied to the media session. * @return The license acquisition service request. */ - createLAServiceRequest(): Windows.Media.Protection.PlayReady.PlayReadyLicenseAcquisitionServiceRequest; + createLAServiceRequest(): Windows.Media.Protection.PlayReady.IPlayReadyLicenseAcquisitionServiceRequest; } /** Provides the service methods for content metering operations. */ class PlayReadyMeteringReportServiceRequest { @@ -40041,17 +40041,17 @@ declare namespace Windows { * Returns an iterator that iterates over the items in the PlayReady secure stop collection. * @return The PlayReady secure stop iterator. */ - first(): Windows.Foundation.Collections.IIterator; + first(): Windows.Foundation.Collections.IIterator; } /** Provides for iteration of the IPlayReadySecureStopServiceRequest interface. */ abstract class PlayReadySecureStopIterator { /** Gets the current item in the PlayReady secure stop collection. */ - current: Windows.Media.Protection.PlayReady.PlayReadySecureStopServiceRequest; + current: Windows.Media.Protection.PlayReady.IPlayReadySecureStopServiceRequest; /** * Retrieves all items in the PlayReady secure stop collection. * @return */ - getMany(): { /** The items in the collection. */ items: Windows.Media.Protection.PlayReady.PlayReadySecureStopServiceRequest; /** The number of items in the collection. */ returnValue: number; }; + getMany(): { /** The items in the collection. */ items: Windows.Media.Protection.PlayReady.IPlayReadySecureStopServiceRequest; /** The number of items in the collection. */ returnValue: number; }; /** Gets a value that indicates whether there is a current item or the iterator is at the end of the PlayReady secure stop collection. */ hasCurrent: boolean; /** @@ -40123,7 +40123,7 @@ declare namespace Windows { */ getMessageBody(): number[]; /** Gets a collection of the SOAP headers applied to the current SOAP request or SOAP response. */ - messageHeaders: Windows.Foundation.Collections.PropertySet; + messageHeaders: Windows.Foundation.Collections.IPropertySet; /** Gets the base URL of the XML Web service. */ uri: Windows.Foundation.Uri; } @@ -40163,12 +40163,12 @@ declare namespace Windows { /** Gets the type of the content identifier used for fetching a license. */ contentIDType: Windows.Media.Protection.PlayReady.NDContentIDType; /** Gets or sets custom data for a license fetch challenge. */ - licenseFetchChallengeCustomData: Windows.Media.Protection.PlayReady.NDCustomData; + licenseFetchChallengeCustomData: Windows.Media.Protection.PlayReady.INDCustomData; } /** Provides the result of the PlayReady-ND license fetch. */ interface INDLicenseFetchResult { /** Gets the custom data from a license fetch response. */ - responseCustomData: Windows.Media.Protection.PlayReady.NDCustomData; + responseCustomData: Windows.Media.Protection.PlayReady.INDCustomData; } /** Specifies arguments for a PlayReady-ND ClosedCaptionDataReceived event. */ interface INDClosedCaptionDataReceivedEventArgs { @@ -40182,7 +40182,7 @@ declare namespace Windows { /** Gets custom data from a PlayReady-ND license fetch operation. This custom data is an argument from a PlayReady-ND LicenseFetchCompleted event. */ interface INDLicenseFetchCompletedEventArgs { /** Gets custom data from a license fetch response. */ - responseCustomData: Windows.Media.Protection.PlayReady.NDCustomData; + responseCustomData: Windows.Media.Protection.PlayReady.INDCustomData; } /** Provides arguments for the PlayReady-ND ProximityDetectionCompleted event. Apps fire this event after they complete the proximity detection process. */ interface INDProximityDetectionCompletedEventArgs { @@ -40192,7 +40192,7 @@ declare namespace Windows { /** Provides arguments for the PlayReady-ND RegistrationCompleted event. */ interface INDRegistrationCompletedEventArgs { /** Gets custom data from a registration response. */ - responseCustomData: Windows.Media.Protection.PlayReady.NDCustomData; + responseCustomData: Windows.Media.Protection.PlayReady.INDCustomData; /** Gets or sets whether to accept or reject a transmitter's certificate. */ transmitterCertificateAccepted: boolean; /** Gets transmitter properties from the transmitter's certificate to verify the transmitter. */ @@ -40960,7 +40960,7 @@ declare namespace Windows { * Creates a copy of SpeechSynthesisStream that references the same bytes as the original stream. * @return The new stream. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Releases system resources that are exposed by SpeechSynthesisStream . */ close(): void; /** Gets the MIME type of the content of SpeechSynthesisStream . */ @@ -40993,7 +40993,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return An asynchronous operation that includes progress updates. For more information, see ReadAsync method. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Goes to the specified position within SpeechSynthesisStream . * @param position The desired position within the stream. @@ -41006,7 +41006,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation places the bytes to write. * @return An asynchronous operation that includes progress updates. For more information, see WriteAsync method. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Provides access to the functionality of an installed speech synthesis engine (voice). */ class SpeechSynthesizer { @@ -41231,7 +41231,7 @@ declare namespace Windows { /** Represents the results of a resource download operation. */ abstract class AdaptiveMediaSourceDownloadResult { /** Gets or sets a buffer containing the downloaded resource. */ - buffer: Windows.Storage.Streams.Buffer; + buffer: Windows.Storage.Streams.IBuffer; /** Gets or sets a string that identifies the MIME content type of the downloaded resource. */ contentType: string; /** Gets or sets an integer value that represents extended status information about the resource download operation. */ @@ -41429,7 +41429,7 @@ declare namespace Windows { * @param effectRequired Indicates whether the audio effect is required. * @param configuration Configuration properties for the audio effect. */ - addAudioEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.PropertySet): void; + addAudioEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.IPropertySet): void; /** * Adds the specified audio effect. * @param activatableClassId The identifier of the audio effect. @@ -41446,7 +41446,7 @@ declare namespace Windows { * @param effectRequired Indicates whether the video effect is required. * @param configuration Configuration properties for the video effect. */ - addVideoEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.PropertySet): void; + addVideoEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.IPropertySet): void; /** Specifies whether the media transcoder always re-encodes the source. */ alwaysReencode: boolean; /** Removes all audio and video effects from the transcode session. */ @@ -41460,7 +41460,7 @@ declare namespace Windows { * @param profile The profile to use for the operation. * @return When this method completes, a PrepareTranscodeResult object is returned which can be used to start the transcode. */ - prepareFileTranscodeAsync(source: Windows.Storage.StorageFile, destination: Windows.Storage.StorageFile, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; + prepareFileTranscodeAsync(source: Windows.Storage.IStorageFile, destination: Windows.Storage.IStorageFile, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously initializes the trancode operation on the specified media source and returns a PrepareTranscodeResult object which can be used to start the transcode operation. * @param source The media source to perform the transcode operation on. @@ -41468,7 +41468,7 @@ declare namespace Windows { * @param profile The profile to use for the operation. * @return When this method completes, a PrepareTranscodeResult object is returned which can be used to start the transcode. */ - prepareMediaStreamSourceTranscodeAsync(source: Windows.Media.Core.MediaSource, destination: Windows.Storage.Streams.RandomAccessStream, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; + prepareMediaStreamSourceTranscodeAsync(source: Windows.Media.Core.IMediaSource, destination: Windows.Storage.Streams.IRandomAccessStream, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously initializes the trancode operation on the specified stream and returns a PrepareTranscodeResult object which can be used to start the transcode operation. * @param source The source stream. @@ -41476,7 +41476,7 @@ declare namespace Windows { * @param profile The profile to use for the operation. * @return When this method completes, a PrepareTranscodeResult object is returned which can be used to start the transcode. */ - prepareStreamTranscodeAsync(source: Windows.Storage.Streams.RandomAccessStream, destination: Windows.Storage.Streams.RandomAccessStream, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; + prepareStreamTranscodeAsync(source: Windows.Storage.Streams.IRandomAccessStream, destination: Windows.Storage.Streams.IRandomAccessStream, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets or sets the time interval to trim from the start of the output. */ trimStartTime: number; /** Gets or sets the time interval to trim from the end of the output. */ @@ -41559,7 +41559,7 @@ declare namespace Windows { /** Gets or sets the duration of the video frame. */ duration: number; /** Gets the extended property set which enables getting and setting properties on the media frame. */ - extendedProperties: Windows.Foundation.Collections.PropertySet; + extendedProperties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets a value that indicates whether an video frame is the first frame after a gap in the stream. */ isDiscontinuous: boolean; /** Gets a value indicating whether the video frame is read-only. */ @@ -41579,7 +41579,7 @@ declare namespace Windows { * Sets the configuration properties that were supplied when the media parser or codec was registered. * @param configuration The configuration properties for the media parser or codec. */ - setProperties(configuration: Windows.Foundation.Collections.PropertySet): void; + setProperties(configuration: Windows.Foundation.Collections.IPropertySet): void; } /** Represents a marker at specific location in a media stream time-line. */ interface IMediaMarker { @@ -41637,7 +41637,7 @@ declare namespace Windows { * @param resultFile The file that the response will be written to. * @return The resultant download operation. */ - createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.StorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; + createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; /** * Initializes a DownloadOperation object with the resource Uri , the file that the response is written to, and the request entity body. * @param uri The location of the resource. @@ -41645,7 +41645,7 @@ declare namespace Windows { * @param requestBodyFile A file that represents the request entity body, which contains additional data the server requires before the download can begin. The file this object points to must be valid for the duration of the download. * @return The resultant download operation. */ - createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.StorageFile, requestBodyFile: Windows.Storage.StorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; + createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile, requestBodyFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; /** * Creates an asynchronous download operation that includes a URI, the file that the response will be written to, and the IInputStream object from which the file contents are read. * @param uri The location of the resource. @@ -41653,7 +41653,7 @@ declare namespace Windows { * @param requestBodyStream A stream that represents the request entity body. * @return The resultant asynchronous download operation. */ - createDownloadAsync(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.StorageFile, requestBodyStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IPromiseWithIAsyncOperation; + createDownloadAsync(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile, requestBodyStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets or sets the TileNotification used to define the visuals, identification tag, and expiration time of a tile notification used to update the app tile when indicating failure of a download to the user. */ failureTileNotification: Windows.UI.Notifications.TileNotification; /** Gets or sets the ToastNotification that defines the content, associated metadata, and events used in a toast notification to indicate failure of a download to the user. */ @@ -41723,7 +41723,7 @@ declare namespace Windows { * Sets the source file for a BackgroundTransferContentPart containing the file for upload. * @param value The source file. */ - setFile(value: Windows.Storage.StorageFile): void; + setFile(value: Windows.Storage.IStorageFile): void; /** * Sets content disposition header values that indicate the nature of the information that this BackgroundTransferContentPart represents. * @param headerName The header name. @@ -41837,7 +41837,7 @@ declare namespace Windows { * @param sourceFile The file for upload. * @return The resultant upload operation. */ - createUpload(uri: Windows.Foundation.Uri, sourceFile: Windows.Storage.StorageFile): Windows.Networking.BackgroundTransfer.UploadOperation; + createUpload(uri: Windows.Foundation.Uri, sourceFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.UploadOperation; /** * Returns an asynchronous operation that, on completion, returns an UploadOperation with the specified URI and one or more BackgroundTransferContentPart objects. * @param uri The location for the upload. @@ -41938,7 +41938,7 @@ declare namespace Windows { /** Gets the URI from which to download the file. */ requestedUri: Windows.Foundation.Uri; /** Returns the IStorageFile object provided by the caller when creating the DownloadOperation object using CreateDownload . */ - resultFile: Windows.Storage.StorageFile; + resultFile: Windows.Storage.IStorageFile; /** Resumes a paused download operation. */ resume(): void; /** @@ -41998,7 +41998,7 @@ declare namespace Windows { /** Gets the URI to upload from. */ requestedUri: Windows.Foundation.Uri; /** Specifies the IStorageFile to upload. */ - sourceFile: Windows.Storage.StorageFile; + sourceFile: Windows.Storage.IStorageFile; /** * Starts an asynchronous upload operation. * @return An asynchronous upload operation that includes progress updates. @@ -42047,7 +42047,7 @@ declare namespace Windows { /** Gets the name of the app. */ attributionName: string; /** Gets the thumbnail of the app. */ - attributionThumbnail: Windows.Storage.Streams.RandomAccessStreamReference; + attributionThumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; /** Gets the number of bytes received by the app over the network. */ bytesReceived: number; /** Gets the number of bytes sent by the app over the network. */ @@ -42202,7 +42202,7 @@ declare namespace Windows { /** Defines a specific NetworkCostType value to query for. */ networkCostType: Windows.Networking.Connectivity.NetworkCostType; /** Gets available data as raw data. */ - rawData: Windows.Storage.Streams.Buffer; + rawData: Windows.Storage.Streams.IBuffer; /** Indicates a specific network operator ID to query for. */ serviceProviderGuid: string; } @@ -43002,7 +43002,7 @@ declare namespace Windows { /** Represents the result of a mobile broadband device service command. */ abstract class MobileBroadbandDeviceServiceCommandResult { /** Gets the response data from the command execution on a mobile broadband device service. */ - responseData: Windows.Storage.Streams.Buffer; + responseData: Windows.Storage.Streams.IBuffer; /** Gets the status code of the command execution on a mobile broadband device service. */ statusCode: number; } @@ -43016,19 +43016,19 @@ declare namespace Windows { * @param data The data to be submitted as part of the command. * @return An asynchronous operation that returns the result of the command. */ - sendQueryCommandAsync(commandId: number, data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + sendQueryCommandAsync(commandId: number, data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Starts an asynchronous operation on a mobile broadband device service to send a set command to the command session. * @param commandId The command identifier for the set command to be executed. * @param data The data to be submitted as part of the command. * @return An asynchronous operation that returns the result of the command. */ - sendSetCommandAsync(commandId: number, data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + sendSetCommandAsync(commandId: number, data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Provides data for a DataReceived event on a MobileBroadbandDeviceServiceDataSession when data is received . */ abstract class MobileBroadbandDeviceServiceDataReceivedEventArgs { /** Gets the data received on the MobileBroadbandDeviceServiceDataSession . */ - receivedData: Windows.Storage.Streams.Buffer; + receivedData: Windows.Storage.Streams.IBuffer; } /** Represents a device service data session which allows the caller to write data to the modem on a mobile broadband device service. */ abstract class MobileBroadbandDeviceServiceDataSession { @@ -43043,7 +43043,7 @@ declare namespace Windows { * @param value The data to be submitted as part of the write operation. * @return An asynchronous operation that returns the result of the write operation. */ - writeDataAsync(value: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncAction; + writeDataAsync(value: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncAction; addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -43063,7 +43063,7 @@ declare namespace Windows { /** Gets the device service identifier for the device service trigger event. */ deviceServiceId: string; /** Gets the received data associated with the triggered event. */ - receivedData: Windows.Storage.Streams.Buffer; + receivedData: Windows.Storage.Streams.IBuffer; } /** Describes different types of Mobile Broadband devices. */ enum MobileBroadbandDeviceType { @@ -43340,7 +43340,7 @@ declare namespace Windows { */ getRecordDetailsAsync(uiccFilePath: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the ID of this UICC application. */ - id: Windows.Storage.Streams.Buffer; + id: Windows.Storage.Streams.IBuffer; /** Gets what kind of UICC application this instance represents. */ kind: Windows.Networking.NetworkOperators.UiccAppKind; /** @@ -43365,7 +43365,7 @@ declare namespace Windows { /** Encapsulates the results of a UICC application record read operation. */ abstract class MobileBroadbandUiccAppReadRecordResult { /** Gets the data returned by the application record read operation. Note that if Status is not Success, this value may be invalid or empty. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; /** Gets a value which indicates whether the record read completed successfully. */ status: Windows.Networking.NetworkOperators.MobileBroadbandUiccAppOperationStatus; } @@ -43815,7 +43815,7 @@ declare namespace Windows { */ static createWatcher(): Windows.Networking.Proximity.PeerWatcher; /** Gets or sets user or device data to include during device discovery. */ - static discoveryData: Windows.Storage.Streams.Buffer; + static discoveryData: Windows.Storage.Streams.IBuffer; /** Gets or sets the name that identifies your computer to remote peers. */ static displayName: string; /** @@ -43850,7 +43850,7 @@ declare namespace Windows { /** Contains information that identifies a peer. */ abstract class PeerInformation { /** Gets the device data included during device discovery. */ - discoveryData: Windows.Storage.Streams.Buffer; + discoveryData: Windows.Storage.Streams.IBuffer; /** Gets the display name of the peer. */ displayName: string; /** Gets the hostname or IP address of the peer. */ @@ -43953,7 +43953,7 @@ declare namespace Windows { * @param message The binary message data to deliver to subscribers. * @return A unique publication ID for the published message. */ - publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.Buffer): number; + publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.IBuffer): number; /** * Publishes a message that contains binary data to subscribers of the specified message type. The specified handler is called when the message has been transmitted. * @param messageType The type of message to deliver to subscribers. @@ -43961,7 +43961,7 @@ declare namespace Windows { * @param messageTransmittedHandler The handler to call when the message has been transmitted. * @return A unique publication ID for the published message. */ - publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.Buffer, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; + publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.IBuffer, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; /** * Publishes a message to subscribers of the specified message type. * @param messageType The type of message to deliver to subscribers. @@ -44013,7 +44013,7 @@ declare namespace Windows { /** Represents a message that's received from a subscription. */ abstract class ProximityMessage { /** Gets the binary data of the message. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; /** Gets the message data as text. */ dataAsString: string; /** Gets the type of the message. */ @@ -44524,9 +44524,9 @@ declare namespace Windows { * Constructs a new SocketActivityContext object with given context data. * @param data Context data to be used when the socket broker notifies the app of socket activity. */ - constructor(data: Windows.Storage.Streams.Buffer); + constructor(data: Windows.Storage.Streams.IBuffer); /** Get the serialized data to associate the app context to a transferred socket. */ - data: Windows.Storage.Streams.Buffer; + data: Windows.Storage.Streams.IBuffer; } /** Provides information on the transferred socket from the Socket Broker. */ abstract class SocketActivityInformation { @@ -44837,7 +44837,7 @@ declare namespace Windows { /** Gets the intermediate certificates sent by the server during SSL negotiation when making an SSL connection with a StreamSocket . */ serverIntermediateCertificates: Windows.Foundation.Collections.IVectorView; /** Get a byte array that represents the private shared secret exchanged by proximity devices. */ - sessionKey: Windows.Storage.Streams.Buffer; + sessionKey: Windows.Storage.Streams.IBuffer; } /** Supports listening for an incoming network connection using a TCP stream socket or Bluetooth RFCOMM. */ class StreamSocketListener { @@ -45183,7 +45183,7 @@ declare namespace Windows { * @param buffer This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @return This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - static createFromSnapshotBuffer(buffer: Windows.Storage.Streams.Buffer): Windows.Networking.XboxLive.XboxLiveDeviceAddress; + static createFromSnapshotBuffer(buffer: Windows.Storage.Streams.IBuffer): Windows.Networking.XboxLive.XboxLiveDeviceAddress; /** * This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @param buffer This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. @@ -45212,7 +45212,7 @@ declare namespace Windows { * This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @return This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - getSnapshotAsBuffer(): Windows.Storage.Streams.Buffer; + getSnapshotAsBuffer(): Windows.Storage.Streams.IBuffer; /** * This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. * @return @@ -45441,7 +45441,7 @@ declare namespace Windows { */ static publishPrivatePayloadBytes(payload: number[]): void; /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - static publishedPrivatePayload: Windows.Storage.Streams.Buffer; + static publishedPrivatePayload: Windows.Storage.Streams.IBuffer; /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ constructor(); /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ @@ -45557,7 +45557,7 @@ declare namespace Windows { /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ status: Windows.Networking.XboxLive.XboxLiveQualityOfServiceMeasurementStatus; /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ - value: Windows.Storage.Streams.Buffer; + value: Windows.Storage.Streams.IBuffer; } /** This API is not available to all apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime. */ enum XboxLiveSocketKind { @@ -46137,7 +46137,7 @@ declare namespace Windows { * @param webAccountPicture The picture to set. * @return This method does not return a value. */ - static setWebAccountPictureAsync(webAccount: Windows.Security.Credentials.WebAccount, webAccountPicture: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; + static setWebAccountPictureAsync(webAccount: Windows.Security.Credentials.WebAccount, webAccountPicture: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; /** * Updates the properties of a web account asynchronously. * @param webAccount The web account to update. @@ -46441,25 +46441,25 @@ declare namespace Windows { * @param data The data to cryptographically sign. * @return When this method completes, it returns a key credential operation result. */ - requestSignAsync(data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + requestSignAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Gets the public portion of the asymmetric KeyCredential . * @return The public portion of the asymmetric key credential. */ - retrievePublicKey(): Windows.Storage.Streams.Buffer; + retrievePublicKey(): Windows.Storage.Streams.IBuffer; /** * Gets the public portion of the asymmetric KeyCredential . * @param blobType The blob type of the public key to retrieve. * @return The public portion of the asymmetric key credential. */ - retrievePublicKey(blobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Storage.Streams.Buffer; + retrievePublicKey(blobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Storage.Streams.IBuffer; } /** Represents the results of the KeyCredential.GetAttestationAsync method. */ abstract class KeyCredentialAttestationResult { /** Gets the attestation information for the KeyCredential. */ - attestationBuffer: Windows.Storage.Streams.Buffer; + attestationBuffer: Windows.Storage.Streams.IBuffer; /** Gets the chain of certificates used to verify the attestation. */ - certificateChainBuffer: Windows.Storage.Streams.Buffer; + certificateChainBuffer: Windows.Storage.Streams.IBuffer; /** Gets the status of the key credential attestation. */ status: Windows.Security.Credentials.KeyCredentialAttestationStatus; } @@ -46516,7 +46516,7 @@ declare namespace Windows { /** Represents the result of a key credential operation. */ abstract class KeyCredentialOperationResult { /** Gets the result of the key credential operation. */ - result: Windows.Storage.Streams.Buffer; + result: Windows.Storage.Streams.IBuffer; /** Gets the status of the key credential. */ status: Windows.Security.Credentials.KeyCredentialStatus; } @@ -46558,7 +46558,7 @@ declare namespace Windows { /** Gets or sets the password string of the credential. */ password: string; /** This API is intended for internal use only should not be used in your code. */ - properties: Windows.Foundation.Collections.PropertySet; + properties: Windows.Foundation.Collections.IPropertySet; /** Gets or sets the resource of the credential. */ resource: string; /** Populates the password for the credential. After the operation returns successfully, you can get the password from the Password property. */ @@ -46718,14 +46718,14 @@ declare namespace Windows { /** Gets or sets the body of text that displays to the user. */ message: string; /** Gets or sets whether to fill dialog box fields with previous credentials. */ - previousCredential: Windows.Storage.Streams.Buffer; + previousCredential: Windows.Storage.Streams.IBuffer; /** Gets or sets the name of the target computer. */ targetName: string; } /** Describes the results of the dialog box operation. */ abstract class CredentialPickerResults { /** Gets the opaque credential. */ - credential: Windows.Storage.Streams.Buffer; + credential: Windows.Storage.Streams.IBuffer; /** Gets the domain name portion of the unpacked credential. */ credentialDomainName: string; /** Gets the password portion of the unpacked credential. */ @@ -46807,7 +46807,7 @@ declare namespace Windows { * @param desizedSize The desired size of the web account picture. * @return When this method completes, it returns the web account's picture. */ - getPictureAsync(desizedSize: Windows.Security.Credentials.WebAccountPictureSize): Windows.Foundation.IPromiseWithIAsyncOperation; + getPictureAsync(desizedSize: Windows.Security.Credentials.WebAccountPictureSize): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the Id of the web account. */ id: string; /** Gets the properties of the web account. */ @@ -46892,7 +46892,7 @@ declare namespace Windows { * Create a new instance of the Certificate class using the specified certificate data. * @param certBlob The certificate data as an ASN.1 DER encoded certificate blob (.cer or .p7b). */ - constructor(certBlob: Windows.Storage.Streams.Buffer); + constructor(certBlob: Windows.Storage.Streams.IBuffer); /** * Build a certificate chain for the specified certificates starting from the end entity certificate to the root using the specified chain building parameters. * @param certificates The intermediate certificates to use when building the certificate chain. @@ -46914,7 +46914,7 @@ declare namespace Windows { * Gets the ASN.1 DER encoded certificate blob. * @return The ASN.1 DER encoded certificate blob. */ - getCertificateBlob(): Windows.Storage.Streams.Buffer; + getCertificateBlob(): Windows.Storage.Streams.IBuffer; /** * Gets the hash value for the certificate for a specified algorithm. * @param hashAlgorithmName The hash algorithm to use for the hash value of the certificate. Only values of "SHA1" or "SHA256" are supported. @@ -47221,12 +47221,12 @@ declare namespace Windows { * @param certificates The list of certificates to build the chain for the signer certificates. * @return An asynchronous operation to retrieve the attached signed CMS message. */ - static generateSignatureAsync(data: Windows.Storage.Streams.Buffer, signers: Windows.Foundation.Collections.IIterable, certificates: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; + static generateSignatureAsync(data: Windows.Storage.Streams.IBuffer, signers: Windows.Foundation.Collections.IIterable, certificates: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a new instance of the CmsAttachedSignature class for the specified signed CMS message. * @param inputBlob A signed CMS message blob. */ - constructor(inputBlob: Windows.Storage.Streams.Buffer); + constructor(inputBlob: Windows.Storage.Streams.IBuffer); /** Gets the list of certificates that are used for chain building for the signer certificate. */ certificates: Windows.Foundation.Collections.IVectorView; /** Gets the content of the signed CMS message. */ @@ -47248,12 +47248,12 @@ declare namespace Windows { * @param certificates The list of certificates to build the chain for the signer certificates. * @return An asynchronous operation to retrieve the detached signed CMS message. */ - static generateSignatureAsync(data: Windows.Storage.Streams.IInputStream, signers: Windows.Foundation.Collections.IIterable, certificates: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; + static generateSignatureAsync(data: Windows.Storage.Streams.IInputStream, signers: Windows.Foundation.Collections.IIterable, certificates: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a new instance of the CmsDetachedSignature class for the specified signed CMS message. * @param inputBlob A signed CMS message blob. */ - constructor(inputBlob: Windows.Storage.Streams.Buffer); + constructor(inputBlob: Windows.Storage.Streams.IBuffer); /** Gets the list of certificates that are used for chain building for the signer certificate. */ certificates: Windows.Foundation.Collections.IVectorView; /** Gets the list of signers that are used for creating or verifying the signature. */ @@ -47565,27 +47565,27 @@ declare namespace Windows { * @param keyBlob Buffer that contains the key pair to import. * @return Represents the imported key pair. */ - importKeyPair(keyBlob: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.CryptographicKey; + importKeyPair(keyBlob: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; /** * Imports a public/private key pair from a buffer in the specified format. * @param keyBlob Buffer that contains the key pair to import. * @param BlobType A CryptographicPrivateKeyBlobType enumeration value that specifies information about the private key contained in the keyBlob buffer. The default value is Pkcs8RawPrivateKeyInfo. * @return Represents the imported key pair. */ - importKeyPair(keyBlob: Windows.Storage.Streams.Buffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; + importKeyPair(keyBlob: Windows.Storage.Streams.IBuffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; /** * Imports a public key into a buffer. * @param keyBlob Buffer that contains the key to import. * @return Represents the imported key. */ - importPublicKey(keyBlob: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.CryptographicKey; + importPublicKey(keyBlob: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; /** * Imports a public key into a buffer for a specified format. * @param keyBlob Buffer that contains the key to import. * @param BlobType A CryptographicPublicKeyBlobType enumeration value that specifies the format of the public key contained in the keyBlob buffer. The default value is X509SubjectPublicKeyInfo. * @return Represents the imported key. */ - importPublicKey(keyBlob: Windows.Storage.Streams.Buffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; + importPublicKey(keyBlob: Windows.Storage.Streams.IBuffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; } /** Represents information about a target algorithm. */ enum Capi1KdfTargetAlgorithm { @@ -47603,7 +47603,7 @@ declare namespace Windows { * @param iv Buffer that contains the initialization vector. If an initialization vector (IV) was used to encrypt the data, you must use the same IV to decrypt the data. For more information, see Encrypt . * @return Decrypted data. */ - static decrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer, iv: Windows.Storage.Streams.Buffer): Windows.Storage.Streams.Buffer; + static decrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, iv: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; /** * Decrypts and authenticates data. For more information and a complete code sample, see EncryptedAndAuthenticatedData . * @param key Symmetric key to use. @@ -47613,7 +47613,7 @@ declare namespace Windows { * @param authenticatedData Authenticated data. This can be Null. * @return A buffer that contains the decrypted data. */ - static decryptAndAuthenticate(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer, nonce: Windows.Storage.Streams.Buffer, authenticationTag: Windows.Storage.Streams.Buffer, authenticatedData: Windows.Storage.Streams.Buffer): Windows.Storage.Streams.Buffer; + static decryptAndAuthenticate(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, nonce: Windows.Storage.Streams.IBuffer, authenticationTag: Windows.Storage.Streams.IBuffer, authenticatedData: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; /** * Decrypts the encrypted input data using the supplied key. * @param key The key to use to decrypt the encrypted input data. @@ -47621,7 +47621,7 @@ declare namespace Windows { * @param iv The initial vector for a symmetric key. For an asymmetric key, set this value to null. * @return The decrypted data. */ - static decryptAsync(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer, iv: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + static decryptAsync(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, iv: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Derives a key from another key by using a key derivation function. For more information, see the KeyDerivationAlgorithmProvider and KeyDerivationParameters classes. * @param key The symmetric or secret key used for derivation. @@ -47629,7 +47629,7 @@ declare namespace Windows { * @param desiredKeySize Requested size, in bytes, of the derived key. * @return Buffer that contains the derived key. */ - static deriveKeyMaterial(key: Windows.Security.Cryptography.Core.CryptographicKey, parameters: Windows.Security.Cryptography.Core.KeyDerivationParameters, desiredKeySize: number): Windows.Storage.Streams.Buffer; + static deriveKeyMaterial(key: Windows.Security.Cryptography.Core.CryptographicKey, parameters: Windows.Security.Cryptography.Core.KeyDerivationParameters, desiredKeySize: number): Windows.Storage.Streams.IBuffer; /** * Encrypts data by using a symmetric or asymmetric algorithm. * @param key Cryptographic key to use for encryption. This can be an asymmetric or a symmetric key. For more information, see AsymmetricKeyAlgorithmProvider and SymmetricKeyAlgorithmProvider . @@ -47637,7 +47637,7 @@ declare namespace Windows { * @param iv Buffer that contains the initialization vector. This can be null for a symmetric algorithm and should always be null for an asymmetric algorithm. If an initialization vector (IV) was used to encrypt the data, you must use the same IV to decrypt the data. You can use the GenerateRandom method to create an IV that contains random data. Other IVs, such as nonce-generated vectors, require custom implementation. For more information, see Cryptographic keys. * @return Encrypted data. */ - static encrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer, iv: Windows.Storage.Streams.Buffer): Windows.Storage.Streams.Buffer; + static encrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, iv: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; /** * Performs authenticated encryption. * @param key Symmetric key to use for encryption. @@ -47646,35 +47646,35 @@ declare namespace Windows { * @param authenticatedData Authenticated data. This can be Null. * @return The encrypted and authenticated data. */ - static encryptAndAuthenticate(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer, nonce: Windows.Storage.Streams.Buffer, authenticatedData: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.EncryptedAndAuthenticatedData; + static encryptAndAuthenticate(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, nonce: Windows.Storage.Streams.IBuffer, authenticatedData: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.EncryptedAndAuthenticatedData; /** * Signs digital content. For more information, see MACs, hashes, and signatures. * @param key Key used for signing. * @param data Data to be signed. * @return The data's signature. */ - static sign(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer): Windows.Storage.Streams.Buffer; + static sign(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; /** * Computes a hash for the supplied input data, and then signs the computed hash using the specified key. * @param key The key to use to compute and sign the hash. * @param data The raw input data to sign. The data is not hashed. * @return An asynchronous operation to retrieve the hashed and signed data. */ - static signAsync(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + static signAsync(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Signs the hashed input data using the specified key. * @param key The key to use to sign the hash. This key must be an asymmetric key obtained from a PersistedKeyProvider or AsymmetricKeyAlgorithmProvider . * @param data The input data to sign. The data is a hashed value which can be obtained through incremental hash. * @return The signed data. */ - static signHashedData(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer): Windows.Storage.Streams.Buffer; + static signHashedData(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; /** * Signs the hashed input data using the specified key. * @param key The key to use to sign the hash. This key must be an asymmetric key obtained from a PersistedKeyProvider or AsymmetricKeyAlgorithmProvider . * @param data The input data to sign. The data is a hashed value which can be obtained through incremental hash. * @return An asynchronous operation to retrieve the signed data. */ - static signHashedDataAsync(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + static signHashedDataAsync(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Verifies a message signature. * @param key Key used for verification. This must be the same key previously used to sign the message. @@ -47682,7 +47682,7 @@ declare namespace Windows { * @param signature Signature previously computed over the message to be verified. * @return true if the message is verified. */ - static verifySignature(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer, signature: Windows.Storage.Streams.Buffer): boolean; + static verifySignature(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, signature: Windows.Storage.Streams.IBuffer): boolean; /** * Verifies the signature of the specified input data against a known signature. * @param key The key to use to retrieve the signature from the input data. This key must be an asymmetric key obtained from a PersistedKeyProvider or AsymmetricKeyAlgorithmProvider . @@ -47690,7 +47690,7 @@ declare namespace Windows { * @param signature The known signature to use to verify the signature of the input data. * @return True if the signature is verified; otherwise false. */ - static verifySignatureWithHashInput(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.Buffer, signature: Windows.Storage.Streams.Buffer): boolean; + static verifySignatureWithHashInput(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, signature: Windows.Storage.Streams.IBuffer): boolean; } /** Represents a reusable hashing object and contains the result of a hashing operation. */ abstract class CryptographicHash { @@ -47698,12 +47698,12 @@ declare namespace Windows { * Appends a binary encoded string to the data stored in the CryptographicHash object. * @param data Data to append. */ - append(data: Windows.Storage.Streams.Buffer): void; + append(data: Windows.Storage.Streams.IBuffer): void; /** * Gets hashed data from the CryptographicHash object and resets the object. * @return Hashed data. */ - getValueAndReset(): Windows.Storage.Streams.Buffer; + getValueAndReset(): Windows.Storage.Streams.IBuffer; } /** Represents a symmetric key or an asymmetric key pair. */ abstract class CryptographicKey { @@ -47711,24 +47711,24 @@ declare namespace Windows { * Exports the key pair to a buffer. * @return Buffer that contains the key pair. */ - export(): Windows.Storage.Streams.Buffer; + export(): Windows.Storage.Streams.IBuffer; /** * Exports the key pair to a buffer given a specified format. * @param BlobType A CryptographicPrivateKeyBlobType enumeration value that specifies the format of the key in the buffer. The default value is Pkcs8RawPrivateKeyInfo. * @return Buffer that contains the key pair. */ - export(BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Storage.Streams.Buffer; + export(BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Storage.Streams.IBuffer; /** * Exports a public key to a buffer. * @return Buffer that contains the public key. */ - exportPublicKey(): Windows.Storage.Streams.Buffer; + exportPublicKey(): Windows.Storage.Streams.IBuffer; /** * Exports a public key to a buffer given a specified format. * @param BlobType A CryptographicPublicKeyBlobType enumeration value that specifies the format of the key in the buffer. The default value is X509SubjectPublicKeyInfo. * @return Buffer that contains the public key. */ - exportPublicKey(BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Storage.Streams.Buffer; + exportPublicKey(BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Storage.Streams.IBuffer; /** Gets the size, in bits, of the key. */ keySize: number; } @@ -47865,9 +47865,9 @@ declare namespace Windows { /** Contains data that can be retrieved from encrypted and authenticated data. Authenticated encryption algorithms are opened by using the SymmetricKeyAlgorithmProvider class. */ abstract class EncryptedAndAuthenticatedData { /** Gets the authentication tag. */ - authenticationTag: Windows.Storage.Streams.Buffer; + authenticationTag: Windows.Storage.Streams.IBuffer; /** Gets the encrypted data. */ - encryptedData: Windows.Storage.Streams.Buffer; + encryptedData: Windows.Storage.Streams.IBuffer; } /** Contains static properties that enable you to retrieve algorithm names that can be used in the OpenAlgorithm method of the HashAlgorithmProvider class. */ abstract class HashAlgorithmNames { @@ -47902,7 +47902,7 @@ declare namespace Windows { * @param data Data to be hashed. * @return Hashed data. */ - hashData(data: Windows.Storage.Streams.Buffer): Windows.Storage.Streams.Buffer; + hashData(data: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; /** Gets the length, in bytes, of the hash. */ hashLength: number; } @@ -47964,7 +47964,7 @@ declare namespace Windows { * @param keyMaterial Data used to create the key. * @return Represents the KDF key. */ - createKey(keyMaterial: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.CryptographicKey; + createKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; } /** Represents parameters used when deriving a key. */ abstract class KeyDerivationParameters { @@ -47980,14 +47980,14 @@ declare namespace Windows { * @param iterationCount Number of iterations to be used to derive a key. * @return Refers to the parameters used during key derivation. */ - static buildForPbkdf2(pbkdf2Salt: Windows.Storage.Streams.Buffer, iterationCount: number): Windows.Security.Cryptography.Core.KeyDerivationParameters; + static buildForPbkdf2(pbkdf2Salt: Windows.Storage.Streams.IBuffer, iterationCount: number): Windows.Security.Cryptography.Core.KeyDerivationParameters; /** * Creates a KeyDerivationParameters object for use in a counter mode, hash-based message authentication code (HMAC) key derivation function. * @param label Buffer that specifies the purpose for the derived keying material. * @param context Buffer that specifies information related to the derived keying material. For example, the context can identify the parties who are deriving the keying material and, optionally, a nonce known by the parties. * @return Refers to the parameters used during key derivation. */ - static buildForSP800108(label: Windows.Storage.Streams.Buffer, context: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.KeyDerivationParameters; + static buildForSP800108(label: Windows.Storage.Streams.IBuffer, context: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.KeyDerivationParameters; /** * Creates a KeyDerivationParameters object for use in the SP800-56A key derivation function. * @param algorithmId Specifies the intended purpose of the derived key. @@ -47997,13 +47997,13 @@ declare namespace Windows { * @param suppPrivInfo Contains private information known to both initiator and responder, such as a shared secret. * @return Refers to the parameters used during key derivation. */ - static buildForSP80056a(algorithmId: Windows.Storage.Streams.Buffer, partyUInfo: Windows.Storage.Streams.Buffer, partyVInfo: Windows.Storage.Streams.Buffer, suppPubInfo: Windows.Storage.Streams.Buffer, suppPrivInfo: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.KeyDerivationParameters; + static buildForSP80056a(algorithmId: Windows.Storage.Streams.IBuffer, partyUInfo: Windows.Storage.Streams.IBuffer, partyVInfo: Windows.Storage.Streams.IBuffer, suppPubInfo: Windows.Storage.Streams.IBuffer, suppPrivInfo: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.KeyDerivationParameters; /** Gets or sets the Capi1KdfTargetAlgorithm . */ capi1KdfTargetAlgorithm: Windows.Security.Cryptography.Core.Capi1KdfTargetAlgorithm; /** Retrieves the number of iterations used to derive the key. For more information, see BuildForPbkdf2 . */ iterationCount: number; /** Gets or sets the parameters used by the key derivation algorithm. */ - kdfGenericBinary: Windows.Storage.Streams.Buffer; + kdfGenericBinary: Windows.Storage.Streams.IBuffer; } /** Contains static properties that enable you to retrieve algorithm names that can be used in the OpenAlgorithm method of the MacAlgorithmProvider class. */ abstract class MacAlgorithmNames { @@ -48035,13 +48035,13 @@ declare namespace Windows { * @param keyMaterial Random data used to help generate the hash. You can call the GenerateRandom method to create the random data. * @return A CryptographicHash object that supports incremental hash operations. */ - createHash(keyMaterial: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.CryptographicHash; + createHash(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicHash; /** * Creates a symmetric key that can be used to create the MAC value. * @param keyMaterial Random data used to help generate the key. You can call the GenerateRandom method to create the random data. * @return Symmetric key. */ - createKey(keyMaterial: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.CryptographicKey; + createKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; /** Gets the length, in bytes, of the message authentication code. */ macLength: number; } @@ -48122,7 +48122,7 @@ declare namespace Windows { * @param keyMaterial Data used to generate the key. You can call the GenerateRandom method to create random key material. * @return Symmetric key. */ - createSymmetricKey(keyMaterial: Windows.Storage.Streams.Buffer): Windows.Security.Cryptography.Core.CryptographicKey; + createSymmetricKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; } } /** Contains static methods that implement data management functionality common to cryptographic operations. */ @@ -48133,63 +48133,63 @@ declare namespace Windows { * @param object2 Buffer to be used for comparison. * @return True specifies that the buffers are equal. Two buffers are equal if each code point in one matches the corresponding code point in the other. */ - static compare(object1: Windows.Storage.Streams.Buffer, object2: Windows.Storage.Streams.Buffer): boolean; + static compare(object1: Windows.Storage.Streams.IBuffer, object2: Windows.Storage.Streams.IBuffer): boolean; /** * Converts a buffer to an encoded string. * @param encoding Encoding format. * @param buffer Data to be encoded. * @return A string that contains the encoded data. */ - static convertBinaryToString(encoding: Windows.Security.Cryptography.BinaryStringEncoding, buffer: Windows.Storage.Streams.Buffer): string; + static convertBinaryToString(encoding: Windows.Security.Cryptography.BinaryStringEncoding, buffer: Windows.Storage.Streams.IBuffer): string; /** * Converts a string to an encoded buffer. * @param value String to be encoded. * @param encoding Encoding format. * @return Encoded buffer. */ - static convertStringToBinary(value: string, encoding: Windows.Security.Cryptography.BinaryStringEncoding): Windows.Storage.Streams.Buffer; + static convertStringToBinary(value: string, encoding: Windows.Security.Cryptography.BinaryStringEncoding): Windows.Storage.Streams.IBuffer; /** * Copies a buffer to an array of bytes. * @param buffer Input buffer. * @return An array of bytes that contains the values copied from the input buffer. You must declare the array before calling this method and pass it by using the ref keyword. If the buffer for the input parameter is empty, then the value parameter will be returned as NULL. */ - static copyToByteArray(buffer: Windows.Storage.Streams.Buffer): number[]; + static copyToByteArray(buffer: Windows.Storage.Streams.IBuffer): number[]; /** * Creates a buffer from an input byte array. * @param value An array of bytes used to create the buffer. * @return Output buffer. */ - static createFromByteArray(value: number[]): Windows.Storage.Streams.Buffer; + static createFromByteArray(value: number[]): Windows.Storage.Streams.IBuffer; /** * Decodes a string that has been base64 encoded. * @param value Base64 encoded input string. * @return Output buffer that contains the decoded string. */ - static decodeFromBase64String(value: string): Windows.Storage.Streams.Buffer; + static decodeFromBase64String(value: string): Windows.Storage.Streams.IBuffer; /** * Decodes a string that has been hexadecimal encoded. * @param value Encoded input string. * @return Output buffer that contains the decoded string. */ - static decodeFromHexString(value: string): Windows.Storage.Streams.Buffer; + static decodeFromHexString(value: string): Windows.Storage.Streams.IBuffer; /** * Encodes a buffer to a base64 string. * @param buffer Input buffer. * @return Base64-encoded output string. */ - static encodeToBase64String(buffer: Windows.Storage.Streams.Buffer): string; + static encodeToBase64String(buffer: Windows.Storage.Streams.IBuffer): string; /** * Encodes a buffer to a hexadecimal string. * @param buffer Input buffer. * @return Hexadecimal encoded output string. */ - static encodeToHexString(buffer: Windows.Storage.Streams.Buffer): string; + static encodeToHexString(buffer: Windows.Storage.Streams.IBuffer): string; /** * Creates a buffer that contains random data. * @param length Length, in bytes, of the buffer to create. * @return Output buffer that contains the random data. */ - static generateRandom(length: number): Windows.Storage.Streams.Buffer; + static generateRandom(length: number): Windows.Storage.Streams.IBuffer; /** * Creates a random number. * @return Integer that contains the random data. @@ -48212,7 +48212,7 @@ declare namespace Windows { * @param data Data to protect. * @return Represents an asynchronous operation. */ - protectAsync(data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + protectAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously protects a data stream. * @param src Stream to be protected. @@ -48225,7 +48225,7 @@ declare namespace Windows { * @param data Data to decrypt. * @return Represents an asynchronous operation. */ - unprotectAsync(data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + unprotectAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously decrypts a data stream. * @param src Stream to decrypt. @@ -48241,7 +48241,7 @@ declare namespace Windows { /** Contains information about the result from protecting or unprotecting an enterprise protected buffer. */ abstract class BufferProtectUnprotectResult { /** Gets the enterprise protected buffer that has been protected or unprotected. */ - buffer: Windows.Storage.Streams.Buffer; + buffer: Windows.Storage.Streams.IBuffer; /** Gets the DataProtectionInfo object concerning the enterprise protected buffer that has been protected or unprotected. */ protectionInfo: Windows.Security.EnterpriseData.DataProtectionInfo; } @@ -48259,7 +48259,7 @@ declare namespace Windows { * @param protectedData The buffer for which protection status is being queried. * @return When the call to this method completes successfully, it returns a DataProtectionInfo object that contains the status of the buffer. */ - static getProtectionInfoAsync(protectedData: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + static getProtectionInfoAsync(protectedData: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Get the status of an enterprise protected stream. * @param protectedStream The stream for which protection status is being queried. @@ -48272,7 +48272,7 @@ declare namespace Windows { * @param identity The enterprise identity. This is an email address or domain that is managed. Your app should use IsIdentityManaged to confirm that an email address or domain is managed. * @return When the call to this method completes successfully, it returns a BufferProtectUnprotectResult object that contains the status of the newly protected buffer. */ - static protectAsync(data: Windows.Storage.Streams.Buffer, identity: string): Windows.Foundation.IPromiseWithIAsyncOperation; + static protectAsync(data: Windows.Storage.Streams.IBuffer, identity: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Protect a stream of data to an enterprise identity. * @param unprotectedStream The input, unprotected stream. @@ -48286,7 +48286,7 @@ declare namespace Windows { * @param data The buffer to be unprotected. * @return When the call to this method completes successfully, it returns a BufferProtectUnprotectResult object that contains the status of the unprotected buffer. */ - static unprotectAsync(data: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperation; + static unprotectAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Removes the protection to an enterprise identity from a stream of data. * @param protectedStream The input, protected stream. @@ -48347,7 +48347,7 @@ declare namespace Windows { * @param collisionOption A CreationCollisionOption value that specifies what to do if desiredName already exists. * @return When the call to this method completes successfully, it returns a ProtectedFileCreateResult object representing the newly created protected file. */ - static createProtectedAndOpenAsync(parentFolder: Windows.Storage.StorageFolder, desiredName: string, identity: string, collisionOption: Windows.Storage.CreationCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; + static createProtectedAndOpenAsync(parentFolder: Windows.Storage.IStorageFolder, desiredName: string, identity: string, collisionOption: Windows.Storage.CreationCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Get the status of an enterprise-protected file. * @param source The file or folder for which protection status is being queried. @@ -48360,14 +48360,14 @@ declare namespace Windows { * @param containerFile The enterprise protected file to be created and loaded. * @return When the call to this method completes successfully, it returns a ProtectedContainerImportResult object representing the newly created protected file. */ - static loadFileFromContainerAsync(containerFile: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFileFromContainerAsync(containerFile: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Create an enterprise-protected file in a specified storage item (such as a folder), and load it from a container file. * @param containerFile The enterprise protected file to be created and loaded. * @param target The storage item into which to create the enterprise protected file. * @return When the call to this method completes successfully, it returns a ProtectedContainerImportResult object representing the newly created protected file. */ - static loadFileFromContainerAsync(containerFile: Windows.Storage.StorageFile, target: Windows.Storage.IStorageItem): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFileFromContainerAsync(containerFile: Windows.Storage.IStorageFile, target: Windows.Storage.IStorageItem): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Create an enterprise-protected file in a specified storage item (such as a folder), and load it from a container file. * @param containerFile The enterprise protected file to be created and loaded. @@ -48375,7 +48375,7 @@ declare namespace Windows { * @param collisionOption The enum value that determines how Windows responds if the created file has the same name as an existing item in the container's location. * @return When the call to this method completes successfully, it returns a ProtectedContainerImportResult object representing the newly created protected file. */ - static loadFileFromContainerAsync(containerFile: Windows.Storage.StorageFile, target: Windows.Storage.IStorageItem, collisionOption: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; + static loadFileFromContainerAsync(containerFile: Windows.Storage.IStorageFile, target: Windows.Storage.IStorageItem, collisionOption: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Protect the data in a file to an enterprise identity. The app can then use standard APIs to read or write from the file. * @param target The file to be protected. @@ -48388,14 +48388,14 @@ declare namespace Windows { * @param protectedFile The protected source file being copied. * @return When the call to this method completes successfully, it returns a ProtectedContainerExportResult object representing the newly created container file. */ - static saveFileAsContainerAsync(protectedFile: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static saveFileAsContainerAsync(protectedFile: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Save an enterprise-protected file as a containerized version, and share it with a specified list of user identities. * @param protectedFile The protected source file being copied. * @param sharedWithIdentities A collection of strings representing the user identities to share the containerized file with. For example, email recipients. * @return When the call to this method completes successfully, it returns a ProtectedContainerExportResult object representing the newly created container file. */ - static saveFileAsContainerAsync(protectedFile: Windows.Storage.StorageFile, sharedWithIdentities: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; + static saveFileAsContainerAsync(protectedFile: Windows.Storage.IStorageFile, sharedWithIdentities: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Describes the enterprise protection state of a file or folder. */ enum FileProtectionStatus { @@ -48493,7 +48493,7 @@ declare namespace Windows { /** Information about the enterprise protected file. */ protectionInfo: Windows.Security.EnterpriseData.FileProtectionInfo; /** The stream random access to the newly created enterprise protected file. */ - stream: Windows.Storage.Streams.RandomAccessStream; + stream: Windows.Storage.Streams.IRandomAccessStream; } /** Possible status values for an enterprise protected file that has been imported from or exported to a container file. */ enum ProtectedImportExportStatus { @@ -49365,7 +49365,7 @@ declare namespace Windows { /** Gets the name of the current settings container. */ name: string; /** Gets an object that represents the settings in this settings container. */ - values: Windows.Foundation.Collections.PropertySet; + values: Windows.Foundation.Collections.IPropertySet; } /** Provides access to the settings in a settings container. The ApplicationDataContainer.Values property returns an object that can be cast to this type. */ abstract class ApplicationDataContainerSettings { @@ -49453,14 +49453,14 @@ declare namespace Windows { * @param fileToReplace The StorageFile to be replaced. * @return No object or value is returned when this method completes. */ - copyAndReplaceAsync(fileToReplace: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + copyAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Creates a copy of the StorageFile , gives it the specified file name, and stores it in the specified StorageFolder . * @param destinationFolder The folder in which to store the copied file. * @param desiredNewName The name of the new copy. * @return When this method completes successfully, it returns the copy as a StorageFile object. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a copy of the StorageFile , gives it the specified file name, and stores it in the specified StorageFolder . The method also specifies what to do if a file with the same name already exists in the specified folder. * @param destinationFolder The folder in which to store the copied file. @@ -49468,13 +49468,13 @@ declare namespace Windows { * @param option A value that indicates what to do if the file name already exists in the destination folder. * @return When this method completes successfully, it returns the copy as a StorageFile object. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a copy of the StorageFile and stores it in the specified StorageFolder . * @param destinationFolder The folder in which to store the copied file. * @return When this method completes successfully, it returns the copy as a StorageFile object. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the date that the file was created. */ dateCreated: Date; /** @@ -49550,13 +49550,13 @@ declare namespace Windows { * @param fileToReplace The StorageFile to be replaced. * @return An object for managing the asynchronous move and replace operation. */ - moveAndReplaceAsync(fileToReplace: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + moveAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Moves the StorageFile to the specified StorageFolder . * @param destinationFolder The destination folder. * @return No object or value is returned when this method completes. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder): Windows.Foundation.IPromiseWithIAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IPromiseWithIAsyncAction; /** * Moves the StorageFile to the specified folder and gives it the specified file name. The method also specifies what to do if a file with the same name already exists in the specified folder. * @param destinationFolder The destination folder. @@ -49564,14 +49564,14 @@ declare namespace Windows { * @param option A value that indicates what to do if the file name already exists in the destination folder. * @return No object or value is returned when this method completes. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncAction; /** * Moves the StorageFile to the specified folder, and gives the file the specified file name. * @param destinationFolder The destination folder. * @param desiredNewName The new file name. * @return No object or value is returned when this method completes. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncAction; /** Gets the music properties associated with the StorageFile , such as the album name, artist name, bit rate, and so on. */ musicProperties: Windows.Storage.FileProperties.MusicProperties; /** Gets the name of the StorageFile . */ @@ -49589,14 +49589,14 @@ declare namespace Windows { * @param accessMode One of the enumeration values that specifies the type of access to allow. * @return When this method completes, it returns an IRandomAccessStream that contains the requested random-access stream. */ - openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IPromiseWithIAsyncOperation; + openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Opens a random-access stream with the specified options over the specified file. * @param accessMode One of the enumeration values that specifies the type of access to allow. * @param options A bitwise combination of the enumeration values that specify options for opening the stream. * @return When this method completes, it returns an IRandomAccessStream that contains the requested random-access stream. */ - openAsync(accessMode: Windows.Storage.FileAccessMode, options: Windows.Storage.StorageOpenOptions): Windows.Foundation.IPromiseWithIAsyncOperation; + openAsync(accessMode: Windows.Storage.FileAccessMode, options: Windows.Storage.StorageOpenOptions): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Opens a read-only, random-access stream over the StorageFile . * @return When this method completes successfully, it returns a read-only, random-access stream (type IRandomAccessStreamWithContentType ). @@ -50029,12 +50029,12 @@ declare namespace Windows { * @param file The file to update. * @return When this method completes, it returns a FileUpdateStatus enum value that describes the status of the updates to the file. */ - static completeUpdatesAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static completeUpdatesAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Lets apps defer real-time updates for a specified file. * @param file The file to defer updates for. */ - static deferUpdates(file: Windows.Storage.StorageFile): void; + static deferUpdates(file: Windows.Storage.IStorageFile): void; } /** Provides a unified interface to the compression features included in Windows that frees developers from responsibility for managing block sizes, compression parameters, and other details that the native compression API requires. */ namespace Compression { @@ -50089,7 +50089,7 @@ declare namespace Windows { * @param buffer The buffer that contains the information to be written to the stream. * @return The asynchronous operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** A decompressor takes a stream compressed by a compressor and decompresses it. */ class Decompressor { @@ -50112,7 +50112,7 @@ declare namespace Windows { * @param options Read options * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } } /** Specifies what to do if a file or folder with the specified name already exists in the current folder when you create a new file or folder. */ @@ -50215,7 +50215,7 @@ declare namespace Windows { * @param lines The list of text strings to append as lines. * @return No object or value is returned when this method completes. */ - static appendLinesAsync(file: Windows.Storage.StorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncAction; + static appendLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncAction; /** * Appends lines of text to the specified file using the specified character encoding. * @param file The file that the lines are appended to. @@ -50223,14 +50223,14 @@ declare namespace Windows { * @param encoding The character encoding of the file. * @return No object or value is returned when this method completes. */ - static appendLinesAsync(file: Windows.Storage.StorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; + static appendLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; /** * Appends text to the specified file. * @param file The file that the text is appended to. * @param contents The text to append. * @return No object or value is returned when this method completes. */ - static appendTextAsync(file: Windows.Storage.StorageFile, contents: string): Windows.Foundation.IPromiseWithIAsyncAction; + static appendTextAsync(file: Windows.Storage.IStorageFile, contents: string): Windows.Foundation.IPromiseWithIAsyncAction; /** * Appends text to the specified file using the specified character encoding. * @param file The file that the text is appended to. @@ -50238,60 +50238,60 @@ declare namespace Windows { * @param encoding The character encoding of the file. * @return No object or value is returned when this method completes. */ - static appendTextAsync(file: Windows.Storage.StorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; + static appendTextAsync(file: Windows.Storage.IStorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; /** * Reads the contents of the specified file and returns a buffer. * @param file The file to read. * @return When this method completes, it returns an object (type IBuffer ) that represents the contents of the file. */ - static readBufferAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static readBufferAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Reads the contents of the specified file and returns lines of text. * @param file The file to read. * @return When this method completes successfully, it returns the contents of the file as a list (type IVector ) of lines of text. Each line of text in the list is represented by a String object. */ - static readLinesAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation>; + static readLinesAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation>; /** * Reads the contents of the specified file using the specified character encoding and returns lines of text. * @param file The file to read. * @param encoding The character encoding to use. * @return When this method completes successfully, it returns the contents of the file as a list (type IVector ) of lines of text. Each line of text in the list is represented by a String object. */ - static readLinesAsync(file: Windows.Storage.StorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncOperation>; + static readLinesAsync(file: Windows.Storage.IStorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncOperation>; /** * Reads the contents of the specified file and returns text. * @param file The file to read. * @return When this method completes successfully, it returns the contents of the file as a text string. */ - static readTextAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static readTextAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Reads the contents of the specified file using the specified character encoding and returns text. * @param file The file to read. * @param encoding The character encoding to use. * @return When this method completes successfully, it returns the contents of the file as a text string. */ - static readTextAsync(file: Windows.Storage.StorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncOperation; + static readTextAsync(file: Windows.Storage.IStorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Writes data from a buffer to the specified file. * @param file The file that the buffer of data is written to. * @param buffer The buffer that contains the data to write. * @return No object or value is returned when this method completes. */ - static writeBufferAsync(file: Windows.Storage.StorageFile, buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncAction; + static writeBufferAsync(file: Windows.Storage.IStorageFile, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncAction; /** * Writes an array of bytes of data to the specified file. * @param file The file that the byte is written to. * @param buffer The array of bytes to write. * @return No object or value is returned when this method completes. */ - static writeBytesAsync(file: Windows.Storage.StorageFile, buffer: number[]): Windows.Foundation.IPromiseWithIAsyncAction; + static writeBytesAsync(file: Windows.Storage.IStorageFile, buffer: number[]): Windows.Foundation.IPromiseWithIAsyncAction; /** * Writes lines of text to the specified file. * @param file The file that the lines are written to. * @param lines The list of text strings to write as lines. * @return No object or value is returned when this method completes. */ - static writeLinesAsync(file: Windows.Storage.StorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncAction; + static writeLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IPromiseWithIAsyncAction; /** * Writes lines of text to the specified file using the specified character encoding. * @param file The file that the lines are written to. @@ -50299,14 +50299,14 @@ declare namespace Windows { * @param encoding The character encoding of the file. * @return No object or value is returned when this method completes. */ - static writeLinesAsync(file: Windows.Storage.StorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; + static writeLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; /** * Writes text to the specified file. * @param file The file that the text is written to. * @param contents The text to write. * @return No object or value is returned when this method completes. */ - static writeTextAsync(file: Windows.Storage.StorageFile, contents: string): Windows.Foundation.IPromiseWithIAsyncAction; + static writeTextAsync(file: Windows.Storage.IStorageFile, contents: string): Windows.Foundation.IPromiseWithIAsyncAction; /** * Writes text to the specified file using the specified character encoding. * @param file The file that the text is written to. @@ -50314,7 +50314,7 @@ declare namespace Windows { * @param encoding The character encoding of the file. * @return No object or value is returned when this method completes. */ - static writeTextAsync(file: Windows.Storage.StorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; + static writeTextAsync(file: Windows.Storage.IStorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IPromiseWithIAsyncAction; } /** Provides access to the properties of a file. */ namespace FileProperties { @@ -50379,21 +50379,21 @@ declare namespace Windows { * @param file The file from which the geographic metadata is retrieved. * @return An asynchronous operation that returns a Geopoint on successful completion. */ - static getGeotagAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static getGeotagAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Asynchronously sets the geographic metadata of a file from the provided Geopoint . * @param file The file into which the geographic metadata is set. * @param geopoint The Geopoint representing the geographic metadata to be set. * @return An asynchronous action. */ - static setGeotagAsync(file: Windows.Storage.StorageFile, geopoint: Windows.Devices.Geolocation.Geopoint): Windows.Foundation.IPromiseWithIAsyncAction; + static setGeotagAsync(file: Windows.Storage.IStorageFile, geopoint: Windows.Devices.Geolocation.Geopoint): Windows.Foundation.IPromiseWithIAsyncAction; /** * Asynchronously sets the geographic metadata of a file to the device's current location using the provided Geolocator object. * @param file The file into which the geographic metadata is set. * @param geolocator The Geolocator object that will be used to determine the device's current location. * @return An asychronous action. */ - static setGeotagFromGeolocatorAsync(file: Windows.Storage.StorageFile, geolocator: Windows.Devices.Geolocation.Geolocator): Windows.Foundation.IPromiseWithIAsyncAction; + static setGeotagFromGeolocatorAsync(file: Windows.Storage.IStorageFile, geolocator: Windows.Devices.Geolocation.Geolocator): Windows.Foundation.IPromiseWithIAsyncAction; } /** Provides access to the image-related properties of an item (like a file or folder). */ abstract class ImageProperties { @@ -50577,7 +50577,7 @@ declare namespace Windows { * Creates a new stream over the thumbnail that is represented by the current storageItemThumbnail object. * @return The new thumbnail stream. The initial, internal position of the stream is 0. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Releases system resources that are exposed by a Windows Runtime object. */ close(): void; /** Gets the MIME content type of the thumbnail image. */ @@ -50612,7 +50612,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** Gets a value that indicates whether the thumbnail image returned was a cached version with a smaller size. */ returnedSmallerCachedSize: boolean; /** @@ -50629,7 +50629,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Describes the purpose of the thumbnail to determine how to adjust the thumbnail image to retrieve. */ enum ThumbnailMode { @@ -50851,7 +50851,7 @@ declare namespace Windows { * @param absolutePath The path of the file to read. * @return When this method completes, it returns an object (type IBuffer ) that represents the contents of the file. */ - static readBufferAsync(absolutePath: string): Windows.Foundation.IPromiseWithIAsyncOperation; + static readBufferAsync(absolutePath: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Reads the contents of the file at the specified path or URI and returns lines of text. * @param absolutePath The path of the file to read. @@ -50884,7 +50884,7 @@ declare namespace Windows { * @param buffer The buffer that contains the data to write. * @return No object or value is returned when this method completes. */ - static writeBufferAsync(absolutePath: string, buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncAction; + static writeBufferAsync(absolutePath: string, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncAction; /** * Writes a single byte of data to the file at the specified path or URI. * @param absolutePath The path of the file that the byte is written to. @@ -51205,7 +51205,7 @@ declare namespace Windows { * @param file The file to add to the list of files that the user has chosen. * @return The enumeration value that indicates the result of this addFile method. */ - addFile(id: string, file: Windows.Storage.StorageFile): Windows.Storage.Pickers.Provider.AddFileResult; + addFile(id: string, file: Windows.Storage.IStorageFile): Windows.Storage.Pickers.Provider.AddFileResult; /** Gets a list of file types (extensions) that the user can choose. */ allowedFileTypes: Windows.Foundation.Collections.IVectorView; /** @@ -51213,7 +51213,7 @@ declare namespace Windows { * @param file The file to test. * @return True if the file can be added to the file picker UI; otherwise false. */ - canAddFile(file: Windows.Storage.StorageFile): boolean; + canAddFile(file: Windows.Storage.IStorageFile): boolean; /** * Determines whether the specified file is in the list of files that the user has chosen. * @param id The identifier of the file. @@ -51320,7 +51320,7 @@ declare namespace Windows { */ getDeferral(): Windows.Storage.Pickers.Provider.TargetFileRequestDeferral; /** Gets or sets the IStorageFile object that is provided to represent the file to save by the app that is providing the save location. */ - targetFile: Windows.Storage.StorageFile; + targetFile: Windows.Storage.IStorageFile; } /** Used by an app that provides a save location to indicate asynchronously that the app is finished responding to a targetfilerequested event. */ abstract class TargetFileRequestDeferral { @@ -51364,7 +51364,7 @@ declare namespace Windows { * @param writeMode A value that specifies whether other apps can write to the local file and, if so, whether Windows will request updates after the local file is written. * @param options A value that specifies additional circumstances and behaviors for when Windows requests updates. */ - static setUpdateInformation(file: Windows.Storage.StorageFile, contentId: string, readMode: Windows.Storage.Provider.ReadActivationMode, writeMode: Windows.Storage.Provider.WriteActivationMode, options: Windows.Storage.Provider.CachedFileOptions): void; + static setUpdateInformation(file: Windows.Storage.IStorageFile, contentId: string, readMode: Windows.Storage.Provider.ReadActivationMode, writeMode: Windows.Storage.Provider.WriteActivationMode, options: Windows.Storage.Provider.CachedFileOptions): void; } /** Used to interact with the file picker if your app provides file updates through the Cached File Updater contract. */ abstract class CachedFileUpdaterUI { @@ -51409,7 +51409,7 @@ declare namespace Windows { * Provide a new version of the local file to represent the remote file. * @param value The new version of the local file that will represent remote file. */ - updateLocalFile(value: Windows.Storage.StorageFile): void; + updateLocalFile(value: Windows.Storage.IStorageFile): void; /** Gets or sets a message to the user indicating that user input is needed to complete the FileUpdateRequest . */ userInputNeededMessage: string; } @@ -51530,7 +51530,7 @@ declare namespace Windows { * @param indexableContent The content properties to index. * @return */ - addAsync(indexableContent: Windows.Storage.Search.IndexableContent): any; /* unmapped return type */ + addAsync(indexableContent: Windows.Storage.Search.IIndexableContent): any; /* unmapped return type */ /** * Builds a query with the specified search filter, sort order, and identifies which properties to retrieve. * @param searchFilter The AQS filter. @@ -51586,7 +51586,7 @@ declare namespace Windows { * @param indexableContent The content properties to update. * @return */ - updateAsync(indexableContent: Windows.Storage.Search.IndexableContent): any; /* unmapped return type */ + updateAsync(indexableContent: Windows.Storage.Search.IIndexableContent): any; /* unmapped return type */ } /** Represents a query for content properties in the ContentIndexer . */ abstract class ContentIndexerQuery { @@ -51647,7 +51647,7 @@ declare namespace Windows { /** Gets the content properties. */ properties: Windows.Foundation.Collections.IMap; /** Gets or sets a Stream that provides full-text content. Changes to the actual representation of the item in the index can be made using the ContentIndexer class. */ - stream: Windows.Storage.Streams.RandomAccessStream; + stream: Windows.Storage.Streams.IRandomAccessStream; /** Specifies the type of content in the Stream . */ streamContentType: string; } @@ -51999,7 +51999,7 @@ declare namespace Windows { /** Gets the content properties. */ properties: Windows.Foundation.Collections.IMap; /** Gets or sets a stream that provides full-text content. Changes to the actual representation of the item in the index can be made using the ContentIndexer class. */ - stream: Windows.Storage.Streams.RandomAccessStream; + stream: Windows.Storage.Streams.IRandomAccessStream; /** Specifies the type of content in the Stream . */ streamContentType: string; } @@ -52044,7 +52044,7 @@ declare namespace Windows { * @param thumbnail The thumbnail image for the StorageFile to create. * @return When this method completes, it returns a StorageFile object that represents the new stream of data. */ - static createStreamedFileAsync(displayNameWithExtension: string, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.RandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; + static createStreamedFileAsync(displayNameWithExtension: string, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a StorageFile to represent a stream of data from the specified URI resource. This method lets the app download the data on-demand when the StorageFile that represents the stream is first accessed. * @param displayNameWithExtension The user-friendly name of the StorageFile to create, including a file type extension. @@ -52052,7 +52052,7 @@ declare namespace Windows { * @param thumbnail The thumbnail image for the StorageFile to create. * @return When this method completes, it returns a StorageFile object that represents the URI resource. */ - static createStreamedFileFromUriAsync(displayNameWithExtension: string, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.RandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; + static createStreamedFileFromUriAsync(displayNameWithExtension: string, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Gets a StorageFile object to represent the specified URI app resource. For examples of sample URIs see How to load file resources. * @param uri The URI of the app resource to get a StorageFile to represent. @@ -52072,7 +52072,7 @@ declare namespace Windows { * @param thumbnail The thumbnail image for the StorageFile to create. * @return When this method completes, it returns a StorageFile object that represents the new data stream. Subsequently, this StorageFile object should be used to access file content instead of the file (type IStorageFile ) that was specified to be replace. */ - static replaceWithStreamedFileAsync(fileToReplace: Windows.Storage.StorageFile, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.RandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; + static replaceWithStreamedFileAsync(fileToReplace: Windows.Storage.IStorageFile, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Replaces the contents of the file referred to by the specified IStorageFile object with a new data stream of the specified URI. This method lets the app download the data on-demand when the StorageFile that represents the stream is first accessed. * @param fileToReplace The file that the created StorageFile will provide a stream of. @@ -52080,7 +52080,7 @@ declare namespace Windows { * @param thumbnail The thumbnail image for the StorageFile to create. * @return When this method completes, it returns a StorageFile object that represents the streamed file. Subsequently, this StorageFile object should be used to access file content instead of the file (type IStorageFile ) that was specified to be replace. */ - static replaceWithStreamedFileFromUriAsync(fileToReplace: Windows.Storage.StorageFile, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.RandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; + static replaceWithStreamedFileFromUriAsync(fileToReplace: Windows.Storage.IStorageFile, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the attributes of a file. */ attributes: Windows.Storage.FileAttributes; /** Gets the MIME type of the contents of the file. */ @@ -52090,7 +52090,7 @@ declare namespace Windows { * @param fileToReplace The file to replace. * @return No object or value is returned when this method completes. */ - copyAndReplaceAsync(fileToReplace: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + copyAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Creates a copy of the file in the specified folder and renames the copy. This method also specifies what to do if a file with the same name already exists in the destination folder. * @param destinationFolder The destination folder where the copy of the file is created. @@ -52098,20 +52098,20 @@ declare namespace Windows { * @param option One of the enumeration values that determines how to handle the collision if a file with the specified desiredNewName already exists in the destination folder. * @return When this method completes, it returns a StorageFile that represents the copy of the file created in the destinationFolder. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a copy of the file in the specified folder and renames the copy. * @param destinationFolder The destination folder where the copy of the file is created. * @param desiredNewName The new name for the copy of the file created in the destinationFolder. * @return When this method completes, it returns a StorageFile that represents the copy of the file created in the destinationFolder. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Creates a copy of the file in the specified folder. * @param destinationFolder The destination folder where the copy of the file is created. * @return When this method completes, it returns a StorageFile that represents the copy of the file created in the destinationFolder. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets the date and time when the current file was created. */ dateCreated: Date; /** @@ -52204,20 +52204,20 @@ declare namespace Windows { * @param fileToReplace The file to replace. * @return No object or value is returned by this method. */ - moveAndReplaceAsync(fileToReplace: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + moveAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Moves the current file to the specified folder. * @param destinationFolder The destination folder where the file is moved. * @return No object or value is returned by this method. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder): Windows.Foundation.IPromiseWithIAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IPromiseWithIAsyncAction; /** * Moves the current file to the specified folder and renames the file according to the desired name. * @param destinationFolder The destination folder where the file is moved. * @param desiredNewName The desired name of the file after it is moved. * @return No object or value is returned by this method. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IPromiseWithIAsyncAction; /** * Moves the current file to the specified folder and renames the file according to the desired name. This method also specifies what to do if a file with the same name already exists in the specified folder. * @param destinationFolder The destination folder where the file is moved. @@ -52225,7 +52225,7 @@ declare namespace Windows { * @param option An enum value that determines how Windows responds if the desiredNewName is the same as the name of an existing file in the destination folder. * @return No object or value is returned by this method. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IPromiseWithIAsyncAction; /** Gets the name of the file including the file name extension. */ name: string; /** @@ -52233,14 +52233,14 @@ declare namespace Windows { * @param accessMode One of the enumeration values that specifies the type of access to allow. * @return When this method completes, it returns an IRandomAccessStream that contains the requested random-access stream. */ - openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IPromiseWithIAsyncOperation; + openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Opens a random-access stream with the specified options over the specified file. * @param accessMode One of the enumeration values that specifies the type of access to allow. * @param options A bitwise combination of the enumeration values that specify options for opening the stream. * @return When this method completes, it returns an IRandomAccessStream that contains the requested random-access stream. */ - openAsync(accessMode: Windows.Storage.FileAccessMode, options: Windows.Storage.StorageOpenOptions): Windows.Foundation.IPromiseWithIAsyncOperation; + openAsync(accessMode: Windows.Storage.FileAccessMode, options: Windows.Storage.StorageOpenOptions): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Opens a random-access stream over the current file for reading file contents. * @return When this method completes, it returns the random-access stream (type IRandomAccessStreamWithContentType ). @@ -52635,7 +52635,7 @@ declare namespace Windows { */ commitAsync(): Windows.Foundation.IPromiseWithIAsyncAction; /** Gets the random-access stream used in the transaction. */ - stream: Windows.Storage.Streams.RandomAccessStream; + stream: Windows.Storage.Streams.IRandomAccessStream; } /** Represents a sequential-access output stream that indicates a request for the data stream of a StorageFile that was created by calling CreateStreamedFileAsync or ReplaceWithStreamedFileAsync . */ abstract class StreamedFileDataRequest { @@ -52656,7 +52656,7 @@ declare namespace Windows { * @param buffer The buffer that contains the data to write. * @return When this method completes, it returns the number of bytes (type UInt32 ) that were written to the stream. If the app specifies a function to monitor progress, that function receives the number of bytes (type UInt32) written so far. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Indicates the reason that data could not be streamed. */ enum StreamedFileFailureMode { @@ -52676,13 +52676,13 @@ declare namespace Windows { * @param input The buffer to be copied. * @return The newly created copy. */ - static createCopyFromMemoryBuffer(input: Windows.Foundation.MemoryBuffer): Windows.Storage.Streams.Buffer; + static createCopyFromMemoryBuffer(input: Windows.Foundation.IMemoryBuffer): Windows.Storage.Streams.Buffer; /** * Creates a MemoryBuffer from an existing IBuffer . * @param input The input IBuffer . * @return The newly created MemoryBuffer . */ - static createMemoryBufferOverIBuffer(input: Windows.Storage.Streams.Buffer): Windows.Foundation.MemoryBuffer; + static createMemoryBufferOverIBuffer(input: Windows.Storage.Streams.IBuffer): Windows.Foundation.MemoryBuffer; /** * Initializes a new instance of the Buffer class with the specified capacity. * @param capacity The maximum number of bytes that the buffer can hold. @@ -52708,7 +52708,7 @@ declare namespace Windows { * @param buffer The buffer. * @return The data reader. */ - static fromBuffer(buffer: Windows.Storage.Streams.Buffer): Windows.Storage.Streams.DataReader; + static fromBuffer(buffer: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.DataReader; /** * Creates and initializes a new instance of the data reader. * @param inputStream The input stream. @@ -52722,7 +52722,7 @@ declare namespace Windows { * Detaches the buffer that is associated with the data reader. * @return The detached buffer. */ - detachBuffer(): Windows.Storage.Streams.Buffer; + detachBuffer(): Windows.Storage.Streams.IBuffer; /** * Detaches the stream that is associated with the data reader. * @return The detached stream. @@ -52746,7 +52746,7 @@ declare namespace Windows { * @param length The length of the buffer, in bytes. * @return The buffer. */ - readBuffer(length: number): Windows.Storage.Streams.Buffer; + readBuffer(length: number): Windows.Storage.Streams.IBuffer; /** * Reads a byte value from the input stream. * @return The value. @@ -52860,7 +52860,7 @@ declare namespace Windows { * Detaches the buffer that is associated with the data writer. * @return The detached buffer. */ - detachBuffer(): Windows.Storage.Streams.Buffer; + detachBuffer(): Windows.Storage.Streams.IBuffer; /** * Detaches the stream that is associated with the data writer. * @return The detached stream. @@ -52897,12 +52897,12 @@ declare namespace Windows { * @param start The starting byte. * @param count The number of bytes to write. */ - writeBuffer(buffer: Windows.Storage.Streams.Buffer, start: number, count: number): void; + writeBuffer(buffer: Windows.Storage.Streams.IBuffer, start: number, count: number): void; /** * Writes the contents of the specified buffer to the output stream. * @param buffer The buffer. */ - writeBuffer(buffer: Windows.Storage.Streams.Buffer): void; + writeBuffer(buffer: Windows.Storage.Streams.IBuffer): void; /** * Writes a byte value to the output stream. * @param value The value. @@ -53006,7 +53006,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Writes data to a file. */ abstract class FileOutputStream { @@ -53022,7 +53022,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Supports reading and writing to a file at a specified position. */ abstract class FileRandomAccessStream { @@ -53034,7 +53034,7 @@ declare namespace Windows { * Creates a new instance of a IRandomAccessStream over the same resource as the current stream. * @return The new stream. The initial, internal position of the stream is 0. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Closes the current stream and releases system resources. */ close(): void; /** @@ -53063,7 +53063,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Sets the position of the stream to the specified value. * @param position The new position of the stream. @@ -53076,7 +53076,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Provides random access of data in input and output streams that are stored in memory instead of on disk. */ class InMemoryRandomAccessStream { @@ -53090,7 +53090,7 @@ declare namespace Windows { * Creates a new instance of a IRandomAccessStream over the same resource as the current stream. * @return The new stream. The initial, internal position of the stream is 0. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Closes the current stream and releases system resources. */ close(): void; /** @@ -53119,7 +53119,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Sets the position of the stream to the specified value. * @param position The new position of the stream. @@ -53132,7 +53132,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Specifies the read options for an input stream. */ enum InputStreamOptions { @@ -53154,7 +53154,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Provides a Windows Runtime output stream for an IStream base implementation. */ abstract class OutputStreamOverStream { @@ -53170,7 +53170,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Provides random access of data in input and output streams. */ abstract class RandomAccessStream { @@ -53207,7 +53207,7 @@ declare namespace Windows { * Creates a new instance of a IRandomAccessStream over the same resource as the current stream. * @return The new stream. The initial, internal position of the stream is 0. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** Closes the current stream and releases system resources. */ close(): void; /** @@ -53236,7 +53236,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Sets the position of the stream to the specified value. * @param position The new position of the stream. @@ -53249,7 +53249,7 @@ declare namespace Windows { * @param buffer The buffer into which the asynchronous writer operation writes. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; } /** Provides random access of data in input and output streams for a file. */ abstract class RandomAccessStreamReference { @@ -53258,13 +53258,13 @@ declare namespace Windows { * @param file The file to create a stream around. * @return The stream that encapsulates file. */ - static createFromFile(file: Windows.Storage.StorageFile): Windows.Storage.Streams.RandomAccessStreamReference; + static createFromFile(file: Windows.Storage.IStorageFile): Windows.Storage.Streams.RandomAccessStreamReference; /** * Creates a random access stream around the specified stream. * @param stream The source stream. * @return The random access stream that encapsulates stream. */ - static createFromStream(stream: Windows.Storage.Streams.RandomAccessStream): Windows.Storage.Streams.RandomAccessStreamReference; + static createFromStream(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Storage.Streams.RandomAccessStreamReference; /** * Creates a random access stream around the specified URI. * @param uri The URI to create the stream around. The valid URI schemes are http, https, ms-appx, and ms-appdata. @@ -53295,14 +53295,14 @@ declare namespace Windows { openReadAsync(): Windows.Foundation.IAsyncOperation; } /** Supports random access of data in input and output streams for a specified data format. */ - interface IRandomAccessStreamWithContentType extends Windows.Storage.Streams.RandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream, Windows.Storage.Streams.IContentTypeProvider {} + interface IRandomAccessStreamWithContentType extends Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream, Windows.Storage.Streams.IContentTypeProvider {} /** Supports random access of data in input and output streams. */ interface IRandomAccessStream extends Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream { /** * Creates a new instance of a IRandomAccessStream over the same resource as the current stream. * @return The new stream. The initial, internal position of the stream is 0. */ - cloneStream(): Windows.Storage.Streams.RandomAccessStream; + cloneStream(): Windows.Storage.Streams.IRandomAccessStream; /** * Returns an input stream at a specified location in a stream. * @param position The location in the stream at which to begin. @@ -53345,7 +53345,7 @@ declare namespace Windows { * @param options Specifies the type of the asynchronous read operation. * @return The asynchronous operation. */ - readAsync(buffer: Windows.Storage.Streams.Buffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; + readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; } /** Represents a sequential stream of bytes to be written. */ interface IOutputStream extends Windows.Foundation.IClosable { @@ -53359,7 +53359,7 @@ declare namespace Windows { * @param buffer A buffer that contains the data to be written. * @return The byte writer operation. */ - writeAsync(buffer: Windows.Storage.Streams.Buffer): Windows.Foundation.IAsyncOperationWithProgress; + writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; } /** Characterizes the format of the data. */ interface IContentTypeProvider { @@ -53530,13 +53530,13 @@ declare namespace Windows { path: string; } /** Represents a file. Provides information about the file and its contents, and ways to manipulate them. */ - interface IStorageFile extends Windows.Storage.IStorageItem, Windows.Storage.Streams.RandomAccessStreamReference, Windows.Storage.Streams.IInputStreamReference { + interface IStorageFile extends Windows.Storage.IStorageItem, Windows.Storage.Streams.IRandomAccessStreamReference, Windows.Storage.Streams.IInputStreamReference { /** * Replaces the specified file with a copy of the current file. * @param fileToReplace The file to replace. * @return No object or value is returned when this method completes. */ - copyAndReplaceAsync(fileToReplace: Windows.Storage.StorageFile): Windows.Foundation.IAsyncAction; + copyAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; /** * Creates a copy of the file in the specified folder, using the desired name. This method also specifies what to do if an existing file in the specified folder has the same name. * @param destinationFolder The destination folder where the copy is created. @@ -53544,32 +53544,32 @@ declare namespace Windows { * @param option An enum value that determines how Windows responds if the desiredNewName is the same as the name of an existing file in the destination folder. * @return When this method completes, it returns a StorageFile that represents the copy. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncOperation; /** * Creates a copy of the file in the specified folder, using the desired name. * @param destinationFolder The destination folder where the copy is created. * @param desiredNewName The desired name of the copy. * @return When this method completes, it returns a StorageFile that represents the copy. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string): Windows.Foundation.IAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncOperation; /** * Creates a copy of the file in the specified folder. * @param destinationFolder The destination folder where the copy is created. * @return When this method completes, it returns a StorageFile that represents the copy. */ - copyAsync(destinationFolder: Windows.Storage.StorageFolder): Windows.Foundation.IAsyncOperation; + copyAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncOperation; /** * Moves the current file to the location of the specified file and replaces the specified file in that location. * @param fileToReplace The file to replace. * @return No object or value is returned by this method. */ - moveAndReplaceAsync(fileToReplace: Windows.Storage.StorageFile): Windows.Foundation.IAsyncAction; + moveAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; /** * Moves the current file to the specified folder. * @param destinationFolder The destination folder where the file is moved. * @return No object or value is returned by this method. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder): Windows.Foundation.IAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncAction; /** * Moves the current file to the specified folder and renames the file according to the desired name. This method also specifies what to do if a file with the same name already exists in the specified folder. * @param destinationFolder The destination folder where the file is moved. @@ -53577,20 +53577,20 @@ declare namespace Windows { * @param option An enum value that determines how Windows responds if the desiredNewName is the same as the name of an existing file in the destination folder. * @return No object or value is returned by this method. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; /** * Moves the current file to the specified folder and renames the file according to the desired name. * @param destinationFolder The destination folder where the file is moved. * @param desiredNewName The desired name of the file after it is moved. * @return No object or value is returned by this method. */ - moveAsync(destinationFolder: Windows.Storage.StorageFolder, desiredNewName: string): Windows.Foundation.IAsyncAction; + moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncAction; /** * Opens a random-access stream over the file. * @param accessMode The type of access to allow. * @return When this method completes, it returns the random-access stream (type IRandomAccessStream ). */ - openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IAsyncOperation; + openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IAsyncOperation; /** * Opens a transacted, random-access stream for writing to the file. * @return When this method completes, it returns a StorageStreamTransaction that contains the random-access stream and methods that can be used to complete transactions. @@ -53906,27 +53906,27 @@ declare namespace Windows { * @param file The file. * @return The launch operation. */ - static launchFileAsync(file: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static launchFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Starts the default app associated with the specified file, using the specified options. * @param file The file. * @param options The launch options for the app. * @return The launch operation. */ - static launchFileAsync(file: Windows.Storage.StorageFile, options: Windows.System.LauncherOptions): Windows.Foundation.IPromiseWithIAsyncOperation; + static launchFileAsync(file: Windows.Storage.IStorageFile, options: Windows.System.LauncherOptions): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Launches File Explorer with the specified options and displays the contents of the specified folder. * @param folder The folder to display in File Explorer. * @param options Options that specify the amount of screen space that File Explorer fills, and the list of items to select in the specified folder. * @return The result of the operation. */ - static launchFolderAsync(folder: Windows.Storage.StorageFolder, options: Windows.System.FolderLauncherOptions): Windows.Foundation.IPromiseWithIAsyncOperation; + static launchFolderAsync(folder: Windows.Storage.IStorageFolder, options: Windows.System.FolderLauncherOptions): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Launches File Explorer and displays the contents of the specified folder. * @param folder The folder to display in File Explorer. * @return The result of the operation. */ - static launchFolderAsync(folder: Windows.Storage.StorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; + static launchFolderAsync(folder: Windows.Storage.IStorageFolder): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Starts the default app associated with the URI scheme name for the specified URI. * @param uri The URI. @@ -54263,16 +54263,16 @@ declare namespace Windows { * @param nonce The cryptographic nonce is optional. The nonce is recommended when ASHWID needs to be verified on the cloud against replay attacks. In the scenarios where nonce is desired, the remote server should generate a random nonce and pass it to the client app, and then verify that the signature has the expected nonce once the ASHWID is received from the client system. * @return The hardware Id information. */ - static getPackageSpecificToken(nonce: Windows.Storage.Streams.Buffer): Windows.System.Profile.HardwareToken; + static getPackageSpecificToken(nonce: Windows.Storage.Streams.IBuffer): Windows.System.Profile.HardwareToken; } /** Represents a token that contains a hardware based identification that is sufficiently unique. */ abstract class HardwareToken { /** Gets the certificate that is used to sign the Id and is used to help verify the authenticity of the Id. */ - certificate: Windows.Storage.Streams.Buffer; + certificate: Windows.Storage.Streams.IBuffer; /** Gets the hardware identifier that identifies the device. */ - id: Windows.Storage.Streams.Buffer; + id: Windows.Storage.Streams.IBuffer; /** Gets the digital signature of hardware Id that helps verify the authenticity of returned Id. */ - signature: Windows.Storage.Streams.Buffer; + signature: Windows.Storage.Streams.IBuffer; } /** Identifies the string keys that might exist within the RetailInfo.Properties map of retail-demo relevant property values. */ abstract class KnownRetailInfoProperties { @@ -54422,13 +54422,13 @@ declare namespace Windows { * @param desiredSize The desired size of the user's picture to return. * @return When this method completes, it returns the user's picture. */ - getPictureAsync(desiredSize: Windows.System.UserPictureSize): Windows.Foundation.IPromiseWithIAsyncOperation; + getPictureAsync(desiredSize: Windows.System.UserPictureSize): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Gets properties for the user. * @param values The properties to get. Use the KnownUserProperties class to obtain property names. * @return When this method completes, it returns the requested properties. If a property is missing or unavailable, it is reported as an empty string. */ - getPropertiesAsync(values: Windows.Foundation.Collections.IVectorView): Windows.Foundation.IPromiseWithIAsyncOperation; + getPropertiesAsync(values: Windows.Foundation.Collections.IVectorView): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Gets a property for the user. Use the KnownUserProperties class to obtain property names. * @param value The property to get. @@ -54553,7 +54553,7 @@ declare namespace Windows { * Gets the current lock screen image as a data stream. * @return The stream that contains the lock screen image data. */ - static getImageStream(): Windows.Storage.Streams.RandomAccessStream; + static getImageStream(): Windows.Storage.Streams.IRandomAccessStream; /** Gets the current lock screen image. */ static originalImageFile: Windows.Foundation.Uri; /** @@ -54567,13 +54567,13 @@ declare namespace Windows { * @param value The StorageFile object that contains the new image for the lock screen. * @return The object used to set the image for the lock screen. */ - static setImageFileAsync(value: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncAction; + static setImageFileAsync(value: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncAction; /** * Sets the lock screen image from a data stream. * @param value The stream that contains the image data. * @return The object used to set the lock screen image. */ - static setImageStreamAsync(value: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; + static setImageStreamAsync(value: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncAction; /** * Unregisters the image feed being used in the lock screen slideshow, stopping the slideshow. (Windows 8.1 only) * @return true if the image feed was disabled; otherwise, false. @@ -54613,7 +54613,7 @@ declare namespace Windows { * @param kind An enumeration that you can use to determine what type of image you want (small, large, and so on). * @return An object that contains the image. */ - static getAccountPicture(kind: Windows.System.UserProfile.AccountPictureKind): Windows.Storage.StorageFile; + static getAccountPicture(kind: Windows.System.UserProfile.AccountPictureKind): Windows.Storage.IStorageFile; /** * Gets the display name for the user account. * @return The display name for the user account. @@ -54655,13 +54655,13 @@ declare namespace Windows { * @param image A file that contains the image. * @return A value that indicates the success or failure of the operation. */ - static setAccountPictureAsync(image: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static setAccountPictureAsync(image: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Sets the picture for the user's account using an IRandomAccessStream object. * @param image The image. * @return A value that indicates the success or failure of the operation. */ - static setAccountPictureFromStreamAsync(image: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static setAccountPictureFromStreamAsync(image: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Sets the pictures for the user's account using an IStorageFile object. Supports adding a small image, large image, and video. * @param smallImage A small version of the image. @@ -54669,7 +54669,7 @@ declare namespace Windows { * @param video A video. * @return A value that indicates the success or failure of the operation. */ - static setAccountPicturesAsync(smallImage: Windows.Storage.StorageFile, largeImage: Windows.Storage.StorageFile, video: Windows.Storage.StorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; + static setAccountPicturesAsync(smallImage: Windows.Storage.IStorageFile, largeImage: Windows.Storage.IStorageFile, video: Windows.Storage.IStorageFile): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Sets the pictures for the user's account using an IRandomAccessStream object. Supports adding a small image, large image, and video. * @param smallImage A small version of the image. @@ -54677,7 +54677,7 @@ declare namespace Windows { * @param video A video. * @return A value that indicates the success or failure of the operation. */ - static setAccountPicturesFromStreamsAsync(smallImage: Windows.Storage.Streams.RandomAccessStream, largeImage: Windows.Storage.Streams.RandomAccessStream, video: Windows.Storage.Streams.RandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; + static setAccountPicturesFromStreamsAsync(smallImage: Windows.Storage.Streams.IRandomAccessStream, largeImage: Windows.Storage.Streams.IRandomAccessStream, video: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IPromiseWithIAsyncOperation; static addEventListener(type: string, listener: Windows.Foundation.EventHandler): void; static removeEventListener(type: string, listener: Windows.Foundation.EventHandler): void; } @@ -55626,7 +55626,7 @@ declare namespace Windows { */ constructor(effect: Windows.UI.Core.AnimationMetrics.AnimationEffect, target: Windows.UI.Core.AnimationMetrics.AnimationEffectTarget); /** Gets the collection of animations that are associated with the AnimationDescription object. */ - animations: Windows.Foundation.Collections.IVectorView; + animations: Windows.Foundation.Collections.IVectorView; /** Gets the maximum cumulative delay time for the animation to be applied to the collection of objects in a target. */ delayLimit: number; /** Gets the amount of time between the application of the animation effect to each object in a target that contains multiple objects. The StaggerDelay, together with the StaggerDelayFactor and DelayLimit, is one of the three elements used to control the relative timing of the animation effects. */ @@ -57706,7 +57706,7 @@ declare namespace Windows { /** Gets or sets the index of the command you want to use as the cancel command. This is the command that fires when users press the ESC key. */ cancelCommandIndex: number; /** Gets an array of commands that appear in the command bar of the message dialog. These commands makes the dialog actionable. */ - commands: Windows.Foundation.Collections.IVector; + commands: Windows.Foundation.Collections.IVector; /** Gets or sets the message to be displayed to the user. */ content: string; /** Gets or sets the index of the command you want to use as the default. This is the command that fires by default when users press the ENTER key. */ @@ -57717,7 +57717,7 @@ declare namespace Windows { * Begins an asynchronous operation showing a dialog. * @return An object that represents the asynchronous operation. For more on the async pattern, see Asynchronous programming. */ - showAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; + showAsync(): Windows.Foundation.IPromiseWithIAsyncOperation; /** Gets or sets the title to display on the dialog, if any. */ title: string; } @@ -57746,26 +57746,26 @@ declare namespace Windows { /** Creates a new instance of the PopupMenu class. */ constructor(); /** Gets the commands for the context menu. */ - commands: Windows.Foundation.Collections.IVector; + commands: Windows.Foundation.Collections.IVector; /** * Shows the context menu at the specified client coordinates. * @param invocationPoint The coordinates (in DIPs), relative to the window, of the user's finger or mouse pointer when the oncontextmenu event fired. The menu is placed above and centered on this point. * @return A IUICommand object that represents the context menu command that was invoked by the user, after the ShowAsync call completes. */ - showAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IPromiseWithIAsyncOperation; + showAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Shows the context menu above the specified selection. * @param selection The coordinates (in DIPs) of the selected rectangle, relative to the window. The context menu is placed directly above and centered on this rectangle such that selection is not covered. * @return A IUICommand object that represents the context menu command invoked by the user, after the ShowForSelectionAsync call completes. */ - showForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IPromiseWithIAsyncOperation; + showForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IPromiseWithIAsyncOperation; /** * Shows the context menu in the preferred placement relative to the specified selection. * @param selection The coordinates (in DIPs) of the selected rectangle, relative to the window. * @param preferredPlacement The preferred placement of the context menu relative to the selection rectangle. * @return A IUICommand object that represents the context menu command invoked by the user, after the ShowForSelectionAsync call completes. */ - showForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IPromiseWithIAsyncOperation; + showForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IPromiseWithIAsyncOperation; } /** Represents a command in a context menu. */ class UICommand { @@ -57808,7 +57808,7 @@ declare namespace Windows { label: string; } /** Represents a callback function that handles the event that is fired when the user invokes a context menu command. */ - type UICommandInvokedHandler = (command: Windows.UI.Popups.UICommand) => void; + type UICommandInvokedHandler = (command: Windows.UI.Popups.IUICommand) => void; /** Represents a command in a context menu or message dialog box. */ interface IUICommand { /** Gets or sets the identifier of the command. */ @@ -59857,7 +59857,7 @@ declare namespace Windows { /** Represents an instance of a background task that has been triggered to run. */ abstract class WebUIBackgroundTaskInstance { /** Gets the current background task. */ - static current: Windows.UI.WebUI.WebUIBackgroundTaskInstance; + static current: Windows.UI.WebUI.IWebUIBackgroundTaskInstance; } /** Provides access to an instance of a background task. */ abstract class WebUIBackgroundTaskInstanceRuntimeClass { @@ -60421,11 +60421,11 @@ declare namespace Windows { /** Represents a method that handles the app activation event. */ type ActivatedEventHandler = (ev: Windows.ApplicationModel.Activation.IActivatedEventArgs & WinRTEvent) => void; /** Represents a method that handles the app navigation event. */ - type NavigatedEventHandler = (ev: Windows.UI.WebUI.WebUINavigatedEventArgs & WinRTEvent) => void; + type NavigatedEventHandler = (ev: Windows.UI.WebUI.IWebUINavigatedEventArgs & WinRTEvent) => void; /** Represents a method that handles the app resumption event. */ type ResumingEventHandler = (ev: WinRTEvent) => void; /** Represents a method that handles the app suspension event. */ - type SuspendingEventHandler = (ev: Windows.ApplicationModel.SuspendingEventArgs & WinRTEvent) => void; + type SuspendingEventHandler = (ev: Windows.ApplicationModel.ISuspendingEventArgs & WinRTEvent) => void; /** Provides access to an instance of a background task. */ interface IWebUIBackgroundTaskInstance { /** Gets or sets the success value for the background task. The success value is what is returned to the foreground instance of your app in the completed event. */ @@ -60610,7 +60610,7 @@ declare namespace Windows { /** Gets the collection of atom:category elements within the app:categories element. */ categories: Windows.Foundation.Collections.IVectorView; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, and all the attributes and child elements including foreign markups. * @param format The format of the element. The only formats accepted by this method are Atom 1.0 and RSS 2.0. @@ -60626,7 +60626,7 @@ declare namespace Windows { /** Gets or sets the text content of the element. If the element contains only child elements, this attribute is NULL. */ nodeValue: string; /** Gets the atom:title element under the app:collection element. */ - title: Windows.Web.Syndication.SyndicationText; + title: Windows.Web.Syndication.ISyndicationText; /** Gets the Uniform Resource Identifier (URI) representing the href attribute of the app:collection element. This is the absolute URI resolved against the xml:base attribute when it is present. If the href attribute is a relative URI string and there is no xml:base attribute, this property will be Null. */ uri: Windows.Foundation.Uri; } @@ -60637,7 +60637,7 @@ declare namespace Windows { /** Gets or sets the Uniform Resource Identifier (URI) for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, and all the attributes and child elements including foreign markups. * @param format The format of the element. The only formats accepted by this method are Atom 1.0 and RSS 2.0. @@ -60664,7 +60664,7 @@ declare namespace Windows { /** Gets the read-only collection of app:collection elements within the app:workspace element. */ collections: Windows.Foundation.Collections.IVectorView; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, and all the attributes and child elements including foreign markups. * @param format The format for the element. The only formats accepted by this method are Atom 1.0 and RSS 2.0. @@ -60680,7 +60680,7 @@ declare namespace Windows { /** Gets or sets the text content of the element. If the element contains only child elements, this attribute is NULL. */ nodeValue: string; /** Gets the atom:title element under the app:workspace element. */ - title: Windows.Web.Syndication.SyndicationText; + title: Windows.Web.Syndication.ISyndicationText; } } /** Provides a modern HTTP client API for Windows Store apps. */ @@ -61500,7 +61500,7 @@ declare namespace Windows { /** Gets or sets the value of the HTTP Content-Location header on the HTTP content. */ contentLocation: Windows.Foundation.Uri; /** Gets or sets the value of an HTTP Content-MD5 header on the HTTP content. */ - contentMD5: Windows.Storage.Streams.Buffer; + contentMD5: Windows.Storage.Streams.IBuffer; /** Gets or sets the HttpContentRangeHeaderValue object that represent the value of an HTTP Content-Range header on the HTTP content. */ contentRange: Windows.Web.Http.Headers.HttpContentRangeHeaderValue; /** Gets or sets the HttpMediaTypeHeaderValue object that represent the value of an HTTP Content-Type header on the HTTP content. */ @@ -62810,14 +62810,14 @@ declare namespace Windows { * Initializes a new instance of the HttpBufferContent class with the specified buffer. * @param content The content used to initialize the HttpBufferContent . */ - constructor(content: Windows.Storage.Streams.Buffer); + constructor(content: Windows.Storage.Streams.IBuffer); /** * Initializes a new instance of the HttpBufferContent class with an offset and count of bytes from the specified buffer. * @param content The content used to initialize the HttpBufferContent . * @param offset The offset in bytes from the beginning of the content buffer to initialize the HttpBufferContent . * @param count The count of bytes in the content buffer to initialize the HttpBufferContent . */ - constructor(content: Windows.Storage.Streams.Buffer, offset: number, count: number); + constructor(content: Windows.Storage.Streams.IBuffer, offset: number, count: number); /** * Serialize the HttpBufferContent into memory as an asynchronous operation. * @return The object that represents the asynchronous operation. @@ -62831,7 +62831,7 @@ declare namespace Windows { * Serialize the HttpBufferContent to a buffer as an asynchronous operation. * @return The object that represents the asynchronous operation. */ - readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Serialize the HttpBufferContent and return an input stream that represents the content as an asynchronous operation. * @return The object that represents the asynchronous operation. @@ -62891,7 +62891,7 @@ declare namespace Windows { * @param uri The Uri the request is sent to. * @return The object representing the asynchronous operation. */ - getBufferAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + getBufferAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. * @param uri The Uri the request is sent to. @@ -63040,7 +63040,7 @@ declare namespace Windows { * Serialize the HttpFormUrlEncodedContent to a buffer as an asynchronous operation. * @return The object representing the asynchronous operation. */ - readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Serialize the HttpFormUrlEncodedContent and return an input stream that represents the content as an asynchronous operation. * @return The object representing the asynchronous operation. @@ -63125,7 +63125,7 @@ declare namespace Windows { * Serialize the HttpMultipartContent to a buffer as an asynchronous operation. * @return The object representing the asynchronous operation. */ - readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Serialize the HttpMultipartContent and return an input stream that represents the content as an asynchronous operation. * @return The object representing the asynchronous operation. @@ -63193,7 +63193,7 @@ declare namespace Windows { * Serialize the HttpMultipartFormDataContent to a buffer as an asynchronous operation. * @return The object representing the asynchronous operation. */ - readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Serialize the HttpMultipartFormDataContent and return an input stream that represents the content as an asynchronous operation. * @return The object representing the asynchronous operation. @@ -63445,7 +63445,7 @@ declare namespace Windows { * Serialize the HttpStreamContent to a buffer as an asynchronous operation. * @return The object representing the asynchronous operation. */ - readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Serialize the HttpStreamContent and return an input stream that represents the content as an asynchronous operation. * @return The object representing the asynchronous operation. @@ -63501,7 +63501,7 @@ declare namespace Windows { * Serialize the HttpStringContent to a buffer as an asynchronous operation. * @return The object that represents the asynchronous operation. */ - readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; + readAsBufferAsync(): Windows.Foundation.IPromiseWithIAsyncOperationWithProgress; /** * Serialize the HttpStringContent and return an input stream that represents the content as an asynchronous operation. * @return The object that represents the asynchronous operation. @@ -63572,7 +63572,7 @@ declare namespace Windows { * Serialize the HTTP content to a buffer as an asynchronous operation. * @return The object representing the asynchronous operation. */ - readAsBufferAsync(): Windows.Foundation.IAsyncOperationWithProgress; + readAsBufferAsync(): Windows.Foundation.IAsyncOperationWithProgress; /** * Serialize the HTTP content and return an input stream that represents the content as an asynchronous operation. * @return The object representing the asynchronous operation. @@ -63639,7 +63639,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, all the attributes and child elements including foreign markups. The only formats accepted by this method are Atom 1.0 and RSS 2.0. * @param format The format of the data. @@ -63713,7 +63713,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, all the attributes and child elements including foreign markups. The only formats accepted by this method are Atom 1.0 and RSS 2.0. * @param format The format of the data. @@ -63783,7 +63783,7 @@ declare namespace Windows { /** Gets a collection of the contributors of the feed. This property represents the collection of all the atom:contributor elements under atom:feed. */ contributors: Windows.Foundation.Collections.IVector; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** Gets the first Uniform Resource Identifier (URI) in a sequence. This property represents the atom:link element with attribute rel=”first”. */ firstUri: Windows.Foundation.Uri; /** Gets or sets the generator of the feed. This property represents the atom:generator element or the generator element in RSS 2.0. */ @@ -63831,13 +63831,13 @@ declare namespace Windows { /** Gets the previous Uniform Resource Identifier (URI) in the sequence. This property represents the atom:link element with attribute rel="previous". */ previousUri: Windows.Foundation.Uri; /** Gets or sets information about the rights for the feed. This property represents the atom:rights element or the copyright element in RSS 2.0. */ - rights: Windows.Web.Syndication.SyndicationText; + rights: Windows.Web.Syndication.ISyndicationText; /** Gets the format of the source document. If the object is not loaded from a document, this property will return SyndicationFormat_Atom10. */ sourceFormat: Windows.Web.Syndication.SyndicationFormat; /** Gets or sets the subtitle of the feed. This property represents the atom:subtitle element or the description element in RSS 2.0. */ - subtitle: Windows.Web.Syndication.SyndicationText; + subtitle: Windows.Web.Syndication.ISyndicationText; /** Gets or sets the title of the syndication feed. */ - title: Windows.Web.Syndication.SyndicationText; + title: Windows.Web.Syndication.ISyndicationText; } /** Specifies the syndication formats supported by the API. */ enum SyndicationFormat { @@ -63868,7 +63868,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, all the attributes and child elements including foreign markups. The only formats accepted by this method are Atom 1.0 and RSS 2.0. * @param format The format of the data. @@ -63920,7 +63920,7 @@ declare namespace Windows { /** Gets the Uniform Resource Identifier (URI) of an editable resource. */ editUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** Gets an ETag HTTP header. */ etag: string; /** @@ -63958,13 +63958,13 @@ declare namespace Windows { /** Gets or sets the date the item was published. */ publishedDate: Date; /** Gets or sets information about the rights of an item. This property represents the atom:rights element. */ - rights: Windows.Web.Syndication.SyndicationText; + rights: Windows.Web.Syndication.ISyndicationText; /** Gets or sets the source feed of the item. This property represents the atom:source element or the source element in RSS 2.0. */ source: Windows.Web.Syndication.SyndicationFeed; /** Gets or sets a summary of the item. */ - summary: Windows.Web.Syndication.SyndicationText; + summary: Windows.Web.Syndication.ISyndicationText; /** Gets or sets the title of the item. */ - title: Windows.Web.Syndication.SyndicationText; + title: Windows.Web.Syndication.ISyndicationText; } /** Represents a link within a syndication feed or item. This class encapsulates information in the /rss/channel/link or / rss/channel/item/link element in RSS 2.0 or the atom:link element in Atom 1.0. */ class SyndicationLink { @@ -63989,7 +63989,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, all the attributes and child elements including foreign markups. The only formats accepted by this method are Atom 1.0 and RSS 2.0. * @param format The format of the data. @@ -64033,7 +64033,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, all the attributes and child elements including foreign markups. The only formats accepted by this method are Atom 1.0 and RSS 2.0. * @param format The format of the data. @@ -64070,7 +64070,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** Gets or sets the email address of the person. */ email: string; /** @@ -64112,7 +64112,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** * Generates the DOM object that represents this element, all the attributes and child elements including foreign markups. The only formats accepted by this method are Atom 1.0 and RSS 2.0. * @param format The format of the data. @@ -64174,7 +64174,7 @@ declare namespace Windows { /** Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element. */ baseUri: Windows.Foundation.Uri; /** Gets the list of child elements within the element. */ - elementExtensions: Windows.Foundation.Collections.IVector; + elementExtensions: Windows.Foundation.Collections.IVector; /** Gets or sets the language of the element. This property represents the xml:lang attribute on the element. It may be inherited from an ancestor element. It must be valid according to XML 1.0. */ language: string; /** Gets or sets the local name of the element. */ @@ -64185,7 +64185,7 @@ declare namespace Windows { nodeValue: string; } /** Represents text, HTML, or XHTML content. This interface encapsulates elements in RSS 2.0 or Atom 1.0 that can have either text, HTML, or XHTML content. In Atom 1.0 this interface maps to an atomTextConstruct in the schema, which can be element atom:title, atom:subtitle, atom:rights or atom:summary. */ - interface ISyndicationText extends Windows.Web.Syndication.SyndicationNode { + interface ISyndicationText extends Windows.Web.Syndication.ISyndicationNode { /** Gets or sets the content of a text content construct like atom:title. */ text: string; /** Gets or sets the type of the content. */ diff --git a/xmldom/xmldom-tests.ts b/xmldom/xmldom-tests.ts new file mode 100644 index 000000000..2cb3ae544 --- /dev/null +++ b/xmldom/xmldom-tests.ts @@ -0,0 +1,36 @@ +/// + +import * as xmldom from 'xmldom'; + +var doc = new xmldom.DOMParser().parseFromString( + '\n'+ + '\ttest\n'+ + '\t\n'+ + '\t\n'+ + '' + ,'text/xml'); +doc.documentElement.setAttribute('x','y'); +doc.documentElement.setAttributeNS('./lite','c:x','y2'); +var nsAttr = doc.documentElement.getAttributeNS('./lite','x'); +console.info(nsAttr); +console.info(doc); + +function callback(w: any) { + +} + +//errorHandler is supported +new xmldom.DOMParser({ + /** + * locator is always need for error position info + */ + locator:{}, + /** + * you can override the errorHandler for xml parser + * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html + */ + errorHandler:{warning:function(w: any){console.warn(w)},error:callback,fatalError:callback} + //only callback model + //errorHandler:function(level,msg){console.log(level,msg)} +}); + diff --git a/xmldom/xmldom.d.ts b/xmldom/xmldom.d.ts new file mode 100644 index 000000000..2a51cec1d --- /dev/null +++ b/xmldom/xmldom.d.ts @@ -0,0 +1,38 @@ +// Type definitions for xmldom 0.1.16 +// Project: https://github.com/jindw/xmldom.git +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "xmldom" { + namespace xmldom { + var DOMParser: DOMParserStatic; + + interface DOMParserStatic { + new(): DOMParser; + new(options: Options): DOMParser; + } + + interface DOMParser { + parseFromString(xmlsource: string, mimeType?: string): Document; + serializeToString(node: Node): string; + } + + interface Options { + locator?: any; + errorHandler?: ErrorHandlerFunction|ErrorHandlerObject; + } + + interface ErrorHandlerFunction { + (level: string, msg: any): any; + } + + interface ErrorHandlerObject { + warning?: (msg: any) => any; + error?: (msg: any) => any; + fatalError?: (msg: any) => any; + } + } + + export = xmldom; +} +